pub struct TelnetCodec {
pub sga: bool,
pub max_buffer_length: usize,
pub buffer: Vec<u8>,
pub message_mode: bool,
}Expand description
Implements a Tokio codec for the Telnet protocol, along with MUD-specific extension protocols such as GMCP.
You should never have to interact with this directly.
Fields§
§sga: boolWhether or not the client has enabled the Suppress Go Ahead option.
max_buffer_length: usize§buffer: Vec<u8>§message_mode: boolIf this field is set to false, nectar will generate an event for each character instead of each message
Implementations§
Trait Implementations§
Source§impl Debug for TelnetCodec
impl Debug for TelnetCodec
Source§impl Decoder for TelnetCodec
impl Decoder for TelnetCodec
Source§type Item = TelnetEvent
type Item = TelnetEvent
The type of decoded frames.
Source§type Error = TelnetError
type Error = TelnetError
The type of unrecoverable frame decoding errors. Read more
Source§fn decode(
&mut self,
buffer: &mut BytesMut,
) -> Result<Option<Self::Item>, TelnetError>
fn decode( &mut self, buffer: &mut BytesMut, ) -> Result<Option<Self::Item>, TelnetError>
Attempts to decode a frame from the provided buffer of bytes. Read more
Source§impl Encoder<TelnetEvent> for TelnetCodec
impl Encoder<TelnetEvent> for TelnetCodec
Source§type Error = TelnetError
type Error = TelnetError
The type of encoding errors. Read more
Source§fn encode(
&mut self,
event: TelnetEvent,
buffer: &mut BytesMut,
) -> Result<(), TelnetError>
fn encode( &mut self, event: TelnetEvent, buffer: &mut BytesMut, ) -> Result<(), TelnetError>
Encodes a frame into the buffer provided. Read more
Auto Trait Implementations§
impl Freeze for TelnetCodec
impl RefUnwindSafe for TelnetCodec
impl Send for TelnetCodec
impl Sync for TelnetCodec
impl Unpin for TelnetCodec
impl UnwindSafe for TelnetCodec
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