pub(crate) struct PayloadU24<'a, C: Cardinality = MaybeEmpty>(pub(crate) Payload<'a>, PhantomData<C>);Expand description
An arbitrary, unknown-content, u24-length-prefixed payload
Tuple Fields§
§0: Payload<'a>§1: PhantomData<C>Implementations§
Source§impl<C: Cardinality> PayloadU24<'_, C>
impl<C: Cardinality> PayloadU24<'_, C>
pub(crate) fn into_owned(self) -> PayloadU24<'static, C>
Trait Implementations§
Source§impl<C: Cardinality> AsRef<[u8]> for PayloadU24<'_, C>
impl<C: Cardinality> AsRef<[u8]> for PayloadU24<'_, C>
Source§impl<'a, C: Clone + Cardinality> Clone for PayloadU24<'a, C>
impl<'a, C: Clone + Cardinality> Clone for PayloadU24<'a, C>
Source§fn clone(&self) -> PayloadU24<'a, C>
fn clone(&self) -> PayloadU24<'a, C>
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl<'a, C: Cardinality> Codec<'a> for PayloadU24<'a, C>
impl<'a, C: Cardinality> Codec<'a> for PayloadU24<'a, C>
Source§fn encode(&self, bytes: &mut Vec<u8>)
fn encode(&self, bytes: &mut Vec<u8>)
Function for encoding itself by appending itself to
the provided vec of bytes.
Source§fn read(r: &mut Reader<'a>) -> Result<Self, InvalidMessage>
fn read(r: &mut Reader<'a>) -> Result<Self, InvalidMessage>
Function for decoding itself from the provided reader
will return Some if the decoding was successful or
None if it was not.
Source§fn get_encoding(&self) -> Vec<u8> ⓘ
fn get_encoding(&self) -> Vec<u8> ⓘ
Convenience function for encoding the implementation
into a vec and returning it
Source§fn read_bytes(bytes: &'a [u8]) -> Result<Self, InvalidMessage>
fn read_bytes(bytes: &'a [u8]) -> Result<Self, InvalidMessage>
Function for wrapping a call to the read function in
a Reader for the slice of bytes provided Read more
Source§impl<C: Cardinality> Debug for PayloadU24<'_, C>
impl<C: Cardinality> Debug for PayloadU24<'_, C>
Source§impl<'a, C: Cardinality> From<Payload<'a>> for PayloadU24<'a, C>
impl<'a, C: Cardinality> From<Payload<'a>> for PayloadU24<'a, C>
Source§impl<'a, C: PartialEq + Cardinality> PartialEq for PayloadU24<'a, C>
impl<'a, C: PartialEq + Cardinality> PartialEq for PayloadU24<'a, C>
Source§fn eq(&self, other: &PayloadU24<'a, C>) -> bool
fn eq(&self, other: &PayloadU24<'a, C>) -> bool
Tests for
self and other values to be equal, and is used by ==.impl<'a, C: Eq + Cardinality> Eq for PayloadU24<'a, C>
impl<'a, C: Cardinality> StructuralPartialEq for PayloadU24<'a, C>
Auto Trait Implementations§
impl<'a, C> Freeze for PayloadU24<'a, C>
impl<'a, C> RefUnwindSafe for PayloadU24<'a, C>where
C: RefUnwindSafe,
impl<'a, C> Send for PayloadU24<'a, C>where
C: Send,
impl<'a, C> Sync for PayloadU24<'a, C>where
C: Sync,
impl<'a, C> Unpin for PayloadU24<'a, C>where
C: Unpin,
impl<'a, C> UnsafeUnpin for PayloadU24<'a, C>
impl<'a, C> UnwindSafe for PayloadU24<'a, C>where
C: UnwindSafe,
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