Skip to main content

Module memcache

Module memcache 

Source
Expand description

Memcached text-protocol parser, helpers, and repair stubs.

The Memcached datastore exposes a small ASCII command grammar. The engine consumes it with a single byte-driven state machine for requests (parser::memcache_parse_req) and another for responses (parser::memcache_parse_rsp). Surrounding helpers cover command classification, multi-key fragmentation, response coalescing, and the placeholder repair surface.

§Examples

use dynomite::msg::{Msg, MsgType};
use dynomite::proto::memcache;

let mut req = Msg::new(0, MsgType::Unknown, true);
let r = memcache::memcache_parse_req(&mut req, b"get user:42\r\n");
assert_eq!(r, dynomite::msg::MsgParseResult::Ok);
assert_eq!(req.ty(), MsgType::ReqMcGet);
assert_eq!(req.keys()[0].key(), b"user:42");

Re-exports§

pub use self::coalesce::memcache_post_coalesce;
pub use self::coalesce::memcache_pre_coalesce;
pub use self::commands::memcache_arithmetic;
pub use self::commands::memcache_cas;
pub use self::commands::memcache_delete;
pub use self::commands::memcache_retrieval;
pub use self::commands::memcache_storage;
pub use self::commands::memcache_touch;
pub use self::fragment::memcache_fragment;
pub use self::fragment::FragmentDispatcher;
pub use self::fragment::FragmentOutcome;
pub use self::multikey::memcache_is_multikey_request;
pub use self::parser::memcache_parse_req;
pub use self::parser::memcache_parse_rsp;
pub use self::repair::memcache_clear_repair_md_for_key;
pub use self::repair::memcache_make_repair_query;
pub use self::repair::memcache_reconcile_responses;
pub use self::repair::memcache_rewrite_query;
pub use self::repair::memcache_rewrite_query_with_timestamp_md;
pub use self::verify::memcache_verify_request;

Modules§

coalesce
Memcached response coalescing helpers.
commands
Memcached command classification helpers.
fragment
Memcached request fragmenter.
multikey
Memcached multi-key request classification.
parser
Memcached text-protocol parser.
repair
Memcached repair surface.
verify
Memcached request verification helper.