tonstruct 0.0.3

TON blockchain types serialization tool for Rust
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
use crate::utils::CastErrorToAnyhow;

pub trait ToCell {
    fn to_cell(&self) -> anyhow::Result<tonlib_core::cell::Cell> {
        let mut buf = tonlib_core::cell::CellBuilder::new();
        self.store(&mut buf)?;
        buf.build().map_err_to_anyhow()
    }

    fn store<'a>(
        &self,
        builder: &'a mut tonlib_core::cell::CellBuilder,
    ) -> anyhow::Result<&'a mut tonlib_core::cell::CellBuilder>;
}