Struct TopicFilters
#[repr(transparent)]pub struct TopicFilters([u8]);Expand description
Borrowed view over a validated UNSUBSCRIBE payload.
Each entry is a length-prefixed topic filter string (§3.10.3). Use
TopicFiltersBuf to build one, or
TopicFilters::new to validate and borrow existing encoded bytes.
Tuple Fields§
§0: [u8]Implementations§
§impl TopicFilters
impl TopicFilters
pub const EMPTY: &'static Self
pub const EMPTY: &'static Self
An empty topic filters payload.
pub const fn new(bytes: &[u8]) -> Result<&Self, DecodeError>
pub const fn new(bytes: &[u8]) -> Result<&Self, DecodeError>
Validates raw UNSUBSCRIBE payload bytes and returns a TopicFilters
reference.
§Errors
Returns DecodeError if any entry is malformed: a truncated or
invalid topic filter string.
pub const unsafe fn new_unchecked(bytes: &[u8]) -> &Self
pub const unsafe fn new_unchecked(bytes: &[u8]) -> &Self
Creates a TopicFilters reference from raw bytes WITHOUT validation.
§Safety
The caller must guarantee that bytes contains only structurally valid
entries: each is a length-prefixed valid topic filter string.
pub const fn iter(&self) -> TopicFilterIter<'_> ⓘ
pub const fn iter(&self) -> TopicFilterIter<'_> ⓘ
Iterates over the topic filters in this payload.
Trait Implementations§
§impl AsRef<TopicFilters> for TopicFiltersBuf
Available on crate feature alloc only.
impl AsRef<TopicFilters> for TopicFiltersBuf
Available on crate feature
alloc only.§fn as_ref(&self) -> &TopicFilters
fn as_ref(&self) -> &TopicFilters
Converts this type into a shared reference of the (usually inferred) input type.
§impl Borrow<TopicFilters> for TopicFiltersBuf
Available on crate feature alloc only.
impl Borrow<TopicFilters> for TopicFiltersBuf
Available on crate feature
alloc only.§fn borrow(&self) -> &TopicFilters
fn borrow(&self) -> &TopicFilters
Immutably borrows from an owned value. Read more
§impl Debug for TopicFilters
impl Debug for TopicFilters
§impl Hash for TopicFilters
impl Hash for TopicFilters
§impl<'a> IntoIterator for &'a TopicFilters
impl<'a> IntoIterator for &'a TopicFilters
§type Item = &'a TopicFilter
type Item = &'a TopicFilter
The type of the elements being iterated over.
§type IntoIter = TopicFilterIter<'a>
type IntoIter = TopicFilterIter<'a>
Which kind of iterator are we turning this into?
§impl PartialEq for TopicFilters
impl PartialEq for TopicFilters
§impl ToOwned for TopicFilters
Available on crate feature alloc only.
impl ToOwned for TopicFilters
Available on crate feature
alloc only.§type Owned = TopicFiltersBuf
type Owned = TopicFiltersBuf
The resulting type after obtaining ownership.
§fn to_owned(&self) -> Self::Owned
fn to_owned(&self) -> Self::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