Expand description
The command layer shared by kevy’s server and its embedded engine.
exec runs one command against one kevy_store::Store and writes
its RESP reply: the argv grammar, the checks, the store call and the
reply wording all live here, once. What differs between the server
and the embedded engine — locking, routing keys to shards, multi-key
coordination, where a write is recorded — stays with each of them,
and Effect tells them what the command did so they can record it.
args reads argv tokens the way Redis does and reply writes
replies with Redis’s wording, for the commands that live outside
this crate.
The stream (X*) and geo (GEO*) commands are behind the
streams-geo feature, off by default.
use kevy_verbs::{Effect, exec};
let mut store = kevy_store::Store::new();
let argv = kevy_resp::Argv::from(vec![b"HSET".to_vec(), b"h".to_vec(), b"f".to_vec(), b"v".to_vec()]);
let mut out = Vec::new();
assert_eq!(exec(&mut store, b"HSET", &argv, &mut out), Some(Effect::Write));
assert_eq!(out, b":1\r\n");Modules§
- aof
- What a write is recorded as, beyond the argv it was run with.
- args
- Reading argv tokens: verb case-folding, numbers, score bounds.
- cmd
- Single command bodies, for a caller that reaches one directly rather
than through
crate::exec: the server’sGET/SETfast path and its RESP3 reply shapes. - reply
- RESP replies in Redis’s shapes and words.
Structs§
- Verb
- One verb the shared layer executes.
Enums§
- Effect
- What a command did, for a caller that records writes.
Constants§
- VERBS
- Every verb
crate::execanswers, sorted by name. The stream and geo rows are there only with thestreams-geofeature.
Functions§
- exec
- Run one command against
store, appending its RESP2 reply toout. - is_
streams_ geo - Whether an uppercase verb is a stream (
X*) or geo (GEO*) verb, the familycrate::execruns only with thestreams-geofeature. The answer does not depend on the feature, so a caller that shares a build with one that turned it on can still keep the family out. - is_
write - Whether an uppercase verb in
VERBScan change the keyspace;Nonefor a verb the table does not hold. Onematchover the same rows, for a caller that asks on every command. - verb
- Look up an uppercase verb in
VERBS.