pub struct Cell(/* private fields */);
Expand description
Thread-safe cell.
Implementations§
Methods from Deref<Target = 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.
Trait Implementations§
Source§impl CellFamily for Cell
impl CellFamily for Cell
Source§type EmptyCellContext = EmptyCellContext
type EmptyCellContext = EmptyCellContext
Source§fn empty_cell() -> Cell
fn empty_cell() -> Cell
Source§fn empty_cell_ref() -> &'static DynCell
fn empty_cell_ref() -> &'static DynCell
Source§fn empty_context() -> &'static Self::EmptyCellContext
fn empty_context() -> &'static Self::EmptyCellContext
Source§fn all_zeros_ref() -> &'static DynCell
fn all_zeros_ref() -> &'static DynCell
Source§fn all_ones_ref() -> &'static DynCell
fn all_ones_ref() -> &'static DynCell
Source§fn virtualize(cell: Cell) -> Cell
fn virtualize(cell: Cell) -> Cell
Source§impl ExactSize for Cell
impl ExactSize for Cell
Source§fn exact_size(&self) -> Size
fn exact_size(&self) -> Size
Source§impl From<Cell> for CellSliceParts
impl From<Cell> for CellSliceParts
Source§impl From<WorkchainShardHashes> for Cell
impl From<WorkchainShardHashes> for Cell
Source§fn from(value: WorkchainShardHashes) -> Self
fn from(value: WorkchainShardHashes) -> Self
Source§impl Store for Cell
impl Store for Cell
Source§fn store_into(
&self,
builder: &mut CellBuilder,
_: &dyn CellContext,
) -> Result<(), Error>
fn store_into( &self, builder: &mut CellBuilder, _: &dyn CellContext, ) -> Result<(), Error>
Source§impl TryAsMut<dyn CellImpl + Sync + Send> for Cell
impl TryAsMut<dyn CellImpl + Sync + Send> for Cell
Source§fn try_as_mut(&mut self) -> Option<&mut DynCell>
fn try_as_mut(&mut self) -> Option<&mut DynCell>
impl Eq for Cell
Auto Trait Implementations§
impl Freeze for Cell
impl !RefUnwindSafe for Cell
impl Send for Cell
impl Sync for Cell
impl Unpin for Cell
impl !UnwindSafe for Cell
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
self
to key
and returns true
if they are equal.