plausible_rs/
plausible_analytics.rs1use reqwest::Client;
2
3pub const BASE_URL: &str = "https://plausible.io";
4
5#[derive(Debug, Clone)]
7pub struct Plausible {
8 pub(crate) client: Client,
9 pub(crate) base_url: String,
10}
11
12impl Plausible {
13 #[must_use]
18 pub fn new() -> Self {
19 Self {
20 client: Client::new(),
21 base_url: BASE_URL.to_string(),
22 }
23 }
24
25 #[must_use]
27 pub fn new_with_client(client: Client) -> Self {
28 Self {
29 client,
30 base_url: BASE_URL.to_string(),
31 }
32 }
33}
34
35impl Default for Plausible {
36 fn default() -> Self {
38 Self::new()
39 }
40}