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>
impl<Io, Err, InitErr> MqttServer<Io, DefaultProtocolServer<Io, Err, InitErr>, DefaultProtocolServer<Io, Err, InitErr>, Err, InitErr>
Set handshake timeout.
Handshake includes connect
packet.
By default handshake timeuot is disabled.
Set memory pool.
Use specified memory pool for memory allocations. By default P5 memory pool is used.
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<Sleep>), Response = (), Error = MqttError<Err>, InitError = InitErr>,
V5: ServiceFactory<Config = (), Request = (Io, State, Option<Sleep>), Response = (), Error = MqttError<Err>, InitError = InitErr>,
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<Sleep>), Response = (), Error = MqttError<Err>, InitError = InitErr>,
V5: ServiceFactory<Config = (), Request = (Io, State, Option<Sleep>), Response = (), Error = MqttError<Err>, InitError = InitErr>,
pub fn v3<St, C, Cn, P>(
self,
service: MqttServer<Io, St, C, Cn, P>
) -> MqttServer<Io, impl ServiceFactory<Config = (), Request = (Io, State, Option<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<C::Error>, 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,
pub fn v3<St, C, Cn, P>(
self,
service: MqttServer<Io, St, C, Cn, P>
) -> MqttServer<Io, impl ServiceFactory<Config = (), Request = (Io, State, Option<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<C::Error>, 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,
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<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>,
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<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>,
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>
impl<Io, Err, InitErr> Default for MqttServer<Io, DefaultProtocolServer<Io, Err, InitErr>, DefaultProtocolServer<Io, Err, InitErr>, Err, InitErr>
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<Sleep>), Response = (), Error = MqttError<Err>, InitError = InitErr>,
V5: ServiceFactory<Config = (), Request = (Io, State, Option<Sleep>), Response = (), Error = MqttError<Err>, InitError = InitErr>,
V3::Future: 'static,
V5::Future: 'static,
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<Sleep>), Response = (), Error = MqttError<Err>, InitError = InitErr>,
V5: ServiceFactory<Config = (), Request = (Io, State, Option<Sleep>), Response = (), Error = MqttError<Err>, InitError = InitErr>,
V3::Future: 'static,
V5::Future: 'static,
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>
impl<Io, V3, V5, Err, InitErr> !Send for MqttServer<Io, V3, V5, Err, InitErr>
impl<Io, V3, V5, Err, InitErr> !Sync for MqttServer<Io, V3, V5, Err, InitErr>
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>
Blanket Implementations
Mutably borrows from an owned value. Read more
pub fn into_factory(self) -> T
pub fn into_factory(self) -> T
Convert Self
to a ServiceFactory
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