pub struct Required<T>(_);
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> TryApply<V, K, Unique> for Required<V>where
&'a V: for<'a> IntoSpan,
K: Kind + Single + ?Sized,
impl<V, K> TryApply<V, K, Unique> for Required<V>where &'a V: for<'a> IntoSpan, K: Kind + Single + ?Sized,
source§impl<V, K, D> TryApplySelf<V, K, D> for Required<V>where
K: Kind + Single + ?Sized,
D: Dedup + ?Sized,
Required<V>: TryApply<V, K, D>,
impl<V, K, D> TryApplySelf<V, K, D> for Required<V>where K: Kind + Single + ?Sized, D: Dedup + ?Sized, Required<V>: TryApply<V, K, D>,
source§impl<V> Validation<Provided> for Required<V>
impl<V> Validation<Provided> for Required<V>
impl<T> Copy for Required<T>where T: Copy,
Auto Trait Implementations§
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, 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>where
T: TryApply<V, K, D>,
K: Kind + ?Sized,
D: Dedup + ?Sized,
fn try_merge<K, D>(&mut self, val: V) -> Result<(), Error>where T: TryApply<V, K, D>, K: Kind + ?Sized, D: Dedup + ?Sized,
Merges the provided
value
to this field::Container
with the
specified parsing Kind
and Dedup
lication strategy. Read moresource§fn try_merge_self<K, D>(&mut self, another: T) -> Result<(), Error>where
T: TryApplySelf<V, K, D>,
K: Kind + ?Sized,
D: Dedup + ?Sized,
fn try_merge_self<K, D>(&mut self, another: T) -> Result<(), Error>where T: TryApplySelf<V, K, D>, K: Kind + ?Sized, D: Dedup + ?Sized,
Merges the value extracted from
another
field::Container
to
this field::Container
with the specified parsing Kind
and
Dedup
lication strategy. Read more