pub enum Message<T = Vec<u8>> {
Control(ControlMessage),
Data(DataMessage<T>),
}Expand description
§Summary
A Message is a representation of an L2TP protocol message. It can be either a DataMessage
or a ControlMessage and constitutes the outermost container for the protocol.
Variants§
Control(ControlMessage)
Data(DataMessage<T>)
Implementations§
Source§impl<T> Message<T>
impl<T> Message<T>
Sourcepub fn try_read(reader: &mut impl Reader<T>) -> Result<Self, Vec<DecodeError>>
pub fn try_read(reader: &mut impl Reader<T>) -> Result<Self, Vec<DecodeError>>
§Summary
Attempt to read a Message using a Reader.
Note: Only validation of the protocol version will take place.
Sourcepub fn try_read_validate(
reader: &mut impl Reader<T>,
validation_options: ValidationOptions,
) -> Result<Self, Vec<DecodeError>>
pub fn try_read_validate( reader: &mut impl Reader<T>, validation_options: ValidationOptions, ) -> Result<Self, Vec<DecodeError>>
§Summary
Attempt to read a Message using a Reader. User-supplied ValidationOptions offer a way to ignore certain protocol mandates.
Trait Implementations§
impl<T: Eq> Eq for Message<T>
impl<T> StructuralPartialEq for Message<T>
Auto Trait Implementations§
impl<T> Freeze for Message<T>where
T: Freeze,
impl<T> RefUnwindSafe for Message<T>where
T: RefUnwindSafe,
impl<T> Send for Message<T>where
T: Send,
impl<T> Sync for Message<T>where
T: Sync,
impl<T> Unpin for Message<T>where
T: Unpin,
impl<T> UnwindSafe for Message<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