pub enum Reddb {
Embedded(EmbeddedClient),
Unavailable(&'static str),
}Expand description
Top-level client handle. Use Reddb::connect to get one.
Variants§
Embedded(EmbeddedClient)
Constructed when a feature gate would have produced a real
variant but the feature is disabled. Every method on this
variant returns a FEATURE_DISABLED error so build-time
configuration bugs surface as runtime errors with a clear
remediation, not as missing trait impls.
Implementations§
Source§impl Reddb
impl Reddb
Sourcepub async fn connect(uri: &str) -> Result<Self>
pub async fn connect(uri: &str) -> Result<Self>
Open a connection. The backend is selected from the URI scheme.
pub async fn query(&self, sql: &str) -> Result<QueryResult>
pub async fn insert( &self, collection: &str, payload: &JsonValue, ) -> Result<InsertResult>
pub async fn bulk_insert( &self, collection: &str, payloads: &[JsonValue], ) -> Result<u64>
pub async fn delete(&self, collection: &str, id: &str) -> Result<u64>
pub async fn close(&self) -> Result<()>
pub fn kv(&self) -> KvClient<'_>
pub fn config(&self) -> ConfigClient<'_>
pub fn vault(&self) -> VaultClient<'_>
pub fn config_collection<'a>(&'a self, collection: &'a str) -> ConfigClient<'a>
pub fn vault_collection<'a>(&'a self, collection: &'a str) -> VaultClient<'a>
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Reddb
impl !RefUnwindSafe for Reddb
impl Send for Reddb
impl Sync for Reddb
impl Unpin for Reddb
impl UnsafeUnpin for Reddb
impl !UnwindSafe for Reddb
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> 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