pub struct ConnectPacket { /* private fields */ }
Expand description
CONNECT
packet
Implementations
sourceimpl ConnectPacket
impl ConnectPacket
pub fn new<C>(client_identifier: C) -> ConnectPacket where
C: Into<String>,
pub fn with_level<P, C>(
protoname: P,
client_identifier: C,
level: u8
) -> Result<ConnectPacket, VariableHeaderError> where
P: Into<String>,
C: Into<String>,
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
sourceimpl Clone for ConnectPacket
impl Clone for ConnectPacket
sourcefn clone(&self) -> ConnectPacket
fn clone(&self) -> ConnectPacket
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
sourceimpl Debug for ConnectPacket
impl Debug for ConnectPacket
sourceimpl DecodablePacket for ConnectPacket
impl DecodablePacket for ConnectPacket
type DecodePacketError = ConnectPacketError
sourcefn 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
sourceimpl EncodablePacket for ConnectPacket
impl EncodablePacket for ConnectPacket
sourcefn fixed_header(&self) -> &FixedHeader
fn fixed_header(&self) -> &FixedHeader
Get a reference to FixedHeader
. All MQTT packet must have a fixed header.
sourcefn 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
sourcefn encoded_packet_length(&self) -> u32
fn encoded_packet_length(&self) -> u32
Length in bytes for data after fixed header, including variable headers and payload
sourceimpl From<ConnectPacket> for VariablePacket
impl From<ConnectPacket> for VariablePacket
sourcefn from(pk: ConnectPacket) -> VariablePacket
fn from(pk: ConnectPacket) -> VariablePacket
Performs the conversion.
sourceimpl PartialEq<ConnectPacket> for ConnectPacket
impl PartialEq<ConnectPacket> for ConnectPacket
sourcefn 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 ==
. Read more
sourcefn ne(&self, other: &ConnectPacket) -> bool
fn ne(&self, other: &ConnectPacket) -> bool
This method tests for !=
.
impl Eq for ConnectPacket
impl StructuralEq for ConnectPacket
impl StructuralPartialEq for ConnectPacket
Auto Trait Implementations
impl RefUnwindSafe for ConnectPacket
impl Send for ConnectPacket
impl Sync for ConnectPacket
impl Unpin for ConnectPacket
impl UnwindSafe for ConnectPacket
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcepub fn borrow_mut(&mut self) -> &mut T
pub fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> Decodable for T where
T: DecodablePacket,
impl<T> Decodable for T where
T: DecodablePacket,
type Error = PacketError<T>
type Cond = Option<FixedHeader>
sourceimpl<T> Encodable for T where
T: EncodablePacket,
impl<T> Encodable for T where
T: EncodablePacket,
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcepub fn to_owned(&self) -> T
pub fn to_owned(&self) -> T
Creates owned data from borrowed data, usually by cloning. Read more
sourcepub fn clone_into(&self, target: &mut T)
pub fn clone_into(&self, target: &mut T)
toowned_clone_into
)Uses borrowed data to replace owned data, usually by cloning. Read more