Struct aopt::set::SetCommitWithValue
source · 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,
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,
pub fn new(inner: SetCommit<'a, S, U>) -> Self
pub fn inner(&self) -> Result<&SetCommit<'a, S, U>, Error>
pub fn inner_mut(&mut self) -> Result<&mut SetCommit<'a, S, U>, Error>
sourcepub fn set_infer<O: Infer>(self) -> SetCommitWithValue<'a, S, O, T>where
O::Val: RawValParser,
pub fn set_infer<O: Infer>(self) -> SetCommitWithValue<'a, S, O, T>where O::Val: RawValParser,
Set the infer type of option.
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,
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,
sourcepub fn set_validator_t(self, validator: ValValidator<T>) -> Self
pub fn set_validator_t(self, validator: ValValidator<T>) -> Self
Set the option value validator.
sourcepub fn add_default_storer_t(self) -> Self
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,
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,
sourcepub fn set_value_t(self, value: T) -> Self
pub fn set_value_t(self, value: T) -> Self
Set the option default value.
sourcepub fn set_values_t(self, value: Vec<T>) -> Self
pub fn set_values_t(self, value: Vec<T>) -> Self
Set the option default value.
sourcepub fn add_default_initializer_t(self) -> Self
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,
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,
sourcepub fn set_validator(self, validator: ValValidator<U::Val>) -> Self
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,
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,
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,
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,
fn cfg(&self) -> &SetCfg<S>
fn cfg_mut(&mut self) -> &mut SetCfg<S>
fn set_index(self, index: Index) -> Self
fn set_action(self, action: Action) -> Self
fn set_name(self, name: impl Into<Str>) -> Self
fn set_ctor(self, ctor: impl Into<Str>) -> Self
fn clr_alias(self) -> Self
fn rem_alias(self, alias: impl Into<Str>) -> Self
fn add_alias(self, alias: impl Into<Str>) -> Self
fn set_force(self, force: bool) -> Self
fn set_hint(self, hint: impl Into<Str>) -> Self
fn set_help(self, help: impl Into<Str>) -> Self
fn set_storer(self, storer: ValStorer) -> Self
fn set_initializer<T: Into<ValInitializer>>(self, initializer: T) -> Self
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> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more