Struct ntex_mqtt::MqttServer [−][src]
pub struct MqttServer<Io, V3, V5, Err, InitErr> { /* fields omitted */ }
Expand description
Mqtt Server
Implementations
impl<Io, Err, InitErr> MqttServer<Io, DefaultProtocolServer<Io, Err, InitErr>, DefaultProtocolServer<Io, Err, InitErr>, Err, InitErr>
[src]
impl<Io, Err, InitErr> MqttServer<Io, DefaultProtocolServer<Io, Err, InitErr>, DefaultProtocolServer<Io, Err, InitErr>, Err, InitErr>
[src]Set handshake timeout in millis.
Handshake includes connect
packet.
By default handshake timeuot is disabled.
impl<Io, V3, V5, Err, InitErr> MqttServer<Io, V3, V5, Err, InitErr> where
Io: AsyncRead + AsyncWrite + Unpin + 'static,
V3: ServiceFactory<Config = (), Request = (Io, State, Option<Pin<Box<Sleep>>>), Response = (), Error = MqttError<Err>, InitError = InitErr>,
V5: ServiceFactory<Config = (), Request = (Io, State, Option<Pin<Box<Sleep>>>), Response = (), Error = MqttError<Err>, InitError = InitErr>,
[src]
impl<Io, V3, V5, Err, InitErr> MqttServer<Io, V3, V5, Err, InitErr> where
Io: AsyncRead + AsyncWrite + Unpin + 'static,
V3: ServiceFactory<Config = (), Request = (Io, State, Option<Pin<Box<Sleep>>>), Response = (), Error = MqttError<Err>, InitError = InitErr>,
V5: ServiceFactory<Config = (), Request = (Io, State, Option<Pin<Box<Sleep>>>), Response = (), Error = MqttError<Err>, InitError = InitErr>,
[src]pub fn v3<St, C, Cn, P>(
self,
service: MqttServer<Io, St, C, Cn, P>
) -> MqttServer<Io, impl ServiceFactory<Config = (), Request = (Io, State, Option<Pin<Box<Sleep>>>), Response = (), Error = MqttError<Err>, InitError = InitErr>, V5, Err, InitErr> where
St: 'static,
C: ServiceFactory<Config = (), Request = Handshake<Io>, Response = HandshakeAck<Io, St>, Error = Err, InitError = InitErr> + '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 v3<St, C, Cn, P>(
self,
service: MqttServer<Io, St, C, Cn, P>
) -> MqttServer<Io, impl ServiceFactory<Config = (), Request = (Io, State, Option<Pin<Box<Sleep>>>), Response = (), Error = MqttError<Err>, InitError = InitErr>, V5, Err, InitErr> where
St: 'static,
C: ServiceFactory<Config = (), Request = Handshake<Io>, Response = HandshakeAck<Io, St>, Error = Err, InitError = InitErr> + '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]Service to handle v3 protocol
Service to handle v3 protocol
pub fn v5<St, C, Cn, P>(
self,
service: MqttServer<Io, St, C, Cn, P>
) -> MqttServer<Io, V3, impl ServiceFactory<Config = (), Request = (Io, State, Option<Pin<Box<Sleep>>>), Response = (), Error = MqttError<Err>, InitError = InitErr>, Err, InitErr> where
St: 'static,
C: ServiceFactory<Config = (), Request = Handshake<Io>, Response = HandshakeAck<Io, St>, Error = Err, InitError = InitErr> + 'static,
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,
C::Error: From<Cn::Error> + From<Cn::InitError> + From<P::Error> + From<P::InitError> + Debug,
PublishAck: TryFrom<P::Error, Error = C::Error>,
[src]
pub fn v5<St, C, Cn, P>(
self,
service: MqttServer<Io, St, C, Cn, P>
) -> MqttServer<Io, V3, impl ServiceFactory<Config = (), Request = (Io, State, Option<Pin<Box<Sleep>>>), Response = (), Error = MqttError<Err>, InitError = InitErr>, Err, InitErr> where
St: 'static,
C: ServiceFactory<Config = (), Request = Handshake<Io>, Response = HandshakeAck<Io, St>, Error = Err, InitError = InitErr> + 'static,
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,
C::Error: From<Cn::Error> + From<Cn::InitError> + From<P::Error> + From<P::InitError> + Debug,
PublishAck: TryFrom<P::Error, Error = C::Error>,
[src]Service to handle v5 protocol
Service to handle v5 protocol
Trait Implementations
impl<Io, Err, InitErr> Default for MqttServer<Io, DefaultProtocolServer<Io, Err, InitErr>, DefaultProtocolServer<Io, Err, InitErr>, Err, InitErr>
[src]
impl<Io, Err, InitErr> Default for MqttServer<Io, DefaultProtocolServer<Io, Err, InitErr>, DefaultProtocolServer<Io, Err, InitErr>, Err, InitErr>
[src]impl<Io, V3, V5, Err, InitErr> ServiceFactory for MqttServer<Io, V3, V5, Err, InitErr> where
Io: AsyncRead + AsyncWrite + Unpin + 'static,
V3: ServiceFactory<Config = (), Request = (Io, State, Option<Pin<Box<Sleep>>>), Response = (), Error = MqttError<Err>, InitError = InitErr>,
V5: ServiceFactory<Config = (), Request = (Io, State, Option<Pin<Box<Sleep>>>), Response = (), Error = MqttError<Err>, InitError = InitErr>,
V3::Future: 'static,
V5::Future: 'static,
[src]
impl<Io, V3, V5, Err, InitErr> ServiceFactory for MqttServer<Io, V3, V5, Err, InitErr> where
Io: AsyncRead + AsyncWrite + Unpin + 'static,
V3: ServiceFactory<Config = (), Request = (Io, State, Option<Pin<Box<Sleep>>>), Response = (), Error = MqttError<Err>, InitError = InitErr>,
V5: ServiceFactory<Config = (), Request = (Io, State, Option<Pin<Box<Sleep>>>), Response = (), Error = MqttError<Err>, InitError = InitErr>,
V3::Future: 'static,
V5::Future: 'static,
[src]type Request = Io
type Request = Io
Requests handled by the service.
type Service = MqttServerImpl<Io, V3::Service, V5::Service, Err>
type Service = MqttServerImpl<Io, V3::Service, V5::Service, Err>
The Service
value created by this factory
type InitError = InitErr
type InitError = InitErr
Errors produced while building a service.
The future of the ServiceFactory
instance.
Create and return a new service value asynchronously.
Map this service’s output to a different type, returning a new service of the resulting type. Read more
Map this service’s error to a different error, returning a new service.
fn map_init_err<F, E>(self, f: F) -> MapInitErr<Self, F, E> where
F: Fn(Self::InitError) -> E + Clone,
fn map_init_err<F, E>(self, f: F) -> MapInitErr<Self, F, E> where
F: Fn(Self::InitError) -> E + Clone,
Map this factory’s init error to a different error, returning a new service.
Auto Trait Implementations
impl<Io, V3, V5, Err, InitErr> RefUnwindSafe for MqttServer<Io, V3, V5, Err, InitErr> where
Err: RefUnwindSafe,
InitErr: RefUnwindSafe,
Io: RefUnwindSafe,
V3: RefUnwindSafe,
V5: RefUnwindSafe,
impl<Io, V3, V5, Err, InitErr> Send for MqttServer<Io, V3, V5, Err, InitErr> where
Err: Send,
InitErr: Send,
Io: Send,
V3: Send,
V5: Send,
impl<Io, V3, V5, Err, InitErr> Sync for MqttServer<Io, V3, V5, Err, InitErr> where
Err: Sync,
InitErr: Sync,
Io: Sync,
V3: Sync,
V5: Sync,
impl<Io, V3, V5, Err, InitErr> Unpin for MqttServer<Io, V3, V5, Err, InitErr> where
Err: Unpin,
InitErr: Unpin,
Io: Unpin,
V3: Unpin,
V5: Unpin,
impl<Io, V3, V5, Err, InitErr> UnwindSafe for MqttServer<Io, V3, V5, Err, InitErr> where
Err: UnwindSafe,
InitErr: UnwindSafe,
Io: UnwindSafe,
V3: UnwindSafe,
V5: UnwindSafe,
Blanket Implementations
Mutably borrows from an owned value. Read more
Instruments this type with the provided Span
, returning an
Instrumented
wrapper. Read more
pub fn into_factory(self) -> T
pub fn into_factory(self) -> T
Convert Self
to a ServiceFactory
type Output = T
type Output = T
Should always be Self