pub struct Connect {
pub protocol: Protocol,
pub keep_alive: u16,
pub client_id: String,
pub clean_session: bool,
pub last_will: Option<LastWill>,
pub login: Option<Login>,
}
Expand description
Connection packet initiated by the client
Fields§
§protocol: Protocol
Mqtt protocol version
keep_alive: u16
Mqtt keep alive time
client_id: String
Client Id
clean_session: bool
Clean session. Asks the broker to clear previous state
last_will: Option<LastWill>
Will that broker needs to publish when the client disconnects
login: Option<Login>
Login credentials
Implementations§
Source§impl Connect
impl Connect
pub fn new<S: Into<String>>(id: S) -> Connect
pub fn set_login<U: Into<String>, P: Into<String>>( &mut self, u: U, p: P, ) -> &mut Connect
pub fn read(fixed_header: FixedHeader, bytes: Bytes) -> Result<Connect, Error>
pub fn write(&self, buffer: &mut BytesMut) -> Result<usize, Error>
pub fn size(&self) -> usize
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