Skip to main content

ListBackend

Trait ListBackend 

Source
pub trait ListBackend: Send + Sync {
    // Required methods
    fn name(&self) -> &str;
    fn new_list(&self, cx: &mut Cx, items: Vec<Value>) -> Result<Value>;
    fn new_cons(&self, cx: &mut Cx, car: Value, cdr: Value) -> Result<Value>;
}
Expand description

Factory protocol for constructing lists in a particular representation.

Required Methods§

Source

fn name(&self) -> &str

Stable name the backend is registered and selected under.

Source

fn new_list(&self, cx: &mut Cx, items: Vec<Value>) -> Result<Value>

Builds a list from an ordered set of items.

Source

fn new_cons(&self, cx: &mut Cx, car: Value, cdr: Value) -> Result<Value>

Builds a cons cell prepending car onto the list cdr.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§