Struct ntex_mqtt::MqttServer [−][src]
Mqtt Server
Implementations
impl<Io, Err, InitErr> MqttServer<Io, DefaultProtocolServer<Io, Err, InitErr>, DefaultProtocolServer<Io, Err, InitErr>, Err, InitErr>
[src]
impl<Io, V3, V5, Err, InitErr> MqttServer<Io, V3, V5, Err, InitErr>
[src]
pub fn handshake_timeout(self, timeout: usize) -> Self
[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]
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>,
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]
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,
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]
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>,
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, 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]
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,
type Config = ()
Service factory configuration
type Request = Io
Requests handled by the service.
type Response = ()
Responses given by the service
type Error = MqttError<Err>
Errors produced by the service
type Service = MqttServerImpl<Io, V3::Service, V5::Service, Err>
The Service
value created by this factory
type InitError = InitErr
Errors produced while building a service.
type Future = Pin<Box<dyn Future<Output = Result<MqttServerImpl<Io, V3::Service, V5::Service, Err>, InitErr>>>>
The future of the ServiceFactory
instance.
fn new_service(&self, _: ()) -> Self::Future
[src]
pub fn map<F, R>(self, f: F) -> MapServiceFactory<Self, F, R> where
F: FnMut(Self::Response) -> R + Clone,
F: FnMut(Self::Response) -> R + Clone,
pub fn map_err<F, E>(self, f: F) -> MapErrServiceFactory<Self, F, E> where
F: Fn(Self::Error) -> E + Clone,
F: Fn(Self::Error) -> E + Clone,
pub fn map_init_err<F, E>(self, f: F) -> MapInitErr<Self, F, E> where
F: Fn(Self::InitError) -> E + Clone,
F: Fn(Self::InitError) -> E + Clone,
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,
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,
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,
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,
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,
Err: UnwindSafe,
InitErr: UnwindSafe,
Io: UnwindSafe,
V3: UnwindSafe,
V5: UnwindSafe,
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T> Instrument for T
[src]
pub fn instrument(self, span: Span) -> Instrumented<Self>
[src]
pub fn in_current_span(self) -> Instrumented<Self>
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> IntoServiceFactory<T> for T where
T: ServiceFactory,
T: ServiceFactory,
pub fn into_factory(self) -> T
impl<T> Same<T> for T
type Output = T
Should always be Self
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,