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: S3’s class environment exports it, and vctrs has no object of that name.
  • A class the package names and builds itself (class = "...") has no class environment either (#1918). Its roxygen block only carries the impl docs (super::docs_only_class_block).