Struct CellParser

Source
pub struct CellParser<'a> {
    pub cell: &'a Cell,
    /* private fields */
}

Fields§

§cell: &'a Cell

Implementations§

Source§

impl<'a> CellParser<'a>

Source

pub fn new(cell: &'a Cell) -> Self

Source

pub fn remaining_bits(&mut self) -> usize

Source

pub fn remaining_refs(&self) -> usize

Source

pub fn remaining_bytes(&mut self) -> usize

Return number of full bytes remaining

Source

pub fn load_bit(&mut self) -> Result<bool, TonCellError>

Source

pub fn seek(&mut self, num_bits: i64) -> Result<(), TonCellError>

Source

pub fn load_u8(&mut self, bit_len: usize) -> Result<u8, TonCellError>

Source

pub fn load_i8(&mut self, bit_len: usize) -> Result<i8, TonCellError>

Source

pub fn load_u16(&mut self, bit_len: usize) -> Result<u16, TonCellError>

Source

pub fn load_i16(&mut self, bit_len: usize) -> Result<i16, TonCellError>

Source

pub fn load_u32(&mut self, bit_len: usize) -> Result<u32, TonCellError>

Source

pub fn load_i32(&mut self, bit_len: usize) -> Result<i32, TonCellError>

Source

pub fn load_u64(&mut self, bit_len: usize) -> Result<u64, TonCellError>

Source

pub fn load_i64(&mut self, bit_len: usize) -> Result<i64, TonCellError>

Source

pub fn load_uint(&mut self, bit_len: usize) -> Result<BigUint, TonCellError>

Source

pub fn load_int(&mut self, bit_len: usize) -> Result<BigInt, TonCellError>

Source

pub fn load_byte(&mut self) -> Result<u8, TonCellError>

Source

pub fn load_slice(&mut self, slice: &mut [u8]) -> Result<(), TonCellError>

Source

pub fn load_bytes(&mut self, num_bytes: usize) -> Result<Vec<u8>, TonCellError>

Source

pub fn load_ref_cell_optional( &mut self, ) -> Result<Option<ArcCell>, TonCellError>

Source

pub fn load_bits_to_slice( &mut self, num_bits: usize, slice: &mut [u8], ) -> Result<(), TonCellError>

Source

pub fn load_bits(&mut self, bit_len: usize) -> Result<Vec<u8>, TonCellError>

Source

pub fn load_utf8(&mut self, num_bytes: usize) -> Result<String, TonCellError>

Source

pub fn load_coins(&mut self) -> Result<BigUint, TonCellError>

Source

pub fn load_remaining(&mut self) -> Result<Cell, TonCellError>

Source

pub fn load_msg_address(&mut self) -> Result<MsgAddress, TonCellError>

Source

pub fn load_address(&mut self) -> Result<TonAddress, TonCellError>

Source

pub fn load_unary_length(&mut self) -> Result<usize, TonCellError>

Source

pub fn load_dict_data<K: Eq + Hash, V>( &mut self, key_len: usize, key_reader: KeyReader<K>, val_reader: ValReader<V>, ) -> Result<HashMap<K, V>, TonCellError>

Source

pub fn load_dict<K: Eq + Hash, V>( &mut self, key_len: usize, key_reader: KeyReader<K>, val_reader: ValReader<V>, ) -> Result<HashMap<K, V>, TonCellError>

Source

pub fn load_dict_snake_format( &mut self, ) -> Result<SnakeFormatDict, TonCellError>

Snake format when we store part of the data in a cell and the rest of the data in the first child cell (and so recursively).

Must be prefixed with 0x00 byte.

§TL-B scheme:

tail#_ {bn:#} b:(bits bn) = SnakeData ~0;

cons#_ {bn:#} {n:#} b:(bits bn) next:^(SnakeData ~n) = SnakeData ~(n + 1);

Source

pub fn load_dict_data_snake_format( &mut self, ) -> Result<SnakeFormatDict, TonCellError>

Source

pub fn ensure_empty(&mut self) -> Result<(), TonCellError>

Source

pub fn load_remaining_data_aligned(&mut self) -> Result<Vec<u8>, TonCellError>

Source

pub fn load_snake_format_aligned( &mut self, has_prefix: bool, ) -> Result<Vec<u8>, TonCellError>

Source

pub fn skip_bits(&mut self, num_bits: usize) -> Result<(), TonCellError>

Source

pub fn load_number<N: TonCellNum>( &mut self, bit_len: usize, ) -> Result<N, TonCellError>

Source

pub fn load_number_optional<N: TonCellNum>( &mut self, bit_len: usize, ) -> Result<Option<N>, TonCellError>

Source

pub fn next_reference(&mut self) -> Result<ArcCell, TonCellError>

Source

pub fn load_either_cell_or_cell_ref(&mut self) -> Result<ArcCell, TonCellError>

Source

pub fn load_maybe_cell_ref(&mut self) -> Result<Option<ArcCell>, TonCellError>

Source

pub fn load_tlb<T: TLB>(&mut self) -> Result<T, TonCellError>

Source

pub fn load_tonhash(&mut self) -> Result<TonHash, TonCellError>

Auto Trait Implementations§

§

impl<'a> Freeze for CellParser<'a>

§

impl<'a> RefUnwindSafe for CellParser<'a>

§

impl<'a> Send for CellParser<'a>

§

impl<'a> Sync for CellParser<'a>

§

impl<'a> Unpin for CellParser<'a>

§

impl<'a> UnwindSafe for CellParser<'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.