[][src]Struct ntex_mqtt::MqttServer

pub struct MqttServer<Io, V3, V5, Err, InitErr> { /* fields omitted */ }

Mqtt Server

Implementations

impl<Io, Err, InitErr> MqttServer<Io, DefaultProtocolServer<Io, Err, InitErr, Codec>, DefaultProtocolServer<Io, Err, InitErr, Codec>, Err, InitErr>[src]

pub fn new() -> Self[src]

Create mqtt protocol selector server

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, IoState<Codec>, Option<Delay>), Response = (), Error = MqttError<Err>, InitError = InitErr>,
    V5: ServiceFactory<Config = (), Request = (Io, IoState<Codec>, Option<Delay>), 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, IoState<Codec>, Option<Delay>), 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

pub fn v5<St, C, Cn, P>(
    self,
    service: MqttServer<Io, St, C, Cn, P>
) -> MqttServer<Io, V3, impl ServiceFactory<Config = (), Request = (Io, IoState<Codec>, Option<Delay>), 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

Trait Implementations

impl<Io, Err, InitErr> Default for MqttServer<Io, DefaultProtocolServer<Io, Err, InitErr, Codec>, DefaultProtocolServer<Io, Err, InitErr, Codec>, 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, IoState<Codec>, Option<Delay>), Response = (), Error = MqttError<Err>, InitError = InitErr>,
    V5: ServiceFactory<Config = (), Request = (Io, IoState<Codec>, Option<Delay>), Response = (), Error = MqttError<Err>, InitError = InitErr>,
    V3::Future: 'static,
    V5::Future: 'static, 
[src]

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 = LocalBoxFuture<'static, Result<MqttServerImpl<Io, V3::Service, V5::Service, Err>, InitErr>>

The future of the ServiceFactory instance.

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
[src]

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
[src]

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
[src]

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
[src]

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
[src]

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T> Instrument for T[src]

impl<T> Instrument for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> IntoServiceFactory<T> for T where
    T: ServiceFactory, 

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]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<V, T> VZip<V> for T where
    V: MultiLane<T>,