Skip to main content

CachedObjectStore

Struct CachedObjectStore 

Source
pub struct CachedObjectStore<S> { /* private fields */ }
Expand description

Async immutable-object accelerator over any conforming backend.

Implementations§

Source§

impl<S> CachedObjectStore<S>

Source

pub fn new( inner: S, options: ObjectCacheOptions, ) -> Result<Self, ObjectCacheConfigError>

Wraps one backend with an independently bounded disposable cache.

§Errors

Rejects a zero bound.

Source

pub const fn inner(&self) -> &S

Returns the wrapped correctness backend.

Source

pub fn stats(&self) -> Result<ObjectCacheStats, ObjectStoreError>

Returns exact current and cumulative accelerator observations.

§Errors

Fails closed if accelerator state was poisoned.

Source

pub fn clear(&self) -> Result<(), ObjectStoreError>

Discards every resident byte. In-flight reads remain valid and may repopulate after this call.

§Errors

Fails closed if accelerator state was poisoned.

Trait Implementations§

Source§

impl<S: AsyncObjectStore> AsyncObjectStore for CachedObjectStore<S>

Source§

fn decoded_cache_get( &self, key: DecodedCacheKey, ) -> Result<Option<DecodedCacheValue>, ObjectStoreError>

Returns one exact decoded immutable representation when resident. Read more
Source§

fn decoded_cache_admit( &self, key: DecodedCacheKey, value: DecodedCacheValue, ) -> Result<DecodedCacheAdmission, ObjectStoreError>

Offers one authenticated decoded representation to a disposable cache. Read more
Source§

async fn put( &self, object_id: ObjectId, bytes: Bytes, budget: WorkBudget, cancellation: &CancellationToken, ) -> ObjectResult<()>

Asynchronously admits one verified immutable object.
Source§

async fn put_many( &self, writes: &[ObjectWrite], budget: WorkBudget, cancellation: &CancellationToken, ) -> ObjectResult<()>

Asynchronously admits an ordered bounded group of verified immutable objects. Read more
Source§

async fn read( &self, object_id: ObjectId, maximum_bytes: u64, budget: WorkBudget, cancellation: &CancellationToken, ) -> ObjectResult<ObjectRead>

Asynchronously reads one complete bounded object.
Source§

async fn read_many( &self, requests: &[ObjectReadRequest], budget: WorkBudget, cancellation: &CancellationToken, ) -> ObjectResult<Vec<ObjectRead>>

Asynchronously reads an ordered batch of complete bounded objects. Read more
Source§

async fn contains( &self, object_id: ObjectId, budget: WorkBudget, cancellation: &CancellationToken, ) -> ObjectResult<bool>

Asynchronously probes one exact object identity.
Source§

fn flush_before_publish( &self, _budget: WorkBudget, _cancellation: &CancellationToken, ) -> impl Future<Output = ObjectResult<()>> + StorageFuture

Makes every previously admitted immutable object crash-durable before an authority record may reference it. Ordinary stores already provide that guarantee from put/put_many; a bounded staging adapter overrides this boundary to group physical writes without changing publication.
Source§

impl<S: Clone> Clone for CachedObjectStore<S>

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more

Auto Trait Implementations§

§

impl<S> Freeze for CachedObjectStore<S>
where S: Freeze,

§

impl<S> RefUnwindSafe for CachedObjectStore<S>
where S: RefUnwindSafe,

§

impl<S> Send for CachedObjectStore<S>
where S: Send,

§

impl<S> Sync for CachedObjectStore<S>
where S: Sync,

§

impl<S> Unpin for CachedObjectStore<S>
where S: Unpin,

§

impl<S> UnsafeUnpin for CachedObjectStore<S>
where S: UnsafeUnpin,

§

impl<S> UnwindSafe for CachedObjectStore<S>
where S: UnwindSafe,

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> FromRef<T> for T
where T: Clone,

Source§

fn from_ref(input: &T) -> T

Converts to this type from a reference to the input type.
Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self> ⓘ

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self> ⓘ

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoRequest<T> for T

Source§

fn into_request(self) -> Request<T>

Wrap the input message T in a tonic::Request
Source§

impl<L> LayerExt<L> for L

Source§

fn named_layer<S>(&self, service: S) -> Layered<<L as Layer<S>>::Service, S>
where L: Layer<S>,

Applies the layer to a service and wraps it in Layered.
Source§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> StorageFuture for T
where T: Send,

Source§

impl<T> StorageProvider for T
where T: Send + Sync + ?Sized,

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> ⓘ
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self> ⓘ

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more