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§
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>>
Implementations§
Source§impl dyn StackValue + '_
impl dyn StackValue + '_
pub fn is_null(&self) -> bool
pub fn is_tuple(&self) -> bool
pub fn as_tuple_range( &self, min_len: u32, max_len: u32, ) -> Option<&[RcStackValue]>
pub fn as_pair(&self) -> Option<(&dyn StackValue, &dyn StackValue)>
pub fn as_list(&self) -> Option<(&dyn StackValue, &dyn StackValue)>
pub fn display_list(&self) -> impl Display + '_
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".