Struct ntex_mqtt::v3::MqttServer [−][src]
pub struct MqttServer<Io, St, C: ServiceFactory, Cn: ServiceFactory, P: ServiceFactory> { /* fields omitted */ }
Expand description
Mqtt v3.1.1 Server
Implementations
impl<Io, St, C> MqttServer<Io, St, C, DefaultControlService<St, C::Error>, DefaultPublishService<St, C::Error>> where
St: 'static,
C: ServiceFactory<Config = (), Request = Handshake<Io>, Response = HandshakeAck<Io, St>> + 'static,
C::Error: Debug,
[src]
impl<Io, St, C> MqttServer<Io, St, C, DefaultControlService<St, C::Error>, DefaultPublishService<St, C::Error>> where
St: 'static,
C: ServiceFactory<Config = (), Request = Handshake<Io>, Response = HandshakeAck<Io, St>> + 'static,
C::Error: Debug,
[src]impl<Io, St, C, Cn, P> MqttServer<Io, St, C, Cn, P> where
Io: AsyncRead + AsyncWrite + Unpin + 'static,
St: 'static,
C: ServiceFactory<Config = (), Request = Handshake<Io>, Response = HandshakeAck<Io, St>> + 'static,
Cn: ServiceFactory<Config = Session<St>, Request = ControlMessage, Response = ControlResult> + 'static,
P: ServiceFactory<Config = Session<St>, Request = Publish, Response = ()> + 'static,
C::Error: From<Cn::Error> + From<Cn::InitError> + From<P::Error> + From<P::InitError> + Debug,
[src]
impl<Io, St, C, Cn, P> MqttServer<Io, St, C, Cn, P> where
Io: AsyncRead + AsyncWrite + Unpin + 'static,
St: 'static,
C: ServiceFactory<Config = (), Request = Handshake<Io>, Response = HandshakeAck<Io, St>> + 'static,
Cn: ServiceFactory<Config = Session<St>, Request = ControlMessage, Response = ControlResult> + 'static,
P: ServiceFactory<Config = Session<St>, Request = Publish, Response = ()> + 'static,
C::Error: From<Cn::Error> + From<Cn::InitError> + From<P::Error> + From<P::InitError> + Debug,
[src]pub fn handshake_timeout(self, timeout: u16) -> Self
[src]
pub fn handshake_timeout(self, timeout: u16) -> Self
[src]Set handshake timeout in millis.
Handshake includes connect
packet and response connect-ack
.
By default handshake timeuot is disabled.
pub fn disconnect_timeout(self, val: u16) -> Self
[src]
pub fn disconnect_timeout(self, val: u16) -> Self
[src]Set server connection disconnect timeout in milliseconds.
Defines a timeout for disconnect connection. If a disconnect procedure does not complete within this time, the connection get dropped.
To disable timeout set value to 0.
By default disconnect timeout is set to 3 seconds.
pub fn max_size(self, size: u32) -> Self
[src]
pub fn max_size(self, size: u32) -> Self
[src]Set max inbound frame size.
If max size is set to 0
, size is unlimited.
By default max size is set to 0
pub fn inflight(self, val: usize) -> Self
[src]
pub fn inflight(self, val: usize) -> Self
[src]Number of in-flight concurrent messages.
By default in-flight is set to 16 messages
pub fn control<F, Srv>(self, service: F) -> MqttServer<Io, St, C, Srv, P> where
F: IntoServiceFactory<Srv>,
Srv: ServiceFactory<Config = Session<St>, Request = ControlMessage, Response = ControlResult> + 'static,
C::Error: From<Srv::Error> + From<Srv::InitError>,
[src]
pub fn control<F, Srv>(self, service: F) -> MqttServer<Io, St, C, Srv, P> where
F: IntoServiceFactory<Srv>,
Srv: ServiceFactory<Config = Session<St>, Request = ControlMessage, Response = ControlResult> + 'static,
C::Error: From<Srv::Error> + From<Srv::InitError>,
[src]Service to handle control packets
All control packets are processed sequentially, max buffered control packets is 16.
pub fn publish<F, Srv>(self, publish: F) -> MqttServer<Io, St, C, Cn, Srv> where
F: IntoServiceFactory<Srv> + 'static,
Srv: ServiceFactory<Config = Session<St>, Request = Publish, Response = ()> + 'static,
C::Error: From<Srv::Error> + From<Srv::InitError> + Debug,
[src]
pub fn publish<F, Srv>(self, publish: F) -> MqttServer<Io, St, C, Cn, Srv> where
F: IntoServiceFactory<Srv> + 'static,
Srv: ServiceFactory<Config = Session<St>, Request = Publish, Response = ()> + 'static,
C::Error: From<Srv::Error> + From<Srv::InitError> + Debug,
[src]Set service to handle publish packets and create mqtt server factory
Auto Trait Implementations
impl<Io, St, C, Cn, P> !RefUnwindSafe for MqttServer<Io, St, C, Cn, P>
impl<Io, St, C, Cn, P> !Send for MqttServer<Io, St, C, Cn, P>
impl<Io, St, C, Cn, P> !Sync for MqttServer<Io, St, C, Cn, P>
impl<Io, St, C, Cn, P> Unpin for MqttServer<Io, St, C, Cn, P> where
C: Unpin,
Cn: Unpin,
Io: Unpin,
P: Unpin,
St: Unpin,
C: Unpin,
Cn: Unpin,
Io: Unpin,
P: Unpin,
St: Unpin,
impl<Io, St, C, Cn, P> !UnwindSafe for MqttServer<Io, St, C, Cn, P>
Blanket Implementations
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]pub fn borrow_mut(&mut self) -> &mut T
[src]
pub fn borrow_mut(&mut self) -> &mut T
[src]Mutably borrows from an owned value. Read more
impl<T> Instrument for T
[src]
impl<T> Instrument for T
[src]fn instrument(self, span: Span) -> Instrumented<Self>
[src]
fn instrument(self, span: Span) -> Instrumented<Self>
[src]Instruments this type with the provided Span
, returning an
Instrumented
wrapper. Read more
fn in_current_span(self) -> Instrumented<Self>
[src]
fn in_current_span(self) -> Instrumented<Self>
[src]impl<T> Same<T> for T
impl<T> Same<T> for T
type Output = T
type Output = T
Should always be Self