Struct mqtt::packet::connect::ConnectPacket
source · pub struct ConnectPacket { /* private fields */ }
Expand description
CONNECT
packet
Implementations§
source§impl ConnectPacket
impl ConnectPacket
pub fn new<C>(client_identifier: C) -> ConnectPacket
pub fn with_level<P, C>( protoname: P, client_identifier: C, level: u8 ) -> Result<ConnectPacket, VariableHeaderError>
pub fn set_keep_alive(&mut self, keep_alive: u16)
pub fn set_user_name(&mut self, name: Option<String>)
pub fn set_will(&mut self, topic_message: Option<(TopicName, Vec<u8>)>)
pub fn set_password(&mut self, password: Option<String>)
pub fn set_client_identifier<I: Into<String>>(&mut self, id: I)
pub fn set_will_retain(&mut self, will_retain: bool)
pub fn set_will_qos(&mut self, will_qos: u8)
pub fn set_clean_session(&mut self, clean_session: bool)
pub fn user_name(&self) -> Option<&str>
pub fn password(&self) -> Option<&str>
pub fn will(&self) -> Option<(&str, &[u8])>
pub fn will_retain(&self) -> bool
pub fn will_qos(&self) -> u8
pub fn client_identifier(&self) -> &str
pub fn protocol_name(&self) -> &str
pub fn protocol_level(&self) -> ProtocolLevel
pub fn clean_session(&self) -> bool
pub fn keep_alive(&self) -> u16
sourcepub fn reserved_flag(&self) -> bool
pub fn reserved_flag(&self) -> bool
Read back the “reserved” Connect flag bit 0. For compliant implementations this should always be false.
Trait Implementations§
source§impl Clone for ConnectPacket
impl Clone for ConnectPacket
source§fn clone(&self) -> ConnectPacket
fn clone(&self) -> ConnectPacket
Returns a copy 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 moresource§impl Debug for ConnectPacket
impl Debug for ConnectPacket
source§impl DecodablePacket for ConnectPacket
impl DecodablePacket for ConnectPacket
type DecodePacketError = ConnectPacketError
source§fn decode_packet<R: Read>(
reader: &mut R,
fixed_header: FixedHeader
) -> Result<Self, PacketError<Self>>
fn decode_packet<R: Read>( reader: &mut R, fixed_header: FixedHeader ) -> Result<Self, PacketError<Self>>
Decode packet given a
FixedHeader
source§impl EncodablePacket for ConnectPacket
impl EncodablePacket for ConnectPacket
source§fn fixed_header(&self) -> &FixedHeader
fn fixed_header(&self) -> &FixedHeader
Get a reference to
FixedHeader
. All MQTT packet must have a fixed header.source§fn encode_packet<W: Write>(&self, writer: &mut W) -> Result<()>
fn encode_packet<W: Write>(&self, writer: &mut W) -> Result<()>
Encodes packet data after fixed header, including variable headers and payload
source§fn encoded_packet_length(&self) -> u32
fn encoded_packet_length(&self) -> u32
Length in bytes for data after fixed header, including variable headers and payload
source§impl From<ConnectPacket> for VariablePacket
impl From<ConnectPacket> for VariablePacket
source§fn from(pk: ConnectPacket) -> VariablePacket
fn from(pk: ConnectPacket) -> VariablePacket
Converts to this type from the input type.
source§impl PartialEq for ConnectPacket
impl PartialEq for ConnectPacket
source§fn eq(&self, other: &ConnectPacket) -> bool
fn eq(&self, other: &ConnectPacket) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.impl Eq for ConnectPacket
impl StructuralPartialEq for ConnectPacket
Auto Trait Implementations§
impl Freeze for ConnectPacket
impl RefUnwindSafe for ConnectPacket
impl Send for ConnectPacket
impl Sync for ConnectPacket
impl Unpin for ConnectPacket
impl UnwindSafe for ConnectPacket
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