pub struct PossibleGapBuffer { /* private fields */ }Expand description
Buffers updates received during a possible-gap window so we don’t fire getDifference on every slightly out-of-order update.
Implementations§
Source§impl PossibleGapBuffer
impl PossibleGapBuffer
pub fn new() -> Self
Sourcepub fn push_global(&mut self, upd: Update)
pub fn push_global(&mut self, upd: Update)
Buffer a global update during a possible-gap window.
Sourcepub fn push_channel(&mut self, channel_id: i64, upd: Update)
pub fn push_channel(&mut self, channel_id: i64, upd: Update)
Buffer a channel update during a possible-gap window.
Sourcepub fn global_deadline_elapsed(&self) -> bool
pub fn global_deadline_elapsed(&self) -> bool
True if the global possible-gap deadline has elapsed.
Sourcepub fn channel_deadline_elapsed(&self, channel_id: i64) -> bool
pub fn channel_deadline_elapsed(&self, channel_id: i64) -> bool
True if a channel’s possible-gap deadline has elapsed.
Sourcepub fn has_global(&self) -> bool
pub fn has_global(&self) -> bool
True if the global buffer has any pending updates.
Sourcepub fn has_channel(&self, channel_id: i64) -> bool
pub fn has_channel(&self, channel_id: i64) -> bool
True if a channel buffer has pending updates.
Sourcepub fn drain_global(&mut self) -> Vec<Update>
pub fn drain_global(&mut self) -> Vec<Update>
Drain global buffered updates.
Sourcepub fn drain_channel(&mut self, channel_id: i64) -> Vec<Update>
pub fn drain_channel(&mut self, channel_id: i64) -> Vec<Update>
Drain channel buffered updates.
Trait Implementations§
Source§impl Default for PossibleGapBuffer
impl Default for PossibleGapBuffer
Source§fn default() -> PossibleGapBuffer
fn default() -> PossibleGapBuffer
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for PossibleGapBuffer
impl RefUnwindSafe for PossibleGapBuffer
impl Send for PossibleGapBuffer
impl Sync for PossibleGapBuffer
impl Unpin for PossibleGapBuffer
impl UnsafeUnpin for PossibleGapBuffer
impl UnwindSafe for PossibleGapBuffer
Blanket Implementations§
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
Mutably borrows from an owned value. Read more
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>
Converts
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>
Converts
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