Skip to main content

Crate kevy_client

Crate kevy_client 

Source
Expand description

kevy-client — unified KV facade so downstream code can switch between in-process embedded and TCP-server backends with one URL string.

use kevy_client::Connection;

// Same business code regardless of backend:
let mut conn = Connection::open(std::env::var("MY_KEVY_URL").unwrap().as_str())?;
conn.set(b"hello", b"world")?;
assert_eq!(conn.get(b"hello")?, Some(b"world".to_vec()));

URL schemes:

  • mem:// — in-process embedded, in-memory only
  • file:///abs/path / file://./rel/path — in-process embedded with persistence
  • kevy://host[:port][/db] — TCP RESP, kevy-native scheme
  • redis://host[:port][/db] — TCP RESP, standard Redis URL (alias)
  • tcp://host[:port] — TCP RESP, raw (no SELECT round-trip)

Auth (redis://user:pass@…) and TLS (rediss://) are rejected up front — kevy ships without either. v1.1.0 added the full string/hash/list/set/ zset + one-shot PUBLISH surface. v1.2.0 added the pub/sub consumer side as a separate Subscriber type — a subscribed connection cannot send normal commands, so it needs its own socket and lives outside the Connection enum. The trait-vs-enum design decision is enum for now (closed two-backend universe); see ROADMAP for the trait extension path.

Structs§

Subscriber
One subscribed TCP connection. Owns the socket; not Sync.

Enums§

Connection
One open connection to a kevy backend, opaque about whether the backend is in-process or over TCP.
PubsubEvent
One pubsub frame received from the server.