Skip to main content

RoxygenBuilder

Struct RoxygenBuilder 

Source
pub struct RoxygenBuilder {
    name: Option<String>,
    rdname: Option<String>,
    title: Option<String>,
    description: Option<String>,
    source: Option<String>,
    export: bool,
    export_method: Option<String>,
    method: Option<(String, String)>,
    custom_tags: Vec<String>,
}
Expand description

Builder for generating roxygen2 documentation tags.

Provides a fluent API for building common roxygen tag patterns used across all class systems.

§Example

let tags = RoxygenBuilder::new()
    .name("Counter$increment")
    .rdname("Counter")
    .export()
    .build();
// => vec!["#' @name Counter$increment", "#' @rdname Counter", "#' @export"]

Fields§

§name: Option<String>

Value for @name tag. Identifies the documented topic (e.g., "Counter$increment").

§rdname: Option<String>

Value for @rdname tag. Groups multiple entries onto a single help page (e.g., all methods of "Counter" share one Rd file).

§title: Option<String>

Value for @title tag. The one-line title shown in help page headers.

§description: Option<String>

Value for @description tag. Longer description text below the title.

§source: Option<String>

Value for @source tag. Typically "Generated by miniextendr" provenance info.

§export: bool

Whether to emit @export. When true, the item is exported from the package NAMESPACE.

§export_method: Option<String>

Value for @exportMethod tag. Used for S4 method exports (e.g., "show").

§method: Option<(String, String)>

Values for @method tag as (generic, class). Used for S3 method dispatch (e.g., ("print", "Counter") emits @method print Counter).

§custom_tags: Vec<String>

Additional custom tag lines emitted verbatim (without the #' prefix, which is added during build). Used for tags like @keywords internal or @param entries.

Implementations§

Source§

impl RoxygenBuilder

Source

pub fn new() -> Self

Create a new empty builder.

Source

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

Set the @name tag.

Source

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

Set the @rdname tag (groups docs into one page).

Source

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

Set the @title tag.

Source

pub fn description(self, desc: impl Into<String>) -> Self

Set the @description tag.

Source

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

Set the @source tag (typically “Generated by miniextendr…”).

Source

pub fn export(self) -> Self

Add @export tag.

Source

pub fn export_method(self, method: impl Into<String>) -> Self

Add @exportMethod tag (for S4).

Source

pub fn method( self, generic: impl Into<String>, class: impl Into<String>, ) -> Self

Add @method tag (for S3).

Source

pub fn custom(self, tag: impl Into<String>) -> Self

Add a custom tag line (without the #' prefix).

Source

pub fn build(&self) -> Vec<String>

Build the roxygen tag lines (each prefixed with #' ).

Trait Implementations§

Source§

impl Default for RoxygenBuilder

Creates an empty builder with no tags set.

Source§

fn default() -> Self

Returns the “default value” for a type. Read more

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