SubscriptionsBuf

Struct SubscriptionsBuf 

pub struct SubscriptionsBuf(Vec<u8>);
Available on crate feature alloc only.
Expand description

Owned SUBSCRIBE payload bytes, the owned counterpart to Subscriptions.

Tuple Fields§

§0: Vec<u8>

Implementations§

§

impl SubscriptionsBuf

pub const fn new() -> Self

Creates an empty buffer.

pub fn push(&mut self, filter: &TopicFilter, options: SubscriptionOptions)

Appends a subscription entry (topic filter + options) to the buffer.

pub const fn as_subscriptions(&self) -> &Subscriptions

Returns a reference to the underlying Subscriptions.

Methods from Deref<Target = Subscriptions>§

pub const EMPTY: &'static Self

pub fn as_bytes(&self) -> &[u8]

Returns the raw encoded bytes.

pub fn is_empty(&self) -> bool

Returns true if the payload contains no subscription entries.

pub fn iter(&self) -> SubscriptionIter<'_>

Iterates over the subscription entries in this payload.

Trait Implementations§

§

impl AsRef<Subscriptions> for SubscriptionsBuf

§

fn as_ref(&self) -> &Subscriptions

Converts this type into a shared reference of the (usually inferred) input type.
§

impl Borrow<Subscriptions> for SubscriptionsBuf

§

fn borrow(&self) -> &Subscriptions

Immutably borrows from an owned value. Read more
§

impl Clone for SubscriptionsBuf

§

fn clone(&self) -> SubscriptionsBuf

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
§

impl Debug for SubscriptionsBuf

§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
§

impl Default for SubscriptionsBuf

§

fn default() -> Self

Returns the “default value” for a type. Read more
§

impl Deref for SubscriptionsBuf

§

type Target = Subscriptions

The resulting type after dereferencing.
§

fn deref(&self) -> &Subscriptions

Dereferences the value.
§

impl<'a> Extend<(&'a TopicFilter, SubscriptionOptions)> for SubscriptionsBuf

§

fn extend<I: IntoIterator<Item = (&'a TopicFilter, SubscriptionOptions)>>( &mut self, iter: I, )

Extends a collection with the contents of an iterator. Read more
Source§

fn extend_one(&mut self, item: A)

🔬This is a nightly-only experimental API. (extend_one)
Extends a collection with exactly one element.
Source§

fn extend_reserve(&mut self, additional: usize)

🔬This is a nightly-only experimental API. (extend_one)
Reserves capacity in a collection for the given number of additional elements. Read more
§

impl<'a> FromIterator<(&'a TopicFilter, SubscriptionOptions)> for SubscriptionsBuf

§

fn from_iter<I: IntoIterator<Item = (&'a TopicFilter, SubscriptionOptions)>>( iter: I, ) -> Self

Creates a value from an iterator. Read more
§

impl Hash for SubscriptionsBuf

§

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given Hasher. Read more
1.3.0 · Source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
§

impl PartialEq for SubscriptionsBuf

§

fn eq(&self, other: &SubscriptionsBuf) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
§

impl Eq for SubscriptionsBuf

§

impl StructuralPartialEq for SubscriptionsBuf

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<P, T> Receiver for P
where P: Deref<Target = T> + ?Sized, T: ?Sized,

Source§

type Target = T

🔬This is a nightly-only experimental API. (arbitrary_self_types)
The target type on which the method may be called.
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.