Skip to main content

rust_mqtt/types/
mod.rs

1//! Contains types used throughout the MQTT specification.
2
3mod binary;
4mod int;
5mod pid;
6mod qos;
7mod reason_code;
8mod string;
9mod topic;
10mod will;
11
12pub(crate) use topic::SubscriptionFilter;
13pub(crate) use will::Will;
14
15pub use binary::MqttBinary;
16pub use int::VarByteInt;
17pub use pid::PacketIdentifier;
18pub use qos::{IdentifiedQoS, QoS};
19pub use reason_code::ReasonCode;
20pub use string::{MqttString, MqttStringError};
21pub use topic::{TopicFilter, TopicName};
22
23/// The error returned when types are larger than what is representable according to the specification.
24///
25/// * [`VarByteInt`]: If [`VarByteInt::MAX_ENCODABLE`] is exceeded, an error of this type is returned.
26/// * [`MqttBinary`]: If [`MqttBinary::MAX_LENGTH`] is exceeded, an error of this type is returned.
27#[derive(Debug)]
28#[cfg_attr(feature = "defmt", derive(defmt::Format))]
29pub struct TooLargeToEncode;