Skip to main content

no_constructor_head

Function no_constructor_head 

Source
pub(super) fn no_constructor_head(
    parsed_impl: &ParsedImpl,
    w: &mut ClassWrapper,
    lines: &mut Vec<String>,
    kind: &'static str,
    imports: Option<&str>,
)
Expand description

The head of an S3 or vctrs class without a constructor: kind is the class system in its title, imports its roxygen imports. Neither gets a new_<class>(): a package that builds its objects in R may write its own (#2069).

  • A class named as its Rust type has its class block on NULL, without an @export of the class name: the class environment (class_env) exports it when a trait impl writes into it (#2264, #2289).
  • A class the package names and builds itself (class = "...") may name its own constructor like the class (#1918). Its roxygen block only carries the impl docs (super::docs_only_class_block), and the writer drops the block when they say nothing, unless the class environment is kept for a trait impl and needs the page.