pub struct Register {
pub name: &'static str,
pub shard_entries: usize,
pub max_age_seconds: i64,
}Expand description
The bounds of one register.
Fields§
§name: &'static strDirectory name under the archive store.
shard_entries: usizeKeys per shard; the oldest record is evicted first.
max_age_seconds: i64A record older than this is neither returned nor kept.
Implementations§
Source§impl Register
impl Register
Sourcepub fn update_many<V: Serialize + DeserializeOwned>(
&self,
now: i64,
items: Vec<(String, V)>,
merge: impl Fn(&str, V, V) -> V,
) -> bool
pub fn update_many<V: Serialize + DeserializeOwned>( &self, now: i64, items: Vec<(String, V)>, merge: impl Fn(&str, V, V) -> V, ) -> bool
Record many values at once under one lock, one write per touched
shard: merge(key, current, new) gives the value kept under a key
that already holds one. Keys that are malformed are skipped. false: the
lock was not obtained or a shard could not be written (its keys are
then not recorded; unknown is the safe state).
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Register
impl RefUnwindSafe for Register
impl Send for Register
impl Sync for Register
impl Unpin for Register
impl UnsafeUnpin for Register
impl UnwindSafe for Register
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<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<A, B, T> HttpServerConnExec<A, B> for Twhere
B: Body,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§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