pub struct Storage { /* private fields */ }Trait Implementations§
Source§impl KV for Storage
impl KV for Storage
Source§fn get<'life0, 'async_trait, T>(
&'life0 self,
ctx: Context,
key: String,
) -> Pin<Box<dyn Future<Output = Result<T>> + Send + 'async_trait>>where
T: Deserialize<'static> + Send + 'async_trait,
Self: 'async_trait,
'life0: 'async_trait,
fn get<'life0, 'async_trait, T>(
&'life0 self,
ctx: Context,
key: String,
) -> Pin<Box<dyn Future<Output = Result<T>> + Send + 'async_trait>>where
T: Deserialize<'static> + Send + 'async_trait,
Self: 'async_trait,
'life0: 'async_trait,
Get returns the value for a given key in the key/value store.
Returns an RPCError error with a KeyDoesNotExist code if the key does not exist.
Source§fn put<'life0, 'async_trait, T>(
&'life0 self,
ctx: Context,
key: String,
value: T,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
fn put<'life0, 'async_trait, T>( &'life0 self, ctx: Context, key: String, value: T, ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
Put overwrites the value for a given key in the key/value store.
Source§fn cas<'life0, 'async_trait, T>(
&'life0 self,
ctx: Context,
key: String,
from: T,
to: T,
put: bool,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
T: Serialize + Deserialize<'static> + Send + 'async_trait,
Self: 'async_trait,
'life0: 'async_trait,
fn cas<'life0, 'async_trait, T>(
&'life0 self,
ctx: Context,
key: String,
from: T,
to: T,
put: bool,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
T: Serialize + Deserialize<'static> + Send + 'async_trait,
Self: 'async_trait,
'life0: 'async_trait,
CAS updates the value for a key if its current value matches the
previous value. Creates the key if it is not exist is requested. Read more
Auto Trait Implementations§
impl Freeze for Storage
impl !RefUnwindSafe for Storage
impl Send for Storage
impl Sync for Storage
impl Unpin for Storage
impl !UnwindSafe for Storage
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