pub struct MemoryBackend { /* private fields */ }Expand description
Process-lifetime, in-memory backend. The default until a durable store is configured.
Trait Implementations§
Source§impl Default for MemoryBackend
impl Default for MemoryBackend
Source§fn default() -> MemoryBackend
fn default() -> MemoryBackend
Returns the “default value” for a type. Read more
Source§impl KvBackend for MemoryBackend
impl KvBackend for MemoryBackend
fn get(&self, key: &[u8]) -> Option<Vec<u8>>
fn set(&self, key: &[u8], value: Vec<u8>)
fn delete(&self, key: &[u8])
Source§fn increment(&self, key: &[u8], delta: i64) -> i64
fn increment(&self, key: &[u8], delta: i64) -> i64
Atomic add-and-get. An unset counter starts at 0;
delta is signed.Source§fn try_acquire(
&self,
key: &[u8],
cost: u64,
spec: Bucket,
now_ms: u64,
) -> Acquire
fn try_acquire( &self, key: &[u8], cost: u64, spec: Bucket, now_ms: u64, ) -> Acquire
Atomic token-bucket acquire against the
now_ms request-clock snapshot. The
refill + counting stay host-native (ADR 000005) — they never cross the WASM
boundary; the filter only decided to consult the limiter.Auto Trait Implementations§
impl !Freeze for MemoryBackend
impl !RefUnwindSafe for MemoryBackend
impl Send for MemoryBackend
impl Sync for MemoryBackend
impl Unpin for MemoryBackend
impl UnsafeUnpin for MemoryBackend
impl UnwindSafe for MemoryBackend
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> FutureExt for T
impl<T> FutureExt for T
Source§fn with_context(self, otel_cx: Context) -> WithContext<Self>
fn with_context(self, otel_cx: Context) -> WithContext<Self>
Source§fn with_current_context(self) -> WithContext<Self>
fn with_current_context(self) -> WithContext<Self>
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