Trait Object

Source
pub trait Object:
    Sized
    + Clone
    + Debug
    + Display
    + Add
    + Sub
    + Mul
    + Div
    + Rem
    + Ord
    + Not {
Show 40 methods // Required methods fn new(value_type: Type, contents: Vec<Number>) -> Self; fn get_type(&self) -> Type; fn get_list(&self) -> Vec<Self>; fn get_contents(&self) -> Vec<Number>; fn get_attributes(&self) -> Table<Self>; fn get_foreign_function(&self) -> fn(Self) -> Self; fn set_type(&mut self, object_type: Type); fn set_list(&mut self, list: Vec<Self>); fn set_contents(&mut self, contents: Vec<Number>); fn set_attributes(&mut self, attributes: Table<Self>); fn set_foreign_function(&mut self, function: fn(Self) -> Self); // Provided methods fn empty_instance() -> Self { ... } fn from_string(string: String) -> Self { ... } fn from_str(string: &str) -> Self { ... } fn from_f64(decimal: f64) -> Self { ... } fn from_number(n: Number) -> Self { ... } fn from_instruction(instruction: Instruction) -> Self { ... } fn from_problem(problem: Problem) -> Self { ... } fn from_vector(vector: Vec<Self>) -> Self { ... } fn from_nothing() -> Self { ... } fn from_function(vector: Vec<Self>) -> Self { ... } fn from_foreign_function(function: fn(Self) -> Self) -> Self { ... } fn get_attr(&self, name: String) -> Self { ... } fn as_number(&self) -> Number { ... } fn as_usize(&self) -> usize { ... } fn as_string(&self) -> String { ... } fn as_list(&self) -> Vec<Self> { ... } fn as_instruction(&self) -> Instruction { ... } fn as_instance(&self) -> Table<Self> { ... } fn as_foreign_function(&self) -> fn(Self) -> Self { ... } fn set_attr(&mut self, name: String, object: Self) { ... } fn get_attr_recursive(&mut self, names: Vec<String>) -> Self { ... } fn set_attr_recursive(&mut self, names: Vec<String>, object: Self) -> Self { ... } fn index(&mut self, index: Self) -> Self { ... } fn list_push(&mut self, object: Self) { ... } fn list_pop(&mut self) -> Self { ... } fn call_foreign_function(&mut self, parameter: Self) -> Self { ... } fn format(&self) -> String { ... } fn print(&self) { ... } fn println(&self) { ... }
}

Required Methods§

Source

fn new(value_type: Type, contents: Vec<Number>) -> Self

Source

fn get_type(&self) -> Type

Source

fn get_list(&self) -> Vec<Self>

Source

fn get_contents(&self) -> Vec<Number>

Source

fn get_attributes(&self) -> Table<Self>

Source

fn get_foreign_function(&self) -> fn(Self) -> Self

Source

fn set_type(&mut self, object_type: Type)

Source

fn set_list(&mut self, list: Vec<Self>)

Source

fn set_contents(&mut self, contents: Vec<Number>)

Source

fn set_attributes(&mut self, attributes: Table<Self>)

Source

fn set_foreign_function(&mut self, function: fn(Self) -> Self)

Provided Methods§

Source

fn empty_instance() -> Self

Source

fn from_string(string: String) -> Self

Source

fn from_str(string: &str) -> Self

Source

fn from_f64(decimal: f64) -> Self

Source

fn from_number(n: Number) -> Self

Source

fn from_instruction(instruction: Instruction) -> Self

Source

fn from_problem(problem: Problem) -> Self

Source

fn from_vector(vector: Vec<Self>) -> Self

Source

fn from_nothing() -> Self

Source

fn from_function(vector: Vec<Self>) -> Self

Source

fn from_foreign_function(function: fn(Self) -> Self) -> Self

Source

fn get_attr(&self, name: String) -> Self

Source

fn as_number(&self) -> Number

Source

fn as_usize(&self) -> usize

Source

fn as_string(&self) -> String

Source

fn as_list(&self) -> Vec<Self>

Source

fn as_instruction(&self) -> Instruction

Source

fn as_instance(&self) -> Table<Self>

Source

fn as_foreign_function(&self) -> fn(Self) -> Self

Source

fn set_attr(&mut self, name: String, object: Self)

Source

fn get_attr_recursive(&mut self, names: Vec<String>) -> Self

Source

fn set_attr_recursive(&mut self, names: Vec<String>, object: Self) -> Self

Source

fn index(&mut self, index: Self) -> Self

Source

fn list_push(&mut self, object: Self)

Source

fn list_pop(&mut self) -> Self

Source

fn call_foreign_function(&mut self, parameter: Self) -> Self

Source

fn format(&self) -> String

Source

fn print(&self)

Source

fn println(&self)

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§