Struct Unsubscribe
pub struct Unsubscribe<'a> {
pub packet_id: PacketId,
pub properties: &'a UnsubscribeProperties,
pub topic_filters: &'a TopicFilters,
}Expand description
UNSUBSCRIBE packet requesting removal of topic filter subscriptions.
Fields§
§packet_id: PacketIdPacket identifier.
properties: &'a UnsubscribePropertiesUNSUBSCRIBE properties.
topic_filters: &'a TopicFiltersTopic filter entries in this packet.
Implementations§
§impl<'a> Unsubscribe<'a>
impl<'a> Unsubscribe<'a>
pub const fn new(
packet_id: PacketId,
properties: &'a UnsubscribeProperties,
topic_filters: &'a TopicFilters,
) -> Self
pub const fn new( packet_id: PacketId, properties: &'a UnsubscribeProperties, topic_filters: &'a TopicFilters, ) -> Self
Creates an UNSUBSCRIBE packet from a topic filter payload.
pub const fn encoded_len(&self) -> usize
pub const fn encoded_len(&self) -> usize
Returns the encoded size of the variable header + payload in bytes.
pub const fn encode(&self, w: &mut Writer<'_>) -> Result<(), EncodeError>
pub const fn encode(&self, w: &mut Writer<'_>) -> Result<(), EncodeError>
Encodes the UNSUBSCRIBE variable header + payload into the writer.
§Errors
Returns EncodeError::InsufficientSpace if the writer does not have
enough capacity.
pub const fn decode(r: &mut Reader<'a>) -> Result<Self, DecodeError>
pub const fn decode(r: &mut Reader<'a>) -> Result<Self, DecodeError>
Decodes an UNSUBSCRIBE packet from the reader.
§Errors
Returns DecodeError if the data is malformed, the packet ID is
zero, properties contain disallowed IDs, or the payload is invalid.
Trait Implementations§
§impl<'a> Clone for Unsubscribe<'a>
impl<'a> Clone for Unsubscribe<'a>
§fn clone(&self) -> Unsubscribe<'a>
fn clone(&self) -> Unsubscribe<'a>
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read more§impl<'a> Debug for Unsubscribe<'a>
impl<'a> Debug for Unsubscribe<'a>
§impl<'a> PartialEq for Unsubscribe<'a>
impl<'a> PartialEq for Unsubscribe<'a>
impl<'a> Eq for Unsubscribe<'a>
impl<'a> StructuralPartialEq for Unsubscribe<'a>
Auto Trait Implementations§
impl<'a> Freeze for Unsubscribe<'a>
impl<'a> RefUnwindSafe for Unsubscribe<'a>
impl<'a> Send for Unsubscribe<'a>
impl<'a> Sync for Unsubscribe<'a>
impl<'a> Unpin for Unsubscribe<'a>
impl<'a> UnwindSafe for Unsubscribe<'a>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more