Struct everscale_types::boc::Boc

source ·
pub struct Boc<C> { /* private fields */ }
Expand description

BOC (Bag Of Cells) helper.

Implementations§

source§

impl<C: CellFamily> Boc<C>

source

pub fn encode_base64<'a, T>(cell: T) -> Stringwhere T: Borrow<dyn Cell<C> + 'a>,

Encodes the specified cell tree as BOC and returns the base64 encoded bytes as a string.

source

pub fn encode<'a, T>(cell: T) -> Vec<u8>where T: Borrow<dyn Cell<C> + 'a>,

Encodes the specified cell tree as BOC.

source

pub fn encode_pair<'a, T1, T2>((cell1, cell2): (T1, T2)) -> Vec<u8>where T1: Borrow<dyn Cell<C> + 'a>, T2: Borrow<dyn Cell<C> + 'a>,

Encodes a pair of cell trees as BOC.

source§

impl<C: DefaultFinalizer> Boc<C>

source

pub fn decode_base64<T: AsRef<[u8]>>(data: T) -> Result<CellContainer<C>, Error>

Decodes a base64 encoded BOC into a cell tree using the default Cell family finalizer.

source

pub fn decode<T>(data: T) -> Result<CellContainer<C>, Error>where T: AsRef<[u8]>,

Decodes a cell tree using the default Cell family finalizer.

source

pub fn decode_pair<T>( data: T ) -> Result<(CellContainer<C>, CellContainer<C>), Error>where T: AsRef<[u8]>,

Decodes a pair of cell trees using the default Cell family finalizer.

source§

impl<C: CellFamily> Boc<C>

source

pub fn decode_ext( data: &[u8], finalizer: &mut dyn Finalizer<C> ) -> Result<CellContainer<C>, Error>

Decodes a cell tree using the specified finalizer.

source

pub fn decode_pair_ext( data: &[u8], finalizer: &mut dyn Finalizer<C> ) -> Result<(CellContainer<C>, CellContainer<C>), Error>

Decodes a pair of cell trees using the specified finalizer.

source§

impl<C: CellFamily> Boc<C>

source

pub fn serialize<S, T>(cell: &T, serializer: S) -> Result<S::Ok, S::Error>where S: Serializer, T: AsRef<dyn Cell<C>>,

Serializes cell into an encoded BOC (as base64 for human readable serializers).

source§

impl<C: DefaultFinalizer> Boc<C>

source

pub fn deserialize<'de, D>( deserializer: D ) -> Result<CellContainer<C>, D::Error>where D: Deserializer<'de>,

Deserializes cell from an encoded BOC (from base64 for human readable deserializers).

Auto Trait Implementations§

§

impl<C> RefUnwindSafe for Boc<C>where C: RefUnwindSafe,

§

impl<C> Send for Boc<C>where C: Send,

§

impl<C> Sync for Boc<C>where C: Sync,

§

impl<C> Unpin for Boc<C>where C: Unpin,

§

impl<C> UnwindSafe for Boc<C>where C: UnwindSafe,

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.