multiversx_sc_scenario::imports

Struct ManagedBufferBuilder

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

Implementations§

Source§

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

Source

pub fn new_from_slice(slice: &[u8]) -> ManagedBufferBuilder<M, Impl>

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>
where M: ManagedTypeApi,

Source§

fn default() -> ManagedBufferBuilder<M>

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

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

Source§

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

Source§

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

Source§

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

Source§

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

Source§

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

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>() -> bool
where T: TryStaticCast,

Source§

fn push_specialized<T, C, H>( &mut self, _context: C, value: &T, h: H, ) -> Result<(), <H as EncodeErrorHandler>::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> InterpretableFrom<T> for T

Source§

fn interpret_from(from: T, _context: &InterpreterContext) -> T

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

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts self into a Left variant of Either<Self, Self> if into_left is true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts self into a Left variant of Either<Self, Self> if into_left(&self) returns true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

impl<T> ReconstructableFrom<T> for T

Source§

fn reconstruct_from(from: T, _builder: &ReconstructorContext) -> T

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