Struct ntex_mqtt::v3::codec::Codec[][src]

pub struct Codec { /* fields omitted */ }
Expand description

Mqtt v3.1.1 protocol codec

Implementations

impl Codec[src]

pub fn new() -> Self[src]

Create Codec instance

pub fn max_size(self, size: u32) -> Self[src]

Set max inbound frame size.

If max size is set to 0, size is unlimited. By default max size is set to 0

pub fn set_max_size(&self, size: u32)[src]

Set max inbound frame size.

If max size is set to 0, size is unlimited. By default max size is set to 0

Trait Implementations

impl Debug for Codec[src]

fn fmt(&self, f: &mut Formatter<'_>) -> Result[src]

Formats the value using the given formatter. Read more

impl Decoder for Codec[src]

type Item = Packet

The type of decoded frames.

type Error = DecodeError

The type of unrecoverable frame decoding errors. Read more

fn decode(&self, src: &mut BytesMut) -> Result<Option<Self::Item>, DecodeError>[src]

Attempts to decode a frame from the provided buffer of bytes.

fn decode_eof(
    &self,
    buf: &mut BytesMut
) -> Result<Option<Self::Item>, Self::Error>

A default method available to be called when there are no more bytes available to be read from the underlying I/O. Read more

impl Default for Codec[src]

fn default() -> Self[src]

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

impl Encoder for Codec[src]

type Item = Packet

The type of items consumed by the Encoder

type Error = EncodeError

The type of encoding errors.

fn encode(
    &self,
    item: Self::Item,
    dst: &mut BytesMut
) -> Result<(), EncodeError>
[src]

Encodes a frame into the buffer provided.

Auto Trait Implementations

impl !RefUnwindSafe for Codec

impl Send for Codec

impl !Sync for Codec

impl Unpin for Codec

impl UnwindSafe for Codec

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

pub fn type_id(&self) -> TypeId[src]

Gets the TypeId of self. Read more

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

pub fn borrow(&self) -> &T[src]

Immutably borrows from an owned value. Read more

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

pub fn borrow_mut(&mut self) -> &mut T[src]

Mutably borrows from an owned value. Read more

impl<T> From<T> for T[src]

pub fn from(t: T) -> T[src]

Performs the conversion.

impl<T> Instrument for T[src]

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

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

fn in_current_span(self) -> Instrumented<Self>[src]

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

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

pub fn into(self) -> U[src]

Performs the conversion.

impl<T> Same<T> for T

type Output = T

Should always be Self

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

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

Performs the conversion.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.

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

Performs the conversion.