Struct ntex_mqtt::v5::MqttServer [−][src]
pub struct MqttServer<Io, St, C: ServiceFactory, Cn: ServiceFactory, P: ServiceFactory> { /* fields omitted */ }
Expand description
Mqtt 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,
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,
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,
C::Error: Debug,
Cn: ServiceFactory<Config = Session<St>, Request = ControlMessage<C::Error>, Response = ControlResult> + 'static,
P: ServiceFactory<Config = Session<St>, Request = Publish, Response = PublishAck> + 'static,
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,
C::Error: Debug,
Cn: ServiceFactory<Config = Session<St>, Request = ControlMessage<C::Error>, Response = ControlResult> + 'static,
P: ServiceFactory<Config = Session<St>, Request = Publish, Response = PublishAck> + 'static,
Set handshake timeout.
Handshake includes connect
packet and response connect-ack
.
By default handshake timeuot is disabled.
Set server connection disconnect timeout.
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.
Set max inbound frame size.
If max size is set to 0
, size is unlimited.
By default max size is set to 0
Set receive max
Number of in-flight publish packets. By default receive max is set to 15 packets. To disable timeout set value to 0.
Number of topic aliases.
By default value is set to 32
Set server max qos setting.
By default max qos is not set`
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<C::Error>, Response = ControlResult> + 'static,
C::Error: From<Srv::Error> + From<Srv::InitError>,
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<C::Error>, Response = ControlResult> + 'static,
C::Error: From<Srv::Error> + From<Srv::InitError>,
Service to handle control messages
pub fn publish<F, Srv>(self, publish: F) -> MqttServer<Io, St, C, Cn, Srv> where
F: IntoServiceFactory<Srv> + 'static,
C::Error: From<Srv::Error> + From<Srv::InitError>,
Srv: ServiceFactory<Config = Session<St>, Request = Publish, Response = PublishAck> + 'static,
Srv::Error: Debug,
PublishAck: TryFrom<Srv::Error, Error = C::Error>,
pub fn publish<F, Srv>(self, publish: F) -> MqttServer<Io, St, C, Cn, Srv> where
F: IntoServiceFactory<Srv> + 'static,
C::Error: From<Srv::Error> + From<Srv::InitError>,
Srv: ServiceFactory<Config = Session<St>, Request = Publish, Response = PublishAck> + 'static,
Srv::Error: Debug,
PublishAck: TryFrom<Srv::Error, Error = C::Error>,
Set service to handle publish packets and create mqtt server factory
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,
C::Error: From<Cn::Error> + From<Cn::InitError> + From<P::Error> + From<P::InitError> + Debug,
Cn: ServiceFactory<Config = Session<St>, Request = ControlMessage<C::Error>, Response = ControlResult> + 'static,
P: ServiceFactory<Config = Session<St>, Request = Publish, Response = PublishAck> + 'static,
P::Error: Debug,
PublishAck: TryFrom<P::Error, Error = C::Error>,
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,
C::Error: From<Cn::Error> + From<Cn::InitError> + From<P::Error> + From<P::InitError> + Debug,
Cn: ServiceFactory<Config = Session<St>, Request = ControlMessage<C::Error>, Response = ControlResult> + 'static,
P: ServiceFactory<Config = Session<St>, Request = Publish, Response = PublishAck> + 'static,
P::Error: Debug,
PublishAck: TryFrom<P::Error, Error = C::Error>,
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,
impl<Io, St, C, Cn, P> !UnwindSafe for MqttServer<Io, St, C, Cn, P>
Blanket Implementations
Mutably borrows from an owned value. Read more
Instruments this type with the provided Span
, returning an
Instrumented
wrapper. Read more
Attaches the provided Subscriber
to this type, returning a
WithDispatch
wrapper. Read more
Attaches the current default Subscriber
to this type, returning a
WithDispatch
wrapper. Read more