Struct CellParts

Source
pub struct CellParts<'a> {
    pub stats: CellTreeStats,
    pub bit_len: u16,
    pub descriptor: CellDescriptor,
    pub children_mask: LevelMask,
    pub references: ArrayVec<Cell, MAX_REF_COUNT>,
    pub data: &'a [u8],
}
Expand description

Partially assembled cell.

Fields§

§stats: CellTreeStats

Cell tree storage stats.

§bit_len: u16

Length of this cell’s data in bits.

§descriptor: CellDescriptor

Well-formed cell descriptor.

§children_mask: LevelMask

Bitwise OR of child level masks.

§references: ArrayVec<Cell, MAX_REF_COUNT>

Array of child cells.

NOTE: it is guaranteed that the length of the array is consistent with the descriptor.

§data: &'a [u8]

Cell data slice.

Implementations§

Source§

impl<'a> CellParts<'a>

Source

pub unsafe fn from_raw_cell( raw_cell: &'a [u8], cells: &[Cell], cell_count: u32, ref_size: usize, ) -> Result<Self, Error>

Reads cell parts from the raw cell slice.

§Safety

The following must be true:

  • bytes must be a correct bytes representation of cell.

NOTE: It is safe to use an unmodified output from CellParts::read_raw_cell.

Source

pub fn read_raw_cell<'b>( bytes: &mut &'b [u8], ref_size: usize, ) -> Result<&'b [u8], Error>

Reads a raw cell from the specified slice. The returned slice is guaranteed to be a correct bytes representation of cell.

Source§

impl CellParts<'_>

Source

pub fn compute_hashes(&self) -> Result<Vec<(HashBytes, u16)>, Error>

Validates cell and computes all hashes.

Auto Trait Implementations§

§

impl<'a> Freeze for CellParts<'a>

§

impl<'a> !RefUnwindSafe for CellParts<'a>

§

impl<'a> Send for CellParts<'a>

§

impl<'a> Sync for CellParts<'a>

§

impl<'a> Unpin for CellParts<'a>

§

impl<'a> !UnwindSafe for CellParts<'a>

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

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

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where 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 T
where 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 for T

Source§

type Output = T

Should always be Self
Source§

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

Source§

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 T
where U: TryFrom<T>,

Source§

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.
Source§

impl<T> EquivalentRepr<T> for T