pub struct Config {
pub api_url: String,
pub api_timeout: u64,
pub api_version: ApiVersion,
}
Fields§
§api_url: String
§api_timeout: u64
§api_version: ApiVersion
Implementations§
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
Source§impl FromStr for Config
Load a Configuraiton from a str.
impl FromStr for Config
Load a Configuraiton from a str.
This function will create new Config struct with, the values from the str given.
§Example
use std::str::FromStr;
use carbone_sdk_rust::config::Config;
use carbone_sdk_rust::errors::CarboneError;
fn main() -> Result<(), CarboneError> {
let config = Config::from_str(r#"{
"apiUrl": "http://127.0.0.1",
"apiTimeout": 4,
"apiVersion" : "4"
}"#)?;
Ok(())
}
Source§impl<'v_a> ValidateArgs<'v_a> for Config
impl<'v_a> ValidateArgs<'v_a> for Config
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 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,
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.