multiversx_sc::types

Struct ManagedBufferBuilder

Source
pub struct ManagedBufferBuilder<M, Impl = ManagedBufferImplDefault<M>>{ /* private fields */ }

Implementations§

Source§

impl<M, Impl> ManagedBufferBuilder<M, Impl>

Source

pub fn new_from_slice(slice: &[u8]) -> Self

Creates instance as lazily as possible. If possible, the slice is loaded into the static buffer. If not, it is saved into the managed buffer so that the data is not lost. Use flush_to_managed_buffer after this to ensure that the managed buffer is populated.

Source§

impl<M, Impl> ManagedBufferBuilder<M, Impl>

Source

pub fn into_managed_buffer(self) -> ManagedBuffer<M>

Source

pub fn append_bytes(&mut self, bytes: &[u8])

Source

pub fn append_managed_buffer(&mut self, item: &ManagedBuffer<M>)

Source

pub fn append_managed_buffer_hex(&mut self, item: &ManagedBuffer<M>)

Converts the input to hex and adds it to the current buffer.

TODO: consider making the hex conversion part of the VM

Source

pub fn append_managed_buffer_binary(&mut self, item: &ManagedBuffer<M>)

Converts the input to binary ASCII and adds it to the current buffer.

Trait Implementations§

Source§

impl<M> Default for ManagedBufferBuilder<M, ManagedBufferImplDefault<M>>
where M: ManagedTypeApi,

Source§

fn default() -> Self

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

impl<M> FormatBuffer for ManagedBufferBuilder<M, ManagedBufferImplDefault<M>>
where M: ManagedTypeApi,

Source§

fn append_ascii(&mut self, ascii: &[u8])

Source§

fn append_display<T: SCDisplay>(&mut self, item: &T)

Source§

fn append_lower_hex<T: SCLowerHex>(&mut self, item: &T)

Source§

fn append_binary<T: SCBinary>(&mut self, item: &T)

Source§

fn append_codec<T: SCCodec>(&mut self, item: &T)

Source§

impl<M, Impl> FormatByteReceiver for ManagedBufferBuilder<M, Impl>

Source§

impl<M, Impl> NestedEncodeOutput for ManagedBufferBuilder<M, Impl>

Source§

fn write(&mut self, bytes: &[u8])

Write to the output.
Source§

fn supports_specialized_type<T: TryStaticCast>() -> bool

Source§

fn push_specialized<T, C, H>( &mut self, _context: C, value: &T, h: H, ) -> Result<(), H::HandledErr>

Source§

fn push_byte(&mut self, byte: u8)

Write a single byte to the output.

Auto Trait Implementations§

§

impl<M, Impl> Freeze for ManagedBufferBuilder<M, Impl>
where Impl: Freeze,

§

impl<M, Impl> RefUnwindSafe for ManagedBufferBuilder<M, Impl>
where Impl: RefUnwindSafe, M: RefUnwindSafe,

§

impl<M, Impl> Send for ManagedBufferBuilder<M, Impl>
where Impl: Send, M: Send,

§

impl<M, Impl> Sync for ManagedBufferBuilder<M, Impl>
where Impl: Sync, M: Sync,

§

impl<M, Impl> Unpin for ManagedBufferBuilder<M, Impl>
where Impl: Unpin, M: Unpin,

§

impl<M, Impl> UnwindSafe for ManagedBufferBuilder<M, Impl>
where Impl: UnwindSafe, M: UnwindSafe,

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