pub struct PostgresBackend { /* private fields */ }Expand description
SQLx-backed PostgreSQL backend.
Implementations§
Trait Implementations§
Source§impl Clone for PostgresBackend
impl Clone for PostgresBackend
Source§fn clone(&self) -> PostgresBackend
fn clone(&self) -> PostgresBackend
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for PostgresBackend
impl Debug for PostgresBackend
Source§impl RemoteStoreBackend for PostgresBackend
impl RemoteStoreBackend for PostgresBackend
Source§async fn get_node(&self, key: &[u8]) -> Result<Option<Vec<u8>>, Self::Error>
async fn get_node(&self, key: &[u8]) -> Result<Option<Vec<u8>>, Self::Error>
Read one content-addressed node by CID bytes.
Source§async fn put_node(&self, key: &[u8], value: &[u8]) -> Result<(), Self::Error>
async fn put_node(&self, key: &[u8], value: &[u8]) -> Result<(), Self::Error>
Store one content-addressed node by CID bytes.
Source§async fn delete_node(&self, key: &[u8]) -> Result<(), Self::Error>
async fn delete_node(&self, key: &[u8]) -> Result<(), Self::Error>
Delete one content-addressed node by CID bytes.
Source§async fn batch_nodes(
&self,
ops: &[RemoteBatchOp<'_>],
) -> Result<(), Self::Error>
async fn batch_nodes( &self, ops: &[RemoteBatchOp<'_>], ) -> Result<(), Self::Error>
Apply node writes/deletes. Implementations should make this atomic when
the provider supports it.
Source§async fn batch_get_nodes_ordered(
&self,
keys: &[&[u8]],
) -> Result<Vec<Option<Vec<u8>>>, Self::Error>
async fn batch_get_nodes_ordered( &self, keys: &[&[u8]], ) -> Result<Vec<Option<Vec<u8>>>, Self::Error>
Read unique node keys in request order.
Source§async fn batch_put_nodes(
&self,
entries: &[(&[u8], &[u8])],
) -> Result<(), Self::Error>
async fn batch_put_nodes( &self, entries: &[(&[u8], &[u8])], ) -> Result<(), Self::Error>
Store multiple content-addressed nodes.
Source§async fn list_node_cids(&self) -> Result<Vec<Vec<u8>>, Self::Error>
async fn list_node_cids(&self) -> Result<Vec<Vec<u8>>, Self::Error>
List all content-addressed node CIDs. Read more
Source§fn prefers_batch_reads(&self) -> bool
fn prefers_batch_reads(&self) -> bool
Whether this backend has native or efficiently coalesced batch reads.
Source§fn supports_hints(&self) -> bool
fn supports_hints(&self) -> bool
Whether this backend persists optional performance hints.
Source§async fn get_hint(
&self,
namespace: &[u8],
key: &[u8],
) -> Result<Option<Vec<u8>>, Self::Error>
async fn get_hint( &self, namespace: &[u8], key: &[u8], ) -> Result<Option<Vec<u8>>, Self::Error>
Read an optional performance hint.
Source§async fn put_hint(
&self,
namespace: &[u8],
key: &[u8],
value: &[u8],
) -> Result<(), Self::Error>
async fn put_hint( &self, namespace: &[u8], key: &[u8], value: &[u8], ) -> Result<(), Self::Error>
Write an optional performance hint.
Source§async fn batch_put_nodes_with_hint(
&self,
entries: &[(&[u8], &[u8])],
namespace: &[u8],
key: &[u8],
value: &[u8],
) -> Result<(), Self::Error>
async fn batch_put_nodes_with_hint( &self, entries: &[(&[u8], &[u8])], namespace: &[u8], key: &[u8], value: &[u8], ) -> Result<(), Self::Error>
Store content-addressed nodes and one hint atomically when supported.
Source§async fn get_root_manifest(
&self,
name: &[u8],
) -> Result<Option<Vec<u8>>, Self::Error>
async fn get_root_manifest( &self, name: &[u8], ) -> Result<Option<Vec<u8>>, Self::Error>
Read a serialized root manifest.
Source§async fn put_root_manifest(
&self,
name: &[u8],
manifest: &[u8],
) -> Result<(), Self::Error>
async fn put_root_manifest( &self, name: &[u8], manifest: &[u8], ) -> Result<(), Self::Error>
Write a serialized root manifest unconditionally.
Source§async fn delete_root_manifest(&self, name: &[u8]) -> Result<(), Self::Error>
async fn delete_root_manifest(&self, name: &[u8]) -> Result<(), Self::Error>
Delete a root manifest.
Source§async fn compare_and_swap_root_manifest(
&self,
name: &[u8],
expected: Option<&[u8]>,
new: Option<&[u8]>,
) -> Result<RemoteManifestUpdate, Self::Error>
async fn compare_and_swap_root_manifest( &self, name: &[u8], expected: Option<&[u8]>, new: Option<&[u8]>, ) -> Result<RemoteManifestUpdate, Self::Error>
Compare-and-swap a serialized root manifest.
Source§async fn list_root_manifests(&self) -> Result<Vec<RemoteNamedRoot>, Self::Error>
async fn list_root_manifests(&self) -> Result<Vec<RemoteNamedRoot>, Self::Error>
List serialized root manifests sorted by raw name bytes.
Source§fn supports_transactions(&self) -> bool
fn supports_transactions(&self) -> bool
Whether this backend can atomically validate root conditions and commit
staged node/root writes.
Source§async fn commit_transaction(
&self,
node_writes: &[RemoteBatchOp<'_>],
root_conditions: &[RemoteRootCondition],
root_writes: &[RemoteRootWrite],
) -> Result<RemoteTransactionUpdate, Self::Error>
async fn commit_transaction( &self, node_writes: &[RemoteBatchOp<'_>], root_conditions: &[RemoteRootCondition], root_writes: &[RemoteRootWrite], ) -> Result<RemoteTransactionUpdate, Self::Error>
Atomically validate serialized root conditions, write nodes, and apply
serialized root writes. Implementations should return
RemoteTransactionUpdate::Conflict without applying any writes when a
condition fails.Source§fn read_parallelism(&self) -> usize
fn read_parallelism(&self) -> usize
Maximum in-flight reads for default async traversal paths.
Auto Trait Implementations§
impl !RefUnwindSafe for PostgresBackend
impl !UnwindSafe for PostgresBackend
impl Freeze for PostgresBackend
impl Send for PostgresBackend
impl Sync for PostgresBackend
impl Unpin for PostgresBackend
impl UnsafeUnpin for PostgresBackend
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