pub struct BocHeader<'a, S = RandomState> { /* private fields */ }Expand description
Intermediate BOC serializer state.
Implementations§
Source§impl<'a, S> BocHeader<'a, S>where
S: BuildHasher + Default,
impl<'a, S> BocHeader<'a, S>where
S: BuildHasher + Default,
Sourcepub fn with_root(root: &'a DynCell) -> Self
pub fn with_root(root: &'a DynCell) -> Self
Creates an intermediate BOC serializer state with a single root.
Sourcepub fn with_capacity(capacity: usize) -> Self
pub fn with_capacity(capacity: usize) -> Self
Creates an empty intermediate BOC serializer state. Reserves space for the specified number of cells.
Sourcepub fn with_capacity_and_root(capacity: usize, root: &'a DynCell) -> Self
pub fn with_capacity_and_root(capacity: usize, root: &'a DynCell) -> Self
Creates an intermediate BOC serializer state with a single root. Reserves space for the specified number of cells.
Source§impl<'a, S> BocHeader<'a, S>where
S: BuildHasher,
impl<'a, S> BocHeader<'a, S>where
S: BuildHasher,
Sourcepub fn clear(&mut self)
pub fn clear(&mut self)
Clears the header, removing all cells. Keeps the allocated memory for reuse.
Sourcepub fn without_hashes(self, without_hashes: bool) -> Self
pub fn without_hashes(self, without_hashes: bool) -> Self
Prevents hashes from being stored in the encoded BOC.
(overwrites descriptor flag store_hashes during serialization).
Sourcepub fn encode_to_writer<W: Write>(&self, writer: W) -> Result<()>
pub fn encode_to_writer<W: Write>(&self, writer: W) -> Result<()>
Writes cell trees into the writer.
NOTE: Use BocHeader::encode when possible since it’s faster.
Sourcepub fn compute_stats(&self) -> BocHeaderStats
pub fn compute_stats(&self) -> BocHeaderStats
Computes the encoded BOC size and other stuff.
Trait Implementations§
Auto Trait Implementations§
impl<'a, S> Freeze for BocHeader<'a, S>where
S: Freeze,
impl<'a, S = RandomState> !RefUnwindSafe for BocHeader<'a, S>
impl<'a, S> Send for BocHeader<'a, S>where
S: Send,
impl<'a, S> Sync for BocHeader<'a, S>where
S: Sync,
impl<'a, S> Unpin for BocHeader<'a, S>where
S: Unpin,
impl<'a, S = RandomState> !UnwindSafe for BocHeader<'a, S>
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