Struct everscale_types::boc::ser::BocHeader

source ·
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,

source

pub fn with_root(root: &'a DynCell) -> Self

Creates an intermediate BOC serializer state with a single root.

source

pub fn with_capacity(capacity: usize) -> Self

Creates an empty intermediate BOC serializer state. Reserves space for the specified number of cells.

source

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,

source

pub fn clear(&mut self)

Clears the header, removing all cells. Keeps the allocated memory for reuse.

source

pub fn add_root(&mut self, root: &'a DynCell)

Adds an additional root to the state.

source

pub fn with_crc(self, include_ctc: bool) -> Self

Includes CRC bytes in the encoded BOC.

source

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).

source

pub fn encode(&self, target: &mut Vec<u8>)

Encodes cell trees into bytes.

Trait Implementations§

source§

impl<S: BuildHasher + Default> Default for BocHeader<'_, S>

source§

fn default() -> Self

Returns the “default value” for a type. Read more

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> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for T
where U: From<T>,

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 for T

source§

type Output = T

Should always be Self
source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

source§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

source§

fn vzip(self) -> V

source§

impl<T> EquivalentRepr<T> for T