mirror of
https://github.com/logos-messaging/libchat.git
synced 2026-03-26 22:23:14 +00:00
clear crate names
This commit is contained in:
parent
1f481005fa
commit
5a6142cad9
7
Cargo.lock
generated
7
Cargo.lock
generated
@ -119,6 +119,13 @@ dependencies = [
|
|||||||
"zeroize",
|
"zeroize",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "client"
|
||||||
|
version = "0.1.0"
|
||||||
|
dependencies = [
|
||||||
|
"libchat",
|
||||||
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "const-oid"
|
name = "const-oid"
|
||||||
version = "0.9.6"
|
version = "0.9.6"
|
||||||
|
|||||||
11
Cargo.toml
11
Cargo.toml
@ -3,15 +3,16 @@
|
|||||||
resolver = "3"
|
resolver = "3"
|
||||||
|
|
||||||
members = [
|
members = [
|
||||||
"libchat/conversations",
|
"core_crates/conversations",
|
||||||
"libchat/crypto",
|
"core_crates/crypto",
|
||||||
"libchat/double-ratchets",
|
"core_crates/double-ratchets",
|
||||||
"libchat/storage",
|
"core_crates/storage",
|
||||||
|
"chat_crates/client",
|
||||||
]
|
]
|
||||||
|
|
||||||
[workspace.dependencies]
|
[workspace.dependencies]
|
||||||
blake2 = "0.10"
|
blake2 = "0.10"
|
||||||
storage = { path = "libchat/storage" }
|
storage = { path = "core_crates/storage" }
|
||||||
|
|
||||||
# Panicking across FFI boundaries is UB; abort is the correct strategy for a
|
# Panicking across FFI boundaries is UB; abort is the correct strategy for a
|
||||||
# C FFI library.
|
# C FFI library.
|
||||||
|
|||||||
10
chat_crates/client/Cargo.toml
Normal file
10
chat_crates/client/Cargo.toml
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
[package]
|
||||||
|
name = "client"
|
||||||
|
version = "0.1.0"
|
||||||
|
edition = "2024"
|
||||||
|
|
||||||
|
[lib]
|
||||||
|
crate-type = ["rlib"]
|
||||||
|
|
||||||
|
[dependencies]
|
||||||
|
libchat = { path = "../../core_crates/conversations" }
|
||||||
18
chat_crates/client/src/client.rs
Normal file
18
chat_crates/client/src/client.rs
Normal file
@ -0,0 +1,18 @@
|
|||||||
|
use libchat::ChatError;
|
||||||
|
use libchat::Context;
|
||||||
|
|
||||||
|
pub struct ChatClient {
|
||||||
|
ctx: Context,
|
||||||
|
}
|
||||||
|
|
||||||
|
impl ChatClient {
|
||||||
|
pub fn new(name: impl Into<String>) -> Self {
|
||||||
|
Self {
|
||||||
|
ctx: Context::new_with_name(name),
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
pub fn create_bundle(&mut self) -> Result<Vec<u8>, ChatError> {
|
||||||
|
self.ctx.create_intro_bundle()
|
||||||
|
}
|
||||||
|
}
|
||||||
3
chat_crates/client/src/lib.rs
Normal file
3
chat_crates/client/src/lib.rs
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
mod client;
|
||||||
|
|
||||||
|
pub use client::ChatClient;
|
||||||
@ -12,6 +12,8 @@ mod types;
|
|||||||
mod utils;
|
mod utils;
|
||||||
|
|
||||||
pub use api::*;
|
pub use api::*;
|
||||||
|
pub use context::{Context, Introduction};
|
||||||
|
pub use errors::ChatError;
|
||||||
|
|
||||||
#[cfg(test)]
|
#[cfg(test)]
|
||||||
mod tests {
|
mod tests {
|
||||||
Loading…
x
Reference in New Issue
Block a user