Struct everscale_types::boc::Boc
source · pub struct Boc;Expand description
BOC (Bag Of Cells) helper.
Implementations§
source§impl Boc
impl Boc
sourcepub fn file_hash(data: impl AsRef<[u8]>) -> HashBytes
pub fn file_hash(data: impl AsRef<[u8]>) -> HashBytes
Computes a simple SHA256 hash of the data.
sourcepub fn encode_base64<T>(cell: T) -> String
pub fn encode_base64<T>(cell: T) -> String
Encodes the specified cell tree as BOC and
returns the base64 encoded bytes as a string.
sourcepub fn encode_pair<T1, T2>((cell1, cell2): (T1, T2)) -> Vec<u8>
pub fn encode_pair<T1, T2>((cell1, cell2): (T1, T2)) -> Vec<u8>
Encodes a pair of cell trees as BOC.
sourcepub fn decode_base64<T: AsRef<[u8]>>(data: T) -> Result<Cell, Error>
pub fn decode_base64<T: AsRef<[u8]>>(data: T) -> Result<Cell, Error>
Decodes a base64 encoded BOC into a cell tree
using an empty cell context.
sourcepub fn decode<T>(data: T) -> Result<Cell, Error>
pub fn decode<T>(data: T) -> Result<Cell, Error>
Decodes a cell tree using an empty cell context.
sourcepub fn decode_pair<T>(data: T) -> Result<(Cell, Cell), Error>
pub fn decode_pair<T>(data: T) -> Result<(Cell, Cell), Error>
Decodes a pair of cell trees using an empty cell context.
sourcepub fn decode_ext(
data: &[u8],
context: &mut dyn CellContext,
) -> Result<Cell, Error>
pub fn decode_ext( data: &[u8], context: &mut dyn CellContext, ) -> Result<Cell, Error>
Decodes a cell tree using the specified cell context.
sourcepub fn decode_pair_ext(
data: &[u8],
context: &mut dyn CellContext,
) -> Result<(Cell, Cell), Error>
pub fn decode_pair_ext( data: &[u8], context: &mut dyn CellContext, ) -> Result<(Cell, Cell), Error>
Decodes a pair of cell trees using the specified cell context.
sourcepub fn serialize<S, T>(cell: &T, serializer: S) -> Result<S::Ok, S::Error>
pub fn serialize<S, T>(cell: &T, serializer: S) -> Result<S::Ok, S::Error>
Serializes cell into an encoded BOC (as base64 for human readable serializers).
sourcepub fn deserialize<'de, D>(deserializer: D) -> Result<Cell, D::Error>where
D: Deserializer<'de>,
pub fn deserialize<'de, D>(deserializer: D) -> Result<Cell, D::Error>where
D: Deserializer<'de>,
Deserializes cell from an encoded BOC (from base64 for human readable deserializers).
Auto Trait Implementations§
impl Freeze for Boc
impl RefUnwindSafe for Boc
impl Send for Boc
impl Sync for Boc
impl Unpin for Boc
impl UnwindSafe for Boc
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more