pub struct OutgoingIndexCache {
cache: DashMap<(ChannelId, u32), Arc<OutgoingIndexEntry>>,
removed: DashSet<(ChannelId, u32)>,
}Fields§
§cache: DashMap<(ChannelId, u32), Arc<OutgoingIndexEntry>>§removed: DashSet<(ChannelId, u32)>Implementations§
Source§impl OutgoingIndexCache
impl OutgoingIndexCache
Sourcepub fn next(&self, channel_id: &ChannelId, epoch: u32) -> u64
pub fn next(&self, channel_id: &ChannelId, epoch: u32) -> u64
Returns the next outgoing index for the given channel and epoch.
Sourcepub fn upsert(&self, channel_id: &ChannelId, epoch: u32, index: u64) -> u64
pub fn upsert(&self, channel_id: &ChannelId, epoch: u32, index: u64) -> u64
Inserts the index for the given channel and epoch, or updates
the existing value if it is less than the provided index.
Returns the index value that is either:
- equal to
indexif no index for the given channel and epoch existed and the value was inserted, or - equal to the existing index value, if the provided
indexis less than the existing index value, or - equal to the provided
indexvalue if it is greater than the existing index value and the value is updated.
Trait Implementations§
Source§impl Debug for OutgoingIndexCache
impl Debug for OutgoingIndexCache
Source§impl Default for OutgoingIndexCache
impl Default for OutgoingIndexCache
Source§fn default() -> OutgoingIndexCache
fn default() -> OutgoingIndexCache
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for OutgoingIndexCache
impl !RefUnwindSafe for OutgoingIndexCache
impl Send for OutgoingIndexCache
impl Sync for OutgoingIndexCache
impl Unpin for OutgoingIndexCache
impl UnwindSafe for OutgoingIndexCache
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
§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>
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