pub(crate) enum RDataHelper {
Fields,
Get,
Set,
NoField,
ReadOnly,
ErrorClass,
EveryRead,
Live,
}Expand description
The R helpers #[derive(ExternalPtr)] emits for a type’s sidecar fields
and the $ / [[ field methods of r_data_accessors call (#1848).
Variants§
Fields
.rdata_fields_<Type>: the field names, a character vector.
Get
.rdata_get_<Type>(x, name): the field’s getter .Call().
Set
.rdata_set_<Type>(x, name, value): the field’s setter .Call().
NoField
.rdata_no_field_<Type>(name, env, cls): the miniextendr_no_field
error, naming the R class cls the method serves.
ReadOnly
.rdata_read_only_<Type>(name, x, env, why): the
miniextendr_read_only_field error of a write to a field R can’t
write, a Computed or #[r_data(read_only)] one or any under
r_data_accessors = "read_only" (#2268), naming the R class of x
and with field_error(read_only_hint = ...) after it.
ErrorClass
.rdata_error_class_<Type>: the classes the field methods put in
front of their own errors, #[externalptr(field_error(class = ...))]
(#1899); NULL without them.
EveryRead
.rdata_every_read_<Type>: TRUE for a type with
restored(refuse = "every_read") (#1901), else FALSE; it gates the
field methods’ calls of RDataHelper::Live.
Live
.rdata_live_<Type>(x, raise): the liveness check of a type with
restored(refuse = "every_read") (#1901). Other types get a stub that
is never called (gated by RDataHelper::EveryRead), so a binding
the methods call is always a function, as R CMD check expects.
Trait Implementations§
Source§impl Clone for RDataHelper
impl Clone for RDataHelper
impl Copy for RDataHelper
Source§impl Debug for RDataHelper
impl Debug for RDataHelper
impl TrivialClone for RDataHelper
Auto Trait Implementations§
impl Forget for RDataHelper
impl Freeze for RDataHelper
impl RefUnwindSafe for RDataHelper
impl Send for RDataHelper
impl Sync for RDataHelper
impl Unpin for RDataHelper
impl UnsafeUnpin for RDataHelper
impl UnwindSafe for RDataHelper
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:
Fields: 0 bytesGet: 0 bytesSet: 0 bytesNoField: 0 bytesReadOnly: 0 bytesErrorClass: 0 bytesEveryRead: 0 bytesLive: 0 bytes