Struct ntex_mqtt::v3::Selector [−][src]
pub struct Selector<Io, Err, InitErr> { /* fields omitted */ }
Expand description
Mqtt server selector
Selector allows to choose different mqtt server impls depends on connectt packet.
Implementations
Set handshake timeout.
Handshake includes connect
packet and response connect-ack
.
By default handshake timeuot is disabled.
Set max inbound frame size.
If max size is set to 0
, size is unlimited.
By default max size is set to 0
pub fn variant<F, R, St, C, Cn, P>(
self,
check: F,
server: MqttServer<Io, St, C, Cn, P>
) -> Self where
F: Fn(&Handshake<Io>) -> R + 'static,
R: Future<Output = Result<bool, Err>> + 'static,
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 variant<F, R, St, C, Cn, P>(
self,
check: F,
server: MqttServer<Io, St, C, Cn, P>
) -> Self where
F: Fn(&Handshake<Io>) -> R + 'static,
R: Future<Output = Result<bool, Err>> + 'static,
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,
Add server variant
Trait Implementations
type Request = Io
type Request = Io
Requests handled by the service.
type InitError = InitErr
type InitError = InitErr
Errors produced while building a service.
type Service = SelectorService<Io, Err>
type Service = SelectorService<Io, Err>
The Service
value created by this factory
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, Err, InitErr> !RefUnwindSafe for Selector<Io, Err, InitErr>
impl<Io, Err, InitErr> Unpin for Selector<Io, Err, InitErr> where
Err: Unpin,
InitErr: Unpin,
Io: Unpin,
impl<Io, Err, InitErr> !UnwindSafe for Selector<Io, Err, InitErr>
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
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