Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make Direction accessible to use with the LMOVE command #646

Merged
merged 2 commits into from Jul 4, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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