pub struct BroadcastChangeTracker { /* private fields */ }
Expand description

BroadcastChangeTracker tracks the broadcasts, their change_count, and the broadcast lookup registry

Implementations§

source§

impl BroadcastChangeTracker

source

pub fn new(broadcasts: Vec<Broadcast>) -> BroadcastChangeTracker

Creates a new BroadcastChangeTracker initialized with the provided broadcasts.

source

pub fn add_broadcasts(&mut self, broadcasts: Vec<Broadcast>) -> Option<u32>

Add a Vec of Broadcasts via self.add_broadcast

Returning the latest change_count (or None for an empty Vec)

source

pub fn add_broadcast(&mut self, broadcast: Broadcast) -> u32

Add a new broadcast to the BroadcastChangeTracker, triggering a change_count increase. Note: If the broadcast already exists, it will be updated instead.

source

pub fn update_broadcast(&mut self, broadcast: Broadcast) -> Result<u32>

Update a broadcast to a new revision, triggering a change_count increase.

Returns an error if the broadcast was never initialized/added.

source

pub fn change_count_delta( &self, client_set: &mut BroadcastSubs, ) -> Option<Vec<Broadcast>>

Returns the new broadcast versions since the provided client_set.

source

pub fn broadcast_delta(&self, broadcasts: &[Broadcast]) -> BroadcastSubsInit

Returns a delta for broadcasts that are out of date with the latest version and a the collection of broadcast subscriptions.

source

pub fn subscribe_to_broadcasts( &self, broadcast_subs: &mut BroadcastSubs, broadcasts: &[Broadcast], ) -> Option<Vec<Broadcast>>

Update a BroadcastSubs to account for new broadcasts.

Returns broadcasts that have changed.

source

pub fn missing_broadcasts(&self, broadcasts: &[Broadcast]) -> Vec<Broadcast>

Check a broadcast list and return unknown broadcast id’s with their appropriate error

Trait Implementations§

source§

impl Debug for BroadcastChangeTracker

source§

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

Formats the value using the given formatter. Read more

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
§

impl<T> Any for T
where T: Any,

§

fn into_any(self: Box<T>) -> Box<dyn Any>

§

fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>

§

fn type_name(&self) -> &'static str

§

impl<T> AnySync for T
where T: Any + Send + Sync,

§

fn into_any_arc(self: Arc<T>) -> Arc<dyn Any + Send + Sync>

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

source§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided [Span], returning an Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
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

§

type Output = T

Should always be Self
source§

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

§

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>,

§

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.
§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a [WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a [WithDispatch] wrapper. Read more
§

impl<T> SendSyncUnwindSafe for T
where T: Send + Sync + UnwindSafe + ?Sized,