pub struct Sv2Frame<T, B> { /* private fields */ }
Implementations§
Trait Implementations§
source§impl<'a, T, B> Frame<'a, T> for Sv2Frame<T, B>
impl<'a, T, B> Frame<'a, T> for Sv2Frame<T, B>
source§fn serialize(self, dst: &mut [u8]) -> Result<(), Error>
fn serialize(self, dst: &mut [u8]) -> Result<(), Error>
Serialize the frame into dst if the frame is already serialized it just swap dst with itself
source§fn get_header(&self) -> Option<Header>
fn get_header(&self) -> Option<Header>
If is an Sv2 frame return the Some(header) if it is a noise frame return None
source§fn from_bytes(
bytes: <Sv2Frame<T, B> as Frame<'a, T>>::Buffer
) -> Result<Sv2Frame<T, B>, isize>
fn from_bytes( bytes: <Sv2Frame<T, B> as Frame<'a, T>>::Buffer ) -> Result<Sv2Frame<T, B>, isize>
Try to build a Frame frame from raw bytes. It return the frame or the number of the bytes needed to complete the frame The resulting frame is just a header plus a payload with the right number of bytes nothing is said about the correctness of the payload
source§fn from_message(
message: T,
message_type: u8,
extension_type: u16,
channel_msg: bool
) -> Option<Sv2Frame<T, B>>
fn from_message( message: T, message_type: u8, extension_type: u16, channel_msg: bool ) -> Option<Sv2Frame<T, B>>
Try to build an Frame frame from a serializable payload. It returns a Frame if the size of the payload fits in the frame, if not it returns None
type Buffer = B
type Deserialized = B
fn payload(&'a mut self) -> &'a mut [u8] ⓘ
fn from_bytes_unchecked( bytes: <Sv2Frame<T, B> as Frame<'a, T>>::Buffer ) -> Sv2Frame<T, B>
fn size_hint(bytes: &[u8]) -> isize
fn encoded_length(&self) -> usize
source§impl<T, B> From<Sv2Frame<T, B>> for EitherFrame<T, B>
impl<T, B> From<Sv2Frame<T, B>> for EitherFrame<T, B>
source§fn from(v: Sv2Frame<T, B>) -> EitherFrame<T, B>
fn from(v: Sv2Frame<T, B>) -> EitherFrame<T, B>
Converts to this type from the input type.
Auto Trait Implementations§
impl<T, B> Freeze for Sv2Frame<T, B>
impl<T, B> RefUnwindSafe for Sv2Frame<T, B>where
B: RefUnwindSafe,
T: RefUnwindSafe,
impl<T, B> Send for Sv2Frame<T, B>
impl<T, B> Sync for Sv2Frame<T, B>
impl<T, B> Unpin for Sv2Frame<T, B>
impl<T, B> UnwindSafe for Sv2Frame<T, B>where
B: UnwindSafe,
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