Skip to main content

ConfigFieldBuilder

Struct ConfigFieldBuilder 

Source
pub struct ConfigFieldBuilder<T> { /* private fields */ }
Expand description

Builder state after the field name is provided.

Implementations§

Source§

impl<T> ConfigFieldBuilder<T>

Source

pub fn alias(self, alias: &str) -> Self

Adds a fallback alias.

§Parameters
  • alias - Fallback key checked after previous names.
§Returns

Updated builder.

Source

pub fn default(self, default: T) -> Self

Sets the default value used when all names are absent.

§Parameters
  • default - Default value.
§Returns

Updated builder.

Source

pub fn read_options(self, read_options: ConfigReadOptions) -> Self

Sets field-level read options.

§Parameters
  • read_options - Options that override the reader’s global options.
§Returns

Updated builder.

Source

pub fn build(self) -> ConfigField<T>

Finishes the builder.

§Returns

A field declaration ready to be passed to crate::ConfigReader::read.

Auto Trait Implementations§

§

impl<T> Freeze for ConfigFieldBuilder<T>
where T: Freeze,

§

impl<T> RefUnwindSafe for ConfigFieldBuilder<T>
where T: RefUnwindSafe,

§

impl<T> Send for ConfigFieldBuilder<T>
where T: Send,

§

impl<T> Sync for ConfigFieldBuilder<T>
where T: Sync,

§

impl<T> Unpin for ConfigFieldBuilder<T>
where T: Unpin,

§

impl<T> UnsafeUnpin for ConfigFieldBuilder<T>
where T: UnsafeUnpin,

§

impl<T> UnwindSafe for ConfigFieldBuilder<T>
where T: UnwindSafe,

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, D> IntoConfigDefault<T> for D
where D: IntoValueDefault<T>,

Source§

fn into_config_default(self) -> T

Converts this fallback value into T.
Source§

impl<T> IntoValueDefault<T> for T

Source§

fn into_value_default(self) -> T

Converts this argument into the default value.
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

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

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.