#[non_exhaustive]pub struct Config {
pub base_url: String,
pub account: Option<String>,
pub cache_dir: PathBuf,
pub cache_enabled: bool,
}Expand description
What a client needs to know before it can talk to Fizzy.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.base_url: StringThe API origin: https://fizzy.do, or a Fizzy running on this machine.
account: Option<String>The account most calls are scoped to, when there is a usual one.
cache_dir: PathBufWhere the response cache keeps its files.
cache_enabled: boolWhether reads are cached by ETag.
Implementations§
Source§impl Config
impl Config
Sourcepub fn with_env(self) -> Config
pub fn with_env(self) -> Config
Lets FIZZY_API_URL, FIZZY_ACCOUNT, FIZZY_CACHE_DIR and FIZZY_CACHE_ENABLED
override whatever is set, the same variables the Go SDK reads. An empty variable
counts as unset.
Sourcepub fn with_base_url(self, base_url: impl Into<String>) -> Config
pub fn with_base_url(self, base_url: impl Into<String>) -> Config
Points the client somewhere other than https://fizzy.do.
Sourcepub fn with_account(self, account: impl Into<String>) -> Config
pub fn with_account(self, account: impl Into<String>) -> Config
Names the usual account.
Sourcepub fn with_cache_enabled(self, enabled: bool) -> Config
pub fn with_cache_enabled(self, enabled: bool) -> Config
Turns the ETag cache on or off.
Sourcepub fn with_cache_dir(self, cache_dir: impl Into<PathBuf>) -> Config
pub fn with_cache_dir(self, cache_dir: impl Into<PathBuf>) -> Config
Moves the cache directory.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Config
impl<'de> Deserialize<'de> for Config
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
impl Eq for Config
impl StructuralPartialEq for Config
Auto Trait Implementations§
impl Freeze for Config
impl RefUnwindSafe for Config
impl Send for Config
impl Sync for Config
impl Unpin for Config
impl UnsafeUnpin for Config
impl UnwindSafe for Config
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.