Value

Trait Value 

Source
pub trait Value:
    Clone
    + Copy
    + Default
    + PartialEq
    + Eq
    + PartialOrd
    + Ord {
    type Number: Integer;
    type Pointer: Integer;

    // Required methods
    fn from_number(number: Self::Number) -> Self;
    fn to_number(self) -> Self::Number;
    fn from_pointer(cons: Self::Pointer) -> Self;
    fn to_pointer(self) -> Self::Pointer;
    fn is_pointer(self) -> bool;
    fn mark(self, mark: bool) -> Self;
    fn is_marked(self) -> bool;

    // Provided methods
    fn to_cons(self) -> Cons<Self> { ... }
    fn from_cons(cons: Cons<Self>) -> Self { ... }
}
Expand description

A value.

Required Associated Types§

Source

type Number: Integer

A number.

Source

type Pointer: Integer

A pointer.

Required Methods§

Source

fn from_number(number: Self::Number) -> Self

Converts a number to a value.

Source

fn to_number(self) -> Self::Number

Converts a value to a number.

Source

fn from_pointer(cons: Self::Pointer) -> Self

Converts a pointer to a value.

Source

fn to_pointer(self) -> Self::Pointer

Converts a value to a pointer.

Source

fn is_pointer(self) -> bool

Checks if a value is a pointer.

Source

fn mark(self, mark: bool) -> Self

Marks a value.

Source

fn is_marked(self) -> bool

Returns true if a value is marked.

Provided Methods§

Source

fn to_cons(self) -> Cons<Self>

Converts a value to a cons.

Source

fn from_cons(cons: Cons<Self>) -> Self

Converts a value to a cons.

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§