pub struct BinarySerdePadding<const PADDING_LENGTH: usize, const PADDING_VALUE: u8>;Expand description
a struct used for adding padding in the middle of your serializable structs.
when serializing, it will write the PADDING_VALUE to the buffer PADDING_LENGTH times.
deserializing, it will do nothing.
Trait Implementations§
Source§impl<const PADDING_LENGTH: usize, const PADDING_VALUE: u8> BinarySerde for BinarySerdePadding<PADDING_LENGTH, PADDING_VALUE>
impl<const PADDING_LENGTH: usize, const PADDING_VALUE: u8> BinarySerde for BinarySerdePadding<PADDING_LENGTH, PADDING_VALUE>
Source§const SERIALIZED_SIZE: usize = PADDING_LENGTH
const SERIALIZED_SIZE: usize = PADDING_LENGTH
the size of this type when serialized to a packed binary format.
Source§type RecursiveArray = RecursiveArrayArrayWrapper<PADDING_LENGTH, u8>
type RecursiveArray = RecursiveArrayArrayWrapper<PADDING_LENGTH, u8>
the fixed size recursive array type that is returned when serializing this type to an array.
the length of this array is guaranteed to be equal to
Self::SERIALIZED_SIZE.Source§fn binary_serialize(&self, buf: &mut [u8], _endianness: Endianness)
fn binary_serialize(&self, buf: &mut [u8], _endianness: Endianness)
serialize this value into the given buffer using the given endianness. Read more
Source§fn binary_deserialize(
_buf: &[u8],
_endianness: Endianness,
) -> Result<Self, DeserializeError>
fn binary_deserialize( _buf: &[u8], _endianness: Endianness, ) -> Result<Self, DeserializeError>
deserializes the given buffer using the given endianness into a value of this type. Read more
Source§fn binary_serialize_to_array(
&self,
endianness: Endianness,
) -> Self::RecursiveArray
fn binary_serialize_to_array( &self, endianness: Endianness, ) -> Self::RecursiveArray
serialize this value to a fixed size array using the given endianness.
Source§impl<const PADDING_LENGTH: usize, const PADDING_VALUE: u8> Clone for BinarySerdePadding<PADDING_LENGTH, PADDING_VALUE>
impl<const PADDING_LENGTH: usize, const PADDING_VALUE: u8> Clone for BinarySerdePadding<PADDING_LENGTH, PADDING_VALUE>
Source§fn clone(&self) -> BinarySerdePadding<PADDING_LENGTH, PADDING_VALUE>
fn clone(&self) -> BinarySerdePadding<PADDING_LENGTH, PADDING_VALUE>
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl<const PADDING_LENGTH: usize, const PADDING_VALUE: u8> Debug for BinarySerdePadding<PADDING_LENGTH, PADDING_VALUE>
impl<const PADDING_LENGTH: usize, const PADDING_VALUE: u8> Debug for BinarySerdePadding<PADDING_LENGTH, PADDING_VALUE>
Source§impl<const PADDING_LENGTH: usize, const PADDING_VALUE: u8> Hash for BinarySerdePadding<PADDING_LENGTH, PADDING_VALUE>
impl<const PADDING_LENGTH: usize, const PADDING_VALUE: u8> Hash for BinarySerdePadding<PADDING_LENGTH, PADDING_VALUE>
impl<const PADDING_LENGTH: usize, const PADDING_VALUE: u8> Copy for BinarySerdePadding<PADDING_LENGTH, PADDING_VALUE>
Auto Trait Implementations§
impl<const PADDING_LENGTH: usize, const PADDING_VALUE: u8> Freeze for BinarySerdePadding<PADDING_LENGTH, PADDING_VALUE>
impl<const PADDING_LENGTH: usize, const PADDING_VALUE: u8> RefUnwindSafe for BinarySerdePadding<PADDING_LENGTH, PADDING_VALUE>
impl<const PADDING_LENGTH: usize, const PADDING_VALUE: u8> Send for BinarySerdePadding<PADDING_LENGTH, PADDING_VALUE>
impl<const PADDING_LENGTH: usize, const PADDING_VALUE: u8> Sync for BinarySerdePadding<PADDING_LENGTH, PADDING_VALUE>
impl<const PADDING_LENGTH: usize, const PADDING_VALUE: u8> Unpin for BinarySerdePadding<PADDING_LENGTH, PADDING_VALUE>
impl<const PADDING_LENGTH: usize, const PADDING_VALUE: u8> UnwindSafe for BinarySerdePadding<PADDING_LENGTH, PADDING_VALUE>
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