pub struct TunPacketCodec(/* private fields */);Expand description
A TUN packet Encoder/Decoder.
Implementations§
Source§impl TunPacketCodec
impl TunPacketCodec
Sourcepub fn new(mtu: usize) -> TunPacketCodec
pub fn new(mtu: usize) -> TunPacketCodec
Create a new TunPacketCodec specifying whether the underlying
tunnel Device has enabled the packet information header.
Trait Implementations§
Source§impl Debug for TunPacketCodec
impl Debug for TunPacketCodec
Source§impl Decoder for TunPacketCodec
impl Decoder for TunPacketCodec
Source§fn decode(
&mut self,
buf: &mut BytesMut,
) -> Result<Option<Self::Item>, Self::Error>
fn decode( &mut self, buf: &mut BytesMut, ) -> Result<Option<Self::Item>, Self::Error>
Attempts to decode a frame from the provided buffer of bytes. Read more
Source§impl Default for TunPacketCodec
impl Default for TunPacketCodec
Source§fn default() -> TunPacketCodec
fn default() -> TunPacketCodec
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for TunPacketCodec
impl RefUnwindSafe for TunPacketCodec
impl Send for TunPacketCodec
impl Sync for TunPacketCodec
impl Unpin for TunPacketCodec
impl UnwindSafe for TunPacketCodec
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