Struct fluvio::config::Config[][src]

pub struct Config {
    pub profile: HashMap<String, Profile>,
    pub cluster: HashMap<String, FluvioConfig>,
    // some fields omitted
}

Fields

profile: HashMap<String, Profile>cluster: HashMap<String, FluvioConfig>

Implementations

create new config with a single local cluster

add new cluster

current profile

set current profile, if profile doesn’t exists return false

delete profile

Deletes the named cluster, whether it is being used or not.

You may want to check if the named cluster is active or not using delete_cluster_check. Otherwise, you may remove a cluster that is being used by the active profile.

Example

let mut config = Config::new();
let cluster = FluvioConfig::new("https://cloud.fluvio.io".to_string());
config.add_cluster(cluster, "fluvio-cloud".to_string());
let profile = Profile::new("fluvio-cloud".to_string());
config.add_profile(profile, "fluvio-cloud".to_string());

config.delete_cluster("fluvio-cloud").unwrap();
assert!(config.cluster("fluvio-cloud").is_none());

Checks whether it’s safe to delete the named cluster

If there are any profiles that reference the named cluster, they are considered conflicts and the cluster is unsafe to delete. When conflicts exist, the conflicting profile names are returned in the Err() return value.

If there are no profile conflicts, this returns with Ok(()).

Example

let mut config = Config::new();
let cluster = FluvioConfig::new("https://cloud.fluvio.io".to_string());
config.add_cluster(cluster, "fluvio-cloud".to_string());
let profile = Profile::new("fluvio-cloud".to_string());
config.add_profile(profile, "fluvio-cloud".to_string());

let conflicts = config.delete_cluster_check("fluvio-cloud").unwrap_err();
assert_eq!(conflicts, vec!["fluvio-cloud"]);

Returns a reference to the current Profile if there is one.

Returns a mutable reference to the current Profile if there is one.

Returns the FluvioConfig belonging to the current profile.

Returns the FluvioConfig belonging to the named profile.

Returns a reference to the named FluvioConfig.

Returns a mutable reference to the named FluvioConfig.

look up replica config this will iterate and find all configuration that can resolve config

  1. match all config that matches criteria including asterik
  2. apply in terms of precedent

Trait Implementations

Formats the value using the given formatter. Read more

Returns the “default value” for a type. Read more

Deserialize this value from the given Serde deserializer. Read more

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

Serialize this value into the given Serde serializer. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more

Instruments this type with the current Span, returning an Instrumented wrapper. Read more

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more

Instruments this type with the current Span, returning an Instrumented wrapper. Read more

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more