pub struct ClassBlockEntry {Show 18 fields
pub rust_type: &'static str,
pub type_path: fn() -> &'static str,
pub r_class_name: &'static str,
pub source_file: &'static str,
pub source_line: u32,
pub source_column: u32,
pub settings: &'static str,
pub constructor: &'static str,
pub constructor_inferred: bool,
pub constructor_candidates: &'static [&'static str],
pub demoted: Option<&'static ClassBlockEntry>,
pub defines: &'static [&'static str],
pub head: &'static str,
pub class_docs: &'static str,
pub class_doc_lines: &'static str,
pub members: &'static str,
pub member_names: &'static [&'static str],
pub tail: &'static str,
}Expand description
One #[miniextendr] impl block’s share of its Rust type’s R class (#1776).
A type’s methods may be split over several impl blocks. Each block
registers its R wrapper in parts, and collect_r_wrappers writes one
class per type: the defining block’s head, every block’s
members in source order, then the defining block’s
tail. The defining block is the one with a
defines entry (at most one block may have any), else
the first in source order. The class’s roxygen block has the
class_docs of every block, the defining block’s
first. Every part is R source, framed by the newline the macro’s raw
string literal adds at each end.
Fields§
§rust_type: &'static strRust type identifier as written in the impl, e.g. "Counter".
type_path: fn() -> &'static strThe type’s core::any::type_name, which tells apart two types that
share an identifier. The blocks of one type are merged by it.
r_class_name: &'static strR-visible class name (class = "...", else the type’s identifier).
source_file: &'static strSource file of the impl block (file!()).
source_line: u32Line of the impl’s type in source_file.
source_column: u32Column of the impl’s type, for the # Generated from header.
settings: &'static strThe class-level settings, rendered: class system and its options,
class = "...", internal / noexport, and the @noRd /
@keywords internal tags. They shape every block’s members, so all
blocks of a type must have the same.
constructor: &'static strThe Rust name of the block’s class constructor, "" when it has
none: the method marked #[miniextendr(<system>(constructor))], else a
receiver-less new returning Self, else
(constructor_inferred) the block’s one
candidate.
constructor_inferred: boolWhether constructor was inferred: the block
declares none and has one candidate. The type’s constructor is then
decided across its impl blocks when collect_r_wrappers merges them.
constructor_candidates: &'static [&'static str]The Rust names of the block’s receiver-less methods returning Self
other than a declared constructor: the methods that could be the
constructor of a type that declares none.
demoted: Option<&'static ClassBlockEntry>The block as it reads when another impl block of the type declares the constructor: present when the block infers one, which there stays a static method.
defines: &'static [&'static str]What this block has that only the defining block may: "a constructor" (or "the inferred constructor `name`"), "S7 properties", "the field fallback" (s3(r_data_accessors, fallback = ...), whose .Call entry the block emits and whose field methods
call it).
head: &'static strThe class definition as this block would write it: the class’s
roxygen block (with the CLASS_DOCS_MARKER and
CLASS_DOC_LINES_MARKER lines, and CLASS_DEFAULT_PREFIX
lines), the class object, the constructor, and the class-level
helpers.
class_docs: &'static strThe block’s doc comment as roxygen lines (with the constructor’s for
S3 and vctrs, whose class block is the constructor’s). The class’s
roxygen block has every block’s, the defining block’s first; a tag
repeated exactly is written once, and two blocks giving the class
different @titles, or a page other than the defining block’s
(@name, @rdname), are refused.
class_doc_lines: &'static strRoxygen lines this block’s members add to the class’s roxygen block,
such as an R6 active binding’s @field or a lifecycle import.
members: &'static strThe block’s members: its methods, static methods and coercions.
member_names: &'static [&'static str]Names the members bind in the class’s own namespaces ($name of an
env class or of an R6 generator, R6 members, S4 and S7 method
registrations), for the check that two blocks don’t bind the same one.
Top-level functions are left to the duplicate-definition scan of the
written file.
tail: &'static strWhat follows every block’s members, such as R6’s $lock().
Trait Implementations§
impl Sync for ClassBlockEntry
Auto Trait Implementations§
impl Freeze for ClassBlockEntry
impl RefUnwindSafe for ClassBlockEntry
impl Send for ClassBlockEntry
impl Unpin for ClassBlockEntry
impl UnsafeUnpin for ClassBlockEntry
impl UnwindSafe for ClassBlockEntry
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> 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: 240 bytes