pub struct Builder<A>where
A: Allocator,{ /* private fields */ }
Expand description
A container used to build a message.
Implementations
sourceimpl<A> Builder<A>where
A: Allocator,
impl<A> Builder<A>where
A: Allocator,
pub fn new(allocator: A) -> Self
sourcepub fn init_root<'a, T: FromPointerBuilder<'a>>(&'a mut self) -> T
pub fn init_root<'a, T: FromPointerBuilder<'a>>(&'a mut self) -> T
Initializes the root as a value of the given type.
sourcepub fn get_root<'a, T: FromPointerBuilder<'a>>(&'a mut self) -> Result<T>
pub fn get_root<'a, T: FromPointerBuilder<'a>>(&'a mut self) -> Result<T>
Gets the root, interpreting it as the given type.
pub fn get_root_as_reader<'a, T: FromPointerReader<'a>>(&'a self) -> Result<T>
sourcepub fn set_root<To, From: SetPointerBuilder<To>>(
&mut self,
value: From
) -> Result<()>
pub fn set_root<To, From: SetPointerBuilder<To>>(
&mut self,
value: From
) -> Result<()>
Sets the root to a deep copy of the given value.
sourcepub fn set_root_canonical<To, From: SetPointerBuilder<To>>(
&mut self,
value: From
) -> Result<()>
pub fn set_root_canonical<To, From: SetPointerBuilder<To>>(
&mut self,
value: From
) -> Result<()>
Sets the root to a canonicalized version of value
. If this was the first action taken
on this Builder
, then a subsequence call to get_segments_for_output()
should return
a single segment, containing the full canonicalized message.
pub fn get_segments_for_output<'a>(&'a self) -> OutputSegments<'a>
pub fn into_reader(self) -> Reader<Builder<A>>
sourceimpl Builder<HeapAllocator>
impl Builder<HeapAllocator>
pub fn new_default() -> Builder<HeapAllocator>
Trait Implementations
sourceimpl<A, T> From<Builder<A>> for TypedReader<Builder<A>, T>where
A: Allocator,
T: for<'a> Owned<'a>,
impl<A, T> From<Builder<A>> for TypedReader<Builder<A>, T>where
A: Allocator,
T: for<'a> Owned<'a>,
sourcefn from(message: Builder<A>) -> TypedReader<Builder<A>, T>
fn from(message: Builder<A>) -> TypedReader<Builder<A>, T>
Converts to this type from the input type.
sourceimpl<A> ReaderSegments for Builder<A>where
A: Allocator,
impl<A> ReaderSegments for Builder<A>where
A: Allocator,
impl<A> Send for Builder<A>where
A: Send + Allocator,
Auto Trait Implementations
impl<A> !RefUnwindSafe for Builder<A>
impl<A> !Sync for Builder<A>
impl<A> Unpin for Builder<A>where
A: Unpin,
impl<A> UnwindSafe for Builder<A>where
A: UnwindSafe,
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more