booru/lib.rs
1#![doc = include_str!("../README.md")]
2
3//! ### Get by page
4//!
5//! ```
6//! use booru::{danbooru::DanbooruClient, Client};
7//!
8//! #[tokio::main]
9//! async fn main() {
10//! let posts = DanbooruClient::builder()
11//! .tag("kafuu_chino")
12//! .limit(5)
13//! .build()
14//! .get_by_page(2)
15//! .await
16//! .expect("There was an error retrieving posts from the API");
17//!
18//! println!("{:?}", posts);
19//! }
20//! ```
21
22//! ### Get by popular
23//!
24//! ```
25//! use booru::{danbooru::DanbooruClient, Client};
26//!
27//! #[tokio::main]
28//! async fn main() {
29//! let posts = DanbooruClient::builder()
30//! .limit(5)
31//! .build()
32//! .get_popular()
33//! .await
34//! .expect("There was an error retrieving posts from the API");
35//!
36//! println!("{:?}", posts);
37//! }
38//! ```
39
40//! ### Get Autocomplete
41//!
42//! ```rust
43#![doc = include_str!("../examples/get_autocomplete.rs")]
44//! ```
45
46pub mod client;
47pub mod model;
48
49// Conveience
50pub use client::{
51 Client,
52 generic::{AutoCompleteItem, Sort},
53};
54
55pub mod safebooru {
56 pub use crate::client::safebooru::*;
57 pub use crate::model::safebooru::*;
58}
59
60pub mod gelbooru {
61 pub use crate::client::gelbooru::*;
62 pub use crate::model::gelbooru::*;
63}
64
65pub mod danbooru {
66 pub use crate::client::danbooru::*;
67 pub use crate::model::danbooru::*;
68}
69
70pub mod rule34 {
71 pub use crate::client::rule34::*;
72 pub use crate::model::rule34::*;
73}