Trait fred::interfaces::ServerInterface

source ·
pub trait ServerInterface: ClientLike {
    // Provided methods
    fn bgrewriteaof<R>(&self) -> impl Future<Output = RedisResult<R>>
       where R: FromRedis { ... }
    fn bgsave<R>(&self) -> impl Future<Output = RedisResult<R>>
       where R: FromRedis { ... }
    fn dbsize<R>(&self) -> impl Future<Output = RedisResult<R>>
       where R: FromRedis { ... }
    fn select(&self, db: u8) -> impl Future<Output = RedisResult<()>> { ... }
    fn failover(
        &self,
        to: Option<(String, u16)>,
        force: bool,
        abort: bool,
        timeout: Option<u32>,
    ) -> impl Future<Output = RedisResult<()>> { ... }
    fn lastsave<R>(&self) -> impl Future<Output = RedisResult<R>>
       where R: FromRedis { ... }
    fn wait<R>(
        &self,
        numreplicas: i64,
        timeout: i64,
    ) -> impl Future<Output = Result<R, RedisError>>
       where R: FromRedis { ... }
    fn sentinel_primary(&self) -> Option<Server> { ... }
    fn sentinel_nodes(&self) -> Option<Vec<Server>> { ... }
}
Available on crate feature i-server only.
Expand description

Functions that implement the server interface.

Provided Methods§

source

fn bgrewriteaof<R>(&self) -> impl Future<Output = RedisResult<R>>
where R: FromRedis,

Instruct Redis to start an Append Only File rewrite process.

https://redis.io/commands/bgrewriteaof

source

fn bgsave<R>(&self) -> impl Future<Output = RedisResult<R>>
where R: FromRedis,

Save the DB in background.

https://redis.io/commands/bgsave

source

fn dbsize<R>(&self) -> impl Future<Output = RedisResult<R>>
where R: FromRedis,

Return the number of keys in the selected database.

https://redis.io/commands/dbsize

source

fn select(&self, db: u8) -> impl Future<Output = RedisResult<()>>

Select the database this client should use.

https://redis.io/commands/select

source

fn failover( &self, to: Option<(String, u16)>, force: bool, abort: bool, timeout: Option<u32>, ) -> impl Future<Output = RedisResult<()>>

This command will start a coordinated failover between the currently-connected-to master and one of its replicas.

https://redis.io/commands/failover

source

fn lastsave<R>(&self) -> impl Future<Output = RedisResult<R>>
where R: FromRedis,

Return the UNIX TIME of the last DB save executed with success.

https://redis.io/commands/lastsave

source

fn wait<R>( &self, numreplicas: i64, timeout: i64, ) -> impl Future<Output = Result<R, RedisError>>
where R: FromRedis,

This command blocks the current client until all the previous write commands are successfully transferred and acknowledged by at least the specified number of replicas. If the timeout, specified in milliseconds, is reached, the command returns even if the specified number of replicas were not yet reached.

https://redis.io/commands/wait/

source

fn sentinel_primary(&self) -> Option<Server>

Read the primary Redis server identifier returned from the sentinel nodes.

source

fn sentinel_nodes(&self) -> Option<Vec<Server>>

Read the set of known sentinel nodes.

Object Safety§

This trait is not object safe.

Implementors§