#[non_exhaustive]pub enum TelnetEvents {
IAC(TelnetIAC),
Negotiation(TelnetNegotiation),
Subnegotiation(TelnetSubnegotiation),
DataReceive(Bytes),
DataSend(Bytes),
DecompressImmediate(Bytes),
}Expand description
The set of events produced by the parser.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
IAC(TelnetIAC)
A 2‑byte IAC command sequence (e.g., GA/EOR/NOP).
Negotiation(TelnetNegotiation)
A WILL/WONT/DO/DONT negotiation (IAC <cmd> <opt>).
Subnegotiation(TelnetSubnegotiation)
A subnegotiation payload (IAC SB <opt> <data> IAC SE).
DataReceive(Bytes)
Application data received from the remote end.
DataSend(Bytes)
Fully encoded data to send to the remote end.
DecompressImmediate(Bytes)
MCCP2/3 boundary. Decompress this data before feeding back into the parser.
Implementations§
Source§impl TelnetEvents
impl TelnetEvents
Sourcepub fn build_send(buffer: Bytes) -> Self
👎Deprecated since 0.2.1: Construct enum variant directly or use into.
pub fn build_send(buffer: Bytes) -> Self
Helper method to generate a TelnetEvents::DataSend.
Sourcepub fn build_receive(buffer: Bytes) -> Self
👎Deprecated since 0.2.1: Construct enum variant directly or use into.
pub fn build_receive(buffer: Bytes) -> Self
Helper method to generate a TelnetEvents::DataReceive.
Sourcepub fn build_iac(command: u8) -> TelnetEvents
👎Deprecated since 0.2.1: Construct enum variant directly or use into.
pub fn build_iac(command: u8) -> TelnetEvents
Helper method to generate a TelnetEvents::IAC.
Sourcepub fn build_negotiation(command: u8, option: u8) -> Self
👎Deprecated since 0.2.1: Construct enum variant directly or use into.
pub fn build_negotiation(command: u8, option: u8) -> Self
Helper method to generate a TelnetEvents::Negotiation.
Sourcepub fn build_subnegotiation(option: u8, buffer: Bytes) -> Self
👎Deprecated since 0.2.1: Construct enum variant directly or use into.
pub fn build_subnegotiation(option: u8, buffer: Bytes) -> Self
Helper method to generate a TelnetEvents::Subnegotiation.
pub fn to_bytes(self) -> Bytes
Trait Implementations§
Source§impl Clone for TelnetEvents
impl Clone for TelnetEvents
Source§fn clone(&self) -> TelnetEvents
fn clone(&self) -> TelnetEvents
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for TelnetEvents
impl Debug for TelnetEvents
Source§impl From<TelnetIAC> for TelnetEvents
impl From<TelnetIAC> for TelnetEvents
Source§impl From<TelnetNegotiation> for TelnetEvents
impl From<TelnetNegotiation> for TelnetEvents
Source§fn from(neg: TelnetNegotiation) -> Self
fn from(neg: TelnetNegotiation) -> Self
Converts to this type from the input type.
Source§impl From<TelnetSubnegotiation> for TelnetEvents
impl From<TelnetSubnegotiation> for TelnetEvents
Source§fn from(sub: TelnetSubnegotiation) -> Self
fn from(sub: TelnetSubnegotiation) -> Self
Converts to this type from the input type.
Source§impl PartialEq for TelnetEvents
impl PartialEq for TelnetEvents
impl Eq for TelnetEvents
impl StructuralPartialEq for TelnetEvents
Auto Trait Implementations§
impl !Freeze for TelnetEvents
impl RefUnwindSafe for TelnetEvents
impl Send for TelnetEvents
impl Sync for TelnetEvents
impl Unpin for TelnetEvents
impl UnwindSafe for TelnetEvents
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