mirror of
https://github.com/logos-messaging/libchat.git
synced 2026-04-01 17:13:13 +00:00
Implement a `client` crate that wraps the `libchat` context behind a simple `ChatClient<D>` API. The delivery strategy is pluggable via a `DeliveryService` trait, with two implementations provided: - `InProcessDelivery` — shared `MessageBus` for single-process tests - `CDelivery` — C function-pointer callback for the FFI layer Add a `client-ffi` crate that exposes the client as a C API via `safer-ffi`. A `generate-headers` binary produces the companion C header. Include two runnable examples: - `examples/in-process` — Alice/Bob exchange using in-process delivery - `examples/c-ffi` — same exchange written entirely in C; smoketested under valgrind (to catch memory leaks) in CI iterates: #71
24 lines
458 B
TOML
24 lines
458 B
TOML
|
|
[workspace]
|
|
resolver = "3"
|
|
|
|
members = [
|
|
"core/conversations",
|
|
"core/crypto",
|
|
"core/double-ratchets",
|
|
"core/storage",
|
|
"crates/client",
|
|
"crates/client-ffi",
|
|
"examples/in-process",
|
|
]
|
|
|
|
[workspace.dependencies]
|
|
blake2 = "0.10"
|
|
libchat = { path = "core/conversations" }
|
|
storage = { path = "core/storage" }
|
|
|
|
# Panicking across FFI boundaries is UB; abort is the correct strategy for a
|
|
# C FFI library.
|
|
[profile.release]
|
|
panic = "abort"
|