Skip to contents

A roxygen2 roclet that writes the Rd files of the rd roclet and adds R8 methods and enum variants to them. A package lists it in place of rd: Roxygen: list(roclets = c("collate", "namespace", "R8::r8rd")) in its DESCRIPTION.

Usage

r8rd()

Value

A roxygen2 roclet, of class roclet_r8_rd.

Details

Each implement(generic, Type) <- function(...) call adds an entry to the usage section of an Rd file, ## R8 method for struct 'Type' (or enum) followed by the call with the method's arguments. The entry goes to the Rd file of the generic when the package declares and documents the generic, an R8 generic or an S3 generic, and otherwise to the Rd file of the type. A roxygen block above the call adds its @param entries to that file; a call without a block is found by scanning R/, and is left out when neither the generic nor the type has an Rd file in the package. A method the package implements in Rust, registered when roxygen2 loads the package, takes an entry by the same rules, with the formals of the trait's method. A replacement method is written as its call, labels(x) <- value. A method of a converter from r8converter(), implement(as_target, "character") <- function(x) ..., takes the entry ## R8 method for class 'character' in the Rd file of the converter, or else of its target type. The usage of an enum lists its variants, such as Method@KFold(k) and Method@Bootstrap.

In the block of a typed generic, each @param of a typed parameter begins with the parameter's type, such as Integer [0, Inf):, which a package leaves out of the tag, and a block without @return takes the return type as its value. The block of a method with a return type of its own adds it to the value of the generic's Rd file. A type that the package documents is a link.

Examples

if (FALSE) { # \dontrun{
roxygen2::roxygenise(roclets = c("collate", "namespace", "R8::r8rd"))
} # }