pub enum Request<'a> {
Show 14 variants
Get {
key: &'a [u8],
},
Gets {
keys: &'a [&'a [u8]],
},
Set {
key: &'a [u8],
value: &'a [u8],
flags: u32,
exptime: u32,
},
Add {
key: &'a [u8],
value: &'a [u8],
flags: u32,
exptime: u32,
},
Replace {
key: &'a [u8],
value: &'a [u8],
flags: u32,
exptime: u32,
},
Incr {
key: &'a [u8],
delta: u64,
},
Decr {
key: &'a [u8],
delta: u64,
},
Append {
key: &'a [u8],
value: &'a [u8],
},
Prepend {
key: &'a [u8],
value: &'a [u8],
},
Cas {
key: &'a [u8],
value: &'a [u8],
flags: u32,
exptime: u32,
cas_unique: u64,
},
Delete {
key: &'a [u8],
},
FlushAll,
Version,
Quit,
}Expand description
A request builder for encoding Memcache commands.
Variants§
Get
GET command: get <key>\r\n
Gets
Multi-GET command: get <key1> <key2> ...\r\n
Set
SET command: set <key> <flags> <exptime> <bytes>\r\n<data>\r\n
Add
ADD command: add <key> <flags> <exptime> <bytes>\r\n<data>\r\n
Stores the item only if the key does not already exist.
Replace
REPLACE command: replace <key> <flags> <exptime> <bytes>\r\n<data>\r\n
Stores the item only if the key already exists.
Incr
INCR command: incr <key> <delta>\r\n
Decr
DECR command: decr <key> <delta>\r\n
Append
APPEND command: append <key> 0 0 <bytes>\r\n<data>\r\n
Appends data to an existing item’s value.
Prepend
PREPEND command: prepend <key> 0 0 <bytes>\r\n<data>\r\n
Prepends data to an existing item’s value.
Cas
CAS command: cas <key> <flags> <exptime> <bytes> <cas_unique>\r\n<data>\r\n
Compare-and-swap: stores only if the CAS token matches.
Delete
DELETE command: delete <key>\r\n
FlushAll
FLUSH_ALL command: flush_all\r\n
Version
VERSION command: version\r\n
Quit
QUIT command: quit\r\n
Implementations§
Source§impl<'a> Request<'a>
impl<'a> Request<'a>
Sourcepub fn add(key: &'a [u8], value: &'a [u8]) -> AddRequest<'a>
pub fn add(key: &'a [u8], value: &'a [u8]) -> AddRequest<'a>
Create an ADD request (store only if key does not exist).
Sourcepub fn replace(key: &'a [u8], value: &'a [u8]) -> ReplaceRequest<'a>
pub fn replace(key: &'a [u8], value: &'a [u8]) -> ReplaceRequest<'a>
Create a REPLACE request (store only if key already exists).