Struct pi_mqtt_proxy::service::MqttConnectHandle
source · pub struct MqttConnectHandle<S: Socket> { /* private fields */ }Expand description
Mqtt连接句柄
Implementations§
source§impl<S: Socket> MqttConnectHandle<S>
impl<S: Socket> MqttConnectHandle<S>
sourcepub fn get_local_addr(&self) -> Option<SocketAddr>
pub fn get_local_addr(&self) -> Option<SocketAddr>
获取连接的本地地址
sourcepub fn get_local_ip(&self) -> Option<String>
pub fn get_local_ip(&self) -> Option<String>
获取连接的本地ip
sourcepub fn get_local_port(&self) -> Option<u16>
pub fn get_local_port(&self) -> Option<u16>
获取连接的本地端口
sourcepub fn get_remote_addr(&self) -> Option<SocketAddr>
pub fn get_remote_addr(&self) -> Option<SocketAddr>
获取连接的对端地址
sourcepub fn get_remote_ip(&self) -> Option<String>
pub fn get_remote_ip(&self) -> Option<String>
获取连接的对端ip
sourcepub fn get_remote_port(&self) -> Option<u16>
pub fn get_remote_port(&self) -> Option<u16>
获取连接的对端端口
sourcepub fn is_security(&self) -> bool
pub fn is_security(&self) -> bool
判断是否是安全的Mqtt连接
sourcepub fn is_passive(&self) -> bool
pub fn is_passive(&self) -> bool
判断是否是被动接收消息
sourcepub fn set_passive(&self, b: bool)
pub fn set_passive(&self, b: bool)
设置是否被动接收消息
sourcepub fn get_session(&self) -> Option<ContextHandle<BrokerSession>>
pub fn get_session(&self) -> Option<ContextHandle<BrokerSession>>
获取连接会话上下文的只读引用
Trait Implementations§
source§impl<S: Socket> GrayVersion for MqttConnectHandle<S>
impl<S: Socket> GrayVersion for MqttConnectHandle<S>
impl<S: Socket> Send for MqttConnectHandle<S>
impl<S: Socket> Sync for MqttConnectHandle<S>
Auto Trait Implementations§
impl<S> !RefUnwindSafe for MqttConnectHandle<S>
impl<S> Unpin for MqttConnectHandle<S>
impl<S> !UnwindSafe for MqttConnectHandle<S>
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