Skip to main content

CjcLibrary

Trait CjcLibrary 

Source
pub trait CjcLibrary {
    // Required methods
    fn name(&self) -> &'static str;
    fn version(&self) -> &'static str;
    fn builtin_names(&self) -> &[&'static str];
    fn method_names(&self) -> &[&'static str];
    fn value_type_names(&self) -> &[&'static str];
}
Expand description

Trait that CJC library crates implement for self-description.

§Example

pub struct VizorLibrary;

impl CjcLibrary for VizorLibrary {
    fn name(&self) -> &'static str { "vizor" }
    fn version(&self) -> &'static str { "0.1.0" }
    fn builtin_names(&self) -> &[&'static str] { &["vizor_plot"] }
    fn method_names(&self) -> &[&'static str] { &["geom_point", "to_svg", "save"] }
    fn value_type_names(&self) -> &[&'static str] { &["VizorPlot"] }
}

Required Methods§

Source

fn name(&self) -> &'static str

Library name (e.g., “vizor”, “data”).

Source

fn version(&self) -> &'static str

Library version string.

Source

fn builtin_names(&self) -> &[&'static str]

List of free-function builtin names this library provides.

Source

fn method_names(&self) -> &[&'static str]

List of method names this library handles on its types.

Source

fn value_type_names(&self) -> &[&'static str]

List of Value variant type names this library introduces.

Implementors§