Struct MqttBytesBuf
pub struct MqttBytesBuf(Vec<u8>);Available on crate feature
alloc only.Expand description
Owned binary data that satisfies the MQTT v5 length limit.
This is the owned counterpart to MqttBytes.
Tuple Fields§
§0: Vec<u8>Implementations§
§impl MqttBytesBuf
impl MqttBytesBuf
Methods from Deref<Target = MqttBytes>§
pub const EMPTY: &'static Self
pub fn encoded_len(&self) -> usize
pub fn encoded_len(&self) -> usize
Returns the number of bytes needed to encode this value.
pub fn try_to_owned(&self) -> Result<MqttBytesBuf, TryReserveError>
pub fn try_to_owned(&self) -> Result<MqttBytesBuf, TryReserveError>
Copies the data into an MqttBytesBuf without panicking if the
allocation fails.
§Errors
Returns TryReserveError if the allocation fails.
Trait Implementations§
§impl AsRef<MqttBytes> for MqttBytesBuf
impl AsRef<MqttBytes> for MqttBytesBuf
§impl AsRef<[u8]> for MqttBytesBuf
impl AsRef<[u8]> for MqttBytesBuf
§impl Borrow<MqttBytes> for MqttBytesBuf
impl Borrow<MqttBytes> for MqttBytesBuf
§impl Clone for MqttBytesBuf
impl Clone for MqttBytesBuf
§fn clone(&self) -> MqttBytesBuf
fn clone(&self) -> MqttBytesBuf
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read more§impl Debug for MqttBytesBuf
impl Debug for MqttBytesBuf
§impl Deref for MqttBytesBuf
impl Deref for MqttBytesBuf
impl Eq for MqttBytesBuf
§impl Hash for MqttBytesBuf
impl Hash for MqttBytesBuf
§impl PartialEq for MqttBytesBuf
impl PartialEq for MqttBytesBuf
impl StructuralPartialEq for MqttBytesBuf
§impl TryFrom<&[u8]> for MqttBytesBuf
impl TryFrom<&[u8]> for MqttBytesBuf
§impl TryFrom<Box<[u8]>> for MqttBytesBuf
impl TryFrom<Box<[u8]>> for MqttBytesBuf
Auto Trait Implementations§
impl Freeze for MqttBytesBuf
impl RefUnwindSafe for MqttBytesBuf
impl Send for MqttBytesBuf
impl Sync for MqttBytesBuf
impl Unpin for MqttBytesBuf
impl UnsafeUnpin for MqttBytesBuf
impl UnwindSafe for MqttBytesBuf
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