pub struct TaggedStringCodec;
Expand description

A tagged StringCodec handler that reads with input of TaggedBytesMut and output of TaggedString, or writes with input of TaggedString and output of TaggedBytesMut

Implementations§

source§

impl TaggedStringCodec

source

pub fn new() -> Self

Creates a new TaggedStringCodec handler

Trait Implementations§

source§

impl Default for TaggedStringCodec

source§

fn default() -> Self

Returns the “default value” for a type. Read more
source§

impl Handler for TaggedStringCodec

§

type Rin = TaggedBytesMut

Associated input message type for [InboundHandler::read]
§

type Rout = TaggedString

Associated output message type for [InboundHandler::read]
§

type Win = TaggedString

Associated input message type for [OutboundHandler::write]
§

type Wout = TaggedBytesMut

Associated output message type for [OutboundHandler::write]
source§

fn name(&self) -> &str

Returns handler name
source§

fn handle_read( &mut self, ctx: &Context<Self::Rin, Self::Rout, Self::Win, Self::Wout>, msg: Self::Rin )

Handles input message.
source§

fn poll_write( &mut self, ctx: &Context<Self::Rin, Self::Rout, Self::Win, Self::Wout> ) -> Option<Self::Wout>

Polls output message from internal transmit queue
source§

fn transport_active( &mut self, ctx: &Context<Self::Rin, Self::Rout, Self::Win, Self::Wout> )

Transport is active now, which means it is connected.
source§

fn transport_inactive( &mut self, ctx: &Context<Self::Rin, Self::Rout, Self::Win, Self::Wout> )

Transport is inactive now, which means it is disconnected.
source§

fn handle_timeout( &mut self, ctx: &Context<Self::Rin, Self::Rout, Self::Win, Self::Wout>, now: Instant )

Handles a timeout event.
source§

fn poll_timeout( &mut self, ctx: &Context<Self::Rin, Self::Rout, Self::Win, Self::Wout>, eto: &mut Instant )

Polls earliest timeout (eto) in its inbound operations.
source§

fn handle_read_eof( &mut self, ctx: &Context<Self::Rin, Self::Rout, Self::Win, Self::Wout> )

Reads an EOF event.
source§

fn handle_exception( &mut self, ctx: &Context<Self::Rin, Self::Rout, Self::Win, Self::Wout>, err: Box<dyn Error> )

Handle an Error exception in one of its operations.
source§

fn handle_close( &mut self, ctx: &Context<Self::Rin, Self::Rout, Self::Win, Self::Wout> )

Handle a close event.

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T> Instrument for T

source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
source§

impl<T> WithSubscriber for T

source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more