pub(crate) struct DotsPolicy {
pub(crate) role: DotsRole,
pub(crate) allow: Vec<String>,
pub(crate) class: Vec<String>,
pub(crate) class_expr: Option<String>,
pub(crate) span: Span,
}Expand description
A parsed dots = empty | empty(..) | forward(..) | data.
Fields§
§role: DotsRole§allow: Vec<String>The names ... takes, in order.
class: Vec<String>The package’s classes for the refusal, in front of its own.
class_expr: Option<String>The package’s classes as an R expression the wrapper evaluates, in
place of class: the field methods pass the type’s field_error
classes, a variable of the derive’s helpers (#2174). The attribute
never sets it.
span: SpanThe attribute value, for diagnostics about the signature.
Implementations§
Source§impl DotsPolicy
impl DotsPolicy
Sourcepub(crate) fn empty(class_expr: Option<String>) -> Self
pub(crate) fn empty(class_expr: Option<String>) -> Self
empty, for generated code that has no attribute, with the refusal’s
classes as an R expression (class_expr): the
field methods of s3(r_data_accessors) and an env class’s [[
(#2174).
Sourcepub(crate) fn check_signature(
&self,
rust_dots: bool,
wrapper_dots: bool,
) -> Result<()>
pub(crate) fn check_signature( &self, rust_dots: bool, wrapper_dots: bool, ) -> Result<()>
Refuse a role the signature can’t have, spanned on the attribute:
forward and data hand the arguments to the Rust function, so it
takes ... (_: ..., &Dots or LazyDots); wrapper_dots says
whether the R wrapper has a ... formal for empty to check.
Sourcepub(crate) fn r_check(
&self,
formals: &str,
call: Option<&str>,
) -> Option<String>
pub(crate) fn r_check( &self, formals: &str, call: Option<&str>, ) -> Option<String>
The wrapper statement that refuses what ... doesn’t take, for a
wrapper with formals (an R formals list); call is the wrapper’s
r_check_call.
None for data, and for a wrapper without a ... formal, which R
keeps from receiving any extra argument.
The formals other than ... and the generated .call, .mx_self and
.ptr are what the helper suggests from, after the allowed names.
Trait Implementations§
Source§impl Clone for DotsPolicy
impl Clone for DotsPolicy
Auto Trait Implementations§
impl !Send for DotsPolicy
impl !Sync for DotsPolicy
impl Freeze for DotsPolicy
impl RefUnwindSafe for DotsPolicy
impl Unpin for DotsPolicy
impl UnsafeUnpin for DotsPolicy
impl UnwindSafe for DotsPolicy
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,
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: 88 bytes