Struct everscale_types::boc::BocRepr
source · pub struct BocRepr;Expand description
BOC representation helper.
Implementations§
source§impl BocRepr
impl BocRepr
sourcepub fn encode_base64<T>(data: T) -> Result<String, Error>where
T: Store,
pub fn encode_base64<T>(data: T) -> Result<String, Error>where
T: Store,
Encodes the specified cell tree as BOC using an empty cell context and
returns the base64 encoded bytes as a string.
sourcepub fn encode<T>(data: T) -> Result<Vec<u8>, Error>where
T: Store,
pub fn encode<T>(data: T) -> Result<Vec<u8>, Error>where
T: Store,
Encodes the specified cell tree as BOC using an empty cell context.
sourcepub fn decode_base64<T, D>(data: D) -> Result<T, BocReprError>
pub fn decode_base64<T, D>(data: D) -> Result<T, BocReprError>
Decodes a base64 encoded BOC into an object
using an empty cell context.
sourcepub fn decode<T, D>(data: D) -> Result<T, BocReprError>
pub fn decode<T, D>(data: D) -> Result<T, BocReprError>
Decodes an object using an empty cell context.
sourcepub fn encode_ext<T>(
data: T,
context: &mut dyn CellContext,
) -> Result<Vec<u8>, Error>where
T: Store,
pub fn encode_ext<T>(
data: T,
context: &mut dyn CellContext,
) -> Result<Vec<u8>, Error>where
T: Store,
Encodes the specified object as BOC.
sourcepub fn decode_ext<T>(
data: &[u8],
context: &mut dyn CellContext,
) -> Result<T, BocReprError>where
for<'a> T: Load<'a>,
pub fn decode_ext<T>(
data: &[u8],
context: &mut dyn CellContext,
) -> Result<T, BocReprError>where
for<'a> T: Load<'a>,
Decodes object from BOC using the specified cell context.
sourcepub fn serialize<S, T>(data: &T, serializer: S) -> Result<S::Ok, S::Error>where
S: Serializer,
T: Store,
pub fn serialize<S, T>(data: &T, serializer: S) -> Result<S::Ok, S::Error>where
S: Serializer,
T: Store,
Serializes the type into an encoded BOC using an empty cell context (as base64 for human readable serializers).
sourcepub fn deserialize<'de, D, T>(deserializer: D) -> Result<T, D::Error>where
D: Deserializer<'de>,
for<'a> T: Load<'a>,
pub fn deserialize<'de, D, T>(deserializer: D) -> Result<T, D::Error>where
D: Deserializer<'de>,
for<'a> T: Load<'a>,
Deserializes the type from an encoded BOC using an empty cell context (from base64 for human readable serializers).
Auto Trait Implementations§
impl Freeze for BocRepr
impl RefUnwindSafe for BocRepr
impl Send for BocRepr
impl Sync for BocRepr
impl Unpin for BocRepr
impl UnwindSafe for BocRepr
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