Struct ServerCapabilities
#[non_exhaustive]pub struct ServerCapabilities {
pub max_qos: QoS,
pub retain_available: bool,
pub max_packet_size: Option<NonZeroU32>,
pub topic_alias_max: Option<NonZeroU16>,
pub wildcard_sub_available: bool,
pub sub_id_available: bool,
pub shared_sub_available: bool,
pub receive_max: NonZeroU16,
pub server_keep_alive: Option<u16>,
}Expand description
Server capabilities extracted from CONNACK properties (§3.2.2.3).
All fields default to the most permissive values defined by the spec.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.max_qos: QoSMaximum QoS the server supports (default: QoS::ExactlyOnce).
retain_available: boolWhether the server supports retained messages (default: true).
max_packet_size: Option<NonZeroU32>Maximum packet size the server accepts. None means no limit beyond
the protocol maximum (§3.2.2.3.6).
topic_alias_max: Option<NonZeroU16>Highest topic alias the server accepts. None means the server does
not accept topic aliases (§3.2.2.3.8).
wildcard_sub_available: boolWhether wildcard subscriptions are available (default: true).
sub_id_available: boolWhether subscription identifiers are available (default: true).
Whether shared subscriptions are available (default: true).
receive_max: NonZeroU16Receive Maximum: the maximum number of in-flight QoS > 0 publishes
the server accepts (default: 65 535, §3.2.2.3.3).
server_keep_alive: Option<u16>Server-assigned keep-alive override. None means the client’s
requested value was accepted (§3.2.2.3.14).
Implementations§
§impl ServerCapabilities
impl ServerCapabilities
pub fn from_connack(props: &ConnackProperties) -> Self
pub fn from_connack(props: &ConnackProperties) -> Self
Reads the capabilities from CONNACK properties.
pub fn check_publish(&self, qos: QoS, retain: bool) -> Result<(), Unsupported>
pub fn check_publish(&self, qos: QoS, retain: bool) -> Result<(), Unsupported>
Checks that the server supports a PUBLISH with this QoS and retain
flag.
§Errors
Returns the first capability the server lacks.
pub fn check_subscribe<'a, I>(
&self,
filters: I,
subscription_id: Option<NonZeroVbi>,
) -> Result<(), Unsupported>where
I: IntoIterator<Item = &'a TopicFilter>,
pub fn check_subscribe<'a, I>(
&self,
filters: I,
subscription_id: Option<NonZeroVbi>,
) -> Result<(), Unsupported>where
I: IntoIterator<Item = &'a TopicFilter>,
Checks that the server supports a SUBSCRIBE with these filters and subscription identifier.
§Errors
Returns the first capability the server lacks.
Trait Implementations§
§impl Clone for ServerCapabilities
impl Clone for ServerCapabilities
§fn clone(&self) -> ServerCapabilities
fn clone(&self) -> ServerCapabilities
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreimpl Copy for ServerCapabilities
§impl Debug for ServerCapabilities
impl Debug for ServerCapabilities
§impl Default for ServerCapabilities
impl Default for ServerCapabilities
impl Eq for ServerCapabilities
§impl PartialEq for ServerCapabilities
impl PartialEq for ServerCapabilities
impl StructuralPartialEq for ServerCapabilities
Auto Trait Implementations§
impl Freeze for ServerCapabilities
impl RefUnwindSafe for ServerCapabilities
impl Send for ServerCapabilities
impl Sync for ServerCapabilities
impl Unpin for ServerCapabilities
impl UnsafeUnpin for ServerCapabilities
impl UnwindSafe for ServerCapabilities
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<K, Q> Equivalent<Q> for K
impl<K, Q> Equivalent<Q> for K
§fn equivalent(&self, key: &Q) -> bool
fn equivalent(&self, key: &Q) -> bool
key and return true if they are equal.impl<T> ErasedDestructor for Twhere
T: 'static,
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more