1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
#![doc(
html_logo_url = "https://i.postimg.cc/3rGyjPqQ/logo.png",
html_favicon_url = "https://i.postimg.cc/3rGyjPqQ/logo.png"
)]
#![recursion_limit = "1024"]
#[doc(inline)]
pub mod client;
#[doc(inline)]
pub mod models;
#[doc(inline)]
pub mod utils;
mod error;
mod gateway;
mod http;
pub use error::PandaError;
pub use http::HttpClient;
pub use models::gateway::events;
pub type HandlerResult = Result<(), Box<dyn std::error::Error>>;
pub type Session<S> = std::sync::Arc<client::SessionData<S>>;
pub async fn new(token: impl Into<String>) -> error::Result<client::Client<()>> {
client::Client::<()>::new(token).await
}
pub async fn new_with_state<S: Sync + Send>(token: impl Into<String>, state: S) -> error::Result<client::Client<S>> {
client::Client::<S>::new_with_state(token, state).await
}