Trait StackValue

Source
pub trait StackValue: SafeDelete + Debug {
Show 22 methods // Required methods fn rc_into_dyn(self: Rc<Self>) -> Rc<dyn StackValue>; fn raw_ty(&self) -> u8; fn store_as_stack_value( &self, builder: &mut CellBuilder, context: &dyn CellContext, ) -> Result<(), Error>; fn fmt_dump(&self, f: &mut Formatter<'_>) -> Result; // Provided methods fn as_int(&self) -> Option<&BigInt> { ... } fn try_as_int(&self) -> VmResult<&BigInt> { ... } fn rc_into_int(self: Rc<Self>) -> VmResult<Rc<BigInt>> { ... } fn as_cell(&self) -> Option<&Cell> { ... } fn try_as_cell(&self) -> VmResult<&Cell> { ... } fn rc_into_cell(self: Rc<Self>) -> VmResult<Rc<Cell>> { ... } fn as_cell_slice(&self) -> Option<&OwnedCellSlice> { ... } fn try_as_cell_slice(&self) -> VmResult<&OwnedCellSlice> { ... } fn rc_into_cell_slice(self: Rc<Self>) -> VmResult<Rc<OwnedCellSlice>> { ... } fn as_cell_builder(&self) -> Option<&CellBuilder> { ... } fn try_as_cell_builder(&self) -> VmResult<&CellBuilder> { ... } fn rc_into_cell_builder(self: Rc<Self>) -> VmResult<Rc<CellBuilder>> { ... } fn as_cont(&self) -> Option<&dyn Cont> { ... } fn try_as_cont(&self) -> VmResult<&dyn Cont> { ... } fn rc_into_cont(self: Rc<Self>) -> VmResult<Rc<dyn Cont>> { ... } fn as_tuple(&self) -> Option<&[RcStackValue]> { ... } fn try_as_tuple(&self) -> VmResult<&[RcStackValue]> { ... } fn rc_into_tuple(self: Rc<Self>) -> VmResult<Rc<Tuple>> { ... }
}
Expand description

Interface of a Stack item.

Required Methods§

Source

fn rc_into_dyn(self: Rc<Self>) -> Rc<dyn StackValue>

Source

fn raw_ty(&self) -> u8

Source

fn store_as_stack_value( &self, builder: &mut CellBuilder, context: &dyn CellContext, ) -> Result<(), Error>

Source

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

Provided Methods§

Implementations§

Source§

impl dyn StackValue + '_

Source

pub fn is_null(&self) -> bool

Source

pub fn is_tuple(&self) -> bool

Source

pub fn as_tuple_range( &self, min_len: u32, max_len: u32, ) -> Option<&[RcStackValue]>

Source

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

Source

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

Source

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

Implementations on Foreign Types§

Source§

impl StackValue for ()

Source§

fn rc_into_dyn(self: Rc<Self>) -> Rc<dyn StackValue>

Source§

fn raw_ty(&self) -> u8

Source§

fn store_as_stack_value( &self, builder: &mut CellBuilder, _: &dyn CellContext, ) -> Result<(), Error>

Source§

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

Source§

impl StackValue for BigInt

Source§

fn rc_into_dyn(self: Rc<Self>) -> Rc<dyn StackValue>

Source§

fn raw_ty(&self) -> u8

Source§

fn store_as_stack_value( &self, builder: &mut CellBuilder, _: &dyn CellContext, ) -> Result<(), Error>

Source§

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

Source§

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

Source§

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

Source§

impl StackValue for CellBuilder

Source§

fn rc_into_dyn(self: Rc<Self>) -> Rc<dyn StackValue>

Source§

fn raw_ty(&self) -> u8

Source§

fn store_as_stack_value( &self, builder: &mut CellBuilder, context: &dyn CellContext, ) -> Result<(), Error>

Source§

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

Source§

fn as_cell_builder(&self) -> Option<&CellBuilder>

Source§

fn rc_into_cell_builder(self: Rc<Self>) -> VmResult<Rc<CellBuilder>>

Source§

impl StackValue for Cell

Source§

fn rc_into_dyn(self: Rc<Self>) -> Rc<dyn StackValue>

Source§

fn raw_ty(&self) -> u8

Source§

fn store_as_stack_value( &self, builder: &mut CellBuilder, _: &dyn CellContext, ) -> Result<(), Error>

Source§

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

Source§

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

Source§

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

Implementors§