pub struct SpannerBackend { /* private fields */ }Expand description
Google Cloud Spanner-backed backend.
Implementations§
Source§impl SpannerBackend
impl SpannerBackend
Sourcepub async fn connect(
database: &str,
config: ClientConfig,
) -> Result<Self, Error>
pub async fn connect( database: &str, config: ClientConfig, ) -> Result<Self, Error>
Connect to a Spanner database resource name using a caller-provided config.
Sourcepub fn with_read_parallelism(self, read_parallelism: usize) -> Self
pub fn with_read_parallelism(self, read_parallelism: usize) -> Self
Set the read parallelism advertised to async prolly traversals.
Trait Implementations§
Source§impl Clone for SpannerBackend
impl Clone for SpannerBackend
Source§fn clone(&self) -> SpannerBackend
fn clone(&self) -> SpannerBackend
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 SpannerBackend
impl Debug for SpannerBackend
Source§impl RemoteStoreBackend for SpannerBackend
impl RemoteStoreBackend for SpannerBackend
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 read_parallelism(&self) -> usize
fn read_parallelism(&self) -> usize
Maximum in-flight reads for default async traversal paths.
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 prefers_batch_reads(&self) -> bool
fn prefers_batch_reads(&self) -> bool
Whether this backend has native or efficiently coalesced batch reads.
Source§fn prefers_rightmost_path_hints(&self) -> bool
fn prefers_rightmost_path_hints(&self) -> bool
Whether append-heavy writes should maintain rightmost-path hints.
Source§async fn publish_nodes(
&self,
publication: NodePublication<'_>,
) -> Result<(), Self::Error>
async fn publish_nodes( &self, publication: NodePublication<'_>, ) -> Result<(), Self::Error>
Publish canonical immutable nodes with advisory logical context.
Auto Trait Implementations§
impl !RefUnwindSafe for SpannerBackend
impl !UnwindSafe for SpannerBackend
impl Freeze for SpannerBackend
impl Send for SpannerBackend
impl Sync for SpannerBackend
impl Unpin for SpannerBackend
impl UnsafeUnpin for SpannerBackend
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> ErasedDestructor for Twhere
T: 'static,
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 moreSource§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
Wrap the input message
T in a tonic::Request