pub struct Connect {
pub protocol: Protocol,
pub clean_start: bool,
pub keep_alive: u16,
pub properties: ConnectProperties,
pub client_id: Arc<String>,
pub last_will: Option<LastWill>,
pub username: Option<Arc<String>>,
pub password: Option<Bytes>,
}
Expand description
Body type of CONNECT packet.
Fields§
§protocol: Protocol
The protocol version.
clean_start: bool
Clean start flag. This value specifies whether the Connection starts a new Session or is a continuation of an existing Session.
keep_alive: u16
The keep alive. A time interval measured in seconds. It is the maximum time interval that is permitted to elapse between the point at which the Client finishes transmitting one MQTT Control Packet and the point it starts sending the next.
properties: ConnectProperties
Properties
client_id: Arc<String>
The client identifier (ClientID).
last_will: Option<LastWill>
The will message.
username: Option<Arc<String>>
The user name.
password: Option<Bytes>
The password.
Implementations§
Source§impl Connect
impl Connect
pub fn new(client_id: Arc<String>, keep_alive: u16) -> Self
pub async fn decode_async<T: AsyncRead + Unpin>( reader: &mut T, header: Header, ) -> Result<Self, ErrorV5>
pub async fn decode_with_protocol<T: AsyncRead + Unpin>( reader: &mut T, header: Header, protocol: Protocol, ) -> Result<Self, ErrorV5>
Trait Implementations§
impl Eq for Connect
impl StructuralPartialEq for Connect
Auto Trait Implementations§
impl !Freeze for Connect
impl RefUnwindSafe for Connect
impl Send for Connect
impl Sync for Connect
impl Unpin for Connect
impl UnwindSafe for Connect
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