20 releases

Uses new Rust 2024

0.8.0 Mar 26, 2026
0.7.4 Feb 21, 2026
0.6.3 Jun 6, 2025

#423 in Asynchronous

MIT license

1MB
4.5K SLoC

Minimal Rust client for Memcached

ci crates.io docs.rs

This crate provides working with memcached server. All methods implemented. Available TCP/Unix/UDP/TLS connections.

  • [Connection] is a Enum that represents a connection to memcached server.
  • [Pipeline] is a structure that represents a pipeline of memcached commands.
  • [WatchStream] is a structure that represents a stream of watch events.
  • [Pool] is a structure that represents a pool of connections.
  • [ClientCrc32] is a structure that represents a Cluster connections with ModN hashing.
  • [ClientHashRing] is a structure that represents a Cluster connections with Ring hashing.
  • [ClientRendezvous] is a structure that represents a Cluster connections with Rendezvous hashing.

smol-runtime feature by default

mcmc-rs = "0.8.0"

tokio-runtime feature by flag

mcmc-rs = { version = "0.8.0", default-features = false, features = ["tokio-runtime"] }

Examples

use smol::{block_on, io};

use mcmc_rs::Connection;

fn main() -> io::Result<()> {
    block_on(async {
        let mut conn = Connection::default().await?;
        conn.set(b"key", 0, 0, false, b"value").await?;
        let item = conn.get(b"key").await?.unwrap();
        println!("{item:#?}");
        Ok(())
    })
}
  • There's a lot more in the [examples] directory.

Tests

docker compose up
bash chmod_unix.bash
cargo test
docker compose down

Benchmarks

cargo bench

Test coverage

cargo llvm-cov

Mutation testing

cargo mutants

Quality code

debtmap analyze .

Formatting doc tests

cargo fmt -- --config format_code_in_doc_comments=true

Fuzzing test

cargo fuzz run fuzz_target_1

Dependencies

~5–13MB
~237K SLoC