pub struct Namespaced<'a, K> { /* private fields */ }
Expand description

A namespaced key-value store. All operations performed with this will be separate from other namespaces.

Trait Implementations§

§

impl<'a, K> AsyncKeyValue for Namespaced<'a, K>where K: AsyncKeyValue,

§

fn execute_key_operation<'life0, 'async_trait>( &'life0 self, op: KeyOperation ) -> Pin<Box<dyn Future<Output = Result<Output, Error>> + Send + 'async_trait, Global>>where 'life0: 'async_trait, Namespaced<'a, K>: 'async_trait,

Executes a single KeyOperation.
§

fn key_namespace(&self) -> Option<&str>

The current namespace.
§

fn with_key_namespace( &self, namespace: &str ) -> Namespaced<'_, Namespaced<'a, K>>where Namespaced<'a, K>: Sized,

Access this Key-Value store within a namespace. When using the returned Namespaced instance, all keys specified will be separated into their own storage designated by namespace.
§

fn set_key<S, V, 'a>( &'a self, key: S, value: &'a V ) -> AsyncBuilder<'a, Self, V> where S: Into<String>, V: Serialize + Send + Sync,

Sets key to value. This function returns a builder that is also a Future. Awaiting the builder will execute Command::Set with the options given.
§

fn set_binary_key<S, 'a>( &'a self, key: S, bytes: &'a [u8] ) -> AsyncBuilder<'a, Self, ()> where S: Into<String>,

Sets key to bytes. This function returns a builder that is also a Future. Awaiting the builder will execute Command::Set with the options given.
§

fn set_numeric_key<S, V>(&self, key: S, value: V) -> AsyncBuilder<'_, Self, ()> where S: Into<String>, V: Into<Numeric>,

Sets key to value. This stores the value as a Numeric, enabling atomic math operations to be performed on this key. This function returns a builder that is also a Future. Awaiting the builder will execute Command::Set with the options given.
§

fn increment_key_by<S, V>(&self, key: S, value: V) -> AsyncBuilder<'_, Self, V> where S: Into<String> + Send + Sync, V: Into<Numeric> + TryFrom<Numeric, Error = IncompatibleTypeError> + Send + Sync,

Increments key by value. The value stored must be a Numeric, otherwise an error will be returned. The result of the increment will be the value’s type. For example, if the stored value is currently a u64, but value is a f64, the current value will be converted to an f64, and the stored value will be an f64.
§

fn decrement_key_by<S, V>(&self, key: S, value: V) -> AsyncBuilder<'_, Self, V> where S: Into<String> + Send + Sync, V: Into<Numeric> + TryFrom<Numeric, Error = IncompatibleTypeError> + Send + Sync,

Decrements key by value. The value stored must be a Numeric, otherwise an error will be returned. The result of the decrement will be the value’s type. For example, if the stored value is currently a u64, but value is a f64, the current value will be converted to an f64, and the stored value will be an f64.
§

fn get_key<S>(&self, key: S) -> AsyncBuilder<'_, Self> where S: Into<String>,

Gets the value stored at key. This function returns a builder that is also a Future. Awaiting the builder will execute Command::Get with the options given.
§

fn delete_key<'life0, 'async_trait, S>( &'life0 self, key: S ) -> Pin<Box<dyn Future<Output = Result<KeyStatus, Error>> + Send + 'async_trait, Global>>where 'life0: 'async_trait, S: 'async_trait + Into<String> + Send, Self: 'async_trait,

Deletes the value stored at key.
§

impl<'a, K> KeyValue for Namespaced<'a, K>where K: KeyValue,

§

fn execute_key_operation(&self, op: KeyOperation) -> Result<Output, Error>

Executes a single KeyOperation.
§

fn key_namespace(&self) -> Option<&str>

The current namespace.
§

fn with_key_namespace( &self, namespace: &str ) -> Namespaced<'_, Namespaced<'a, K>>where Namespaced<'a, K>: Sized,

Access this Key-Value store within a namespace. When using the returned Namespaced instance, all keys specified will be separated into their own storage designated by namespace.
§

fn set_key<S, V, 'a>(&'a self, key: S, value: &'a V) -> Builder<'a, Self, V>where S: Into<String>, V: Serialize + Send + Sync,

Sets key to value. This function returns a builder that is also a Future. Awaiting the builder will execute Command::Set with the options given.
§

fn set_binary_key<S, 'a>( &'a self, key: S, bytes: &'a [u8] ) -> Builder<'a, Self, ()>where S: Into<String>,

Sets key to bytes. This function returns a builder that is also a Future. Awaiting the builder will execute Command::Set with the options given.
§

fn set_numeric_key<S, V>(&self, key: S, value: V) -> Builder<'_, Self, ()>where S: Into<String>, V: Into<Numeric>,

Sets key to value. This stores the value as a Numeric, enabling atomic math operations to be performed on this key. This function returns a builder that is also a Future. Awaiting the builder will execute Command::Set with the options given.
§

fn increment_key_by<S, V>(&self, key: S, value: V) -> Builder<'_, Self, V>where S: Into<String> + Send + Sync, V: Into<Numeric> + TryFrom<Numeric, Error = IncompatibleTypeError> + Send + Sync,

Increments key by value. The value stored must be a Numeric, otherwise an error will be returned. The result of the increment will be the value’s type. For example, if the stored value is currently a u64, but value is a f64, the current value will be converted to an f64, and the stored value will be an f64.
§

fn decrement_key_by<S, V>(&self, key: S, value: V) -> Builder<'_, Self, V>where S: Into<String> + Send + Sync, V: Into<Numeric> + TryFrom<Numeric, Error = IncompatibleTypeError> + Send + Sync,

Decrements key by value. The value stored must be a Numeric, otherwise an error will be returned. The result of the decrement will be the value’s type. For example, if the stored value is currently a u64, but value is a f64, the current value will be converted to an f64, and the stored value will be an f64.
§

fn get_key<S>(&self, key: S) -> Builder<'_, Self>where S: Into<String>,

Gets the value stored at key. This function returns a builder that is also a Future. Awaiting the builder will execute Command::Get with the options given.
§

fn delete_key<S>(&self, key: S) -> Result<KeyStatus, Error>where S: Into<String> + Send,

Deletes the value stored at key.

Auto Trait Implementations§

§

impl<'a, K> RefUnwindSafe for Namespaced<'a, K>where K: RefUnwindSafe,

§

impl<'a, K> Send for Namespaced<'a, K>where K: Sync,

§

impl<'a, K> Sync for Namespaced<'a, K>where K: Sync,

§

impl<'a, K> Unpin for Namespaced<'a, K>

§

impl<'a, K> UnwindSafe for Namespaced<'a, K>where K: RefUnwindSafe,

Blanket Implementations§

source§

impl<T> Any for Twhere T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere T: 'a,

§

fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

§

impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere T: 'a,

§

fn implicit( self, class: Class, constructed: bool, tag: u32 ) -> TaggedParser<'a, Implicit, Self, E>

source§

impl<T> Borrow<T> for Twhere T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T> Instrument for T

source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
source§

impl<T, U> Into<U> for Twhere U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> Same<T> for T

§

type Output = T

Should always be Self
source§

impl<T, U> TryFrom<U> for Twhere U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for Twhere V: MultiLane<T>,

§

fn vzip(self) -> V

source§

impl<T> WithSubscriber for T

source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more