Skip to main content

ImplAttrs

Struct ImplAttrs 

Source
pub struct ImplAttrs {
Show 16 fields pub class_system: ClassSystem, pub class_name: Option<String>, pub label: 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: bool, pub strict: 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, multi-impl labeling, 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", label = "ops")].

Fields§

§class_system: ClassSystem

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

§class_name: Option<String>

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

§label: Option<String>

Optional label for distinguishing multiple impl blocks of the same type.

When a type has multiple #[miniextendr] impl blocks, each must have a distinct label. The label is used in:

  • Generated wrapper names (e.g., C_Type_label__method)
  • Module registration (e.g., impl Type as "label")

Single impl blocks don’t require labels.

§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: bool

When true, auto-include #[r_data] field accessors in the class definition. For R6: active bindings via $set("active", ...) post-creation. For S7: properties spliced from .rdata_properties_{Type}.

§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.

§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> 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 = Infallible

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

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

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