pub trait Serialize<Item> {
// Required method
fn serialize<R: Receiver<Item = Item>>(
self,
receiver: &mut R
) -> Result<(), R::Error>;
}
Expand description
trait for an object that can be serialized into Item
s
serialize Self
into the given receiver
reading as big-endian array of u8
s
reading as i64
(even if usize::BITS < 64
)
saves fixed-size array simply as N
T
s one after another (no length stored)
tuples are saved as an A
and B
one after another
saving as big-endian array of u8
s
reading as u64
(even if usize::BITS < 64
)
saves a slice/vector (if items are cloneable) as the length (number of items) as a usize
and then (clones) of the Self::Item
s
reading as big-endian array of u8
s
saving as big-endian array of u8
s
saves a vector (moved here) as length (number of items) as a usize
and then the Self::Item
s
reading as big-endian array of u8
s
reading as big-endian array of u8
s
reading as big-endian array of u8
s
an option is saved just like it would’ve been derived
reading as big-endian array of u8
s
saving as big-endian array of u8
s