pub(crate) struct ChoiceLayers<'a> {
pub missing: bool,
pub nullable: bool,
pub either_right: Option<&'a Type>,
pub value: &'a Type,
}Expand description
The wrappers around the value of a match_arg / choices parameter,
peeled outermost first: Missing<..>, then Option<..>, then
Either<T, R> with the choice on the left (a scalar choice, or a
several_ok list: Either<Vec<T>, R>, #1612). A plain T (or a plain
several_ok container) has none.
Each layer changes one contract and leaves the rest to the layer below:
Missing reports an omitted argument as Missing::Absent and keeps the
choice vector as the R formal (#1551), Option turns NULL into None
(#1473), and Either sends every argument that is not character or
factor to its R arm instead of the choice check.
Fields§
§missing: boolMissing<..> is the outermost wrapper.
nullable: boolOption<..> wraps the value (inside Missing, if present).
either_right: Option<&'a Type>Either<T, R> wraps the value (inside the others): its R arm.
value: &'a TypeThe type under the layers: the MatchArg type (or the string type of a
choices parameter) for a scalar, the container for several_ok.
Trait Implementations§
Source§impl<'a> Clone for ChoiceLayers<'a>
impl<'a> Clone for ChoiceLayers<'a>
impl<'a> Copy for ChoiceLayers<'a>
Source§impl<'a> Debug for ChoiceLayers<'a>
impl<'a> Debug for ChoiceLayers<'a>
impl<'a> TrivialClone for ChoiceLayers<'a>
Auto Trait Implementations§
impl<'a> !Send for ChoiceLayers<'a>
impl<'a> !Sync for ChoiceLayers<'a>
impl<'a> Freeze for ChoiceLayers<'a>
impl<'a> RefUnwindSafe for ChoiceLayers<'a>
impl<'a> Unpin for ChoiceLayers<'a>
impl<'a> UnsafeUnpin for ChoiceLayers<'a>
impl<'a> UnwindSafe for ChoiceLayers<'a>
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> Printable for T
Source§impl<T> SizeHint for Twhere
T: ?Sized,
impl<T> SizeHint for Twhere
T: ?Sized,
Source§default fn lower_bound(&self) -> usize
default fn lower_bound(&self) -> usize
core_io_internals)[u8; 12] could return any value between 0 and
12 inclusively as a correct implementation. Read moreSource§impl<T> SizedTypeProperties for T
impl<T> SizedTypeProperties for T
Source§#[doc(hidden)]const SIZE: usize = _
#[doc(hidden)]const SIZE: usize = _
sized_type_properties)Source§#[doc(hidden)]const ALIGN: usize = _
#[doc(hidden)]const ALIGN: usize = _
sized_type_properties)Source§#[doc(hidden)]const ALIGNMENT: Alignment = _
#[doc(hidden)]const ALIGNMENT: Alignment = _
ptr_alignment_type)Source§#[doc(hidden)]const IS_ZST: bool = _
#[doc(hidden)]const IS_ZST: bool = _
sized_type_properties)Source§#[doc(hidden)]const LAYOUT: Layout = _
#[doc(hidden)]const LAYOUT: Layout = _
sized_type_properties)Source§#[doc(hidden)]const MAX_SLICE_LEN: usize = _
#[doc(hidden)]const MAX_SLICE_LEN: usize = _
sized_type_properties)[Self]. Read moreLayout§
Note: Most layout information is completely unstable and may even differ between compilations. The only exception is types with certain repr(...) attributes. Please see the Rust Reference's “Type Layout” chapter for details on type layout guarantees.
Size: 24 bytes