Skip to content

Commit

Permalink
Make Direction a public enum to use with Commands like blmove (#646)
Browse files Browse the repository at this point in the history
  • Loading branch information
maospr committed Jul 4, 2022
1 parent c21c2df commit 1206f81
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
6 changes: 4 additions & 2 deletions src/commands.rs
Expand Up @@ -831,13 +831,13 @@ implement_commands! {
cmd("ZPOPMIN").arg(key).arg(count)
}

/// Removes and returns up to count members with the highest scores,
/// Removes and returns up to count members with the highest scores,
/// from the first non-empty sorted set in the provided list of key names.
fn zmpop_max<K: ToRedisArgs>(keys: &'a [K], count: isize) {
cmd("ZMPOP").arg(keys.len()).arg(keys).arg("MAX").arg("COUNT").arg(count)
}

/// Removes and returns up to count members with the lowest scores,
/// Removes and returns up to count members with the lowest scores,
/// from the first non-empty sorted set in the provided list of key names.
fn zmpop_min<K: ToRedisArgs>(keys: &'a [K], count: isize) {
cmd("ZMPOP").arg(keys.len()).arg(keys).arg("MIN").arg("COUNT").arg(count)
Expand Down Expand Up @@ -2216,7 +2216,9 @@ impl ToRedisArgs for LposOptions {

/// Enum for the LEFT | RIGHT args used by some commands
pub enum Direction {
/// Targets the first element (head) of the list
Left,
/// Targets the last element (tail) of the list
Right,
}

Expand Down
2 changes: 1 addition & 1 deletion src/lib.rs
Expand Up @@ -361,7 +361,7 @@ assert_eq!(result, Ok(("foo".to_string(), b"bar".to_vec())));
// public api
pub use crate::client::Client;
pub use crate::cmd::{cmd, pack_command, pipe, Arg, Cmd, Iter};
pub use crate::commands::{Commands, ControlFlow, LposOptions, PubSubCommands};
pub use crate::commands::{Commands, ControlFlow, Direction, LposOptions, PubSubCommands};
pub use crate::connection::{
parse_redis_url, transaction, Connection, ConnectionAddr, ConnectionInfo, ConnectionLike,
IntoConnectionInfo, Msg, PubSub, RedisConnectionInfo,
Expand Down

0 comments on commit 1206f81

Please sign in to comment.