pub type DynCell = dyn CellImpl + Send + Sync;Expand description
Dyn trait type alias.
Implementations§
Source§impl DynCell
impl DynCell
Sourcepub fn level_mask(&self) -> LevelMask
pub fn level_mask(&self) -> LevelMask
Computes the level mask from the descriptor bytes.
Sourcepub fn reference_count(&self) -> u8
pub fn reference_count(&self) -> u8
Computes the number of child cells from descriptor bytes.
Sourcepub fn get_reference_as_slice(&self, index: u8) -> Result<CellSlice<'_>, Error>
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.
Sourcepub fn repr_depth(&self) -> u16
pub fn repr_depth(&self) -> u16
Returns a representation depth of the cell.
Sourcepub fn has_max_depth(&self) -> bool
pub fn has_max_depth(&self) -> bool
Returns true if any of cell levels has the maximum depth.
Sourcepub fn references(&self) -> RefsIter<'_> ⓘ
pub fn references(&self) -> RefsIter<'_> ⓘ
Creates an iterator through child nodes.
Sourcepub fn as_slice(&self) -> Result<CellSlice<'_>, Error>
pub fn as_slice(&self) -> Result<CellSlice<'_>, Error>
Returns this cell as a cell slice. Returns an error if the cell is not ordinary.
Sourcepub fn as_slice_allow_exotic(&self) -> CellSlice<'_>
pub fn as_slice_allow_exotic(&self) -> CellSlice<'_>
Returns this cell as a cell slice.
Loads cell as is.
Sourcepub fn compute_unique_stats(&self, limit: usize) -> Option<CellTreeStats>
pub fn compute_unique_stats(&self, limit: usize) -> Option<CellTreeStats>
Recursively computes the count of distinct cells returning the total storage used by this dag taking into account the identification of equal cells.
Sourcepub fn touch_recursive(&self)
pub fn touch_recursive(&self)
Recursively traverses the cells tree without tracking a uniqueness of cells. Usefull for adding small subtrees to merkle proofs.
Sourcepub fn debug_root(&self) -> DebugCell<'_>
pub fn debug_root(&self) -> DebugCell<'_>
Returns an object that implements Debug for printing only
the root cell of the cell tree.
Sourcepub fn display_root(&self) -> DisplayCellRoot<'_>
pub fn display_root(&self) -> DisplayCellRoot<'_>
Returns an object that implements Display for printing only
the root cell of the cell tree.
Sourcepub fn display_tree(&self) -> DisplayCellTree<'_>
pub fn display_tree(&self) -> DisplayCellTree<'_>
Returns an object that implements Display for printing all
cells in the cell tree.
Sourcepub fn display_data(&self) -> impl Display + Binary + '_
pub fn display_data(&self) -> impl Display + Binary + '_
Returns an object which will display cell data as a bitstring with a termination bit.
Sourcepub fn parse<'a, T: Load<'a>>(&'a self) -> Result<T, Error>
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. Fails if the cell is not ordinary.
NOTE: parsing Cell will load the first reference!
Sourcepub fn parse_exotic<'a, T: LoadCell<'a>>(&'a self) -> Result<T, Error>
pub fn parse_exotic<'a, T: LoadCell<'a>>(&'a self) -> Result<T, Error>
Loads an exotic cell.