pub struct StaticCell { /* private fields */ }
Expand description

Static cell which can be used to create cell references in const context.

Implementations§

source§

impl StaticCell

source

pub const unsafe fn new( data: &'static [u8], bit_len: u16, hash: &'static [u8; 32] ) -> Self

Creates a new plain ordinary cell from parts.

Safety

The following must be true:

  • Data must be well-formed and normalized (contain bit tag if needed and be enough to store bit_len of bits).
  • bit_len must be in range 0..=1023
  • hash must be a correct hash for the current cell.

Trait Implementations§

source§

impl<C: CellFamily> Cell<C> for StaticCell

source§

fn descriptor(&self) -> CellDescriptor

Returns cell descriptor. Read more
source§

fn data(&self) -> &[u8]

Returns the raw data of this cell.
source§

fn bit_len(&self) -> u16

Returns the data size of this cell in bits.
source§

fn reference(&self, _: u8) -> Option<&dyn Cell<C>>

Returns a reference to the Nth child cell.
source§

fn reference_cloned(&self, _: u8) -> Option<CellContainer<C>>

Returns the Nth child cell.
source§

fn virtualize(&self) -> &dyn Cell<C>

Returns this cell as a virtualized cell, so that all hashes and depths will have an offset.
source§

fn hash(&self, _: u8) -> &CellHash

Returns cell hash for the specified level. Read more
source§

fn depth(&self, _: u8) -> u16

Returns cell depth for the specified level.

Auto Trait Implementations§

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,

const: unstable · source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

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

const: unstable · source§

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

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

const: unstable · source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

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

const: unstable · 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, U> TryFrom<U> for Twhere U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
const: unstable · 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.
const: unstable · source§

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

Performs the conversion.