[][src]Struct sage_mqtt::Subscribe

pub struct Subscribe {
    pub packet_identifier: u16,
    pub subscription_identifier: Option<u32>,
    pub user_properties: Vec<(String, String)>,
    pub subscriptions: Vec<(String, SubscriptionOptions)>,
}

The subscribe packet is a request from the client to listen to one or more topics.

Fields

packet_identifier: u16

The packet identifier is used to identify the message throughout the communication.

subscription_identifier: Option<u32>

Optional identifier used to represent the subscription in nextcoming mmessages.

user_properties: Vec<(String, String)>

General purpose user properies

subscriptions: Vec<(String, SubscriptionOptions)>

The list of topics to subscribe to with options. Each topics can use wildcards.

Implementations

impl Subscribe[src]

pub async fn write<'_, W: AsyncWrite + Unpin>(
    self,
    writer: &'_ mut W
) -> SageResult<usize>
[src]

Write the Subscribe body of a packet, returning the written size in bytes in case of success.

pub async fn read<'_, R: AsyncRead + Unpin>(
    reader: &'_ mut R,
    remaining_size: usize
) -> SageResult<Self>
[src]

Read the Subscribe body from reader, retuning it in case of success.

Trait Implementations

impl Clone for Subscribe[src]

impl Debug for Subscribe[src]

impl Default for Subscribe[src]

impl PartialEq<Subscribe> for Subscribe[src]

impl StructuralPartialEq for Subscribe[src]

Auto Trait Implementations

Blanket Implementations

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

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

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

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

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

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

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.

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.