pub struct MqttServer<V3, V5, Err, InitErr> { /* private fields */ }Expand description
Mqtt Server
Implementations§
Source§impl<Err, InitErr> MqttServer<DefaultProtocolServer<Err, InitErr>, DefaultProtocolServer<Err, InitErr>, Err, InitErr>
impl<Err, InitErr> MqttServer<DefaultProtocolServer<Err, InitErr>, DefaultProtocolServer<Err, InitErr>, Err, InitErr>
Source§impl<V3, V5, Err, InitErr> MqttServer<V3, V5, Err, InitErr>
impl<V3, V5, Err, InitErr> MqttServer<V3, V5, Err, InitErr>
Sourcepub fn v3<St, H, P, M, Codec>(
self,
service: MqttServer<St, H, P, M, Codec>,
) -> MqttServer<impl ServiceFactory<IoBoxed, SharedCfg, Response = (), Error = MqttError<Err>, InitError = InitErr>, V5, Err, InitErr>where
St: 'static,
H: ServiceFactory<IoBoxed, SharedCfg, Response = (IoBoxed, Codec, St, Seconds), Error = MqttError<Err>, InitError = InitErr> + 'static,
P: ServiceFactory<DispatchItem<Codec>, (SharedCfg, St), Response = Option<<Codec as Encoder>::Item>, Error = MqttError<Err>, InitError = MqttError<Err>> + 'static,
M: Middleware2<P::Service, SharedCfg>,
M::Service: Service<DispatchItem<Codec>, Response = Option<<Codec as Encoder>::Item>, Error = MqttError<Err>> + 'static,
Codec: Encoder + Decoder + Clone + 'static,
pub fn v3<St, H, P, M, Codec>(
self,
service: MqttServer<St, H, P, M, Codec>,
) -> MqttServer<impl ServiceFactory<IoBoxed, SharedCfg, Response = (), Error = MqttError<Err>, InitError = InitErr>, V5, Err, InitErr>where
St: 'static,
H: ServiceFactory<IoBoxed, SharedCfg, Response = (IoBoxed, Codec, St, Seconds), Error = MqttError<Err>, InitError = InitErr> + 'static,
P: ServiceFactory<DispatchItem<Codec>, (SharedCfg, St), Response = Option<<Codec as Encoder>::Item>, Error = MqttError<Err>, InitError = MqttError<Err>> + 'static,
M: Middleware2<P::Service, SharedCfg>,
M::Service: Service<DispatchItem<Codec>, Response = Option<<Codec as Encoder>::Item>, Error = MqttError<Err>> + 'static,
Codec: Encoder + Decoder + Clone + 'static,
Service to handle v3 protocol
Sourcepub fn v5<St, H, P, M, Codec>(
self,
service: MqttServer<St, H, P, M, Codec>,
) -> MqttServer<V3, impl ServiceFactory<IoBoxed, SharedCfg, Response = (), Error = MqttError<Err>, InitError = InitErr>, Err, InitErr>where
St: 'static,
H: ServiceFactory<IoBoxed, SharedCfg, Response = (IoBoxed, Codec, St, Seconds), Error = MqttError<Err>, InitError = InitErr> + 'static,
P: ServiceFactory<DispatchItem<Codec>, (SharedCfg, St), Response = Option<<Codec as Encoder>::Item>, Error = MqttError<Err>, InitError = MqttError<Err>> + 'static,
M: Middleware2<P::Service, SharedCfg>,
M::Service: Service<DispatchItem<Codec>, Response = Option<<Codec as Encoder>::Item>, Error = MqttError<Err>> + 'static,
Codec: Encoder + Decoder + Clone + 'static,
pub fn v5<St, H, P, M, Codec>(
self,
service: MqttServer<St, H, P, M, Codec>,
) -> MqttServer<V3, impl ServiceFactory<IoBoxed, SharedCfg, Response = (), Error = MqttError<Err>, InitError = InitErr>, Err, InitErr>where
St: 'static,
H: ServiceFactory<IoBoxed, SharedCfg, Response = (IoBoxed, Codec, St, Seconds), Error = MqttError<Err>, InitError = InitErr> + 'static,
P: ServiceFactory<DispatchItem<Codec>, (SharedCfg, St), Response = Option<<Codec as Encoder>::Item>, Error = MqttError<Err>, InitError = MqttError<Err>> + 'static,
M: Middleware2<P::Service, SharedCfg>,
M::Service: Service<DispatchItem<Codec>, Response = Option<<Codec as Encoder>::Item>, Error = MqttError<Err>> + 'static,
Codec: Encoder + Decoder + Clone + 'static,
Service to handle v5 protocol
Trait Implementations§
Source§impl<Err, InitErr> Default for MqttServer<DefaultProtocolServer<Err, InitErr>, DefaultProtocolServer<Err, InitErr>, Err, InitErr>
impl<Err, InitErr> Default for MqttServer<DefaultProtocolServer<Err, InitErr>, DefaultProtocolServer<Err, InitErr>, Err, InitErr>
Source§type Service = MqttServerImpl<<V3 as ServiceFactory<IoBoxed, SharedCfg>>::Service, <V5 as ServiceFactory<IoBoxed, SharedCfg>>::Service, Err>
type Service = MqttServerImpl<<V3 as ServiceFactory<IoBoxed, SharedCfg>>::Service, <V5 as ServiceFactory<IoBoxed, SharedCfg>>::Service, Err>
The kind of
Service created by this factory.Source§async fn create(&self, cfg: SharedCfg) -> Result<Self::Service, Self::InitError>
async fn create(&self, cfg: SharedCfg) -> Result<Self::Service, Self::InitError>
Create and return a new service value asynchronously.
Source§async fn pipeline(
&self,
cfg: Cfg,
) -> Result<Pipeline<Self::Service>, Self::InitError>where
Self: Sized,
async fn pipeline(
&self,
cfg: Cfg,
) -> Result<Pipeline<Self::Service>, Self::InitError>where
Self: Sized,
Create and return a new service value asynchronously and wrap into a container
Source§fn map<F, Res>(
self,
f: F,
) -> ServiceChainFactory<MapFactory<Self, F, Req, Res, Cfg>, Req, Cfg>
fn map<F, Res>( self, f: F, ) -> ServiceChainFactory<MapFactory<Self, F, Req, Res, Cfg>, Req, Cfg>
Map this service’s output to a different type, returning a new service
of the resulting type.
Source§fn map_err<F, E>(
self,
f: F,
) -> ServiceChainFactory<MapErrFactory<Self, Req, Cfg, F, E>, Req, Cfg>
fn map_err<F, E>( self, f: F, ) -> ServiceChainFactory<MapErrFactory<Self, Req, Cfg, F, E>, Req, Cfg>
Map this service’s error to a different error, returning a new service.
Source§fn map_init_err<F, E>(
self,
f: F,
) -> ServiceChainFactory<MapInitErr<Self, Req, Cfg, F, E>, Req, Cfg>
fn map_init_err<F, E>( self, f: F, ) -> ServiceChainFactory<MapInitErr<Self, Req, Cfg, F, E>, Req, Cfg>
Map this factory’s init error to a different error, returning a new service.
Source§type Service = MqttServerImpl<<V3 as ServiceFactory<IoBoxed, SharedCfg>>::Service, <V5 as ServiceFactory<IoBoxed, SharedCfg>>::Service, Err>
type Service = MqttServerImpl<<V3 as ServiceFactory<IoBoxed, SharedCfg>>::Service, <V5 as ServiceFactory<IoBoxed, SharedCfg>>::Service, Err>
The kind of
Service created by this factory.Source§async fn create(&self, cfg: SharedCfg) -> Result<Self::Service, Self::InitError>
async fn create(&self, cfg: SharedCfg) -> Result<Self::Service, Self::InitError>
Create and return a new service value asynchronously.
Source§async fn pipeline(
&self,
cfg: Cfg,
) -> Result<Pipeline<Self::Service>, Self::InitError>where
Self: Sized,
async fn pipeline(
&self,
cfg: Cfg,
) -> Result<Pipeline<Self::Service>, Self::InitError>where
Self: Sized,
Create and return a new service value asynchronously and wrap into a container
Source§fn map<F, Res>(
self,
f: F,
) -> ServiceChainFactory<MapFactory<Self, F, Req, Res, Cfg>, Req, Cfg>
fn map<F, Res>( self, f: F, ) -> ServiceChainFactory<MapFactory<Self, F, Req, Res, Cfg>, Req, Cfg>
Map this service’s output to a different type, returning a new service
of the resulting type.
Source§fn map_err<F, E>(
self,
f: F,
) -> ServiceChainFactory<MapErrFactory<Self, Req, Cfg, F, E>, Req, Cfg>
fn map_err<F, E>( self, f: F, ) -> ServiceChainFactory<MapErrFactory<Self, Req, Cfg, F, E>, Req, Cfg>
Map this service’s error to a different error, returning a new service.
Source§fn map_init_err<F, E>(
self,
f: F,
) -> ServiceChainFactory<MapInitErr<Self, Req, Cfg, F, E>, Req, Cfg>
fn map_init_err<F, E>( self, f: F, ) -> ServiceChainFactory<MapInitErr<Self, Req, Cfg, F, E>, Req, Cfg>
Map this factory’s init error to a different error, returning a new service.
Auto Trait Implementations§
impl<V3, V5, Err, InitErr> Freeze for MqttServer<V3, V5, Err, InitErr>
impl<V3, V5, Err, InitErr> RefUnwindSafe for MqttServer<V3, V5, Err, InitErr>
impl<V3, V5, Err, InitErr> Send for MqttServer<V3, V5, Err, InitErr>
impl<V3, V5, Err, InitErr> Sync for MqttServer<V3, V5, Err, InitErr>
impl<V3, V5, Err, InitErr> Unpin for MqttServer<V3, V5, Err, InitErr>
impl<V3, V5, Err, InitErr> UnwindSafe for MqttServer<V3, V5, Err, InitErr>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T, Req, Cfg> IntoServiceFactory<T, Req, Cfg> for Twhere
T: ServiceFactory<Req, Cfg>,
impl<T, Req, Cfg> IntoServiceFactory<T, Req, Cfg> for Twhere
T: ServiceFactory<Req, Cfg>,
Source§fn into_factory(self) -> T
fn into_factory(self) -> T
Convert
Self to a ServiceFactory