Enum kinetic::commands::Delete
[−]
[src]
pub enum Delete { Versioned { key: Vec<u8>, version: Vec<u8>, }, Forced { key: Vec<u8>, }, }
Deletes the key
There are two kinds of delete operations: Versioned
and Forced
.
A Versioned
delete will delete the key only if the version matches
while a Forced
delete will delete the key without doing a version check.
Return value
Deleting a key will return Ok()
if the key was deleted or an Err(...)
if
it failed to find the key or match the version.
Examples
Deleting a specific version
use kinetic::Client; use kinetic::commands::Delete; let c = Client::new("127.0.0.1:8123").unwrap(); c.send(Delete::Versioned { key: "hello".as_bytes().to_vec(), version: "1.0.0".as_bytes().to_vec() }).unwrap();
Forcing a delete
use kinetic::Client; use kinetic::commands::Delete; let c = Client::new("127.0.0.1:8123").unwrap(); c.send(Delete::Forced { key: "hello".as_bytes().to_vec() }).unwrap();
Performance notes
A Forced
delete will perform faster on certaing devices given that
it does not require a metadata version check.
Variants
Versioned | Fields
| ||||
Forced | Fields
|