mirror of
https://github.com/logos-messaging/nim-ffi.git
synced 2026-06-21 16:59:30 +00:00
* rust examples: sync main.rs + tokio main.rs demoing the listener API Adds two bundled examples to the generated Rust crate: - examples/main.rs: sync flow using std::sync::mpsc to bridge a typed on_echo_fired listener into main + a wildcard add_event_listener that uses decode_event_payload::<EchoEvent>(envelope) for the matching event id. - examples/tokio_main.rs: same shape via #[tokio::main] + tokio::sync::mpsc. Bumps generateCargoToml to ship `[dev-dependencies]` with tokio's `rt-multi-thread` + `macros` features so the bundled examples can use #[tokio::main] without polluting the library's runtime profile. Run with `cargo run --example main` (set DYLD_LIBRARY_PATH=<repo> on macOS until build.rs emits an rpath). Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com> * simplify examples --------- Co-authored-by: Claude Opus 4.7 <noreply@anthropic.com>
223 lines
5.5 KiB
TOML
223 lines
5.5 KiB
TOML
# This file is automatically @generated by Cargo.
|
|
# It is not intended for manual editing.
|
|
version = 4
|
|
|
|
[[package]]
|
|
name = "cfg-if"
|
|
version = "1.0.4"
|
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
checksum = "9330f8b2ff13f34540b44e946ef35111825727b38d33286ef986142615121801"
|
|
|
|
[[package]]
|
|
name = "ciborium"
|
|
version = "0.2.2"
|
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
checksum = "42e69ffd6f0917f5c029256a24d0161db17cea3997d185db0d35926308770f0e"
|
|
dependencies = [
|
|
"ciborium-io",
|
|
"ciborium-ll",
|
|
"serde",
|
|
]
|
|
|
|
[[package]]
|
|
name = "ciborium-io"
|
|
version = "0.2.2"
|
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
checksum = "05afea1e0a06c9be33d539b876f1ce3692f4afea2cb41f740e7743225ed1c757"
|
|
|
|
[[package]]
|
|
name = "ciborium-ll"
|
|
version = "0.2.2"
|
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
checksum = "57663b653d948a338bfb3eeba9bb2fd5fcfaecb9e199e87e1eda4d9e8b240fd9"
|
|
dependencies = [
|
|
"ciborium-io",
|
|
"half",
|
|
]
|
|
|
|
[[package]]
|
|
name = "crunchy"
|
|
version = "0.2.4"
|
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
checksum = "460fbee9c2c2f33933d720630a6a0bac33ba7053db5344fac858d4b8952d77d5"
|
|
|
|
[[package]]
|
|
name = "flume"
|
|
version = "0.11.1"
|
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
checksum = "da0e4dd2a88388a1f4ccc7c9ce104604dab68d9f408dc34cd45823d5a9069095"
|
|
dependencies = [
|
|
"futures-core",
|
|
"futures-sink",
|
|
"spin",
|
|
]
|
|
|
|
[[package]]
|
|
name = "futures-core"
|
|
version = "0.3.32"
|
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
checksum = "7e3450815272ef58cec6d564423f6e755e25379b217b0bc688e295ba24df6b1d"
|
|
|
|
[[package]]
|
|
name = "futures-sink"
|
|
version = "0.3.32"
|
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
checksum = "c39754e157331b013978ec91992bde1ac089843443c49cbc7f46150b0fad0893"
|
|
|
|
[[package]]
|
|
name = "half"
|
|
version = "2.7.1"
|
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
checksum = "6ea2d84b969582b4b1864a92dc5d27cd2b77b622a8d79306834f1be5ba20d84b"
|
|
dependencies = [
|
|
"cfg-if",
|
|
"crunchy",
|
|
"zerocopy",
|
|
]
|
|
|
|
[[package]]
|
|
name = "lock_api"
|
|
version = "0.4.14"
|
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
checksum = "224399e74b87b5f3557511d98dff8b14089b3dadafcab6bb93eab67d3aace965"
|
|
dependencies = [
|
|
"scopeguard",
|
|
]
|
|
|
|
[[package]]
|
|
name = "my_timer"
|
|
version = "0.1.0"
|
|
dependencies = [
|
|
"ciborium",
|
|
"flume",
|
|
"serde",
|
|
"tokio",
|
|
]
|
|
|
|
[[package]]
|
|
name = "pin-project-lite"
|
|
version = "0.2.17"
|
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
checksum = "a89322df9ebe1c1578d689c92318e070967d1042b512afbe49518723f4e6d5cd"
|
|
|
|
[[package]]
|
|
name = "proc-macro2"
|
|
version = "1.0.106"
|
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
checksum = "8fd00f0bb2e90d81d1044c2b32617f68fcb9fa3bb7640c23e9c748e53fb30934"
|
|
dependencies = [
|
|
"unicode-ident",
|
|
]
|
|
|
|
[[package]]
|
|
name = "quote"
|
|
version = "1.0.45"
|
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
checksum = "41f2619966050689382d2b44f664f4bc593e129785a36d6ee376ddf37259b924"
|
|
dependencies = [
|
|
"proc-macro2",
|
|
]
|
|
|
|
[[package]]
|
|
name = "scopeguard"
|
|
version = "1.2.0"
|
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
checksum = "94143f37725109f92c262ed2cf5e59bce7498c01bcc1502d7b9afe439a4e9f49"
|
|
|
|
[[package]]
|
|
name = "serde"
|
|
version = "1.0.228"
|
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
checksum = "9a8e94ea7f378bd32cbbd37198a4a91436180c5bb472411e48b5ec2e2124ae9e"
|
|
dependencies = [
|
|
"serde_core",
|
|
"serde_derive",
|
|
]
|
|
|
|
[[package]]
|
|
name = "serde_core"
|
|
version = "1.0.228"
|
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
checksum = "41d385c7d4ca58e59fc732af25c3983b67ac852c1a25000afe1175de458b67ad"
|
|
dependencies = [
|
|
"serde_derive",
|
|
]
|
|
|
|
[[package]]
|
|
name = "serde_derive"
|
|
version = "1.0.228"
|
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
checksum = "d540f220d3187173da220f885ab66608367b6574e925011a9353e4badda91d79"
|
|
dependencies = [
|
|
"proc-macro2",
|
|
"quote",
|
|
"syn",
|
|
]
|
|
|
|
[[package]]
|
|
name = "spin"
|
|
version = "0.9.8"
|
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
checksum = "6980e8d7511241f8acf4aebddbb1ff938df5eebe98691418c4468d0b72a96a67"
|
|
dependencies = [
|
|
"lock_api",
|
|
]
|
|
|
|
[[package]]
|
|
name = "syn"
|
|
version = "2.0.117"
|
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
checksum = "e665b8803e7b1d2a727f4023456bbbbe74da67099c585258af0ad9c5013b9b99"
|
|
dependencies = [
|
|
"proc-macro2",
|
|
"quote",
|
|
"unicode-ident",
|
|
]
|
|
|
|
[[package]]
|
|
name = "tokio"
|
|
version = "1.52.3"
|
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
checksum = "8fc7f01b389ac15039e4dc9531aa973a135d7a4135281b12d7c1bc79fd57fffe"
|
|
dependencies = [
|
|
"pin-project-lite",
|
|
"tokio-macros",
|
|
]
|
|
|
|
[[package]]
|
|
name = "tokio-macros"
|
|
version = "2.7.0"
|
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
checksum = "385a6cb71ab9ab790c5fe8d67f1645e6c450a7ce006a33de03daa956cf70a496"
|
|
dependencies = [
|
|
"proc-macro2",
|
|
"quote",
|
|
"syn",
|
|
]
|
|
|
|
[[package]]
|
|
name = "unicode-ident"
|
|
version = "1.0.24"
|
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
checksum = "e6e4313cd5fcd3dad5cafa179702e2b244f760991f45397d14d4ebf38247da75"
|
|
|
|
[[package]]
|
|
name = "zerocopy"
|
|
version = "0.8.48"
|
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
checksum = "eed437bf9d6692032087e337407a86f04cd8d6a16a37199ed57949d415bd68e9"
|
|
dependencies = [
|
|
"zerocopy-derive",
|
|
]
|
|
|
|
[[package]]
|
|
name = "zerocopy-derive"
|
|
version = "0.8.48"
|
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
checksum = "70e3cd084b1788766f53af483dd21f93881ff30d7320490ec3ef7526d203bad4"
|
|
dependencies = [
|
|
"proc-macro2",
|
|
"quote",
|
|
"syn",
|
|
]
|