pub struct ClassDocBuilder<'a> {
class_name: &'a str,
type_ident: &'a Ident,
doc_tags: &'a [String],
class_system_label: &'static str,
imports: Option<String>,
attr_internal: bool,
attr_noexport: bool,
}Expand description
Builder for class-level roxygen documentation header.
Generates the common roxygen tags that appear at the start of each class definition:
@title(unless user provided)@name(unless user provided)@rdname(unless user provided)- User-provided doc tags
@source Generated by miniextendr...- Class-system-specific imports
@export(unless user provided,@noRd, or internal/noexport flags)
Fields§
§class_name: &'a strThe R-visible class name (e.g., "Counter").
type_ident: &'a IdentThe Rust type identifier, used in the @source annotation.
User-provided roxygen tags extracted from doc comments.
class_system_label: &'static strHuman-readable label for the class system (e.g., "R6", "S3", "Env"),
used in the auto-generated @title.
imports: Option<String>Optional @importFrom tag for class-system-specific R packages
(e.g., "@importFrom R6 R6Class").
attr_internal: boolWhen true, adds @keywords internal and suppresses @export.
Set by #[miniextendr(internal)].
attr_noexport: boolWhen true, suppresses @export but does not add @keywords internal.
Set by #[miniextendr(noexport)].
Implementations§
Source§impl<'a> ClassDocBuilder<'a>
impl<'a> ClassDocBuilder<'a>
Sourcepub fn new(
class_name: &'a str,
type_ident: &'a Ident,
doc_tags: &'a [String],
class_system_label: &'static str,
) -> Self
pub fn new( class_name: &'a str, type_ident: &'a Ident, doc_tags: &'a [String], class_system_label: &'static str, ) -> Self
Create a new ClassDocBuilder with the given class metadata.
By default, @export is included unless suppressed by user tags or
the with_export_control method.
Sourcepub fn with_imports(self, imports: impl Into<String>) -> Self
pub fn with_imports(self, imports: impl Into<String>) -> Self
Set R package imports (e.g., “@importFrom R6 R6Class”).
Sourcepub fn with_export_control(self, internal: bool, noexport: bool) -> Self
pub fn with_export_control(self, internal: bool, noexport: bool) -> Self
Set attribute-level internal/noexport flags from ParsedImpl.
Sourcepub fn build(&self) -> Vec<String>
pub fn build(&self) -> Vec<String>
Build the roxygen #' @tag lines for the class header.
Returns a vector of strings, each a complete roxygen comment line (e.g., "#' @title ...").
Auto-generates @title, @name, and @rdname if not provided by the user, and
respects @noRd to suppress all documentation output.
Auto Trait Implementations§
impl<'a> Freeze for ClassDocBuilder<'a>
impl<'a> RefUnwindSafe for ClassDocBuilder<'a>
impl<'a> !Send for ClassDocBuilder<'a>
impl<'a> !Sync for ClassDocBuilder<'a>
impl<'a> Unpin for ClassDocBuilder<'a>
impl<'a> UnsafeUnpin for ClassDocBuilder<'a>
impl<'a> UnwindSafe for ClassDocBuilder<'a>
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> 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