Host

Trait Host 

Source
pub trait Host: Send {
    // Required method
    fn increment(
        &mut self,
        bucket: Resource<Bucket>,
        key: String,
        delta: u64,
    ) -> impl Future<Output = Result<Result<u64, Error>>> + Send;
}

Required Methods§

Source

fn increment( &mut self, bucket: Resource<Bucket>, key: String, delta: u64, ) -> impl Future<Output = Result<Result<u64, Error>>> + Send

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).

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementations on Foreign Types§

Source§

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

Source§

fn increment( &mut self, bucket: Resource<Bucket>, key: String, delta: u64, ) -> impl Future<Output = Result<Result<u64, Error>>> + Send

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§

Source§

impl<H> Host for Ctx<H>
where H: Handler,