Trait StackValue

Source
pub trait StackValue: SafeDelete {
Show 33 methods // Required methods fn ty(&self) -> StackValueType; fn is_equal(&self, other: &dyn StackValue) -> bool; fn fmt_dump(&self, f: &mut Formatter<'_>) -> Result; // Provided methods fn as_null(&self) -> Result<&()> { ... } fn as_nan(&self) -> Result<&NaN> { ... } fn as_int(&self) -> Result<&BigInt> { ... } fn as_cell(&self) -> Result<&Cell> { ... } fn as_builder(&self) -> Result<&CellBuilder> { ... } fn as_slice(&self) -> Result<CellSlice<'_>> { ... } fn as_string(&self) -> Result<&str> { ... } fn as_bytes(&self) -> Result<&[u8]> { ... } fn as_tuple(&self) -> Result<&StackTuple> { ... } fn as_cont(&self) -> Result<&dyn FiftCont> { ... } fn as_word_list(&self) -> Result<&WordList> { ... } fn as_box(&self) -> Result<&SharedBox> { ... } fn as_atom(&self) -> Result<&Atom> { ... } fn as_hashmap(&self) -> Result<&HashMapTreeNode> { ... } fn as_vm_cont(&self) -> Result<&RcCont> { ... } fn rc_into_null(self: Rc<Self>) -> Result<Rc<()>> { ... } fn rc_into_nan(self: Rc<Self>) -> Result<Rc<NaN>> { ... } fn rc_into_int(self: Rc<Self>) -> Result<Rc<BigInt>> { ... } fn rc_into_cell(self: Rc<Self>) -> Result<Rc<Cell>> { ... } fn rc_into_builder(self: Rc<Self>) -> Result<Rc<CellBuilder>> { ... } fn rc_into_cell_slice(self: Rc<Self>) -> Result<Rc<OwnedCellSlice>> { ... } fn rc_into_string(self: Rc<Self>) -> Result<Rc<String>> { ... } fn rc_into_bytes(self: Rc<Self>) -> Result<Rc<Vec<u8>>> { ... } fn rc_into_tuple(self: Rc<Self>) -> Result<Rc<StackTuple>> { ... } fn rc_into_cont(self: Rc<Self>) -> Result<Rc<dyn FiftCont>> { ... } fn rc_into_word_list(self: Rc<Self>) -> Result<Rc<WordList>> { ... } fn rc_into_shared_box(self: Rc<Self>) -> Result<Rc<SharedBox>> { ... } fn rc_into_atom(self: Rc<Self>) -> Result<Rc<Atom>> { ... } fn rc_into_hashmap(self: Rc<Self>) -> Result<Rc<HashMapTreeNode>> { ... } fn rc_into_vm_cont(self: Rc<Self>) -> Result<Rc<RcCont>> { ... }
}

Required Methods§

Source

fn ty(&self) -> StackValueType

Source

fn is_equal(&self, other: &dyn StackValue) -> bool

Source

fn fmt_dump(&self, f: &mut Formatter<'_>) -> Result

Provided Methods§

Source

fn as_null(&self) -> Result<&()>

Source

fn as_nan(&self) -> Result<&NaN>

Source

fn as_int(&self) -> Result<&BigInt>

Source

fn as_cell(&self) -> Result<&Cell>

Source

fn as_builder(&self) -> Result<&CellBuilder>

Source

fn as_slice(&self) -> Result<CellSlice<'_>>

Source

fn as_string(&self) -> Result<&str>

Source

fn as_bytes(&self) -> Result<&[u8]>

Source

fn as_tuple(&self) -> Result<&StackTuple>

Source

fn as_cont(&self) -> Result<&dyn FiftCont>

Source

fn as_word_list(&self) -> Result<&WordList>

Source

fn as_box(&self) -> Result<&SharedBox>

Source

fn as_atom(&self) -> Result<&Atom>

Source

fn as_hashmap(&self) -> Result<&HashMapTreeNode>

Source

fn as_vm_cont(&self) -> Result<&RcCont>

Source

fn rc_into_null(self: Rc<Self>) -> Result<Rc<()>>

Source

fn rc_into_nan(self: Rc<Self>) -> Result<Rc<NaN>>

Source

fn rc_into_int(self: Rc<Self>) -> Result<Rc<BigInt>>

Source

fn rc_into_cell(self: Rc<Self>) -> Result<Rc<Cell>>

Source

fn rc_into_builder(self: Rc<Self>) -> Result<Rc<CellBuilder>>

Source

fn rc_into_cell_slice(self: Rc<Self>) -> Result<Rc<OwnedCellSlice>>

Source

fn rc_into_string(self: Rc<Self>) -> Result<Rc<String>>

Source

fn rc_into_bytes(self: Rc<Self>) -> Result<Rc<Vec<u8>>>

Source

fn rc_into_tuple(self: Rc<Self>) -> Result<Rc<StackTuple>>

Source

fn rc_into_cont(self: Rc<Self>) -> Result<Rc<dyn FiftCont>>

Source

fn rc_into_word_list(self: Rc<Self>) -> Result<Rc<WordList>>

Source

fn rc_into_shared_box(self: Rc<Self>) -> Result<Rc<SharedBox>>

Source

fn rc_into_atom(self: Rc<Self>) -> Result<Rc<Atom>>

Source

fn rc_into_hashmap(self: Rc<Self>) -> Result<Rc<HashMapTreeNode>>

Source

fn rc_into_vm_cont(self: Rc<Self>) -> Result<Rc<RcCont>>

Implementations§

Source§

impl dyn StackValue + '_

Source

pub fn display_dump(&self) -> impl Display + '_

Source

pub fn display_list(&self) -> impl Display + '_

Source

pub fn is_null(&self) -> bool

Source

pub fn as_pair(&self) -> Option<(&dyn StackValue, &dyn StackValue)>

Source

pub fn as_list(&self) -> Option<(&dyn StackValue, &dyn StackValue)>

Implementations on Foreign Types§

Source§

impl StackValue for ()

Source§

fn ty(&self) -> StackValueType

Source§

fn is_equal(&self, other: &dyn StackValue) -> bool

Source§

fn fmt_dump(&self, f: &mut Formatter<'_>) -> Result

Source§

fn as_null(&self) -> Result<&()>

Source§

fn rc_into_null(self: Rc<Self>) -> Result<Rc<()>>

Source§

impl StackValue for String

Source§

fn ty(&self) -> StackValueType

Source§

fn is_equal(&self, other: &dyn StackValue) -> bool

Source§

fn fmt_dump(&self, f: &mut Formatter<'_>) -> Result

Source§

fn as_string(&self) -> Result<&str>

Source§

fn rc_into_string(self: Rc<Self>) -> Result<Rc<String>>

Source§

impl StackValue for Vec<u8>

Source§

fn ty(&self) -> StackValueType

Source§

fn is_equal(&self, other: &dyn StackValue) -> bool

Source§

fn fmt_dump(&self, f: &mut Formatter<'_>) -> Result

Source§

fn as_bytes(&self) -> Result<&[u8]>

Source§

fn rc_into_bytes(self: Rc<Self>) -> Result<Rc<Vec<u8>>>

Source§

impl StackValue for BigInt

Source§

fn ty(&self) -> StackValueType

Source§

fn is_equal(&self, other: &dyn StackValue) -> bool

Source§

fn fmt_dump(&self, f: &mut Formatter<'_>) -> Result

Source§

fn as_int(&self) -> Result<&BigInt>

Source§

fn rc_into_int(self: Rc<Self>) -> Result<Rc<BigInt>>

Source§

impl StackValue for CellBuilder

Source§

fn ty(&self) -> StackValueType

Source§

fn is_equal(&self, other: &dyn StackValue) -> bool

Source§

fn fmt_dump(&self, f: &mut Formatter<'_>) -> Result

Source§

fn as_builder(&self) -> Result<&CellBuilder>

Source§

fn rc_into_builder(self: Rc<Self>) -> Result<Rc<CellBuilder>>

Source§

impl StackValue for Cell

Source§

fn ty(&self) -> StackValueType

Source§

fn is_equal(&self, other: &dyn StackValue) -> bool

Source§

fn fmt_dump(&self, f: &mut Formatter<'_>) -> Result

Source§

fn as_cell(&self) -> Result<&Cell>

Source§

fn rc_into_cell(self: Rc<Self>) -> Result<Rc<Cell>>

Source§

impl StackValue for NaN

Source§

fn ty(&self) -> StackValueType

Source§

fn is_equal(&self, other: &dyn StackValue) -> bool

Source§

fn fmt_dump(&self, f: &mut Formatter<'_>) -> Result

Source§

fn as_nan(&self) -> Result<&NaN>

Source§

fn rc_into_nan(self: Rc<Self>) -> Result<Rc<NaN>>

Source§

impl StackValue for RcCont

Source§

fn ty(&self) -> StackValueType

Source§

fn is_equal(&self, other: &dyn StackValue) -> bool

Source§

fn fmt_dump(&self, f: &mut Formatter<'_>) -> Result

Source§

fn as_vm_cont(&self) -> Result<&RcCont>

Source§

fn rc_into_vm_cont(self: Rc<Self>) -> Result<Rc<RcCont>>

Implementors§