[][src]Struct azure_app_configuration::client::AzureAppConfigClient

pub struct AzureAppConfigClient { /* fields omitted */ }

Methods

impl AzureAppConfigClient[src]

pub fn new<S: Into<String>>(
    uri_endpoint: S,
    access_key: S,
    secret: S
) -> AzureAppConfigClient
[src]

Creates a new instance of Azure App Configuration Client

Arguments

  • uri_endpoint - Your Azure App Configuration service url
  • access_key - Azure provided access_key
  • secret - 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]

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]

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]

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]

Set the target key with the desired value, label, tags and content-type

Arguments

  • key - Key name to be set
  • value - Key value
  • label - Key label (SearchLabel::All for no label and SearchLabel::For("label") to stablish label
  • tags - HashMap<String,String> collection of key value associated tags
  • content_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]

Get key value

Arguments

  • key - Key name to be set
  • label - 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]

Remove target key value from Azure App Configuration service

Arguments

  • key - Key to be deleted
  • label - 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

Blanket Implementations

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> From<T> for T[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Same<T> for T

type Output = T

Should always be Self