Struct cadre::client::CadreClient
source · pub struct CadreClient { /* private fields */ }
Expand description
An asynchronous client for the configuration store.
Implementations
sourceimpl CadreClient
impl CadreClient
sourcepub fn new(origin: &str, secret: &str) -> Self
pub fn new(origin: &str, secret: &str) -> Self
Create a new client object pointing at a given HTTP origin.
sourcepub async fn read_template(&self, env: &str) -> Result<Value>
pub async fn read_template(&self, env: &str) -> Result<Value>
Fetch the raw JSON source for a template.
sourcepub async fn write_template(&self, env: &str, template: &Value) -> Result<()>
pub async fn write_template(&self, env: &str, template: &Value) -> Result<()>
Write the value for a template.
sourcepub async fn load_config(&self, env: &str) -> Result<Value>
pub async fn load_config(&self, env: &str) -> Result<Value>
Read a populated configuration with templated and default values.
sourcepub async fn list_configs(&self) -> Result<Vec<String>>
pub async fn list_configs(&self) -> Result<Vec<String>>
List all available configuration environment names.
Trait Implementations
sourceimpl Clone for CadreClient
impl Clone for CadreClient
sourcefn clone(&self) -> CadreClient
fn clone(&self) -> CadreClient
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreAuto Trait Implementations
impl !RefUnwindSafe for CadreClient
impl Send for CadreClient
impl Sync for CadreClient
impl Unpin for CadreClient
impl !UnwindSafe for CadreClient
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more