pub struct Postgres {
    url: String,
    schema: Option<String>,
    tls: MakeTlsConnector,
    client: Option<Client>,
    epoch: i64,
    nonce: [u8; 16],
}
Expand description

A Stash whose data is stored in a Postgres database. The format of the tables are not specified and should not be relied upon. The only promise is stability. Any changes to the table schemas will be accompanied by a clear

Fields

url: Stringschema: Option<String>tls: MakeTlsConnectorclient: Option<Client>epoch: i64nonce: [u8; 16]

Implementations

Opens the stash stored at the specified path.

Sets client to a new connection to the Postgres server.

Construct a fenced transaction, which will cause this Stash to fail if another connection is opened to it. f may be called multiple times in a backoff-retry loop if the Postgres server is unavailable, so it should only call functions on its Transaction argument.

Examples
async fn x(&mut self) -> Result<(), StashError> {
    self.transact(move |tx| {
        Box::pin(async move {
            // Use tx.
        })
    })
    .await

Trait Implementations

Atomically adds entries, seals, and compacts multiple collections. Read more

Formats the value using the given formatter. Read more

Reports the current since frontier.

Reports the current upper frontier.

Loads or creates the named collection. Read more

Iterates over all entries in the stash. Read more

Iterates over entries in the stash for the given key. Read more

Atomically adds multiple entries to the arrangement. Read more

Atomically advances the upper frontier to the specified value. Read more

Performs multiple seals at once, potentially in a more performant way than performing the individual seals one by one. Read more

Atomically advances the since frontier to the specified value. Read more

Performs multiple compactions at once, potentially in a more performant way than performing the individual compactions one by one. Read more

Atomically consolidates entries less than the since frontier. Read more

Performs multiple consolidations at once, potentially in a more performant way than performing the individual consolidations one by one. Read more

Returns the most recent timestamp at which sealed entries can be read.

Returns the current value of sealed entries. Read more

Returns the current k,v pairs of sealed entries, erroring if there is more than one entry for a given key or the multiplicity is not 1 for each key. Read more

Returns the current sealed value for the given key, erroring if there is more than one entry for the key or its multiplicity is not 1. Read more

Atomically adds a single entry to the arrangement. 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

Should always be Self

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