pub struct PostgresDriver { /* private fields */ }Expand description
PostgreSQL driver for durable external-service storage.
Implementations§
Source§impl PostgresDriver
impl PostgresDriver
Sourcepub fn new(connection_string: impl Into<String>) -> Self
pub fn new(connection_string: impl Into<String>) -> Self
Creates a new PostgreSQL driver using default options.
Sourcepub fn with_options(options: PostgresDriverOptions) -> Self
pub fn with_options(options: PostgresDriverOptions) -> Self
Creates a new PostgreSQL driver with explicit options.
Sourcepub const fn options(&self) -> &PostgresDriverOptions
pub const fn options(&self) -> &PostgresDriverOptions
Returns the configured options.
Sourcepub const fn schema(&self) -> PostgresDriverStorageSchema
pub const fn schema(&self) -> PostgresDriverStorageSchema
Returns the storage schema.
Trait Implementations§
Source§impl Clone for PostgresDriver
impl Clone for PostgresDriver
Source§impl Debug for PostgresDriver
impl Debug for PostgresDriver
Source§impl Driver for PostgresDriver
impl Driver for PostgresDriver
Source§fn capabilities(&self) -> Capabilities
fn capabilities(&self) -> Capabilities
Reports supported driver behaviour.
Source§fn initialise<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn initialise<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Prepares the driver for use.
Source§fn finalise<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn finalise<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Releases driver resources.
Source§fn get<'life0, 'life1, 'life2, 'life3, 'life4, 'async_trait>(
&'life0 self,
namespace: &'life1 Namespace,
collection: &'life2 CollectionName,
key: &'life3 Key,
options: &'life4 ReadOptions,
) -> Pin<Box<dyn Future<Output = Result<Option<StoredValue>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
'life4: 'async_trait,
fn get<'life0, 'life1, 'life2, 'life3, 'life4, 'async_trait>(
&'life0 self,
namespace: &'life1 Namespace,
collection: &'life2 CollectionName,
key: &'life3 Key,
options: &'life4 ReadOptions,
) -> Pin<Box<dyn Future<Output = Result<Option<StoredValue>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
'life4: 'async_trait,
Reads a stored value.
Source§fn set<'life0, 'life1, 'life2, 'life3, 'life4, 'async_trait>(
&'life0 self,
namespace: &'life1 Namespace,
collection: &'life2 CollectionName,
key: &'life3 Key,
value: StoredValue,
options: &'life4 WriteOptions,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
'life4: 'async_trait,
fn set<'life0, 'life1, 'life2, 'life3, 'life4, 'async_trait>(
&'life0 self,
namespace: &'life1 Namespace,
collection: &'life2 CollectionName,
key: &'life3 Key,
value: StoredValue,
options: &'life4 WriteOptions,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
'life4: 'async_trait,
Writes a stored value.
Source§fn delete<'life0, 'life1, 'life2, 'life3, 'life4, 'async_trait>(
&'life0 self,
namespace: &'life1 Namespace,
collection: &'life2 CollectionName,
key: &'life3 Key,
options: &'life4 DeleteOptions,
) -> Pin<Box<dyn Future<Output = Result<bool>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
'life4: 'async_trait,
fn delete<'life0, 'life1, 'life2, 'life3, 'life4, 'async_trait>(
&'life0 self,
namespace: &'life1 Namespace,
collection: &'life2 CollectionName,
key: &'life3 Key,
options: &'life4 DeleteOptions,
) -> Pin<Box<dyn Future<Output = Result<bool>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
'life4: 'async_trait,
Deletes a stored value and returns whether a value was removed.
Source§fn exists<'life0, 'life1, 'life2, 'life3, 'async_trait>(
&'life0 self,
namespace: &'life1 Namespace,
collection: &'life2 CollectionName,
key: &'life3 Key,
) -> Pin<Box<dyn Future<Output = Result<bool>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
fn exists<'life0, 'life1, 'life2, 'life3, 'async_trait>(
&'life0 self,
namespace: &'life1 Namespace,
collection: &'life2 CollectionName,
key: &'life3 Key,
) -> Pin<Box<dyn Future<Output = Result<bool>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
Returns whether a stored value exists.
Source§fn scan_prefix<'life0, 'life1, 'life2, 'life3, 'async_trait>(
&'life0 self,
namespace: &'life1 Namespace,
collection: &'life2 CollectionName,
options: &'life3 ScanOptions,
) -> Pin<Box<dyn Future<Output = Result<Vec<(Key, StoredValue)>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
fn scan_prefix<'life0, 'life1, 'life2, 'life3, 'async_trait>(
&'life0 self,
namespace: &'life1 Namespace,
collection: &'life2 CollectionName,
options: &'life3 ScanOptions,
) -> Pin<Box<dyn Future<Output = Result<Vec<(Key, StoredValue)>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
Scans values by key prefix.
Auto Trait Implementations§
impl !Freeze for PostgresDriver
impl !RefUnwindSafe for PostgresDriver
impl !UnwindSafe for PostgresDriver
impl Send for PostgresDriver
impl Sync for PostgresDriver
impl Unpin for PostgresDriver
impl UnsafeUnpin for PostgresDriver
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,
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