pub struct Required<T>(/* private fields */);Expand description
Container requiring a field to have a value mandatory.
It’s similar to an Option, but panics on accessing to an absent
underlying value. So, is not intended to be created directly in user code,
but rather only used for marking types in struct fields, so this library
machinery may kick in and take care of correct values creation without
introducing any panics.
Accessing the underlying value, stored in this wrapper, is intended to be
done via Deref and DerefMut in user code.
Implementations§
Trait Implementations§
Source§impl<V> Container<V> for Required<V>
impl<V> Container<V> for Required<V>
Source§impl<'a, T> IntoIterator for &'a Required<T>
impl<'a, T> IntoIterator for &'a Required<T>
Source§impl<'a, T> IntoIterator for &'a mut Required<T>
impl<'a, T> IntoIterator for &'a mut Required<T>
Source§impl<T> IntoIterator for Required<T>
impl<T> IntoIterator for Required<T>
Source§impl<V, K, D> TryApplySelf<V, K, D> for Required<V>
impl<V, K, D> TryApplySelf<V, K, D> for Required<V>
Source§fn try_apply_self(&mut self, another: Self) -> Result<()>
fn try_apply_self(&mut self, another: Self) -> Result<()>
Source§impl<V> Validation<Provided> for Required<V>
impl<V> Validation<Provided> for Required<V>
impl<T: Copy> Copy for Required<T>
Auto Trait Implementations§
impl<T> Freeze for Required<T>where
T: Freeze,
impl<T> RefUnwindSafe for Required<T>where
T: RefUnwindSafe,
impl<T> Send for Required<T>where
T: Send,
impl<T> Sync for Required<T>where
T: Sync,
impl<T> Unpin for Required<T>where
T: Unpin,
impl<T> UnwindSafe for Required<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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T, V> TryMerge<V> for Twhere
T: ?Sized,
impl<T, V> TryMerge<V> for Twhere
T: ?Sized,
Source§fn try_merge<K, D>(&mut self, val: V) -> Result<(), Error>
fn try_merge<K, D>(&mut self, val: V) -> Result<(), Error>
Merges the provided
value to this field::Container with the
specified parsing Kind and Deduplication strategy. Read moreSource§fn try_merge_self<K, D>(&mut self, another: T) -> Result<(), Error>
fn try_merge_self<K, D>(&mut self, another: T) -> Result<(), Error>
Merges the value extracted from
another field::Container to
this field::Container with the specified parsing Kind and
Deduplication strategy. Read more