ServerInterface

Trait ServerInterface 

Source
pub trait ServerInterface: ClientLike {
    // Provided methods
    fn bgrewriteaof<R>(&self) -> impl Future<Output = FredResult<R>> + Send
       where R: FromValue { ... }
    fn bgsave<R>(&self) -> impl Future<Output = FredResult<R>> + Send
       where R: FromValue { ... }
    fn dbsize<R>(&self) -> impl Future<Output = FredResult<R>> + Send
       where R: FromValue { ... }
    fn select<I>(&self, index: I) -> impl Future<Output = FredResult<()>> + Send
       where I: TryInto<Value> + Send,
             I::Error: Into<Error> + Send { ... }
    fn failover(
        &self,
        to: Option<(String, u16)>,
        force: bool,
        abort: bool,
        timeout: Option<u32>,
    ) -> impl Future<Output = FredResult<()>> + Send { ... }
    fn lastsave<R>(&self) -> impl Future<Output = FredResult<R>> + Send
       where R: FromValue { ... }
    fn wait<R>(
        &self,
        numreplicas: i64,
        timeout: i64,
    ) -> impl Future<Output = Result<R, Error>> + Send
       where R: FromValue { ... }
    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 = FredResult<R>> + Send
where R: FromValue,

Instruct Redis to start an Append Only File rewrite process.

https://redis.io/commands/bgrewriteaof

Source

fn bgsave<R>(&self) -> impl Future<Output = FredResult<R>> + Send
where R: FromValue,

Save the DB in background.

https://redis.io/commands/bgsave

Source

fn dbsize<R>(&self) -> impl Future<Output = FredResult<R>> + Send
where R: FromValue,

Return the number of keys in the selected database.

https://redis.io/commands/dbsize

Source

fn select<I>(&self, index: I) -> impl Future<Output = FredResult<()>> + Send
where I: TryInto<Value> + Send, I::Error: Into<Error> + Send,

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 = FredResult<()>> + Send

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 = FredResult<R>> + Send
where R: FromValue,

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, Error>> + Send
where R: FromValue,

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.

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.

Implementors§