Skip to main content

ClassDocBuilder

Struct ClassDocBuilder 

Source
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 str

The R-visible class name (e.g., "Counter").

§type_ident: &'a Ident

The Rust type identifier, used in the @source annotation.

§doc_tags: &'a [String]

User-provided roxygen tags extracted from doc comments.

§class_system_label: &'static str

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

When true, adds @keywords internal and suppresses @export. Set by #[miniextendr(internal)].

§attr_noexport: bool

When true, suppresses @export but does not add @keywords internal. Set by #[miniextendr(noexport)].

Implementations§

Source§

impl<'a> ClassDocBuilder<'a>

Source

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.

Source

pub fn with_imports(self, imports: impl Into<String>) -> Self

Set R package imports (e.g., “@importFrom R6 R6Class”).

Source

pub fn with_export_control(self, internal: bool, noexport: bool) -> Self

Set attribute-level internal/noexport flags from ParsedImpl.

Source

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