pub struct SetCommitWithValue<'a, S, U, T>where
    S: Set,
    U: Infer + 'static,
    T: ErasedTy,
    U::Val: RawValParser,
    SetCfg<S>: ConfigValue + Default,{ /* private fields */ }
Expand description

Create option using given configurations.

Implementations§

source§

impl<'a, S, U, T> SetCommitWithValue<'a, S, U, T>where S: Set, U: Infer + 'static, T: ErasedTy, U::Val: RawValParser, SetCfg<S>: ConfigValue + Default,

source

pub fn new(inner: SetCommit<'a, S, U>) -> Self

source

pub fn inner(&self) -> Result<&SetCommit<'a, S, U>, Error>

source

pub fn inner_mut(&mut self) -> Result<&mut SetCommit<'a, S, U>, Error>

source

pub fn set_infer<O: Infer>(self) -> SetCommitWithValue<'a, S, O, T>where O::Val: RawValParser,

Set the infer type of option.

source

pub fn run(self) -> Result<Uid, Error>

Run the commit.

It create an option using given type Ctor. And add it to referenced Set, return the new option Uid.

source§

impl<'a, S, U, T> SetCommitWithValue<'a, S, U, T>where S: Set, U: Infer + 'static, U::Val: RawValParser, T: ErasedTy + RawValParser, SetCfg<S>: ConfigValue + Default,

source

pub fn set_validator_t(self, validator: ValValidator<T>) -> Self

Set the option value validator.

source

pub fn add_default_storer_t(self) -> Self

Add default storer of type T.

source§

impl<'a, S, U, T> SetCommitWithValue<'a, S, U, T>where S: Set, T: ErasedTy + Clone, U: Infer + 'static, U::Val: RawValParser, SetCfg<S>: ConfigValue + Default,

source

pub fn set_value_t(self, value: T) -> Self

Set the option default value.

source

pub fn set_values_t(self, value: Vec<T>) -> Self

Set the option default value.

source

pub fn add_default_initializer_t(self) -> Self

Add a default initializer.

source§

impl<'a, S, U, T> SetCommitWithValue<'a, S, U, T>where S: Set, T: ErasedTy, U: Infer + 'static, U::Val: RawValParser, SetCfg<S>: ConfigValue + Default,

source

pub fn set_validator(self, validator: ValValidator<U::Val>) -> Self

Set the option value validator.

source§

impl<'a, S, U, T> SetCommitWithValue<'a, S, U, T>where S: Set, T: ErasedTy, U: Infer + 'static, U::Val: Clone + RawValParser, SetCfg<S>: ConfigValue + Default,

source

pub fn set_value(self, value: U::Val) -> Self

Set the option default value.

source

pub fn set_values(self, value: Vec<U::Val>) -> Self

Set the option default value.

Trait Implementations§

source§

impl<'a, S, U, T> Commit<S> for SetCommitWithValue<'a, S, U, T>where S: Set, T: ErasedTy, U: Infer + 'static, U::Val: RawValParser, SetCfg<S>: ConfigValue + Default,

source§

fn cfg(&self) -> &SetCfg<S>

source§

fn cfg_mut(&mut self) -> &mut SetCfg<S>

source§

fn set_index(self, index: Index) -> Self

source§

fn set_action(self, action: Action) -> Self

source§

fn set_name(self, name: impl Into<Str>) -> Self

source§

fn set_ctor(self, ctor: impl Into<Str>) -> Self

source§

fn clr_alias(self) -> Self

source§

fn rem_alias(self, alias: impl Into<Str>) -> Self

source§

fn add_alias(self, alias: impl Into<Str>) -> Self

source§

fn set_force(self, force: bool) -> Self

source§

fn set_hint(self, hint: impl Into<Str>) -> Self

source§

fn set_help(self, help: impl Into<Str>) -> Self

source§

fn set_storer(self, storer: ValStorer) -> Self

source§

fn set_initializer<T: Into<ValInitializer>>(self, initializer: T) -> Self

source§

impl<'a, S, U, T> Debug for SetCommitWithValue<'a, S, U, T>where U: Infer + 'static, T: ErasedTy, S: Set + Debug, U::Val: RawValParser, SetCfg<S>: ConfigValue + Default + Debug,

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl<'a, S, U, T> RefUnwindSafe for SetCommitWithValue<'a, S, U, T>where S: RefUnwindSafe, T: RefUnwindSafe, U: RefUnwindSafe, <<S as Set>::Ctor as Ctor>::Config: RefUnwindSafe,

§

impl<'a, S, U, T> Send for SetCommitWithValue<'a, S, U, T>where S: Send, T: Send, U: Send, <<S as Set>::Ctor as Ctor>::Config: Send,

§

impl<'a, S, U, T> Sync for SetCommitWithValue<'a, S, U, T>where S: Sync, T: Sync, U: Sync, <<S as Set>::Ctor as Ctor>::Config: Sync,

§

impl<'a, S, U, T> Unpin for SetCommitWithValue<'a, S, U, T>where T: Unpin, U: Unpin, <<S as Set>::Ctor as Ctor>::Config: Unpin,

§

impl<'a, S, U, T> !UnwindSafe for SetCommitWithValue<'a, S, U, T>

Blanket Implementations§

source§

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

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

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

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere 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 Twhere 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, U> TryFrom<U> for Twhere U: Into<T>,

§

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 Twhere U: TryFrom<T>,

§

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.
source§

impl<T> ErasedTy for Twhere T: Any + 'static,