pub struct Sequence;
Expand description
A sequential byte layout for AsBytes
and FromBytes
implementors.
The layout is aligned like a sequence of u64
, where we repeatedly announce a length,
and then follow it by that many bytes. We may need to follow this with padding bytes.
Encodes and decodes bytes sequences, by prepending the length and appending the all sequences.
Trait Implementations§
Source§impl EncodeDecode for Sequence
impl EncodeDecode for Sequence
Source§fn length_in_words<'a, A>(bytes: &A) -> usizewhere
A: AsBytes<'a>,
fn length_in_words<'a, A>(bytes: &A) -> usizewhere
A: AsBytes<'a>,
Encoded length in number of
u64
words required.Source§fn encode<'a, A>(store: &mut Vec<u64>, bytes: &A)where
A: AsBytes<'a>,
fn encode<'a, A>(store: &mut Vec<u64>, bytes: &A)where
A: AsBytes<'a>,
Encodes
bytes
into a sequence of u64
.Source§fn write<'a, A, W: Write>(writer: W, bytes: &A) -> Result<()>where
A: AsBytes<'a>,
fn write<'a, A, W: Write>(writer: W, bytes: &A) -> Result<()>where
A: AsBytes<'a>,
Writes
bytes
in the encoded format to an arbitrary writer.Auto Trait Implementations§
impl Freeze for Sequence
impl RefUnwindSafe for Sequence
impl Send for Sequence
impl Sync for Sequence
impl Unpin for Sequence
impl UnwindSafe for Sequence
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more