Trait bytepack::LEPacker
[−]
[src]
pub trait LEPacker { fn pack<T: Packed>(&mut self, t: T) -> Result<()>; fn pack_ref<T: Packed + Clone>(&mut self, t: &T) -> Result<()>; fn pack_all<T: Packed + Clone>(&mut self, buf: &[T]) -> Result<()>; }
Provides the same API and functionnality as Packer
but ensure that
the data is in little endian format. See Packer
for more
documentation.
Required Methods
fn pack<T: Packed>(&mut self, t: T) -> Result<()>
fn pack_ref<T: Packed + Clone>(&mut self, t: &T) -> Result<()>
Here T needs to be Clone
because the endianness switch cannot be done in-place. This method
thus allocates a copy of buf
if an endianness switch is needed.
fn pack_all<T: Packed + Clone>(&mut self, buf: &[T]) -> Result<()>
Here T needs to be Clone
because the endianness switch cannot be done in-place. This method
thus allocates a copy of buf
if an endianness switch is needed.
Implementors
impl<W> LEPacker for W where
W: Write,