From 05df56620b621a7a6760c9021b9eb8cc7c076f9c Mon Sep 17 00:00:00 2001 From: sacvenka Date: Tue, 4 Mar 2025 00:06:05 -0800 Subject: [PATCH 1/6] added client change server event --- .DS_Store | Bin 0 -> 6148 bytes src/context/server_events.rs | 35 +++++++++++++++++++++++++++++++++++ 2 files changed, 35 insertions(+) create mode 100644 .DS_Store diff --git a/.DS_Store b/.DS_Store new file mode 100644 index 0000000000000000000000000000000000000000..5008ddfcf53c02e82d7eee2e57c38e5672ef89f6 GIT binary patch literal 6148 zcmeH~Jr2S!425mzP>H1@V-^m;4Wg<&0T*E43hX&L&p$$qDprKhvt+--jT7}7np#A3 zem<@ulZcFPQ@L2!n>{z**++&mCkOWA81W14cNZlEfg7;MkzE(HCqgga^y>{tEnwC%0;vJ&^%eQ zLs35+`xjp>T0 ValkeyResult<()>] = [..]; +#[distributed_slice()] +pub static CLIENT_CHANGED_SERVER_EVENTS_LIST: [fn(&Context, ClientChangeSubevent)] = [..]; + extern "C" fn cron_callback( ctx: *mut raw::RedisModuleCtx, _eid: raw::RedisModuleEvent, @@ -146,6 +156,25 @@ extern "C" fn module_change_event_callback( }); } +extern "C" fn client_change_event_callback( + ctx: *mut raw::RedisModuleCtx, + _eid: raw::RedisModuleEvent, + subevent: u64, + _data: *mut ::std::os::raw::c_void, +) { + let client_change_sub_event = if subevent == raw::REDISMODULE_SUBEVENT_CLIENT_CHANGE_CONNECTED { + ClientChangeSubevent::Connected + } else { + ClientChangeSubevent::Disconnected + }; + let ctx = Context::new(ctx); + CLIENT_CHANGED_SERVER_EVENTS_LIST + .iter() + .for_each(|callback| { + callback(&ctx, client_change_sub_event); + }); +} + extern "C" fn config_change_event_callback( ctx: *mut raw::RedisModuleCtx, _eid: raw::RedisModuleEvent, @@ -225,6 +254,12 @@ pub fn register_server_events(ctx: &Context) -> Result<(), ValkeyError> { raw::REDISMODULE_EVENT_MODULE_CHANGE, Some(module_change_event_callback), )?; + register_single_server_event_type( + ctx, + &CLIENT_CHANGED_SERVER_EVENTS_LIST, + raw::REDISMODULE_EVENT_CLIENT_CHANGE, + Some(client_change_event_callback), + )?; register_single_server_event_type( ctx, &CONFIG_CHANGED_SERVER_EVENTS_LIST, From caca945a9e8ef894556bc8ca5c857c2bc6cb33fd Mon Sep 17 00:00:00 2001 From: sacvenka Date: Tue, 4 Mar 2025 10:03:29 -0800 Subject: [PATCH 2/6] added client_changed_event_handler macro Signed-off-by: sacvenka --- valkeymodule-rs-macros/src/lib.rs | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/valkeymodule-rs-macros/src/lib.rs b/valkeymodule-rs-macros/src/lib.rs index fbcd410..6f9e939 100644 --- a/valkeymodule-rs-macros/src/lib.rs +++ b/valkeymodule-rs-macros/src/lib.rs @@ -173,6 +173,28 @@ pub fn module_changed_event_handler(_attr: TokenStream, item: TokenStream) -> To gen.into() } +/// Proc macro which is set on a function that need to be called whenever a module is loaded or unloaded on the server. +/// The function must accept a [Context] and [ClientChangeSubEvent]. +/// +/// Example: +/// +/// ```rust,no_run,ignore +/// #[client_changed_event_handler] +/// fn client_changed_event_handler(ctx: &Context, values: ClientChangeSubEvent) { ... } +/// ``` +#[proc_macro_attribute] +pub fn client_changed_event_handler(_attr: TokenStream, item: TokenStream) -> TokenStream { + let ast: ItemFn = match syn::parse(item) { + Ok(res) => res, + Err(e) => return e.to_compile_error().into(), + }; + let gen = quote! { + #[linkme::distributed_slice(valkey_module::server_events::CLIENT_CHANGED_SERVER_EVENTS_LIST)] + #ast + }; + gen.into() +} + /// Proc macro which is set on a function that need to be called whenever a configuration change /// event is happening. The function must accept a [Context] and [&[&str]] that contains the names /// of the configiration values that was changed. From 7716a56f397e4e457be8cadd6835466b6d0c84a6 Mon Sep 17 00:00:00 2001 From: sacvenka Date: Wed, 5 Mar 2025 10:28:42 -0800 Subject: [PATCH 3/6] added an example for client_change_server_event Signed-off-by: sacvenka --- examples/server_events.rs | 21 ++++++- valkeymodule-rs-macros/Cargo.lock | 98 +++++++++++++++++++++++++++++++ valkeymodule-rs-macros/src/lib.rs | 2 +- 3 files changed, 118 insertions(+), 3 deletions(-) create mode 100644 valkeymodule-rs-macros/Cargo.lock diff --git a/examples/server_events.rs b/examples/server_events.rs index 5c2e38e..d949076 100644 --- a/examples/server_events.rs +++ b/examples/server_events.rs @@ -1,12 +1,14 @@ use std::sync::atomic::{AtomicI64, Ordering}; use valkey_module::alloc::ValkeyAlloc; +use valkey_module::server_events::ClientChangeSubevent; use valkey_module::{ server_events::FlushSubevent, valkey_module, Context, ValkeyResult, ValkeyString, ValkeyValue, }; -use valkey_module_macros::{config_changed_event_handler, cron_event_handler, flush_event_handler}; +use valkey_module_macros::{client_changed_event_handler, config_changed_event_handler, cron_event_handler, flush_event_handler}; static NUM_FLUSHES: AtomicI64 = AtomicI64::new(0); +static NUM_CONNECTS: AtomicI64 = AtomicI64::new(0); static NUM_CRONS: AtomicI64 = AtomicI64::new(0); static NUM_MAX_MEMORY_CONFIGURATION_CHANGES: AtomicI64 = AtomicI64::new(0); @@ -30,6 +32,21 @@ fn cron_event_handler(_ctx: &Context, _hz: u64) { NUM_CRONS.fetch_add(1, Ordering::SeqCst); } +#[client_changed_event_handler] +fn client_changed_event_handler(ctx: &Context, client_event: ClientChangeSubevent){ + if let ClientChangeSubevent::Connected = client_event { + let id = ctx.get_client_id(); + let current_user = ctx.get_current_user(); + let username = ctx.get_client_username(); + + ctx.log_notice(&format!("id: {}", id)); + ctx.log_notice(&format!("current_user: {}", current_user)); + ctx.log_notice(&format!("username: {}", username)); + + NUM_CONNECTS.fetch_add(1, Ordering::SeqCst); + } +} + fn num_flushed(_ctx: &Context, _args: Vec) -> ValkeyResult { Ok(ValkeyValue::Integer(NUM_FLUSHES.load(Ordering::SeqCst))) } @@ -55,5 +72,5 @@ valkey_module! { ["num_flushed", num_flushed, "readonly", 0, 0, 0], ["num_max_memory_changes", num_maxmemory_changes, "readonly", 0, 0, 0], ["num_crons", num_crons, "readonly", 0, 0, 0], - ], + ] } diff --git a/valkeymodule-rs-macros/Cargo.lock b/valkeymodule-rs-macros/Cargo.lock new file mode 100644 index 0000000..40bba11 --- /dev/null +++ b/valkeymodule-rs-macros/Cargo.lock @@ -0,0 +1,98 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +version = 4 + +[[package]] +name = "bitflags" +version = "1.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" + +[[package]] +name = "proc-macro2" +version = "1.0.94" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a31971752e70b8b2686d7e46ec17fb38dad4051d94024c88df49b667caea9c84" +dependencies = [ + "unicode-ident", +] + +[[package]] +name = "quote" +version = "1.0.39" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c1f1914ce909e1658d9907913b4b91947430c7d9be598b15a1912935b8c04801" +dependencies = [ + "proc-macro2", +] + +[[package]] +name = "serde" +version = "1.0.218" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e8dfc9d19bdbf6d17e22319da49161d5d0108e4188e8b680aef6299eed22df60" +dependencies = [ + "serde_derive", +] + +[[package]] +name = "serde_derive" +version = "1.0.218" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f09503e191f4e797cb8aac08e9a4a4695c5edf6a2e70e376d961ddd5c969f82b" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.99", +] + +[[package]] +name = "serde_syn" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0e0ca8adcbd02c69d24859f7f0c54ede988e4509c8767c8a3185ec0eb158281c" +dependencies = [ + "bitflags", + "proc-macro2", + "serde", + "syn 1.0.109", +] + +[[package]] +name = "syn" +version = "1.0.109" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "72b64191b275b66ffe2469e8af2c1cfe3bafa67b529ead792a6d0160888b4237" +dependencies = [ + "proc-macro2", + "quote", + "unicode-ident", +] + +[[package]] +name = "syn" +version = "2.0.99" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e02e925281e18ffd9d640e234264753c43edc62d64b2d4cf898f1bc5e75f3fc2" +dependencies = [ + "proc-macro2", + "quote", + "unicode-ident", +] + +[[package]] +name = "unicode-ident" +version = "1.0.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5a5f39404a5da50712a4c1eecf25e90dd62b613502b7e925fd4e4d19b5c96512" + +[[package]] +name = "valkey-module-macros" +version = "0.1.4" +dependencies = [ + "proc-macro2", + "quote", + "serde", + "serde_syn", + "syn 1.0.109", +] diff --git a/valkeymodule-rs-macros/src/lib.rs b/valkeymodule-rs-macros/src/lib.rs index 6f9e939..56b0c95 100644 --- a/valkeymodule-rs-macros/src/lib.rs +++ b/valkeymodule-rs-macros/src/lib.rs @@ -173,7 +173,7 @@ pub fn module_changed_event_handler(_attr: TokenStream, item: TokenStream) -> To gen.into() } -/// Proc macro which is set on a function that need to be called whenever a module is loaded or unloaded on the server. +/// Proc macro which is set on a function that need to be called whenever a client connects or disconnects on the server. /// The function must accept a [Context] and [ClientChangeSubEvent]. /// /// Example: From b9d3ce5fd0e75d4fb7ada3d20ff9a50579309fb3 Mon Sep 17 00:00:00 2001 From: sacvenka Date: Wed, 5 Mar 2025 10:29:39 -0800 Subject: [PATCH 4/6] removed .DS_store Signed-off-by: sacvenka --- .DS_Store | Bin 6148 -> 0 bytes 1 file changed, 0 insertions(+), 0 deletions(-) delete mode 100644 .DS_Store diff --git a/.DS_Store b/.DS_Store deleted file mode 100644 index 5008ddfcf53c02e82d7eee2e57c38e5672ef89f6..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 6148 zcmeH~Jr2S!425mzP>H1@V-^m;4Wg<&0T*E43hX&L&p$$qDprKhvt+--jT7}7np#A3 zem<@ulZcFPQ@L2!n>{z**++&mCkOWA81W14cNZlEfg7;MkzE(HCqgga^y>{tEnwC%0;vJ&^%eQ zLs35+`xjp>T0 Date: Fri, 7 Mar 2025 09:30:39 -0800 Subject: [PATCH 5/6] added unit tests and functonality for disconnect subevent Signed-off-by: sacvenka --- examples/server_events.rs | 25 ++++++++++++++++--------- src/context/client.rs | 6 ++++++ tests/integration.rs | 5 +++++ 3 files changed, 27 insertions(+), 9 deletions(-) diff --git a/examples/server_events.rs b/examples/server_events.rs index d949076..60162c6 100644 --- a/examples/server_events.rs +++ b/examples/server_events.rs @@ -9,6 +9,7 @@ use valkey_module_macros::{client_changed_event_handler, config_changed_event_ha static NUM_FLUSHES: AtomicI64 = AtomicI64::new(0); static NUM_CONNECTS: AtomicI64 = AtomicI64::new(0); +static NUM_DISCONNECTS: AtomicI64 = AtomicI64::new(0); static NUM_CRONS: AtomicI64 = AtomicI64::new(0); static NUM_MAX_MEMORY_CONFIGURATION_CHANGES: AtomicI64 = AtomicI64::new(0); @@ -33,17 +34,13 @@ fn cron_event_handler(_ctx: &Context, _hz: u64) { } #[client_changed_event_handler] -fn client_changed_event_handler(ctx: &Context, client_event: ClientChangeSubevent){ +fn client_changed_event_handler(ctx: &Context, client_event: ClientChangeSubevent) { if let ClientChangeSubevent::Connected = client_event { - let id = ctx.get_client_id(); - let current_user = ctx.get_current_user(); - let username = ctx.get_client_username(); - - ctx.log_notice(&format!("id: {}", id)); - ctx.log_notice(&format!("current_user: {}", current_user)); - ctx.log_notice(&format!("username: {}", username)); - + ctx.log_notice(&format!("Connected")); NUM_CONNECTS.fetch_add(1, Ordering::SeqCst); + } else { + ctx.log_notice(&format!("Disconnected")); + NUM_DISCONNECTS.fetch_sub(1, Ordering::SeqCst); } } @@ -61,6 +58,14 @@ fn num_maxmemory_changes(_ctx: &Context, _args: Vec) -> ValkeyResu )) } +fn num_connects(_ctx: &Context, _args: Vec) -> ValkeyResult { + Ok(ValkeyValue::Integer(NUM_CONNECTS.load(Ordering::SeqCst))) +} + +fn num_disconnects(_ctx: &Context, _args: Vec) -> ValkeyResult { + Ok(ValkeyValue::Integer(NUM_DISCONNECTS.load(Ordering::SeqCst))) +} + ////////////////////////////////////////////////////// valkey_module! { @@ -72,5 +77,7 @@ valkey_module! { ["num_flushed", num_flushed, "readonly", 0, 0, 0], ["num_max_memory_changes", num_maxmemory_changes, "readonly", 0, 0, 0], ["num_crons", num_crons, "readonly", 0, 0, 0], + ["num_connects", num_connects, "readonly", 0, 0, 0], + ["num_disconnects", num_disconnects, "readonly", 0, 0, 0], ] } diff --git a/src/context/client.rs b/src/context/client.rs index 4c64721..79f8fd3 100644 --- a/src/context/client.rs +++ b/src/context/client.rs @@ -44,6 +44,12 @@ impl Context { ValkeyString::from_redis_module_string(self.ctx, client_username) } + pub fn get_client_username_by_id(&self, client_id: u64) -> ValkeyString { + let client_username = + unsafe { RedisModule_GetClientUserNameById.unwrap()(self.ctx, client_id) }; + ValkeyString::from_redis_module_string(self.ctx, client_username) + } + pub fn get_client_cert(&self) -> ValkeyString { let client_id = self.get_client_id(); let client_cert = unsafe { RedisModule_GetClientCertificate.unwrap()(self.ctx, client_id) }; diff --git a/tests/integration.rs b/tests/integration.rs index 779b59b..a692944 100644 --- a/tests/integration.rs +++ b/tests/integration.rs @@ -457,6 +457,10 @@ fn test_server_event() -> Result<()> { assert!(res > 0); + let res: i64 = redis::cmd("num_connects").query(&mut con)?; + + assert_eq!(res, 0); + Ok(()) } @@ -1033,3 +1037,4 @@ fn test_client() -> Result<()> { .with_context(|| "failed execute client.name")?; Ok(()) } + From c286c7c30830ba16956a4a3517c0fb4656ae2538 Mon Sep 17 00:00:00 2001 From: sacvenka Date: Fri, 7 Mar 2025 09:40:45 -0800 Subject: [PATCH 6/6] removed cargo.lock Signed-off-by: sacvenka --- Cargo.lock | 750 ----------------------------------------------------- 1 file changed, 750 deletions(-) delete mode 100644 Cargo.lock diff --git a/Cargo.lock b/Cargo.lock deleted file mode 100644 index 54e6c33..0000000 --- a/Cargo.lock +++ /dev/null @@ -1,750 +0,0 @@ -# This file is automatically @generated by Cargo. -# It is not intended for manual editing. -version = 3 - -[[package]] -name = "addr2line" -version = "0.22.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6e4503c46a5c0c7844e948c9a4d6acd9f50cccb4de1c48eb9e291ea17470c678" -dependencies = [ - "gimli", -] - -[[package]] -name = "adler" -version = "1.0.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f26201604c87b1e01bd3d98f8d5d9a8fcbb815e8cedb41ffccbeb4bf593a35fe" - -[[package]] -name = "aho-corasick" -version = "1.1.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8e60d3430d3a69478ad0993f19238d2df97c507009a52b3c10addcd7f6bcb916" -dependencies = [ - "memchr", -] - -[[package]] -name = "anyhow" -version = "1.0.95" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "34ac096ce696dc2fcabef30516bb13c0a68a11d30131d3df6f04711467681b04" - -[[package]] -name = "arc-swap" -version = "1.7.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "69f7f8c3906b62b754cd5326047894316021dcfe5a194c8ea52bdd94934a3457" - -[[package]] -name = "autocfg" -version = "1.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f1fdabc7756949593fe60f30ec81974b613357de856987752631dea1e3394c80" - -[[package]] -name = "backtrace" -version = "0.3.73" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5cc23269a4f8976d0a4d2e7109211a419fe30e8d88d677cd60b6bc79c5732e0a" -dependencies = [ - "addr2line", - "cc", - "cfg-if", - "libc", - "miniz_oxide", - "object", - "rustc-demangle", -] - -[[package]] -name = "bindgen" -version = "0.70.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f49d8fed880d473ea71efb9bf597651e77201bdd4893efe54c9e5d65ae04ce6f" -dependencies = [ - "bitflags 2.8.0", - "cexpr", - "clang-sys", - "itertools", - "log", - "prettyplease", - "proc-macro2", - "quote 1.0.36", - "regex", - "rustc-hash", - "shlex", - "syn 2.0.58", -] - -[[package]] -name = "bitflags" -version = "1.3.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" - -[[package]] -name = "bitflags" -version = "2.8.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8f68f53c83ab957f72c32642f3868eec03eb974d1fb82e453128456482613d36" - -[[package]] -name = "bytes" -version = "1.10.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f61dac84819c6588b558454b194026eb1f09c293b9036ae9b159e74e73ab6cf9" - -[[package]] -name = "cc" -version = "1.2.13" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c7777341816418c02e033934a09f20dc0ccaf65a5201ef8a450ae0105a573fda" -dependencies = [ - "shlex", -] - -[[package]] -name = "cexpr" -version = "0.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6fac387a98bb7c37292057cffc56d62ecb629900026402633ae9160df93a8766" -dependencies = [ - "nom", -] - -[[package]] -name = "cfg-if" -version = "1.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" - -[[package]] -name = "clang-sys" -version = "1.7.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "67523a3b4be3ce1989d607a828d036249522dd9c1c8de7f4dd2dae43a37369d1" -dependencies = [ - "glob", - "libc", - "libloading", -] - -[[package]] -name = "combine" -version = "4.6.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ba5a308b75df32fe02788e748662718f03fde005016435c444eea572398219fd" -dependencies = [ - "bytes", - "memchr", -] - -[[package]] -name = "either" -version = "1.10.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "11157ac094ffbdde99aa67b23417ebdd801842852b500e395a45a9c0aac03e4a" - -[[package]] -name = "enum-primitive-derive" -version = "0.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e2b90e520ec62c1864c8c78d637acbfe8baf5f63240f2fb8165b8325c07812dd" -dependencies = [ - "num-traits 0.1.43", - "quote 0.3.15", - "syn 0.11.11", -] - -[[package]] -name = "form_urlencoded" -version = "1.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e13624c2627564efccf4934284bdd98cbaa14e79b0b5a141218e507b3a823456" -dependencies = [ - "percent-encoding", -] - -[[package]] -name = "gimli" -version = "0.29.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "40ecd4077b5ae9fd2e9e169b102c6c330d0605168eb0e8bf79952b256dbefffd" - -[[package]] -name = "glob" -version = "0.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d2fabcfbdc87f4758337ca535fb41a6d701b65693ce38287d856d1674551ec9b" - -[[package]] -name = "heck" -version = "0.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2304e00983f87ffb38b55b444b5e3b60a884b5d30c0fca7d82fe33449bbe55ea" - -[[package]] -name = "idna" -version = "0.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "634d9b1461af396cad843f47fdba5597a4f9e6ddd4bfb6ff5d85028c25cb12f6" -dependencies = [ - "unicode-bidi", - "unicode-normalization", -] - -[[package]] -name = "itertools" -version = "0.13.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "413ee7dfc52ee1a4949ceeb7dbc8a33f2d6c088194d9f922fb8318faf1f01186" -dependencies = [ - "either", -] - -[[package]] -name = "itoa" -version = "1.0.11" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "49f1f14873335454500d59611f1cf4a4b0f786f9ac11f4312a78e4cf2566695b" - -[[package]] -name = "lazy_static" -version = "1.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bbd2bcb4c963f2ddae06a2efc7e9f3591312473c50c6685e1f298068316e66fe" - -[[package]] -name = "libc" -version = "0.2.169" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b5aba8db14291edd000dfcc4d620c7ebfb122c613afb886ca8803fa4e128a20a" - -[[package]] -name = "libloading" -version = "0.8.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0c2a198fb6b0eada2a8df47933734e6d35d350665a33a3593d7164fa52c75c19" -dependencies = [ - "cfg-if", - "windows-targets", -] - -[[package]] -name = "linkme" -version = "0.3.29" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "70fe496a7af8c406f877635cbf3cd6a9fac9d6f443f58691cd8afe6ce0971af4" -dependencies = [ - "linkme-impl", -] - -[[package]] -name = "linkme-impl" -version = "0.3.29" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b01f197a15988fb5b2ec0a5a9800c97e70771499c456ad757d63b3c5e9b96e75" -dependencies = [ - "proc-macro2", - "quote 1.0.36", - "syn 2.0.58", -] - -[[package]] -name = "log" -version = "0.4.25" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "04cbf5b083de1c7e0222a7a51dbfdba1cbe1c6ab0b15e29fff3f6c077fd9cd9f" - -[[package]] -name = "memchr" -version = "2.7.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6c8640c5d730cb13ebd907d8d04b52f55ac9a2eec55b440c8892f40d56c76c1d" - -[[package]] -name = "memoffset" -version = "0.7.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5de893c32cde5f383baa4c04c5d6dbdd735cfd4a794b0debdb2bb1b421da5ff4" -dependencies = [ - "autocfg", -] - -[[package]] -name = "minimal-lexical" -version = "0.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "68354c5c6bd36d73ff3feceb05efa59b6acb7626617f4962be322a825e61f79a" - -[[package]] -name = "miniz_oxide" -version = "0.7.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9d811f3e15f28568be3407c8e7fdb6514c1cda3cb30683f15b6a1a1dc4ea14a7" -dependencies = [ - "adler", -] - -[[package]] -name = "nix" -version = "0.26.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "598beaf3cc6fdd9a5dfb1630c2800c7acd31df7aaf0f565796fba2b53ca1af1b" -dependencies = [ - "bitflags 1.3.2", - "cfg-if", - "libc", - "memoffset", - "pin-utils", -] - -[[package]] -name = "nom" -version = "7.1.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d273983c5a657a70a3e8f2a01329822f3b8c8172b73826411a55751e404a0a4a" -dependencies = [ - "memchr", - "minimal-lexical", -] - -[[package]] -name = "num-bigint" -version = "0.4.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a5e44f723f1133c9deac646763579fdb3ac745e418f2a7af9cd0c431da1f20b9" -dependencies = [ - "num-integer", - "num-traits 0.2.19", -] - -[[package]] -name = "num-integer" -version = "0.1.46" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7969661fd2958a5cb096e56c8e1ad0444ac2bbcd0061bd28660485a44879858f" -dependencies = [ - "num-traits 0.2.19", -] - -[[package]] -name = "num-traits" -version = "0.1.43" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "92e5113e9fd4cc14ded8e499429f396a20f98c772a47cc8622a736e1ec843c31" -dependencies = [ - "num-traits 0.2.19", -] - -[[package]] -name = "num-traits" -version = "0.2.19" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "071dfc062690e90b734c0b2273ce72ad0ffa95f0c74596bc250dcfd960262841" -dependencies = [ - "autocfg", -] - -[[package]] -name = "object" -version = "0.36.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "576dfe1fc8f9df304abb159d767a29d0476f7750fbf8aa7ad07816004a207434" -dependencies = [ - "memchr", -] - -[[package]] -name = "percent-encoding" -version = "2.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e3148f5046208a5d56bcfc03053e3ca6334e51da8dfb19b6cdc8b306fae3283e" - -[[package]] -name = "pin-utils" -version = "0.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184" - -[[package]] -name = "prettyplease" -version = "0.2.17" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8d3928fb5db768cb86f891ff014f0144589297e3c6a1aba6ed7cecfdace270c7" -dependencies = [ - "proc-macro2", - "syn 2.0.58", -] - -[[package]] -name = "proc-macro2" -version = "1.0.79" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e835ff2298f5721608eb1a980ecaee1aef2c132bf95ecc026a11b7bf3c01c02e" -dependencies = [ - "unicode-ident", -] - -[[package]] -name = "quote" -version = "0.3.15" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7a6e920b65c65f10b2ae65c831a81a073a89edd28c7cce89475bff467ab4167a" - -[[package]] -name = "quote" -version = "1.0.36" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0fa76aaf39101c457836aec0ce2316dbdc3ab723cdda1c6bd4e6ad4208acaca7" -dependencies = [ - "proc-macro2", -] - -[[package]] -name = "redis" -version = "0.28.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e37ec3fd44bea2ec947ba6cc7634d7999a6590aca7c35827c250bc0de502bda6" -dependencies = [ - "arc-swap", - "combine", - "itoa", - "num-bigint", - "percent-encoding", - "ryu", - "sha1_smol", - "socket2", - "url", -] - -[[package]] -name = "regex" -version = "1.11.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b544ef1b4eac5dc2db33ea63606ae9ffcfac26c1416a2806ae0bf5f56b201191" -dependencies = [ - "aho-corasick", - "memchr", - "regex-automata", - "regex-syntax", -] - -[[package]] -name = "regex-automata" -version = "0.4.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "368758f23274712b504848e9d5a6f010445cc8b87a7cdb4d7cbee666c1288da3" -dependencies = [ - "aho-corasick", - "memchr", - "regex-syntax", -] - -[[package]] -name = "regex-syntax" -version = "0.8.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2b15c43186be67a4fd63bee50d0303afffcef381492ebe2c5d87f324e1b8815c" - -[[package]] -name = "rustc-demangle" -version = "0.1.24" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "719b953e2095829ee67db738b3bfa9fa368c94900df327b3f07fe6e794d2fe1f" - -[[package]] -name = "rustc-hash" -version = "1.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "08d43f7aa6b08d49f382cde6a7982047c3426db949b1424bc4b7ec9ae12c6ce2" - -[[package]] -name = "rustversion" -version = "1.0.15" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "80af6f9131f277a45a3fba6ce8e2258037bb0477a67e610d3c1fe046ab31de47" - -[[package]] -name = "ryu" -version = "1.0.17" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e86697c916019a8588c99b5fac3cead74ec0b4b819707a682fd4d23fa0ce1ba1" - -[[package]] -name = "serde" -version = "1.0.210" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c8e3592472072e6e22e0a54d5904d9febf8508f65fb8552499a1abc7d1078c3a" -dependencies = [ - "serde_derive", -] - -[[package]] -name = "serde_derive" -version = "1.0.210" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "243902eda00fad750862fc144cea25caca5e20d615af0a81bee94ca738f1df1f" -dependencies = [ - "proc-macro2", - "quote 1.0.36", - "syn 2.0.58", -] - -[[package]] -name = "serde_syn" -version = "0.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0e0ca8adcbd02c69d24859f7f0c54ede988e4509c8767c8a3185ec0eb158281c" -dependencies = [ - "bitflags 1.3.2", - "proc-macro2", - "serde", - "syn 1.0.109", -] - -[[package]] -name = "sha1_smol" -version = "1.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ae1a47186c03a32177042e55dbc5fd5aee900b8e0069a8d70fba96a9375cd012" - -[[package]] -name = "shlex" -version = "1.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0fda2ff0d084019ba4d7c6f371c95d8fd75ce3524c3cb8fb653a3023f6323e64" - -[[package]] -name = "socket2" -version = "0.5.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ce305eb0b4296696835b71df73eb912e0f1ffd2556a501fcede6e0c50349191c" -dependencies = [ - "libc", - "windows-sys", -] - -[[package]] -name = "strum_macros" -version = "0.26.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4c6bee85a5a24955dc440386795aa378cd9cf82acd5f764469152d2270e581be" -dependencies = [ - "heck", - "proc-macro2", - "quote 1.0.36", - "rustversion", - "syn 2.0.58", -] - -[[package]] -name = "syn" -version = "0.11.11" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d3b891b9015c88c576343b9b3e41c2c11a51c219ef067b264bd9c8aa9b441dad" -dependencies = [ - "quote 0.3.15", - "synom", - "unicode-xid", -] - -[[package]] -name = "syn" -version = "1.0.109" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "72b64191b275b66ffe2469e8af2c1cfe3bafa67b529ead792a6d0160888b4237" -dependencies = [ - "proc-macro2", - "quote 1.0.36", - "unicode-ident", -] - -[[package]] -name = "syn" -version = "2.0.58" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "44cfb93f38070beee36b3fef7d4f5a16f27751d94b187b666a5cc5e9b0d30687" -dependencies = [ - "proc-macro2", - "quote 1.0.36", - "unicode-ident", -] - -[[package]] -name = "synom" -version = "0.11.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a393066ed9010ebaed60b9eafa373d4b1baac186dd7e008555b0f702b51945b6" -dependencies = [ - "unicode-xid", -] - -[[package]] -name = "tinyvec" -version = "1.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "87cc5ceb3875bb20c2890005a4e226a4651264a5c75edb2421b52861a0a0cb50" -dependencies = [ - "tinyvec_macros", -] - -[[package]] -name = "tinyvec_macros" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20" - -[[package]] -name = "unicode-bidi" -version = "0.3.15" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "08f95100a766bf4f8f28f90d77e0a5461bbdb219042e7679bebe79004fed8d75" - -[[package]] -name = "unicode-ident" -version = "1.0.12" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3354b9ac3fae1ff6755cb6db53683adb661634f67557942dea4facebec0fee4b" - -[[package]] -name = "unicode-normalization" -version = "0.1.23" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a56d1686db2308d901306f92a263857ef59ea39678a5458e7cb17f01415101f5" -dependencies = [ - "tinyvec", -] - -[[package]] -name = "unicode-xid" -version = "0.0.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8c1f860d7d29cf02cb2f3f359fd35991af3d30bac52c57d265a3c461074cb4dc" - -[[package]] -name = "url" -version = "2.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "31e6302e3bb753d46e83516cae55ae196fc0c309407cf11ab35cc51a4c2a4633" -dependencies = [ - "form_urlencoded", - "idna", - "percent-encoding", -] - -[[package]] -name = "valkey-module" -version = "0.1.4" -dependencies = [ - "anyhow", - "backtrace", - "bindgen", - "bitflags 2.8.0", - "cc", - "cfg-if", - "enum-primitive-derive", - "lazy_static", - "libc", - "linkme", - "log", - "nix", - "num-traits 0.2.19", - "redis", - "regex", - "serde", - "strum_macros", - "valkey-module", - "valkey-module-macros", - "valkey-module-macros-internals", -] - -[[package]] -name = "valkey-module-macros" -version = "0.1.4" -dependencies = [ - "proc-macro2", - "quote 1.0.36", - "serde", - "serde_syn", - "syn 1.0.109", -] - -[[package]] -name = "valkey-module-macros-internals" -version = "0.1.4" -dependencies = [ - "lazy_static", - "proc-macro2", - "quote 1.0.36", - "syn 1.0.109", -] - -[[package]] -name = "windows-sys" -version = "0.52.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "282be5f36a8ce781fad8c8ae18fa3f9beff57ec1b52cb3de0789201425d9a33d" -dependencies = [ - "windows-targets", -] - -[[package]] -name = "windows-targets" -version = "0.52.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7dd37b7e5ab9018759f893a1952c9420d060016fc19a472b4bb20d1bdd694d1b" -dependencies = [ - "windows_aarch64_gnullvm", - "windows_aarch64_msvc", - "windows_i686_gnu", - "windows_i686_msvc", - "windows_x86_64_gnu", - "windows_x86_64_gnullvm", - "windows_x86_64_msvc", -] - -[[package]] -name = "windows_aarch64_gnullvm" -version = "0.52.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bcf46cf4c365c6f2d1cc93ce535f2c8b244591df96ceee75d8e83deb70a9cac9" - -[[package]] -name = "windows_aarch64_msvc" -version = "0.52.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "da9f259dd3bcf6990b55bffd094c4f7235817ba4ceebde8e6d11cd0c5633b675" - -[[package]] -name = "windows_i686_gnu" -version = "0.52.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b474d8268f99e0995f25b9f095bc7434632601028cf86590aea5c8a5cb7801d3" - -[[package]] -name = "windows_i686_msvc" -version = "0.52.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1515e9a29e5bed743cb4415a9ecf5dfca648ce85ee42e15873c3cd8610ff8e02" - -[[package]] -name = "windows_x86_64_gnu" -version = "0.52.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5eee091590e89cc02ad514ffe3ead9eb6b660aedca2183455434b93546371a03" - -[[package]] -name = "windows_x86_64_gnullvm" -version = "0.52.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "77ca79f2451b49fa9e2af39f0747fe999fcda4f5e241b2898624dca97a1f2177" - -[[package]] -name = "windows_x86_64_msvc" -version = "0.52.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "32b752e52a2da0ddfbdbcc6fceadfeede4c939ed16d13e648833a61dfb611ed8"