Struct fluvio_cluster::SysConfigBuilder[][src]

pub struct SysConfigBuilder { /* fields omitted */ }

Builder for SysConfig.

Implementations

impl SysConfigBuilder[src]

pub fn cloud<VALUE: Into<String>>(&mut self, value: VALUE) -> &mut Self[src]

The type of cloud infrastructure the cluster will be running on

Example

builder.cloud("minikube");

pub fn namespace<VALUE: Into<String>>(&mut self, value: VALUE) -> &mut Self[src]

The namespace in which to install the system chart

Example

builder.namespace("fluvio");

pub fn chart_location(&mut self, value: ChartLocation) -> &mut Self[src]

The location at which to find the system chart to install

pub fn chart_version<VALUE: Into<String>>(&mut self, value: VALUE) -> &mut Self[src]

The version of the system chart to install (REQUIRED).

Example

builder.chart_version("0.6.1");

impl SysConfigBuilder[src]

pub fn build(&self) -> Result<SysConfig, SysInstallError>[src]

Validates all builder options and constructs a SysConfig

pub fn local_chart<P: Into<PathBuf>>(&mut self, path: P) -> &mut Self[src]

The local chart location to install sys charts from

Example

builder.local_chart("./helm/fluvio-sys");

pub fn remote_chart<S: Into<String>>(&mut self, location: S) -> &mut Self[src]

The remote chart location to install sys charts from

Example

builder.remote_chart("https://charts.fluvio.io");

pub fn with<F>(&mut self, f: F) -> &mut Self where
    F: Fn(&mut Self) -> &mut Self, 
[src]

A builder helper for conditionally setting options

This is useful for maintaining a fluid call chain even when we only want to set certain options conditionally and the conditions are more complicated than a simple boolean.

Example

enum NamespaceCandidate {
    UserGiven(String),
    System,
    Default,
}
fn make_config(ns: NamespaceCandidate) -> Result<SysConfig, SysInstallError> {
    let config = SysConfig::builder("0.7.0-alpha.1")
        .with(|builder| match &ns {
            NamespaceCandidate::UserGiven(user) => builder.namespace(user),
            NamespaceCandidate::System => builder.namespace("system"),
            NamespaceCandidate::Default => builder,
        })
        .build()?;
    Ok(config)
}

pub fn with_if<F>(&mut self, cond: bool, f: F) -> &mut Self where
    F: Fn(&mut Self) -> &mut Self, 
[src]

A builder helper for conditionally setting options

This is useful for maintaining a builder call chain even when you only want to apply some options conditionally based on a boolean value.

Example

let custom_namespace = false;
let config = SysConfig::builder("0.7.0-alpha.1")
    // Custom namespace is not applied
    .with_if(custom_namespace, |builder| builder.namespace("my-namespace"))
    .build()?;

Trait Implementations

impl Clone for SysConfigBuilder[src]

impl Default for SysConfigBuilder[src]

Auto Trait Implementations

Blanket Implementations

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

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

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

impl<T> Erased for T

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

impl<T> Instrument for T[src]

impl<T> Instrument for T[src]

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

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

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<V, T> VZip<V> for T where
    V: MultiLane<T>, 

impl<T> WithSubscriber for T[src]