pub struct Container<T: ImmutableData> { /* private fields */ }
Expand description
Container object provides base field accessors over an arbitrary (mutable or immutable) buffers See https://lab.whitequark.org/notes/2016-12-13/abstracting-over-mutability-in-rust/ for details
Implementations§
Source§impl<'a, T: ImmutableData> Container<T>
impl<'a, T: ImmutableData> Container<T>
Sourcepub fn from(buff: T) -> (Self, usize)
pub fn from(buff: T) -> (Self, usize)
Create a new container object from an existing buffer This parses the header and splits the data into fields to simplify access
Sourcepub fn header(&self) -> WireHeader<&[u8]>
pub fn header(&self) -> WireHeader<&[u8]>
Fetch wire header
Sourcepub fn private_options(&self) -> &[u8] ⓘ
pub fn private_options(&self) -> &[u8] ⓘ
Return the private options section data
Sourcepub fn public_options(&self) -> impl Iterator<Item = Options> + '_
pub fn public_options(&self) -> impl Iterator<Item = Options> + '_
Return the public options section data
Sourcepub fn signed(&self) -> &[u8] ⓘ
pub fn signed(&self) -> &[u8] ⓘ
Return the signed portion of the message for signing or verification
Sourcepub fn signature(&self) -> &[u8] ⓘ
pub fn signature(&self) -> &[u8] ⓘ
Return the signature portion of the message for verification
Trait Implementations§
impl<T: ImmutableData> StructuralPartialEq for Container<T>
Auto Trait Implementations§
impl<T> Freeze for Container<T>where
T: Freeze,
impl<T> RefUnwindSafe for Container<T>where
T: RefUnwindSafe,
impl<T> Send for Container<T>where
T: Send,
impl<T> Sync for Container<T>where
T: Sync,
impl<T> Unpin for Container<T>where
T: Unpin,
impl<T> UnwindSafe for Container<T>where
T: 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