pub struct OptionalParameter<T: ParameterVariant> { /* private fields */ }
Expand description
A parameter that might not have a value, represented by Option<T>
.
This struct has ownership of the declared parameter. Additional parameter declaration will fail
while this struct exists and the parameter will be undeclared when it is dropped.
Implementations§
Source§impl<T: ParameterVariant> OptionalParameter<T>
impl<T: ParameterVariant> OptionalParameter<T>
Sourcepub fn set<U: Into<T>>(&self, value: U) -> Result<(), ParameterValueError>
pub fn set<U: Into<T>>(&self, value: U) -> Result<(), ParameterValueError>
Assigns a value to the optional parameter, setting it to Some(value)
.
Returns ParameterValueError::OutOfRange
if the value is out of the parameter’s range.
Trait Implementations§
Source§impl<T: ParameterVariant + Debug> Debug for OptionalParameter<T>
impl<T: ParameterVariant + Debug> Debug for OptionalParameter<T>
Source§impl<T: ParameterVariant> Drop for OptionalParameter<T>
impl<T: ParameterVariant> Drop for OptionalParameter<T>
Source§impl<T: ParameterVariant> TryFrom<ParameterBuilder<'_, T>> for OptionalParameter<T>
impl<T: ParameterVariant> TryFrom<ParameterBuilder<'_, T>> for OptionalParameter<T>
Source§type Error = DeclarationError
type Error = DeclarationError
The type returned in the event of a conversion error.
Auto Trait Implementations§
impl<T> Freeze for OptionalParameter<T>
impl<T> RefUnwindSafe for OptionalParameter<T>where
T: RefUnwindSafe,
impl<T> Send for OptionalParameter<T>where
T: Send,
impl<T> Sync for OptionalParameter<T>where
T: Sync,
impl<T> Unpin for OptionalParameter<T>where
T: Unpin,
impl<T> UnwindSafe for OptionalParameter<T>where
T: UnwindSafe,
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