1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
use crate::utils;
use bytes_utils::Str;

/// The direction to move elements in a *LMOVE command.
///
/// <https://redis.io/commands/blmove>
#[derive(Clone, Debug, Eq, PartialEq)]
pub enum LMoveDirection {
  Left,
  Right,
}

impl LMoveDirection {
  pub(crate) fn to_str(&self) -> Str {
    utils::static_str(match *self {
      LMoveDirection::Left => "LEFT",
      LMoveDirection::Right => "RIGHT",
    })
  }
}

/// Location flag for the `LINSERT` command.
#[derive(Clone, Debug, Eq, PartialEq)]
pub enum ListLocation {
  Before,
  After,
}

impl ListLocation {
  pub(crate) fn to_str(&self) -> Str {
    utils::static_str(match *self {
      ListLocation::Before => "BEFORE",
      ListLocation::After => "AFTER",
    })
  }
}