lemmy_client/utils.rs
1macro_rules! impl_marker_trait {
2 ($trait_name:ty, [$( $impler:ty ),+$(,)?]) => {
3 $(
4 impl $trait_name for $impler {}
5 )*
6 };
7}
8
9pub(crate) use impl_marker_trait;
10
11#[derive(Debug, Clone, PartialEq, Eq)]
12/// Options for instantiating a `LemmyClient`.
13pub struct ClientOptions {
14 /// Domain of the instance the client will send requests to.
15 /// ```
16 /// use lemmy_client::ClientOptions;
17 /// // ❌ You do not have to include the scheme for the domain.
18 /// let options = ClientOptions {
19 /// domain: String::from("https://lemmy.ml"),
20 /// secure: true
21 /// };
22 ///
23 /// // ✅ All you need is the domain (including subdomain, if applicaple).
24 /// let options = ClientOptions {
25 /// domain: String::from("lemmy.ml"),
26 /// secure: true
27 /// };
28 /// ```
29 pub domain: String,
30 /// If true, use HTTPS. If false, use HTTP
31 pub secure: bool,
32}