Trait packed_struct::PackedStructSlice [−][src]
pub trait PackedStructSlice where
Self: Sized, {
fn pack_to_slice(&self, output: &mut [u8]) -> PackingResult<()>;
fn unpack_from_slice(src: &[u8]) -> PackingResult<Self>;
fn packed_bytes_size(opt_self: Option<&Self>) -> PackingResult<usize>;
fn pack_to_vec(&self) -> PackingResult<Vec<u8>> { ... }
}
Expand description
A structure that can be packed and unpacked from a slice of bytes.
Required methods
fn pack_to_slice(&self, output: &mut [u8]) -> PackingResult<()>
fn pack_to_slice(&self, output: &mut [u8]) -> PackingResult<()>
Pack the structure into an output buffer.
fn unpack_from_slice(src: &[u8]) -> PackingResult<Self>
fn unpack_from_slice(src: &[u8]) -> PackingResult<Self>
Unpack the structure from a buffer.
fn packed_bytes_size(opt_self: Option<&Self>) -> PackingResult<usize>
fn packed_bytes_size(opt_self: Option<&Self>) -> PackingResult<usize>
Number of bytes that the type or this particular instance of this structure demands for packing or unpacking.
Provided methods
fn pack_to_vec(&self) -> PackingResult<Vec<u8>>
Implementations on Foreign Types
impl<A, B, C, D, E, F, G, H, I, J> PackedStructSlice for (A, B, C, D, E, F, G, H, I, J) where
A: PackedStructSlice,
B: PackedStructSlice,
C: PackedStructSlice,
D: PackedStructSlice,
E: PackedStructSlice,
F: PackedStructSlice,
G: PackedStructSlice,
H: PackedStructSlice,
I: PackedStructSlice,
J: PackedStructSlice,
impl<A, B, C, D, E, F, G, H, I, J> PackedStructSlice for (A, B, C, D, E, F, G, H, I, J) where
A: PackedStructSlice,
B: PackedStructSlice,
C: PackedStructSlice,
D: PackedStructSlice,
E: PackedStructSlice,
F: PackedStructSlice,
G: PackedStructSlice,
H: PackedStructSlice,
I: PackedStructSlice,
J: PackedStructSlice,
impl<A, B, C, D, E, F, G, H, I> PackedStructSlice for (A, B, C, D, E, F, G, H, I) where
A: PackedStructSlice,
B: PackedStructSlice,
C: PackedStructSlice,
D: PackedStructSlice,
E: PackedStructSlice,
F: PackedStructSlice,
G: PackedStructSlice,
H: PackedStructSlice,
I: PackedStructSlice,
impl<A, B, C, D, E, F, G, H, I> PackedStructSlice for (A, B, C, D, E, F, G, H, I) where
A: PackedStructSlice,
B: PackedStructSlice,
C: PackedStructSlice,
D: PackedStructSlice,
E: PackedStructSlice,
F: PackedStructSlice,
G: PackedStructSlice,
H: PackedStructSlice,
I: PackedStructSlice,
impl<A, B, C, D, E, F, G, H> PackedStructSlice for (A, B, C, D, E, F, G, H) where
A: PackedStructSlice,
B: PackedStructSlice,
C: PackedStructSlice,
D: PackedStructSlice,
E: PackedStructSlice,
F: PackedStructSlice,
G: PackedStructSlice,
H: PackedStructSlice,
impl<A, B, C, D, E, F, G, H> PackedStructSlice for (A, B, C, D, E, F, G, H) where
A: PackedStructSlice,
B: PackedStructSlice,
C: PackedStructSlice,
D: PackedStructSlice,
E: PackedStructSlice,
F: PackedStructSlice,
G: PackedStructSlice,
H: PackedStructSlice,
impl<A, B, C, D, E, F, G> PackedStructSlice for (A, B, C, D, E, F, G) where
A: PackedStructSlice,
B: PackedStructSlice,
C: PackedStructSlice,
D: PackedStructSlice,
E: PackedStructSlice,
F: PackedStructSlice,
G: PackedStructSlice,
impl<A, B, C, D, E, F, G> PackedStructSlice for (A, B, C, D, E, F, G) where
A: PackedStructSlice,
B: PackedStructSlice,
C: PackedStructSlice,
D: PackedStructSlice,
E: PackedStructSlice,
F: PackedStructSlice,
G: PackedStructSlice,
impl<A, B, C, D, E, F> PackedStructSlice for (A, B, C, D, E, F) where
A: PackedStructSlice,
B: PackedStructSlice,
C: PackedStructSlice,
D: PackedStructSlice,
E: PackedStructSlice,
F: PackedStructSlice,
impl<A, B, C, D, E, F> PackedStructSlice for (A, B, C, D, E, F) where
A: PackedStructSlice,
B: PackedStructSlice,
C: PackedStructSlice,
D: PackedStructSlice,
E: PackedStructSlice,
F: PackedStructSlice,
impl<A, B, C, D, E> PackedStructSlice for (A, B, C, D, E) where
A: PackedStructSlice,
B: PackedStructSlice,
C: PackedStructSlice,
D: PackedStructSlice,
E: PackedStructSlice,
impl<A, B, C, D, E> PackedStructSlice for (A, B, C, D, E) where
A: PackedStructSlice,
B: PackedStructSlice,
C: PackedStructSlice,
D: PackedStructSlice,
E: PackedStructSlice,
impl<A, B, C, D> PackedStructSlice for (A, B, C, D) where
A: PackedStructSlice,
B: PackedStructSlice,
C: PackedStructSlice,
D: PackedStructSlice,
impl<A, B, C, D> PackedStructSlice for (A, B, C, D) where
A: PackedStructSlice,
B: PackedStructSlice,
C: PackedStructSlice,
D: PackedStructSlice,
impl<A, B, C> PackedStructSlice for (A, B, C) where
A: PackedStructSlice,
B: PackedStructSlice,
C: PackedStructSlice,
impl<A, B, C> PackedStructSlice for (A, B, C) where
A: PackedStructSlice,
B: PackedStructSlice,
C: PackedStructSlice,
This can only be used as a vector of structures that have a statically known size
Implementors
Slice unpacking for byte arrays