pub struct TopicAlias { /* private fields */ }
Implementations§
Source§impl TopicAlias
impl TopicAlias
Source§impl TopicAlias
impl TopicAlias
Sourcepub fn parse(bytes: &[u8]) -> Result<(Self, usize), MqttError>
pub fn parse(bytes: &[u8]) -> Result<(Self, usize), MqttError>
Parses a u16 property from the given byte slice.
§Parameters
bytes
- The byte slice to parse from
§Returns
Ok((Self, usize))
- The parsed property and number of bytes consumedErr(MqttError)
- If parsing fails or validation fails
§Examples
ⓘ
let data = &[0x00, 0x3C]; // 60 in big-endian
let (prop, consumed) = ServerKeepAlive::parse(data).unwrap();
assert_eq!(consumed, 2);
Sourcepub fn to_buffers(&self) -> Vec<IoSlice<'_>>
pub fn to_buffers(&self) -> Vec<IoSlice<'_>>
Sourcepub fn to_continuous_buffer(&self) -> Vec<u8> ⓘ
pub fn to_continuous_buffer(&self) -> Vec<u8> ⓘ
Trait Implementations§
Source§impl Clone for TopicAlias
impl Clone for TopicAlias
Source§fn clone(&self) -> TopicAlias
fn clone(&self) -> TopicAlias
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl Debug for TopicAlias
impl Debug for TopicAlias
Source§impl Display for TopicAlias
impl Display for TopicAlias
Source§impl From<TopicAlias> for Property
impl From<TopicAlias> for Property
Source§fn from(v: TopicAlias) -> Self
fn from(v: TopicAlias) -> Self
Converts to this type from the input type.
Source§impl PartialEq for TopicAlias
impl PartialEq for TopicAlias
Source§impl Serialize for TopicAlias
impl Serialize for TopicAlias
impl Eq for TopicAlias
impl StructuralPartialEq for TopicAlias
Auto Trait Implementations§
impl Freeze for TopicAlias
impl RefUnwindSafe for TopicAlias
impl Send for TopicAlias
impl Sync for TopicAlias
impl Unpin for TopicAlias
impl UnwindSafe for TopicAlias
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key
and return true
if they are equal.