pub struct ManagedBufferBuilder<M, Impl = ManagedBufferBuilderImplBasic<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]) -> ManagedBufferBuilder<M, Impl>
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>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>where
M: ManagedTypeApi,
impl<M> Default for ManagedBufferBuilder<M>where
M: ManagedTypeApi,
Source§fn default() -> ManagedBufferBuilder<M>
fn default() -> ManagedBufferBuilder<M>
Returns the “default value” for a type. Read more
Source§impl<M> FormatBuffer for ManagedBufferBuilder<M>where
M: ManagedTypeApi,
impl<M> FormatBuffer for ManagedBufferBuilder<M>where
M: ManagedTypeApi,
fn append_ascii(&mut self, ascii: &[u8])
fn append_display<T>(&mut self, item: &T)where
T: SCDisplay,
fn append_lower_hex<T>(&mut self, item: &T)where
T: SCLowerHex,
fn append_binary<T>(&mut self, item: &T)where
T: SCBinary,
fn append_codec<T>(&mut self, item: &T)where
T: SCCodec,
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>() -> boolwhere
T: TryStaticCast,
fn push_specialized<T, C, H>( &mut self, _context: C, value: &T, h: H, ) -> Result<(), <H as EncodeErrorHandler>::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
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> InterpretableFrom<T> for T
impl<T> InterpretableFrom<T> for T
fn interpret_from(from: T, _context: &InterpreterContext) -> T
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
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 moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
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