pub struct ManagedBufferBuilder<M, Impl = ManagedBufferImplDefault<M>>where
M: ManagedTypeApi,
Impl: ManagedBufferBuilderImpl<M>,{ /* private fields */ }
Implementations§
Source§impl<M, Impl> ManagedBufferBuilder<M, Impl>where
M: ManagedTypeApi,
Impl: ManagedBufferBuilderImpl<M>,
impl<M, Impl> ManagedBufferBuilder<M, Impl>where
M: ManagedTypeApi,
Impl: ManagedBufferBuilderImpl<M>,
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, Impl> ManagedBufferBuilder<M, Impl>where
M: ManagedTypeApi,
Impl: ManagedBufferBuilderImpl<M>,
impl<M, Impl> ManagedBufferBuilder<M, Impl>where
M: ManagedTypeApi,
Impl: ManagedBufferBuilderImpl<M>,
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 ManagedBufferBuilder<M, ManagedBufferImplDefault<M>>where
M: ManagedTypeApi,
impl<M> Default for ManagedBufferBuilder<M, ManagedBufferImplDefault<M>>where
M: ManagedTypeApi,
Source§impl<M> FormatBuffer for ManagedBufferBuilder<M, ManagedBufferImplDefault<M>>where
M: ManagedTypeApi,
impl<M> FormatBuffer for ManagedBufferBuilder<M, ManagedBufferImplDefault<M>>where
M: ManagedTypeApi,
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, Impl> FormatByteReceiver for ManagedBufferBuilder<M, Impl>where
M: ManagedTypeApi,
Impl: ManagedBufferBuilderImpl<M>,
impl<M, Impl> FormatByteReceiver for ManagedBufferBuilder<M, Impl>where
M: ManagedTypeApi,
Impl: ManagedBufferBuilderImpl<M>,
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, Impl> NestedEncodeOutput for ManagedBufferBuilder<M, Impl>where
M: ManagedTypeApi,
Impl: ManagedBufferBuilderImpl<M>,
impl<M, Impl> NestedEncodeOutput for ManagedBufferBuilder<M, Impl>where
M: ManagedTypeApi,
Impl: ManagedBufferBuilderImpl<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>
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>
impl<M, Impl> Sync for ManagedBufferBuilder<M, Impl>
impl<M, Impl> Unpin for ManagedBufferBuilder<M, Impl>
impl<M, Impl> UnwindSafe for ManagedBufferBuilder<M, Impl>where
Impl: UnwindSafe,
M: 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