spin_world::fermyon::spin2_0_0::redis

Trait HostConnection

Source
pub trait HostConnection {
    // Required methods
    fn open<'life0, 'async_trait>(
        &'life0 mut self,
        address: String,
    ) -> Pin<Box<dyn Future<Output = Result<Resource<Connection>, Error>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn publish<'life0, 'async_trait>(
        &'life0 mut self,
        self_: Resource<Connection>,
        channel: String,
        payload: Payload,
    ) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn get<'life0, 'async_trait>(
        &'life0 mut self,
        self_: Resource<Connection>,
        key: String,
    ) -> Pin<Box<dyn Future<Output = Result<Option<Payload>, Error>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn set<'life0, 'async_trait>(
        &'life0 mut self,
        self_: Resource<Connection>,
        key: String,
        value: Payload,
    ) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn incr<'life0, 'async_trait>(
        &'life0 mut self,
        self_: Resource<Connection>,
        key: String,
    ) -> Pin<Box<dyn Future<Output = Result<i64, Error>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn del<'life0, 'async_trait>(
        &'life0 mut self,
        self_: Resource<Connection>,
        keys: Vec<String>,
    ) -> Pin<Box<dyn Future<Output = Result<u32, Error>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn sadd<'life0, 'async_trait>(
        &'life0 mut self,
        self_: Resource<Connection>,
        key: String,
        values: Vec<String>,
    ) -> Pin<Box<dyn Future<Output = Result<u32, Error>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn smembers<'life0, 'async_trait>(
        &'life0 mut self,
        self_: Resource<Connection>,
        key: String,
    ) -> Pin<Box<dyn Future<Output = Result<Vec<String>, Error>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn srem<'life0, 'async_trait>(
        &'life0 mut self,
        self_: Resource<Connection>,
        key: String,
        values: Vec<String>,
    ) -> Pin<Box<dyn Future<Output = Result<u32, Error>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn execute<'life0, 'async_trait>(
        &'life0 mut self,
        self_: Resource<Connection>,
        command: String,
        arguments: Vec<RedisParameter>,
    ) -> Pin<Box<dyn Future<Output = Result<Vec<RedisResult>, Error>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn drop<'life0, 'async_trait>(
        &'life0 mut self,
        rep: Resource<Connection>,
    ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
}

Required Methods§

Source

fn open<'life0, 'async_trait>( &'life0 mut self, address: String, ) -> Pin<Box<dyn Future<Output = Result<Resource<Connection>, Error>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Open a connection to the Redis instance at address.

Source

fn publish<'life0, 'async_trait>( &'life0 mut self, self_: Resource<Connection>, channel: String, payload: Payload, ) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Publish a Redis message to the specified channel.

Source

fn get<'life0, 'async_trait>( &'life0 mut self, self_: Resource<Connection>, key: String, ) -> Pin<Box<dyn Future<Output = Result<Option<Payload>, Error>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Get the value of a key.

Source

fn set<'life0, 'async_trait>( &'life0 mut self, self_: Resource<Connection>, key: String, value: Payload, ) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Set key to value.

If key already holds a value, it is overwritten.

Source

fn incr<'life0, 'async_trait>( &'life0 mut self, self_: Resource<Connection>, key: String, ) -> Pin<Box<dyn Future<Output = Result<i64, Error>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Increments the number stored at key by one.

If the key does not exist, it is set to 0 before performing the operation. An error::type-error is returned if the key contains a value of the wrong type or contains a string that can not be represented as integer.

Source

fn del<'life0, 'async_trait>( &'life0 mut self, self_: Resource<Connection>, keys: Vec<String>, ) -> Pin<Box<dyn Future<Output = Result<u32, Error>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Removes the specified keys.

A key is ignored if it does not exist. Returns the number of keys deleted.

Source

fn sadd<'life0, 'async_trait>( &'life0 mut self, self_: Resource<Connection>, key: String, values: Vec<String>, ) -> Pin<Box<dyn Future<Output = Result<u32, Error>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Add the specified values to the set named key, returning the number of newly-added values.

Source

fn smembers<'life0, 'async_trait>( &'life0 mut self, self_: Resource<Connection>, key: String, ) -> Pin<Box<dyn Future<Output = Result<Vec<String>, Error>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Retrieve the contents of the set named key.

Source

fn srem<'life0, 'async_trait>( &'life0 mut self, self_: Resource<Connection>, key: String, values: Vec<String>, ) -> Pin<Box<dyn Future<Output = Result<u32, Error>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Remove the specified values from the set named key, returning the number of newly-removed values.

Source

fn execute<'life0, 'async_trait>( &'life0 mut self, self_: Resource<Connection>, command: String, arguments: Vec<RedisParameter>, ) -> Pin<Box<dyn Future<Output = Result<Vec<RedisResult>, Error>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Execute an arbitrary Redis command and receive the result.

Source

fn drop<'life0, 'async_trait>( &'life0 mut self, rep: Resource<Connection>, ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Implementations on Foreign Types§

Source§

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

Source§

fn open<'life0, 'async_trait>( &'life0 mut self, address: String, ) -> Pin<Box<dyn Future<Output = Result<Resource<Connection>, Error>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Open a connection to the Redis instance at address.

Source§

fn publish<'life0, 'async_trait>( &'life0 mut self, self_: Resource<Connection>, channel: String, payload: Payload, ) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Publish a Redis message to the specified channel.

Source§

fn get<'life0, 'async_trait>( &'life0 mut self, self_: Resource<Connection>, key: String, ) -> Pin<Box<dyn Future<Output = Result<Option<Payload>, Error>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Get the value of a key.

Source§

fn set<'life0, 'async_trait>( &'life0 mut self, self_: Resource<Connection>, key: String, value: Payload, ) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Set key to value.

If key already holds a value, it is overwritten.

Source§

fn incr<'life0, 'async_trait>( &'life0 mut self, self_: Resource<Connection>, key: String, ) -> Pin<Box<dyn Future<Output = Result<i64, Error>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Increments the number stored at key by one.

If the key does not exist, it is set to 0 before performing the operation. An error::type-error is returned if the key contains a value of the wrong type or contains a string that can not be represented as integer.

Source§

fn del<'life0, 'async_trait>( &'life0 mut self, self_: Resource<Connection>, keys: Vec<String>, ) -> Pin<Box<dyn Future<Output = Result<u32, Error>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Removes the specified keys.

A key is ignored if it does not exist. Returns the number of keys deleted.

Source§

fn sadd<'life0, 'async_trait>( &'life0 mut self, self_: Resource<Connection>, key: String, values: Vec<String>, ) -> Pin<Box<dyn Future<Output = Result<u32, Error>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Add the specified values to the set named key, returning the number of newly-added values.

Source§

fn smembers<'life0, 'async_trait>( &'life0 mut self, self_: Resource<Connection>, key: String, ) -> Pin<Box<dyn Future<Output = Result<Vec<String>, Error>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Retrieve the contents of the set named key.

Source§

fn srem<'life0, 'async_trait>( &'life0 mut self, self_: Resource<Connection>, key: String, values: Vec<String>, ) -> Pin<Box<dyn Future<Output = Result<u32, Error>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Remove the specified values from the set named key, returning the number of newly-removed values.

Source§

fn execute<'life0, 'async_trait>( &'life0 mut self, self_: Resource<Connection>, command: String, arguments: Vec<RedisParameter>, ) -> Pin<Box<dyn Future<Output = Result<Vec<RedisResult>, Error>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Execute an arbitrary Redis command and receive the result.

Source§

fn drop<'life0, 'async_trait>( &'life0 mut self, rep: Resource<Connection>, ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Implementors§