1use std::{collections::HashMap, time::Duration};
2
3#[derive(Debug, Clone)]
4#[non_exhaustive]
5pub struct BlockFrostSettings {
6 pub base_url: Option<String>,
7 pub retry_settings: RetrySettings,
8 pub headers: HashMap<String, String>,
9}
10
11impl BlockFrostSettings {
12 pub fn new() -> Self {
13 Self {
14 base_url: None,
15 retry_settings: RetrySettings::default(),
16 headers: HashMap::new(),
17 }
18 }
19}
20
21#[derive(Debug, Clone)]
22#[non_exhaustive]
23pub struct IpfsSettings {
24 pub retry_settings: RetrySettings,
25 pub headers: HashMap<String, String>,
26}
27
28impl IpfsSettings {
29 pub fn new() -> Self {
37 Self {
38 retry_settings: RetrySettings::default(),
39 headers: HashMap::new(),
40 }
41 }
42}
43
44impl Default for BlockFrostSettings {
46 fn default() -> Self {
47 Self::new()
48 }
49}
50
51impl Default for IpfsSettings {
53 fn default() -> Self {
54 Self::new()
55 }
56}
57
58#[derive(Default, Copy, Clone, Debug, PartialEq, Eq, PartialOrd, Ord, Hash)]
66pub struct RetrySettings {
67 pub amount: u64,
68 pub delay: Duration,
69}
70
71impl RetrySettings {
72 pub fn new(amount: u64, delay: Duration) -> Self {
74 Self { amount, delay }
75 }
76}