Enum pliantdb_core::kv::Command [−][src]
pub enum Command {
Set {
value: Value,
expiration: Option<Timestamp>,
keep_existing_expiration: bool,
check: Option<KeyCheck>,
return_previous_value: bool,
},
Get {
delete: bool,
},
Increment {
amount: Numeric,
saturating: bool,
},
Decrement {
amount: Numeric,
saturating: bool,
},
Delete,
}Expand description
Commands for a key-value store.
Variants
Set a key/value pair.
Show fields
Fields of Set
value: ValueThe value.
expiration: Option<Timestamp>If set, the key will be set to expire automatically.
keep_existing_expiration: boolIf true and the key already exists, the expiration will not be updated. If false and an expiration is provided, the expiration will be set.
check: Option<KeyCheck>Conditional checks for whether the key is already present or not.
return_previous_value: boolIf true and the key already exists, the existing key will be returned if overwritten.
Get the value from a key.
Show fields
Fields of Get
delete: boolRemove the key after retrieving the value.
Increment a numeric key. Returns an error if the key cannot be
deserialized to the same numeric type as amount. If saturating is
true, overflows will be prevented and the value will remain within the
numeric bounds.
Show fields
Decrement a numeric key. Returns an error if the key cannot be
deserialized to the same numeric type as amount. If saturating is
true, overflows will be prevented and the value will remain within the
numeric bounds.
Show fields
Delete a key.
Trait Implementations
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>, Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations
impl RefUnwindSafe for Commandimpl UnwindSafe for CommandBlanket Implementations
Mutably borrows from an owned value. Read more
type Output = T
type Output = TShould always be Self