Describe serialization format

This commit is contained in:
bjorn3
2021-02-11 11:08:54 +01:00
parent a0c2276ee7
commit 720da20588

View File

@@ -781,6 +781,17 @@ impl<'f> DoubleEndedIterator for Insts<'f> {
} }
} }
/// A custom serialize and deserialize implementation for [`Layout`].
///
/// This doesn't use a derived implementation as [`Layout`] is a manual implementation of a linked
/// list. Storing it directly as a regular list saves a lot of space.
///
/// The following format is used. (notated in EBNF form)
///
/// ```plain
/// data = block_data * ;
/// block_data = "block_id" , "inst_count" , ( "inst_id" * ) ;
/// ```
#[cfg(feature = "enable-serde")] #[cfg(feature = "enable-serde")]
mod serde { mod serde {
use ::serde::de::{Deserializer, Error, SeqAccess, Visitor}; use ::serde::de::{Deserializer, Error, SeqAccess, Visitor};