[−][src]Struct ntex_mqtt::v5::MqttServer
Mqtt Server
Implementations
impl<Io, St, C> MqttServer<Io, St, C, DefaultControlService<St, C::Error>, DefaultPublishService<St, C::Error>> where
St: 'static,
C: ServiceFactory<Config = (), Request = Connect<Io>, Response = ConnectAck<Io, St>> + 'static,
C::Error: Debug,
[src]
St: 'static,
C: ServiceFactory<Config = (), Request = Connect<Io>, Response = ConnectAck<Io, St>> + 'static,
C::Error: Debug,
pub fn new<F>(connect: F) -> Self where
F: IntoServiceFactory<C>,
[src]
F: IntoServiceFactory<C>,
Create server factory and provide connect service
impl<Io, St, C, Cn, P> MqttServer<Io, St, C, Cn, P> where
Io: AsyncRead + AsyncWrite + Unpin + 'static,
St: 'static,
C: ServiceFactory<Config = (), Request = Connect<Io>, Response = ConnectAck<Io, St>> + 'static,
C::Error: Debug,
Cn: ServiceFactory<Config = Session<St>, Request = ControlPacket<C::Error>, Response = ControlResult> + 'static,
P: ServiceFactory<Config = Session<St>, Request = Publish, Response = PublishAck> + 'static,
[src]
Io: AsyncRead + AsyncWrite + Unpin + 'static,
St: 'static,
C: ServiceFactory<Config = (), Request = Connect<Io>, Response = ConnectAck<Io, St>> + 'static,
C::Error: Debug,
Cn: ServiceFactory<Config = Session<St>, Request = ControlPacket<C::Error>, Response = ControlResult> + 'static,
P: ServiceFactory<Config = Session<St>, Request = Publish, Response = PublishAck> + 'static,
pub fn handshake_timeout(self, timeout: usize) -> Self
[src]
Set handshake timeout in millis.
Handshake includes connect
packet and response connect-ack
.
By default handshake timeuot is disabled.
pub fn disconnect_timeout(self, val: usize) -> Self
[src]
Set server connection disconnect timeout in milliseconds.
Defines a timeout for disconnect connection. If a disconnect procedure does not complete within this time, the connection get dropped.
To disable timeout set value to 0.
By default disconnect timeout is set to 3 seconds.
pub fn max_size(self, size: u32) -> Self
[src]
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 receive_max(self, val: u16) -> Self
[src]
Set receive max
Number of in-flight publish packets. By default receive max is set to 15 packets. To disable timeout set value to 0.
pub fn max_topic_alias(self, val: u16) -> Self
[src]
Number of topic aliases.
By default value is set to 32
pub fn control<F, Srv>(self, service: F) -> MqttServer<Io, St, C, Srv, P> where
F: IntoServiceFactory<Srv>,
Srv: ServiceFactory<Config = Session<St>, Request = ControlPacket<C::Error>, Response = ControlResult> + 'static,
C::Error: From<Srv::Error> + From<Srv::InitError>,
[src]
F: IntoServiceFactory<Srv>,
Srv: ServiceFactory<Config = Session<St>, Request = ControlPacket<C::Error>, Response = ControlResult> + 'static,
C::Error: From<Srv::Error> + From<Srv::InitError>,
Service to handle control packets
All control packets are processed sequentially, max buffered control packets is 16.
pub fn publish<F, Srv>(self, publish: F) -> MqttServer<Io, St, C, Cn, Srv> where
F: IntoServiceFactory<Srv> + 'static,
C::Error: From<Srv::Error> + From<Srv::InitError>,
Srv: ServiceFactory<Config = Session<St>, Request = Publish, Response = PublishAck> + 'static,
Srv::Error: Debug,
PublishAck: TryFrom<Srv::Error, Error = C::Error>,
[src]
F: IntoServiceFactory<Srv> + 'static,
C::Error: From<Srv::Error> + From<Srv::InitError>,
Srv: ServiceFactory<Config = Session<St>, Request = Publish, Response = PublishAck> + 'static,
Srv::Error: Debug,
PublishAck: TryFrom<Srv::Error, Error = C::Error>,
Set service to handle publish packets and create mqtt server factory
impl<Io, St, C, Cn, P> MqttServer<Io, St, C, Cn, P> where
Io: AsyncRead + AsyncWrite + Unpin + 'static,
St: 'static,
C: ServiceFactory<Config = (), Request = Connect<Io>, Response = ConnectAck<Io, St>> + 'static,
C::Error: From<Cn::Error> + From<Cn::InitError> + From<P::Error> + From<P::InitError> + Debug,
Cn: ServiceFactory<Config = Session<St>, Request = ControlPacket<C::Error>, Response = ControlResult> + 'static,
P: ServiceFactory<Config = Session<St>, Request = Publish, Response = PublishAck> + 'static,
P::Error: Debug,
PublishAck: TryFrom<P::Error, Error = C::Error>,
[src]
Io: AsyncRead + AsyncWrite + Unpin + 'static,
St: 'static,
C: ServiceFactory<Config = (), Request = Connect<Io>, Response = ConnectAck<Io, St>> + 'static,
C::Error: From<Cn::Error> + From<Cn::InitError> + From<P::Error> + From<P::InitError> + Debug,
Cn: ServiceFactory<Config = Session<St>, Request = ControlPacket<C::Error>, Response = ControlResult> + 'static,
P: ServiceFactory<Config = Session<St>, Request = Publish, Response = PublishAck> + 'static,
P::Error: Debug,
PublishAck: TryFrom<P::Error, Error = C::Error>,
pub fn finish(
self
) -> impl ServiceFactory<Config = (), Request = Io, Response = (), Error = MqttError<C::Error>>
[src]
self
) -> impl ServiceFactory<Config = (), Request = Io, Response = (), Error = MqttError<C::Error>>
Set service to handle publish packets and create mqtt server factory
Auto Trait Implementations
impl<Io, St, C, Cn, P> RefUnwindSafe for MqttServer<Io, St, C, Cn, P> where
C: RefUnwindSafe,
Cn: RefUnwindSafe,
Io: RefUnwindSafe,
P: RefUnwindSafe,
St: RefUnwindSafe,
C: RefUnwindSafe,
Cn: RefUnwindSafe,
Io: RefUnwindSafe,
P: RefUnwindSafe,
St: RefUnwindSafe,
impl<Io, St, C, Cn, P> Send for MqttServer<Io, St, C, Cn, P> where
C: Send,
Cn: Send,
Io: Send,
P: Send,
St: Send,
C: Send,
Cn: Send,
Io: Send,
P: Send,
St: Send,
impl<Io, St, C, Cn, P> Sync for MqttServer<Io, St, C, Cn, P> where
C: Sync,
Cn: Sync,
Io: Sync,
P: Sync,
St: Sync,
C: Sync,
Cn: Sync,
Io: Sync,
P: Sync,
St: Sync,
impl<Io, St, C, Cn, P> Unpin for MqttServer<Io, St, C, Cn, P> where
C: Unpin,
Cn: Unpin,
Io: Unpin,
P: Unpin,
St: Unpin,
C: Unpin,
Cn: Unpin,
Io: Unpin,
P: Unpin,
St: Unpin,
impl<Io, St, C, Cn, P> UnwindSafe for MqttServer<Io, St, C, Cn, P> where
C: UnwindSafe,
Cn: UnwindSafe,
Io: UnwindSafe,
P: UnwindSafe,
St: UnwindSafe,
C: UnwindSafe,
Cn: UnwindSafe,
Io: UnwindSafe,
P: UnwindSafe,
St: 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,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> Same<T> for T
type Output = T
Should always be Self
impl<T> Sealed<T> for T where
T: ?Sized,
T: ?Sized,
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.
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>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
V: MultiLane<T>,