MPacket

Enum MPacket 

Source
pub enum MPacket<'message> {
Show 14 variants Connect(MConnect<'message>), Connack(MConnack), Publish(MPublish<'message>), Puback(MPuback), Pubrec(MPubrec), Pubrel(MPubrel), Pubcomp(MPubcomp), Subscribe(MSubscribe<'message>), Suback(MSuback<'message>), Unsubscribe(MUnsubscribe<'message>), Unsuback(MUnsuback), Pingreq(MPingreq), Pingresp(MPingresp), Disconnect(MDisconnect),
}

Variants§

§

Connect(MConnect<'message>)

§

Connack(MConnack)

§

Publish(MPublish<'message>)

§

Puback(MPuback)

§

Pubrec(MPubrec)

§

Pubrel(MPubrel)

§

Pubcomp(MPubcomp)

§

Subscribe(MSubscribe<'message>)

§

Suback(MSuback<'message>)

§

Unsubscribe(MUnsubscribe<'message>)

§

Unsuback(MUnsuback)

§

Pingreq(MPingreq)

§

Pingresp(MPingresp)

§

Disconnect(MDisconnect)

Implementations§

Source§

impl<'message> MPacket<'message>

Source

pub async fn write_to<W: AsyncWrite>( &self, writer: Pin<&mut W>, ) -> Result<(), MPacketWriteError>

Trait Implementations§

Source§

impl<'message> Clone for MPacket<'message>

Source§

fn clone(&self) -> MPacket<'message>

Returns a duplicate 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<'message> Debug for MPacket<'message>

Source§

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

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

impl<'message> From<MConnack> for MPacket<'message>

Source§

fn from(v: MConnack) -> Self

Converts to this type from the input type.
Source§

impl<'message> From<MConnect<'message>> for MPacket<'message>

Source§

fn from(v: MConnect<'message>) -> Self

Converts to this type from the input type.
Source§

impl<'message> From<MDisconnect> for MPacket<'message>

Source§

fn from(v: MDisconnect) -> Self

Converts to this type from the input type.
Source§

impl<'message> From<MPingreq> for MPacket<'message>

Source§

fn from(v: MPingreq) -> Self

Converts to this type from the input type.
Source§

impl<'message> From<MPingresp> for MPacket<'message>

Source§

fn from(v: MPingresp) -> Self

Converts to this type from the input type.
Source§

impl<'message> From<MPuback> for MPacket<'message>

Source§

fn from(v: MPuback) -> Self

Converts to this type from the input type.
Source§

impl<'message> From<MPubcomp> for MPacket<'message>

Source§

fn from(v: MPubcomp) -> Self

Converts to this type from the input type.
Source§

impl<'message> From<MPublish<'message>> for MPacket<'message>

Source§

fn from(v: MPublish<'message>) -> Self

Converts to this type from the input type.
Source§

impl<'message> From<MPubrec> for MPacket<'message>

Source§

fn from(v: MPubrec) -> Self

Converts to this type from the input type.
Source§

impl<'message> From<MPubrel> for MPacket<'message>

Source§

fn from(v: MPubrel) -> Self

Converts to this type from the input type.
Source§

impl<'message> From<MSuback<'message>> for MPacket<'message>

Source§

fn from(v: MSuback<'message>) -> Self

Converts to this type from the input type.
Source§

impl<'message> From<MSubscribe<'message>> for MPacket<'message>

Source§

fn from(v: MSubscribe<'message>) -> Self

Converts to this type from the input type.
Source§

impl<'message> From<MUnsuback> for MPacket<'message>

Source§

fn from(v: MUnsuback) -> Self

Converts to this type from the input type.
Source§

impl<'message> PartialEq for MPacket<'message>

Source§

fn eq(&self, other: &MPacket<'message>) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

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

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl<'other, 'message> TryFrom<&'other MPacket<'message>> for &'other MConnack

Source§

type Error = ()

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

fn try_from(value: &'other MPacket<'message>) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl<'other, 'message> TryFrom<&'other MPacket<'message>> for &'other MConnect<'message>

Source§

type Error = ()

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

fn try_from(value: &'other MPacket<'message>) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl<'other, 'message> TryFrom<&'other MPacket<'message>> for &'other MDisconnect

Source§

type Error = ()

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

fn try_from(value: &'other MPacket<'message>) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl<'other, 'message> TryFrom<&'other MPacket<'message>> for &'other MPingreq

Source§

type Error = ()

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

fn try_from(value: &'other MPacket<'message>) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl<'other, 'message> TryFrom<&'other MPacket<'message>> for &'other MPingresp

Source§

type Error = ()

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

fn try_from(value: &'other MPacket<'message>) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl<'other, 'message> TryFrom<&'other MPacket<'message>> for &'other MPuback

Source§

type Error = ()

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

fn try_from(value: &'other MPacket<'message>) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl<'other, 'message> TryFrom<&'other MPacket<'message>> for &'other MPubcomp

Source§

type Error = ()

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

fn try_from(value: &'other MPacket<'message>) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl<'other, 'message> TryFrom<&'other MPacket<'message>> for &'other MPublish<'message>

Source§

type Error = ()

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

fn try_from(value: &'other MPacket<'message>) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl<'other, 'message> TryFrom<&'other MPacket<'message>> for &'other MPubrec

Source§

type Error = ()

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

fn try_from(value: &'other MPacket<'message>) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl<'other, 'message> TryFrom<&'other MPacket<'message>> for &'other MPubrel

Source§

type Error = ()

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

fn try_from(value: &'other MPacket<'message>) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl<'other, 'message> TryFrom<&'other MPacket<'message>> for &'other MSuback<'message>

Source§

type Error = ()

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

fn try_from(value: &'other MPacket<'message>) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl<'other, 'message> TryFrom<&'other MPacket<'message>> for &'other MSubscribe<'message>

Source§

type Error = ()

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

fn try_from(value: &'other MPacket<'message>) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl<'other, 'message> TryFrom<&'other MPacket<'message>> for &'other MUnsuback

Source§

type Error = ()

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

fn try_from(value: &'other MPacket<'message>) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl<'other, 'message> TryFrom<&'other MPacket<'message>> for MConnack

Source§

type Error = ()

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

fn try_from(value: &'other MPacket<'message>) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl<'other, 'message> TryFrom<&'other MPacket<'message>> for MConnect<'message>

Source§

type Error = ()

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

fn try_from(value: &'other MPacket<'message>) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl<'other, 'message> TryFrom<&'other MPacket<'message>> for MDisconnect

Source§

type Error = ()

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

fn try_from(value: &'other MPacket<'message>) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl<'other, 'message> TryFrom<&'other MPacket<'message>> for MPingreq

Source§

type Error = ()

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

fn try_from(value: &'other MPacket<'message>) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl<'other, 'message> TryFrom<&'other MPacket<'message>> for MPingresp

Source§

type Error = ()

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

fn try_from(value: &'other MPacket<'message>) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl<'other, 'message> TryFrom<&'other MPacket<'message>> for MPuback

Source§

type Error = ()

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

fn try_from(value: &'other MPacket<'message>) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl<'other, 'message> TryFrom<&'other MPacket<'message>> for MPubcomp

Source§

type Error = ()

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

fn try_from(value: &'other MPacket<'message>) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl<'other, 'message> TryFrom<&'other MPacket<'message>> for MPublish<'message>

Source§

type Error = ()

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

fn try_from(value: &'other MPacket<'message>) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl<'other, 'message> TryFrom<&'other MPacket<'message>> for MPubrec

Source§

type Error = ()

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

fn try_from(value: &'other MPacket<'message>) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl<'other, 'message> TryFrom<&'other MPacket<'message>> for MPubrel

Source§

type Error = ()

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

fn try_from(value: &'other MPacket<'message>) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl<'other, 'message> TryFrom<&'other MPacket<'message>> for MSuback<'message>

Source§

type Error = ()

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

fn try_from(value: &'other MPacket<'message>) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl<'other, 'message> TryFrom<&'other MPacket<'message>> for MSubscribe<'message>

Source§

type Error = ()

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

fn try_from(value: &'other MPacket<'message>) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl<'other, 'message> TryFrom<&'other MPacket<'message>> for MUnsuback

Source§

type Error = ()

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

fn try_from(value: &'other MPacket<'message>) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl<'message> TryFrom<MPacket<'message>> for MConnack

Source§

type Error = ()

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

fn try_from(value: MPacket<'message>) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl<'message> TryFrom<MPacket<'message>> for MConnect<'message>

Source§

type Error = ()

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

fn try_from(value: MPacket<'message>) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl<'message> TryFrom<MPacket<'message>> for MDisconnect

Source§

type Error = ()

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

fn try_from(value: MPacket<'message>) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl<'message> TryFrom<MPacket<'message>> for MPingreq

Source§

type Error = ()

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

fn try_from(value: MPacket<'message>) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl<'message> TryFrom<MPacket<'message>> for MPingresp

Source§

type Error = ()

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

fn try_from(value: MPacket<'message>) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl<'message> TryFrom<MPacket<'message>> for MPuback

Source§

type Error = ()

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

fn try_from(value: MPacket<'message>) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl<'message> TryFrom<MPacket<'message>> for MPubcomp

Source§

type Error = ()

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

fn try_from(value: MPacket<'message>) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl<'message> TryFrom<MPacket<'message>> for MPublish<'message>

Source§

type Error = ()

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

fn try_from(value: MPacket<'message>) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl<'message> TryFrom<MPacket<'message>> for MPubrec

Source§

type Error = ()

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

fn try_from(value: MPacket<'message>) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl<'message> TryFrom<MPacket<'message>> for MPubrel

Source§

type Error = ()

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

fn try_from(value: MPacket<'message>) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl<'message> TryFrom<MPacket<'message>> for MSuback<'message>

Source§

type Error = ()

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

fn try_from(value: MPacket<'message>) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl<'message> TryFrom<MPacket<'message>> for MSubscribe<'message>

Source§

type Error = ()

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

fn try_from(value: MPacket<'message>) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl<'message> TryFrom<MPacket<'message>> for MUnsuback

Source§

type Error = ()

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

fn try_from(value: MPacket<'message>) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl<'message> Copy for MPacket<'message>

Source§

impl<'message> Eq for MPacket<'message>

Source§

impl<'message> StructuralPartialEq for MPacket<'message>

Auto Trait Implementations§

§

impl<'message> Freeze for MPacket<'message>

§

impl<'message> RefUnwindSafe for MPacket<'message>

§

impl<'message> Send for MPacket<'message>

§

impl<'message> Sync for MPacket<'message>

§

impl<'message> Unpin for MPacket<'message>

§

impl<'message> UnwindSafe for MPacket<'message>

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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<I, T> ExtractContext<I, ()> for T

Source§

fn extract_context(self, _original_input: I)

Given the context attached to a nom error, and given the original input to the nom parser, extract more the useful context information. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

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<I> RecreateContext<I> for I

Source§

fn recreate_context(_original_input: I, tail: I) -> I

Given the original input, as well as the context reported by nom, recreate a context in the original string where the error occurred. Read more
Source§

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

Source§

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>,

Source§

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>,

Source§

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.