[−][src]Struct azure_app_configuration::client::AzureAppConfigClient
Methods
impl AzureAppConfigClient
[src]
pub fn new<S: Into<String>>(
uri_endpoint: S,
access_key: S,
secret: S
) -> AzureAppConfigClient
[src]
uri_endpoint: S,
access_key: S,
secret: S
) -> AzureAppConfigClient
Creates a new instance of Azure App Configuration Client
Arguments
uri_endpoint
- Your Azure App Configuration service urlaccess_key
- Azure provided access_keysecret
- Azure provided secret key
Examples
use azure_app_configuration::client::AzureAppConfigClient; let client = AzureAppConfigClient::new( "https://yourendpoint.azconfig.io", "access_key", "wgf9BDWeh/+Dtq8DmpsJSUpwrdgYLrXG8svE+VyM06w=");
pub async fn list_labels<'_>(
&'_ self
) -> Result<Labels, Box<dyn Error + Send + Sync + 'static>>
[src]
&'_ self
) -> Result<Labels, Box<dyn Error + Send + Sync + 'static>>
List all available labels in Azure App Configuration service
Examples
let labels = app_config_client.list_labels().await.unwrap();
for l in labels.items {
println!("{:?}", l);
}
pub async fn list_keys<'_>(
&'_ self
) -> Result<Keys, Box<dyn Error + Send + Sync + 'static>>
[src]
&'_ self
) -> Result<Keys, Box<dyn Error + Send + Sync + 'static>>
List all available keys in Azure App Configuration service
Examples
let keys = app_config_client.list_keys().await.unwrap();
for k in keys.items {
println!("{:?}", k);
}
pub async fn list_key_values<'_, '_>(
&'_ self,
label: SearchLabel<'_>
) -> Result<KeyValues, Box<dyn Error + Send + Sync + 'static>>
[src]
&'_ self,
label: SearchLabel<'_>
) -> Result<KeyValues, Box<dyn Error + Send + Sync + 'static>>
List all available key values in Azure App Configuration service
Examples
let key_values = app_config_client.list_key_values(SearchLabel::All).await;
for k in key_values {
println!("{:?}", k);
}
pub async fn set_key<'a, '_, S: Into<String>>(
&'_ self,
key: S,
value: S,
label: SearchLabel<'a>,
tags: Option<HashMap<S, S>>,
content_type: Option<S>
) -> Result<KeyValue, Box<dyn Error + Send + Sync + 'static>>
[src]
&'_ self,
key: S,
value: S,
label: SearchLabel<'a>,
tags: Option<HashMap<S, S>>,
content_type: Option<S>
) -> Result<KeyValue, Box<dyn Error + Send + Sync + 'static>>
Set the target key with the desired value, label, tags and content-type
Arguments
key
- Key name to be setvalue
- Key valuelabel
- Key label (SearchLabel::All for no label and SearchLabel::For("label") to stablish labeltags
- HashMap<String,String> collection of key value associated tagscontent_type
- Key associated content-type
Examples
use std::collections::HashMap;
use azure_app_configuration::search_label::SearchLabel;
let mut tags = HashMap::new();
tags.insert("tag1", "tagvalue1");
tags.insert("tag2", "tagvalue2");
let kv = app_config_client
.set_key(
"UseCache",
"true",
SearchLabel::For("PublicWebsite"),
Some(tags),
None,
)
.await;
println!("{:?}", kv);
pub async fn get_key_value<'_, '_, S: Into<String>>(
&'_ self,
key: S,
label: SearchLabel<'_>
) -> Result<KeyValue, Box<dyn Error + Send + Sync + 'static>>
[src]
&'_ self,
key: S,
label: SearchLabel<'_>
) -> Result<KeyValue, Box<dyn Error + Send + Sync + 'static>>
Get key value
Arguments
key
- Key name to be setlabel
- Key label (SearchLabel::All for no label and SearchLabel::For("label") to stablish label
Examples
use azure_app_configuration::search_label::SearchLabel;
let kv = app_config_client
.get_key_value("ConnectionString", SearchLabel::For("ContosoApp"))
.await;
pub async fn remove_key_value<'_, '_, S: Into<String>>(
&'_ self,
key: S,
label: SearchLabel<'_>
) -> Result<(), Box<dyn Error + Send + Sync + 'static>>
[src]
&'_ self,
key: S,
label: SearchLabel<'_>
) -> Result<(), Box<dyn Error + Send + Sync + 'static>>
Remove target key value from Azure App Configuration service
Arguments
key
- Key to be deletedlabel
- Label where the key will be found and removed, if no label is specified all labels with that key will be remove
Examples
app_config_client
.remove_key_value("EnableProxy", SearchLabel::For("ApplicationLabel"))
.await
.unwrap(); ///
pub fn endpoint_uri(&self) -> String
[src]
Auto Trait Implementations
impl Send for AzureAppConfigClient
impl Unpin for AzureAppConfigClient
impl Sync for AzureAppConfigClient
impl UnwindSafe for AzureAppConfigClient
impl RefUnwindSafe for AzureAppConfigClient
Blanket Implementations
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> From<T> for T
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Same<T> for T
type Output = T
Should always be Self