1use common::v1::types::SessionToken;
2use handler::ErasedHandler;
3use syncer::Syncer;
4
5mod handler;
6mod http;
7mod syncer;
8
9pub use handler::EventHandler;
10pub use http::Http;
11
12pub struct Client {
13 pub syncer: Syncer,
14 pub http: Http,
15}
16
17impl Client {
18 pub fn new(token: SessionToken) -> Self {
19 Self {
20 http: Http::new(token.clone()),
21 syncer: Syncer::new(token),
22 }
23 }
24
25 pub fn with_handler(self, handler: Box<dyn ErasedHandler>) -> Self {
35 Self {
36 syncer: self.syncer.with_handler(handler),
37 ..self
38 }
39 }
40}