pub(crate) enum OptionalSpelling {
Option,
Nullable,
}Expand description
How an optional argument type is spelled: Option<T>, or
miniextendr_api::Nullable<T>, whose TryFromSexp forwards to
Option<T>’s (NULL and NA read None).
A Nullable<T> argument behaves as Option<T> (#2294): the R-side
checks, the conversion’s wording, coerce, no_na and the choice
parameters read it through optional_layer. Code that builds the value
through an Option helper (a coerce converter, a match_arg decoder)
wraps the result for Nullable (OptionalSpelling::wrap_ok).
Variants§
Implementations§
Source§impl OptionalSpelling
impl OptionalSpelling
Sourcepub(crate) fn wrap_ok(self, result: TokenStream) -> TokenStream
pub(crate) fn wrap_ok(self, result: TokenStream) -> TokenStream
result, a Result<Option<T>, E> expression, as a
Result<Self<T>, E>: unchanged for Option, its Ok value wrapped
in Nullable for Nullable.
Trait Implementations§
Source§impl Clone for OptionalSpelling
impl Clone for OptionalSpelling
impl Copy for OptionalSpelling
Source§impl Debug for OptionalSpelling
impl Debug for OptionalSpelling
Source§impl Eq for OptionalSpelling
impl Eq for OptionalSpelling
1.0.0 (const: unstable) · Source§#[doc(hidden)]fn assert_receiver_is_total_eq(&self)
#[doc(hidden)]fn assert_receiver_is_total_eq(&self)
implementation detail of #[derive(Eq)]
Source§#[doc(hidden)]fn assert_fields_are_eq(&self)
#[doc(hidden)]fn assert_fields_are_eq(&self)
derive_eq_internals)Source§impl PartialEq for OptionalSpelling
impl PartialEq for OptionalSpelling
impl StructuralPartialEq for OptionalSpelling
impl TrivialClone for OptionalSpelling
Auto Trait Implementations§
impl Forget for OptionalSpelling
impl Freeze for OptionalSpelling
impl RefUnwindSafe for OptionalSpelling
impl Send for OptionalSpelling
impl Sync for OptionalSpelling
impl Unpin for OptionalSpelling
impl UnsafeUnpin for OptionalSpelling
impl UnwindSafe for OptionalSpelling
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: 1 byte
Size for each variant:
Option: 0 bytesNullable: 0 bytes