Type Definition everscale_types::cell::DynCell

source ·
pub type DynCell = dyn CellImpl + Send + Sync;
Expand description

Dyn trait type alias.

Implementations§

source§

impl DynCell

source

pub fn cell_type(&self) -> CellType

Computes cell type from descriptor bytes.

source

pub fn level(&self) -> u8

Computes the cell level from the level mask.

source

pub fn level_mask(&self) -> LevelMask

Computes the level mask from the descriptor bytes.

source

pub fn reference_count(&self) -> u8

Computes the number of child cells from descriptor bytes.

source

pub fn get_reference_as_slice(&self, index: u8) -> Result<CellSlice<'_>, Error>

Tries to load the specified child cell as slice. Returns an error if the loaded cell is absent or is pruned.

source

pub fn is_exotic(&self) -> bool

Returns whether the cell is not Ordinary.

source

pub fn repr_hash(&self) -> &HashBytes

Returns a representation hash of the cell.

source

pub fn repr_depth(&self) -> u16

Returns a representation depth of the cell.

source

pub fn is_empty(&self) -> bool

Returns true if the cell is empty (no bits, no refs).

source

pub fn references(&self) -> RefsIter<'_>

Creates an iterator through child nodes.

source

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

Returns this cell as a cell slice. Returns an error if the cell is pruned.

source

pub unsafe fn as_slice_unchecked(&self) -> CellSlice<'_>

Returns this cell as a cell slice.

Safety

The following must be true:

  • cell is not pruned
source

pub fn debug_root(&self) -> DebugCell<'_>

Returns an object that implements Debug for printing only the root cell of the cell tree.

source

pub fn display_root(&self) -> DisplayCellRoot<'_>

Returns an object that implements Display for printing only the root cell of the cell tree.

source

pub fn display_tree(&self) -> DisplayCellTree<'_>

Returns an object that implements Display for printing all cells in the cell tree.

source

pub fn parse<'a, T: Load<'a>>(&'a self) -> Result<T, Error>

Converts this cell into a slice and tries to load the specified type from it.

NOTE: parsing Cell will load the first reference!

Trait Implementations§

source§

impl Debug for DynCell

source§

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

Formats the value using the given formatter. Read more
source§

impl<'a> Load<'a> for &'a DynCell

source§

fn load_from(slice: &mut CellSlice<'a>) -> Result<Self, Error>

Tries to load itself from a cell slice.
source§

impl PartialEq<dyn CellImpl + Sync + Send> for DynCell

source§

fn eq(&self, other: &DynCell) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl Serialize for DynCell

source§

fn serialize<S: Serializer>(&self, serializer: S) -> Result<S::Ok, S::Error>

Serialize this value into the given Serde serializer. Read more
source§

impl Eq for DynCell