Expand description
Blocking RESP2 client over TcpStream.
RespClient::connect opens a TCP connection (with TCP_NODELAY);
RespClient::request writes one command and blocks until exactly one
reply is parsed. Works against any RESP2 server — kevy, valkey, redis.
RespClient::from_url is the URL-string entry point and accepts
kevy:// (kevy-native alias), redis:// (standard), and tcp://
(plain host:port — no leading SELECT round-trip):
let _ = RespClient::from_url("kevy://localhost:6379")?; // alias of redis://
let _ = RespClient::from_url("kevy://localhost:6379/0")?; // also issues SELECT 0
let _ = RespClient::from_url("redis://10.0.0.5:6379")?;
let _ = RespClient::from_url("tcp://kevy.internal:6379")?;Single-threaded; one client per thread. Holds an incremental read buffer
so multi-segment replies reassemble across read calls.
Pure Rust, only deps are std + kevy_resp.
§Example
use kevy_resp_client::RespClient;
let mut c = RespClient::connect("127.0.0.1", 6379)?;
let reply = c.request(&[b"PING".to_vec()])?;
println!("{reply:?}");Structs§
- Resp
Client - A blocking RESP2 connection over
TcpStream.
Enums§
- Reply
- A parsed RESP reply (server → client) — the client-side counterpart of
the crate’s
encode_*functions (server-side encoders).