[−][src]Struct ntex_mqtt::MqttServer
Mqtt Server
Methods
impl<Io, St, C> MqttServer<Io, St, C> 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) -> MqttServer<Io, St, C> where
F: IntoServiceFactory<C>,
[src]
F: IntoServiceFactory<C>,
Create server factory and provide connect service
impl<Io, St, C> MqttServer<Io, St, C> 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 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: usize) -> 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 inflight(self, val: usize) -> Self
[src]
Number of in-flight concurrent messages.
in-flight is set to 15 messages
pub fn subscribe<F, Srv>(self, subscribe: F) -> Self where
F: IntoServiceFactory<Srv>,
Srv: ServiceFactory<Config = Session<St>, Request = Subscribe, Response = SubscribeResult> + 'static,
C::Error: From<Srv::Error> + From<Srv::InitError>,
[src]
F: IntoServiceFactory<Srv>,
Srv: ServiceFactory<Config = Session<St>, Request = Subscribe, Response = SubscribeResult> + 'static,
C::Error: From<Srv::Error> + From<Srv::InitError>,
Service to execute for subscribe packet
pub fn unsubscribe<F, Srv>(self, unsubscribe: F) -> Self where
F: IntoServiceFactory<Srv>,
Srv: ServiceFactory<Config = Session<St>, Request = Unsubscribe, Response = ()> + 'static,
C::Error: From<Srv::Error> + From<Srv::InitError>,
[src]
F: IntoServiceFactory<Srv>,
Srv: ServiceFactory<Config = Session<St>, Request = Unsubscribe, Response = ()> + 'static,
C::Error: From<Srv::Error> + From<Srv::InitError>,
Service to execute for unsubscribe packet
pub fn disconnect<F, Out>(self, disconnect: F) -> Self where
F: Fn(&Session<St>, bool) -> Out + 'static,
Out: Future + 'static,
[src]
F: Fn(&Session<St>, bool) -> Out + 'static,
Out: Future + 'static,
Callback to execute on disconnect
Second parameter indicates error occured during disconnect.
pub fn finish<F, P>(
self,
publish: F
) -> impl ServiceFactory<Config = (), Request = Io, Response = (), Error = MqttError<C::Error>> where
Io: AsyncRead + AsyncWrite + Unpin + 'static,
F: IntoServiceFactory<P> + 'static,
P: ServiceFactory<Config = Session<St>, Request = Publish, Response = ()> + 'static,
C::Error: From<P::Error> + From<P::InitError> + Debug,
[src]
self,
publish: F
) -> impl ServiceFactory<Config = (), Request = Io, Response = (), Error = MqttError<C::Error>> where
Io: AsyncRead + AsyncWrite + Unpin + 'static,
F: IntoServiceFactory<P> + 'static,
P: ServiceFactory<Config = Session<St>, Request = Publish, Response = ()> + 'static,
C::Error: From<P::Error> + From<P::InitError> + Debug,
Set service to execute for publish packet and create service factory
Auto Trait Implementations
impl<Io, St, C> !RefUnwindSafe for MqttServer<Io, St, C>
impl<Io, St, C> !Send for MqttServer<Io, St, C>
impl<Io, St, C> !Sync for MqttServer<Io, St, C>
impl<Io, St, C> Unpin for MqttServer<Io, St, C> where
C: Unpin,
Io: Unpin,
St: Unpin,
C: Unpin,
Io: Unpin,
St: Unpin,
impl<Io, St, C> !UnwindSafe for MqttServer<Io, St, C>
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, 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>,