Struct everscale_types::cell::Cell

source ·
#[repr(transparent)]
pub struct Cell(_);
Expand description

Thread-safe cell.

Methods from Deref<Target = 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 AsRef<dyn CellImpl + Send + Sync> for Cell

source§

fn as_ref(&self) -> &DynCell

Converts this type into a shared reference of the (usually inferred) input type.
source§

impl Borrow<dyn CellImpl + Send + Sync> for Cell

source§

fn borrow(&self) -> &DynCell

Immutably borrows from an owned value. Read more
source§

impl CellFamily for Cell

source§

fn empty_cell() -> Cell

Creates an empty cell. Read more
source§

fn empty_cell_ref() -> &'static DynCell

Returns a static reference to the empty cell
source§

fn all_zeros_ref() -> &'static DynCell

Returns a static reference to the cell with all zeros.
source§

fn all_ones_ref() -> &'static DynCell

Returns a static reference to the cell with all ones.
source§

fn virtualize(cell: Cell) -> Cell

Creates a virtualized cell from the specified cell.
source§

impl Clone for Cell

source§

fn clone(&self) -> Cell

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for Cell

source§

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

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

impl DefaultFinalizer for Cell

§

type Finalizer = ArcCellFinalizer

The default finalizer type.
source§

fn default_finalizer() -> Self::Finalizer

Creates a default finalizer.
source§

impl Deref for Cell

§

type Target = dyn CellImpl + Send + Sync

The resulting type after dereferencing.
source§

fn deref(&self) -> &Self::Target

Dereferences the value.
source§

impl From<Arc<dyn CellImpl + Send + Sync, Global>> for Cell

source§

fn from(value: Arc<DynCell>) -> Self

Converts to this type from the input type.
source§

impl From<Cell> for Arc<DynCell>

source§

fn from(value: Cell) -> Self

Converts to this type from the input type.
source§

impl<'a> Load<'a> for Cell

source§

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

Tries to load itself from a cell slice.
source§

impl PartialEq<Cell> for Cell

source§

fn eq(&self, other: &Self) -> 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 Store for Cell

source§

fn store_into( &self, builder: &mut CellBuilder, _: &mut dyn Finalizer ) -> Result<(), Error>

Tries to store itself into the cell builder.
source§

impl TryAsMut<dyn CellImpl + Send + Sync> for Cell

source§

fn try_as_mut(&mut self) -> Option<&mut DynCell>

Tries to convert this type into a mutable reference of the (usually inferred) input type.
source§

impl Eq for Cell

source§

impl StructuralEq for Cell

Auto Trait Implementations§

§

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> Any for Twhere T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for Twhere U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> Same<T> for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for Twhere T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for Twhere U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for Twhere V: MultiLane<T>,

§

fn vzip(self) -> V