pub enum PacketDecoder {
Stream {
stream: Box<dyn BufRead + Send>,
is_eof: bool,
counters: ProtocolCounters,
},
Socket {
socket: UdpSocket,
is_eof: bool,
counters: ProtocolCounters,
last_seq_num: u16,
partial_packet_info: Option<UdpParserState>,
read_buffer: Vec<u8>,
last_recv_time: Option<Instant>,
},
}Variants§
Implementations§
Source§impl PacketDecoder
impl PacketDecoder
pub fn from_stream(stream: impl Read + Send + 'static) -> Self
pub fn from_socket(addr: impl ToSocketAddrs) -> Self
pub fn read_packet(&mut self) -> ReadResult<Option<Packet>>
pub fn is_eof(&self) -> bool
pub fn counters(&self) -> ProtocolCounters
Auto Trait Implementations§
impl Freeze for PacketDecoder
impl !RefUnwindSafe for PacketDecoder
impl Send for PacketDecoder
impl !Sync for PacketDecoder
impl Unpin for PacketDecoder
impl !UnwindSafe for PacketDecoder
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