1#![allow(clippy::uninlined_format_args)]
2
3pub mod client;
5pub mod types;
7
8pub use crate::client::Client;
9
10#[derive(Debug, thiserror::Error)]
12pub enum Error {
13 #[error(transparent)]
15 Reqwest(#[from] reqwest::Error),
16
17 #[error(transparent)]
19 Json(#[from] serde_json::Error),
20
21 #[error("api error ({0})")]
23 Api(String),
24
25 #[error("invalid api response")]
27 InvalidApiResponse,
28}
29
30pub type FmlResult<T> = Result<T, Error>;
32
33#[cfg(test)]
34mod test {
35 use super::*;
36
37 const KEY: &str = include_str!("../key.txt");
38
39 #[tokio::test]
40 async fn random() {
41 let client = Client::new(KEY.into());
42 let data = client.list_random(5).await.expect("invalid list");
43 println!("{:#?}", data);
44 assert!(!data.is_empty());
45 }
46}