Struct Cell

Source
pub struct Cell { /* private fields */ }

Implementations§

Source§

impl Cell

Source

pub fn new( data: Vec<u8>, bit_len: usize, references: Vec<ArcCell>, is_exotic: bool, ) -> Result<Self, TonCellError>

Source

pub fn parser(&self) -> CellParser<'_>

Source

pub fn parse<F, T>(&self, parse: F) -> Result<T, TonCellError>
where F: FnOnce(&mut CellParser<'_>) -> Result<T, TonCellError>,

Source

pub fn parse_fully<F, T>(&self, parse: F) -> Result<T, TonCellError>
where F: FnOnce(&mut CellParser<'_>) -> Result<T, TonCellError>,

Source

pub fn reference(&self, idx: usize) -> Result<&ArcCell, TonCellError>

Source

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

Source

pub fn bit_len(&self) -> usize

Source

pub fn references(&self) -> &[ArcCell]

Source

pub fn cell_depth(&self) -> u16

Source

pub fn get_depth(&self, level: u8) -> u16

Source

pub fn cell_hash(&self) -> TonHash

Source

pub fn get_hash(&self, level: u8) -> TonHash

Source

pub fn is_exotic(&self) -> bool

Source

pub fn is_library(&self) -> bool

Source

pub fn cell_hash_base64(&self) -> String

Source

pub fn load_snake_formatted_string(&self) -> Result<String, TonCellError>

Source

pub fn to_arc(self) -> ArcCell

Source

pub fn expect_reference_count( &self, expected_refs: usize, ) -> Result<(), TonCellError>

👎Deprecated

It is recommended to use CellParser::next_reference() instead

Trait Implementations§

Source§

impl Clone for Cell

Source§

fn clone(&self) -> Cell

Returns a duplicate of the value. Read more
1.0.0 · Source§

const 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 Default for Cell

Source§

fn default() -> Self

Returns the “default value” for a type. Read more
Source§

impl Hash for Cell

Source§

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given Hasher. Read more
1.3.0 · Source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
Source§

impl PartialEq for Cell

Source§

fn eq(&self, other: &Cell) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

const fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl TLB for Cell

Source§

fn read_definition(parser: &mut CellParser<'_>) -> Result<Self, TonCellError>

read-write definition https://docs.ton.org/v3/documentation/data-formats/tlb/tl-b-language#overview must be implemented by all TLB objects doesn’t include prefix handling
Source§

fn write_definition( &self, builder: &mut CellBuilder, ) -> Result<(), TonCellError>

Source§

fn from_boc(boc: &[u8]) -> Result<Self, TonCellError>

Source§

const PREFIX: TLBPrefix = TLBPrefix::NULL

Source§

fn read(parser: &mut CellParser<'_>) -> Result<Self, TonCellError>

Source§

fn write(&self, dst: &mut CellBuilder) -> Result<(), TonCellError>

Source§

fn cell_hash(&self) -> Result<TonHash, TonCellError>

Utilities
Source§

fn from_cell(cell: &Cell) -> Result<Self, TonCellError>

Parsing
Source§

fn from_boc_hex(boc_hex: &str) -> Result<Self, TonCellError>

Source§

fn from_boc_b64(boc_b64: &str) -> Result<Self, TonCellError>

Source§

fn to_cell(&self) -> Result<Cell, TonCellError>

Serialization
Source§

fn to_boc(&self, add_crc32: bool) -> Result<Vec<u8>, TonCellError>

Source§

fn to_boc_hex(&self, add_crc32: bool) -> Result<String, TonCellError>

Source§

fn to_boc_b64(&self, add_crc32: bool) -> Result<String, TonCellError>

Source§

fn verify_prefix(parser: &mut CellParser<'_>) -> Result<(), TonCellError>

Helpers - for internal use
Source§

fn write_prefix(builder: &mut CellBuilder) -> Result<(), TonCellError>

Source§

impl TonMessage for Cell

Source§

impl Eq for Cell

Source§

impl StructuralPartialEq 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> 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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. 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> ToOwned for T
where T: Clone,

Source§

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