Enum ntex_mqtt::v3::codec::Packet

source ·
pub enum Packet {
Show 14 variants Connect(Box<Connect>), ConnectAck(ConnectAck), Publish(Publish), PublishAck { packet_id: NonZeroU16, }, PublishReceived { packet_id: NonZeroU16, }, PublishRelease { packet_id: NonZeroU16, }, PublishComplete { packet_id: NonZeroU16, }, Subscribe { packet_id: NonZeroU16, topic_filters: Vec<(ByteString, QoS)>, }, SubscribeAck { packet_id: NonZeroU16, status: Vec<SubscribeReturnCode>, }, Unsubscribe { packet_id: NonZeroU16, topic_filters: Vec<ByteString>, }, UnsubscribeAck { packet_id: NonZeroU16, }, PingRequest, PingResponse, Disconnect,
}
Expand description

MQTT Control Packets

Variants§

§

Connect(Box<Connect>)

Client request to connect to Server

§

ConnectAck(ConnectAck)

Connect acknowledgment

§

Publish(Publish)

Publish message

§

PublishAck

Fields

§packet_id: NonZeroU16

Packet Identifier

Publish acknowledgment

§

PublishReceived

Fields

§packet_id: NonZeroU16

Packet Identifier

Publish received (assured delivery part 1)

§

PublishRelease

Fields

§packet_id: NonZeroU16

Packet Identifier

Publish release (assured delivery part 2)

§

PublishComplete

Fields

§packet_id: NonZeroU16

Packet Identifier

Publish complete (assured delivery part 3)

§

Subscribe

Fields

§packet_id: NonZeroU16

Packet Identifier

§topic_filters: Vec<(ByteString, QoS)>

the list of Topic Filters and QoS to which the Client wants to subscribe.

Client subscribe request

§

SubscribeAck

Fields

§packet_id: NonZeroU16
§status: Vec<SubscribeReturnCode>

corresponds to a Topic Filter in the SUBSCRIBE Packet being acknowledged.

Subscribe acknowledgment

§

Unsubscribe

Fields

§packet_id: NonZeroU16

Packet Identifier

§topic_filters: Vec<ByteString>

the list of Topic Filters that the Client wishes to unsubscribe from.

Unsubscribe request

§

UnsubscribeAck

Fields

§packet_id: NonZeroU16

Packet Identifier

Unsubscribe acknowledgment

§

PingRequest

PING request

§

PingResponse

PING response

§

Disconnect

Client is disconnecting

Implementations§

source§

impl Packet

source

pub fn packet_type(&self) -> u8

Trait Implementations§

source§

impl Clone for Packet

source§

fn clone(&self) -> Packet

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for Packet

source§

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

Formats the value using the given formatter. Read more
source§

impl From<Connect> for Packet

source§

fn from(val: Connect) -> Packet

Converts to this type from the input type.
source§

impl From<Publish> for Packet

source§

fn from(val: Publish) -> Packet

Converts to this type from the input type.
source§

impl PartialEq for Packet

source§

fn eq(&self, other: &Packet) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl Eq for Packet

source§

impl StructuralEq for Packet

source§

impl StructuralPartialEq for Packet

Auto Trait Implementations§

§

impl !RefUnwindSafe for Packet

§

impl Send for Packet

§

impl Sync for Packet

§

impl Unpin for Packet

§

impl !UnwindSafe for Packet

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.

§

impl<T> Instrument for T

§

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

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

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> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for T
where T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
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.
§

impl<T> WithSubscriber for T

§

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
§

fn with_current_subscriber(self) -> WithDispatch<Self>

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