pub struct ManagedBufferCachedBuilder<M>where
    M: ManagedTypeApi,{ /* private fields */ }

Implementations§

source§

impl<M> ManagedBufferCachedBuilder<M>where M: ManagedTypeApi,

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

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

source§

fn default() -> Self

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

impl<M: ManagedTypeApi> FormatBuffer for ManagedBufferCachedBuilder<M>

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

source§

impl<M: ManagedTypeApi> NestedEncodeOutput for ManagedBufferCachedBuilder<M>

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>where T: TryStaticCast, C: TryStaticCast, H: EncodeErrorHandler,

source§

fn push_byte(&mut self, byte: u8)

Write a single byte to the output.

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

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

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere 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 Twhere 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 Twhere U: Into<T>,

§

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 Twhere U: TryFrom<T>,

§

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.