Struct MqttBytes
#[repr(transparent)]pub struct MqttBytes([u8]);Expand description
A byte slice that satisfies the MQTT v5 Binary Data length limit (at most 65 535 bytes).
This is an unsized type like [[u8]]. Use it for borrowed
references and MqttBytesBuf for owned values.
Tuple Fields§
§0: [u8]Implementations§
Source§impl MqttBytes
impl MqttBytes
Sourcepub const unsafe fn new_unchecked(data: &[u8]) -> &MqttBytes
pub const unsafe fn new_unchecked(data: &[u8]) -> &MqttBytes
Creates binary data without validating the length invariant.
§Safety
The caller must guarantee that data.len() <= 65_535.
Sourcepub const fn encoded_len(&self) -> usize
pub const fn encoded_len(&self) -> usize
Returns the number of bytes needed to encode this value.
Trait Implementations§
Source§impl AsRef<MqttBytes> for MqttBytesBuf
impl AsRef<MqttBytes> for MqttBytesBuf
Source§impl Borrow<MqttBytes> for MqttBytesBuf
impl Borrow<MqttBytes> for MqttBytesBuf
Source§impl ToOwned for MqttBytes
impl ToOwned for MqttBytes
Source§type Owned = MqttBytesBuf
type Owned = MqttBytesBuf
The resulting type after obtaining ownership.
Source§fn to_owned(&self) -> <MqttBytes as ToOwned>::Owned
fn to_owned(&self) -> <MqttBytes as ToOwned>::Owned
Creates owned data from borrowed data, usually by cloning. Read more
1.63.0 · Source§fn clone_into(&self, target: &mut Self::Owned)
fn clone_into(&self, target: &mut Self::Owned)
Uses borrowed data to replace owned data, usually by cloning. Read more
impl Eq for MqttBytes
impl StructuralPartialEq for MqttBytes
Auto Trait Implementations§
impl Freeze for MqttBytes
impl RefUnwindSafe for MqttBytes
impl Send for MqttBytes
impl !Sized for MqttBytes
impl Sync for MqttBytes
impl Unpin for MqttBytes
impl UnwindSafe for MqttBytes
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