pub struct BroadcastChangeTracker { /* private fields */ }Expand description
BroadcastChangeTracker tracks the broadcasts, their change_count, and the broadcast lookup registry
Implementations§
Source§impl BroadcastChangeTracker
impl BroadcastChangeTracker
Sourcepub fn new(broadcasts: Vec<Broadcast>) -> BroadcastChangeTracker
pub fn new(broadcasts: Vec<Broadcast>) -> BroadcastChangeTracker
Creates a new BroadcastChangeTracker initialized with the provided broadcasts.
Sourcepub fn add_broadcasts(&mut self, broadcasts: Vec<Broadcast>) -> Option<u32>
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)
Sourcepub fn add_broadcast(&mut self, broadcast: Broadcast) -> u32
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.
Sourcepub fn update_broadcast(&mut self, broadcast: Broadcast) -> Result<u32>
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.
Sourcepub fn change_count_delta(
&self,
client_set: &mut BroadcastSubs,
) -> Option<Vec<Broadcast>>
pub fn change_count_delta( &self, client_set: &mut BroadcastSubs, ) -> Option<Vec<Broadcast>>
Returns the new broadcast versions since the provided client_set.
Sourcepub fn broadcast_delta(&self, broadcasts: &[Broadcast]) -> BroadcastSubsInit
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.
Sourcepub fn subscribe_to_broadcasts(
&self,
broadcast_subs: &mut BroadcastSubs,
broadcasts: &[Broadcast],
) -> Option<Vec<Broadcast>>
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.
Sourcepub fn missing_broadcasts(&self, broadcasts: &[Broadcast]) -> Vec<Broadcast>
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§
Auto Trait Implementations§
impl Freeze for BroadcastChangeTracker
impl RefUnwindSafe for BroadcastChangeTracker
impl Send for BroadcastChangeTracker
impl Sync for BroadcastChangeTracker
impl Unpin for BroadcastChangeTracker
impl UnwindSafe for BroadcastChangeTracker
Blanket Implementations§
§impl<T> AnySync for T
impl<T> AnySync for T
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
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more