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 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 pruned.
Sourcepub unsafe fn as_slice_unchecked(&self) -> CellSlice<'_>
pub unsafe fn as_slice_unchecked(&self) -> CellSlice<'_>
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 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.
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() -> Self::EmptyCellContext
fn empty_context() -> 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 Store for Cell
impl Store for Cell
Source§fn store_into(
&self,
builder: &mut CellBuilder,
_: &mut dyn CellContext,
) -> Result<(), Error>
fn store_into( &self, builder: &mut CellBuilder, _: &mut dyn CellContext, ) -> Result<(), Error>
Source§impl TryAsMut<dyn CellImpl + Send + Sync> for Cell
impl TryAsMut<dyn CellImpl + Send + Sync> 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.