Trait wasmcloud_runtime::capability::keyvalue::atomics::Host

source ·
pub trait Host: Send {
    // Required method
    fn increment<'life0, 'async_trait>(
        &'life0 mut self,
        bucket: Resource<Bucket>,
        key: String,
        delta: u64,
    ) -> Pin<Box<dyn Future<Output = Result<Result<u64, Error>>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
}

Required Methods§

source

fn increment<'life0, 'async_trait>( &'life0 mut self, bucket: Resource<Bucket>, key: String, delta: u64, ) -> Pin<Box<dyn Future<Output = Result<Result<u64, Error>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Atomically increment the value associated with the key in the store by the given delta. It returns the new value.

If the key does not exist in the store, it creates a new key-value pair with the value set to the given delta.

If any other error occurs, it returns an Err(error).

Implementations on Foreign Types§

source§

impl<_T: Host + ?Sized + Send> Host for &mut _T

source§

fn increment<'life0, 'async_trait>( &'life0 mut self, bucket: Resource<Bucket>, key: String, delta: u64, ) -> Pin<Box<dyn Future<Output = Result<Result<u64, Error>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Atomically increment the value associated with the key in the store by the given delta. It returns the new value.

If the key does not exist in the store, it creates a new key-value pair with the value set to the given delta.

If any other error occurs, it returns an Err(error).

Implementors§