1use super::{
2 ZoeClientBlobService, ZoeClientMessageManager, ZoeClientSessionManager, ZoeClientStorage,
3};
4use crate::error::Result;
5use std::sync::Arc;
6use zoe_blob_store::BlobClient;
7use zoe_state_machine::GroupManager;
8use zoe_wire_protocol::{KeyPair, VerifyingKey};
9
10#[cfg(not(feature = "frb-api"))]
11mod file_storage;
12#[cfg(not(feature = "frb-api"))]
13mod relay;
14#[cfg(not(feature = "frb-api"))]
15mod secret;
16
17#[cfg(feature = "frb-api")]
19pub mod file_storage;
20#[cfg(feature = "frb-api")]
21pub mod relay;
22#[cfg(feature = "frb-api")]
23pub mod secret;
24
25pub use super::Client;
26
27#[cfg(feature = "frb-api")]
28use flutter_rust_bridge::frb;
29
30#[cfg_attr(feature = "frb-api", frb)]
31impl Client {
33 pub fn client_secret_hex(&self) -> Result<String> {
34 self.client_secret.to_hex()
35 }
36
37 pub fn id_hex(&self) -> String {
38 hex::encode(self.client_secret.inner_keypair.id())
39 }
40
41 pub fn session_manager(&self) -> Arc<ZoeClientSessionManager> {
51 self.session_manager.clone()
52 }
53
54 pub fn group_manager(&self) -> GroupManager {
55 self.session_manager.group_manager()
56 }
57}
58
59#[cfg_attr(feature = "frb-api", frb(ignore))]
60impl Client {
61 pub fn message_manager(&self) -> &Arc<ZoeClientMessageManager> {
63 &self.message_manager
64 }
65
66 pub fn blob_service(&self) -> &Arc<ZoeClientBlobService> {
68 &self.blob_service
69 }
70
71 pub fn storage(&self) -> &Arc<ZoeClientStorage> {
73 &self.storage
74 }
75
76 pub fn public_key(&self) -> VerifyingKey {
78 self.client_secret.inner_keypair.public_key()
79 }
80
81 pub fn keypair(&self) -> &Arc<KeyPair> {
83 &self.client_secret.inner_keypair
84 }
85 pub fn blob_client(&self) -> &BlobClient {
94 self.fs.blob_client()
95 }
96}