Skip to main content

ImplAttrs

Struct ImplAttrs 

Source
pub struct ImplAttrs {
Show 18 fields pub class_system: ClassSystem, pub class_name: Option<String>, pub vctrs_attrs: VctrsAttrs, pub r6_inherit: Option<String>, pub r6_portable: Option<bool>, pub r6_cloneable: Option<bool>, pub r6_lock_objects: Option<bool>, pub r6_lock_class: Option<bool>, pub s7_parent: Option<String>, pub s7_abstract: bool, pub r_data_accessors: RDataAccessors, pub field_lookup: FieldLookup, pub field_fallback: Option<FieldFallback>, pub strict: bool, pub preconditions: Option<bool>, pub internal: bool, pub noexport: bool, pub blanket: bool,
}
Expand description

Attributes parsed from #[miniextendr(...)] on an impl block.

These control which R class system to use, class naming, and class-system-specific options (R6 inheritance, S7 parent, vctrs kind, etc.).

Parsed by the syn::parse::Parse implementation which handles all supported attribute formats like #[miniextendr(r6, class = "Custom")].

Fields§

§class_system: ClassSystem

Which R class system to generate wrappers for. Defaults to Env unless overridden by feature flags (r6-default, s7-default).

§class_name: Option<String>

Optional override for the R class name. When None, the Rust type name is used.

§vctrs_attrs: VctrsAttrs

vctrs-specific attributes (only used when class_system is Vctrs)

§r6_inherit: Option<String>

R6 parent class for inheritance. Use #[miniextendr(r6(inherit = "ParentClass"))] to specify the parent.

§r6_portable: Option<bool>

R6 portable flag. Default TRUE. Set to false for non-portable R6 classes.

§r6_cloneable: Option<bool>

R6 cloneable flag. Controls whether $clone() is available.

§r6_lock_objects: Option<bool>

R6 lock_objects flag. Controls whether fields can be added after creation.

§r6_lock_class: Option<bool>

R6 lock_class flag. Controls whether the class definition can be modified.

§s7_parent: Option<String>

S7 parent class for inheritance. Use #[miniextendr(s7(parent = "ParentClass"))] to specify the parent.

§s7_abstract: bool

S7 abstract class flag. Abstract classes cannot be instantiated.

§r_data_accessors: RDataAccessors

The class-level form of the #[r_data] field accessors (r6(r_data_accessors), s3(r_data_accessors = "get"), …). For R6: active bindings via $set("active", ...) post-creation. For S7: properties spliced from .rdata_properties_{Type}. For S3, S4 and env: $ / [[ field methods (#1848).

§field_lookup: FieldLookup

How the S3 readers look a field up (lookup = "list", #1921).

§field_fallback: Option<FieldFallback>

What the S3, S4 and env readers call for a name no field has (fallback = "Self::f", #2150).

§strict: bool

When true, methods returning lossy types (i64/u64/isize/usize + Vec variants) use strict::checked_*() instead of IntoR::into_sexp(), panicking on overflow.

§preconditions: Option<bool>

Some(false) drops the R-side type-check guards from the generated method wrappers, Some(true) keeps them: those of an inherent impl, including the setter branch of an R6 active binding, and those of a trait impl, including the empty-body (TPIE) form. TryFromSexp still raises on bad input, with the same argument-error condition; the message comes from the conversion. Set by the bare #[miniextendr(no_preconditions)] / preconditions (the last one written wins). A method’s own preconditions / no_preconditions and each parameter’s spelling come first; None defers to the crate default, then the no-preconditions-default feature (crate::r_preconditions::resolve_type_checks).

§internal: bool

Mark class as internal: adds @keywords internal, suppresses @export.

§noexport: bool

Suppress @export without adding @keywords internal.

§blanket: bool

When true on a trait impl (impl Trait for Type), the impl block is NOT emitted (a blanket impl already provides it), but C wrappers and R wrappers ARE generated from the method signatures in the body.

Trait Implementations§

Source§

impl Debug for ImplAttrs

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Parse for ImplAttrs

Source§

fn parse(input: ParseStream<'_>) -> Result<Self>

Parses #[miniextendr(...)] impl-level options.

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> SizeHint for T
where T: ?Sized,

Source§

default fn lower_bound(&self) -> usize

🔬This is a nightly-only experimental API. (core_io_internals)
Returns a lower bound on the number of elements this container-like item contains. For example, an array [u8; 12] could return any value between 0 and 12 inclusively as a correct implementation. Read more
Source§

default fn upper_bound(&self) -> Option<usize>

🔬This is a nightly-only experimental API. (core_io_internals)
Returns an upper bound on the number of elements this container-like item contains if it can be determined, otherwise None. Read more
Source§

final fn size_hint(&self) -> (usize, Option<usize>)

🔬This is a nightly-only experimental API. (core_io_internals)
Returns an estimate for the number of elements this container like type contains. Read more
Source§

impl<T> SizedTypeProperties for T

Source§

#[doc(hidden)]
const SIZE: usize = _

🔬This is a nightly-only experimental API. (sized_type_properties)
Source§

#[doc(hidden)]
const ALIGN: usize = _

🔬This is a nightly-only experimental API. (sized_type_properties)
Source§

#[doc(hidden)]
const ALIGNMENT: Alignment = _

🔬This is a nightly-only experimental API. (ptr_alignment_type)
Source§

#[doc(hidden)]
const IS_ZST: bool = _

🔬This is a nightly-only experimental API. (sized_type_properties)
true if this type requires no storage. false if its size is greater than zero. Read more
Source§

#[doc(hidden)]
const LAYOUT: Layout = _

🔬This is a nightly-only experimental API. (sized_type_properties)
Source§

#[doc(hidden)]
const MAX_SLICE_LEN: usize = _

🔬This is a nightly-only experimental API. (sized_type_properties)
The largest safe length for a [Self]. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.

Layout§

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: 184 bytes