Struct multiversx_sc::types::ManagedBufferCachedBuilder
source · pub struct ManagedBufferCachedBuilder<M>where
M: ManagedTypeApi,{ /* private fields */ }
Implementations§
source§impl<M> ManagedBufferCachedBuilder<M>where
M: ManagedTypeApi,
impl<M> ManagedBufferCachedBuilder<M>where M: ManagedTypeApi,
sourcepub fn new_from_slice(slice: &[u8]) -> Self
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,
impl<M> ManagedBufferCachedBuilder<M>where M: ManagedTypeApi,
pub fn into_managed_buffer(self) -> ManagedBuffer<M>
pub fn append_bytes(&mut self, bytes: &[u8])
pub fn append_managed_buffer(&mut self, item: &ManagedBuffer<M>)
sourcepub fn append_managed_buffer_hex(&mut self, item: &ManagedBuffer<M>)
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
sourcepub fn append_managed_buffer_binary(&mut self, item: &ManagedBuffer<M>)
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,
impl<M> Default for ManagedBufferCachedBuilder<M>where M: ManagedTypeApi,
source§impl<M: ManagedTypeApi> FormatBuffer for ManagedBufferCachedBuilder<M>
impl<M: ManagedTypeApi> FormatBuffer for ManagedBufferCachedBuilder<M>
fn append_ascii(&mut self, ascii: &[u8])
fn append_display<T: SCDisplay>(&mut self, item: &T)
fn append_lower_hex<T: SCLowerHex>(&mut self, item: &T)
fn append_binary<T: SCBinary>(&mut self, item: &T)
fn append_codec<T: SCCodec>(&mut self, item: &T)
source§impl<M> FormatByteReceiver for ManagedBufferCachedBuilder<M>where
M: ManagedTypeApi,
impl<M> FormatByteReceiver for ManagedBufferCachedBuilder<M>where M: ManagedTypeApi,
type Api = M
fn append_bytes(&mut self, bytes: &[u8])
fn append_managed_buffer(&mut self, item: &ManagedBuffer<M>)
fn append_managed_buffer_lower_hex(&mut self, item: &ManagedBuffer<M>)
fn append_managed_buffer_binary(&mut self, item: &ManagedBuffer<M>)
source§impl<M: ManagedTypeApi> NestedEncodeOutput for ManagedBufferCachedBuilder<M>
impl<M: ManagedTypeApi> NestedEncodeOutput for ManagedBufferCachedBuilder<M>
fn supports_specialized_type<T: TryStaticCast>() -> bool
fn push_specialized<T, C, H>( &mut self, _context: C, value: &T, h: H ) -> Result<(), H::HandledErr>where T: TryStaticCast, C: TryStaticCast, H: EncodeErrorHandler,
Auto Trait Implementations§
impl<M> CodecFromSelf for ManagedBufferCachedBuilder<M>where M: CodecFromSelf,
impl<M> RefUnwindSafe for ManagedBufferCachedBuilder<M>where M: RefUnwindSafe, <M as HandleTypeInfo>::ManagedBufferHandle: RefUnwindSafe,
impl<M> Send for ManagedBufferCachedBuilder<M>where M: Send, <M as HandleTypeInfo>::ManagedBufferHandle: Send,
impl<M> Sync for ManagedBufferCachedBuilder<M>where M: Sync, <M as HandleTypeInfo>::ManagedBufferHandle: Sync,
impl<M> Unpin for ManagedBufferCachedBuilder<M>where M: Unpin, <M as HandleTypeInfo>::ManagedBufferHandle: Unpin,
impl<M> UnwindSafe for ManagedBufferCachedBuilder<M>where M: UnwindSafe, <M as HandleTypeInfo>::ManagedBufferHandle: UnwindSafe,
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