Struct PubackPacket

Source
pub struct PubackPacket<'a, const MAX_PROPERTIES: usize> {
    pub fixed_header: u8,
    pub remain_len: u32,
    pub packet_identifier: u16,
    pub reason_code: u8,
    pub property_len: u32,
    pub properties: Vec<Property<'a>, MAX_PROPERTIES>,
}

Fields§

§fixed_header: u8§remain_len: u32§packet_identifier: u16§reason_code: u8§property_len: u32§properties: Vec<Property<'a>, MAX_PROPERTIES>

Trait Implementations§

Source§

impl<'a, const MAX_PROPERTIES: usize> Packet<'a> for PubackPacket<'a, MAX_PROPERTIES>

Source§

fn new() -> Self

Source§

fn encode( &mut self, buffer: &mut [u8], buffer_len: usize, ) -> Result<usize, BufferError>

Method encode provide way how to transfer Packet struct into Byte array (buffer)
Source§

fn decode( &mut self, buff_reader: &mut BuffReader<'a>, ) -> Result<(), BufferError>

Decode method is opposite of encode - decoding Byte array and mapping it into corresponding Packet struct
Source§

fn set_property_len(&mut self, value: u32)

Setter method for packet properties len - not all Packet types support this
Source§

fn get_property_len(&mut self) -> u32

Setter method for packet properties len - not all Packet types support this
Source§

fn push_to_properties(&mut self, property: Property<'a>)

Method enables pushing new property into packet properties
Source§

fn property_allowed(&mut self, property: &Property<'a>) -> bool

Returns if property is allowed for packet
Source§

fn set_fixed_header(&mut self, header: u8)

Setter for packet fixed header
Source§

fn set_remaining_len(&mut self, remaining_len: u32)

Setter for remaining len
Source§

fn add_properties<const MAX_PROPERTIES: usize>( &mut self, properties: &Vec<Property<'a>, MAX_PROPERTIES>, ) -> u32

Method enables adding properties from client config - each packet decides if property can be used with that or not
Source§

fn decode_properties( &mut self, buff_reader: &mut BuffReader<'a>, ) -> Result<(), BufferError>

Method is decoding Byte array pointing to properties into heapless Vec in packet. If decoding goes wrong method is returning Error
Source§

fn decode_fixed_header( &mut self, buff_reader: &mut BuffReader<'_>, ) -> Result<PacketType, BufferError>

Method is decoding packet header into fixed header part and remaining length

Auto Trait Implementations§

§

impl<'a, const MAX_PROPERTIES: usize> Freeze for PubackPacket<'a, MAX_PROPERTIES>

§

impl<'a, const MAX_PROPERTIES: usize> RefUnwindSafe for PubackPacket<'a, MAX_PROPERTIES>

§

impl<'a, const MAX_PROPERTIES: usize> Send for PubackPacket<'a, MAX_PROPERTIES>

§

impl<'a, const MAX_PROPERTIES: usize> Sync for PubackPacket<'a, MAX_PROPERTIES>

§

impl<'a, const MAX_PROPERTIES: usize> Unpin for PubackPacket<'a, MAX_PROPERTIES>

§

impl<'a, const MAX_PROPERTIES: usize> UnwindSafe for PubackPacket<'a, MAX_PROPERTIES>

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

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.