Skip to main content

Module r6_class

Module r6_class 

Source
Expand description

R6 class wrapper generator (R6Class with $new(), active bindings, private methods). R6-class R wrapper generator.

Generates an R6::R6Class(...) definition with mutable, reference semantics: obj$method() dispatches via R6, and &mut self methods modify state in place without re-binding obj. Supports private methods, active bindings (computed/settable properties), lifecycle hooks (finalize, deep_clone), and inheritance via r6(inherit = ...). Slower than env (R6 dispatch chain) and requires the R6 package; no value semantics โ€” for value-semantics formal OOP, use S7.

Constantsยง

MX_INHERITED_PARAM_PREFIX ๐Ÿ”’
Marker prefix emitted by the proc-macro when a subclass method param might be inherited from a parent class documented in-package. Resolved at write-time in registry.rs to either nothing (parent is documented โ†’ roxygen2 inherits) or (no documentation available) (parent not found or not in-package).

Functionsยง

active_setter_precondition_checks ๐Ÿ”’
Build the stopifnot() precondition lines for the setter branch of a combined getter/setter active binding.
generate_r6_r_wrapper
Generates the complete R wrapper string for an R6-style class.