Skip to main content

DirtySet

Struct DirtySet 

Source
pub struct DirtySet<const N: usize> { /* private fields */ }
Expand description

One attribute path that has changed since the last report.

A fixed-capacity set, because a subscription’s report must be bounded and a device cannot allocate. When it fills, the subscription stops tracking individual paths and re-primes on the next report — §8.5’s own recovery: “Including all subscription data to re-prime the subscription”.

Implementations§

Source§

impl<const N: usize> DirtySet<N>

Source

pub const fn new() -> Self

An empty set — nothing has changed.

Source

pub fn insert(&mut self, path: AttributePath)

Records a change to a concrete path.

Duplicates are dropped: a value that changed twice between reports is reported once, with its latest value — §8.5 asks for “the attribute data that has changed”, not a history of it.

Source

pub fn paths(&self) -> &[AttributePath]

The changed paths, or empty when the set has overflowed.

Source

pub fn is_dirty(&self) -> bool

Whether anything has changed.

Source

pub const fn must_reprime(&self) -> bool

Whether the next report must carry the whole subscription.

Source

pub fn clear(&mut self)

Forgets everything — what a completed report does.

Source

pub fn reprime(&mut self)

Marks the subscription for a full re-prime.

§8.5: “If the publisher does not receive a Status Response action in response to a Report Data action … the publisher MAY terminate the Subscribe interaction or SHALL re-synchronize the subscription in the next Report Data transaction by … Including all subscription data to re-prime the subscription.”

Trait Implementations§

Source§

impl<const N: usize> Clone for DirtySet<N>

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

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

Performs copy-assignment from source. Read more
Source§

impl<const N: usize> Debug for DirtySet<N>

Source§

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

Formats the value using the given formatter. Read more
Source§

impl<const N: usize> Default for DirtySet<N>

Source§

fn default() -> Self

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

Auto Trait Implementations§

§

impl<const N: usize> Forget for DirtySet<N>

§

impl<const N: usize> Freeze for DirtySet<N>
where VecInner<AttributePath, usize, VecStorageInner<[MaybeUninit<AttributePath>; N]>>: Freeze,

§

impl<const N: usize> Move for DirtySet<N>

§

impl<const N: usize> RefUnwindSafe for DirtySet<N>

§

impl<const N: usize> Send for DirtySet<N>
where VecInner<AttributePath, usize, VecStorageInner<[MaybeUninit<AttributePath>; N]>>: Send,

§

impl<const N: usize> Sync for DirtySet<N>
where VecInner<AttributePath, usize, VecStorageInner<[MaybeUninit<AttributePath>; N]>>: Sync,

§

impl<const N: usize> Unpin for DirtySet<N>
where VecInner<AttributePath, usize, VecStorageInner<[MaybeUninit<AttributePath>; N]>>: Unpin,

§

impl<const N: usize> UnsafeUnpin for DirtySet<N>

§

impl<const N: usize> UnwindSafe for DirtySet<N>

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<T> Same for T

Source§

type Output = T

Should always be Self
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 = !

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

fn try_from(value: U) -> Result<T, !>

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.