| trait_methods | R Documentation |
Inspect or use a Rust-like explicit trait
trait_methods(trait, inherited = TRUE)
impl_trait(
trait,
class,
methods = list(),
assoc_types = list(),
assoc_consts = list(),
replace = FALSE
)
trait_report(x, trait)
has_trait(x, trait)
assert_trait(x, trait, arg = deparse(substitute(x)))
trait_call(trait, method, x, ...)
trait_assoc_type(trait, x, name)
trait_assoc_const(trait, x, name)
trait |
A trait created by |
inherited |
Include inherited methods from supertraits? |
class |
A concrete S7 class, S3 class wrapper, S4 class, or base class wrapper. Register union members separately. |
methods |
Named list of method implementations. Omitted trait methods use their default implementation when one is available. |
assoc_types |
Named list of associated type values. |
assoc_consts |
Named list of associated constant values. |
replace |
Replace an existing implementation record and silence warnings about visible S7 methods? |
x |
An object or class. |
arg |
Name to use in error messages. |
method |
Method name within the trait. |
... |
Additional arguments passed to the S7 generic. |
name |
Associated item name. |
trait_methods() returns a named list of trait_method() objects.
impl_trait() returns the stored implementation record, invisibly.
trait_report() returns a one-row data frame. has_trait() returns a
single logical value. assert_trait() returns x, unchanged.
trait_call() returns the result of the underlying S7 generic.
trait_assoc_type() and trait_assoc_const() return the stored associated
item value.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.