pub struct PersistClient {
    pub(crate) cfg: PersistConfig,
    pub(crate) blob: Arc<dyn BlobMulti + Send + Sync>,
    pub(crate) consensus: Arc<dyn Consensus + Send + Sync>,
    pub(crate) metrics: Arc<Metrics>,
}
Expand description

A handle for interacting with the set of persist shard made durable at a single PersistLocation.

All async methods on PersistClient retry for as long as they are able, but the returned std::future::Futures implement “cancel on drop” semantics. This means that callers can add a timeout using tokio::time::timeout or tokio::time::timeout_at.

tokio::time::timeout(timeout, client.open::<String, String, u64, i64>(id)).await

Fields

cfg: PersistConfigblob: Arc<dyn BlobMulti + Send + Sync>consensus: Arc<dyn Consensus + Send + Sync>metrics: Arc<Metrics>

Implementations

Returns a new client for interfacing with persist shards made durable to the given BlobMulti and Consensus.

This is exposed mostly for testing. Persist users likely want crate::cache::PersistClientCache::open.

Provides capabilities for the durable TVC identified by shard_id at its current since and upper frontiers.

This method is a best-effort attempt to regain control of the frontiers of a shard. Its most common uses are to recover capabilities that have expired (leases) or to attempt to read a TVC that one did not create (or otherwise receive capabilities for). If the frontiers have been fully released by all other parties, this call may result in capabilities with empty frontiers (which are useless).

If shard_id has never been used before, initializes a new shard and returns handles with since and upper frontiers set to initial values of Antichain::from_elem(T::minimum()).

Self::open, but returning only a ReadHandle.

Use this to save latency and a bit of persist traffic if you’re just going to immediately drop or expire the WriteHandle.

Self::open, but returning only a WriteHandle.

Use this to save latency and a bit of persist traffic if you’re just going to immediately drop or expire the ReadHandle.

Trait Implementations

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Formats the value using the given formatter. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Attaches the provided Context to this type, returning a WithContext wrapper. Read more

Attaches the current Context to this type, returning a WithContext wrapper. Read more

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

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

Calls U::from(self).

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

Wrap the input message T in a tonic::Request

Upcasts this ProgressEventTimestamp to Any. Read more

Returns the name of the concrete type of this object. Read more

Should always be Self

The resulting type after obtaining ownership.

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

🔬 This is a nightly-only experimental API. (toowned_clone_into)

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

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.

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

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