Struct capnp::message::TypedBuilder

source ·
pub struct TypedBuilder<T, A = HeapAllocator>
where T: Owned, A: Allocator,
{ /* private fields */ }
Expand description

Stongly typed variant of the Builder

Generic type parameters:

  • T - type of the capnp message which this builder is specialized on. Please see module documentation for more info about builder type specialization.
  • A - type of allocator

Implementations§

source§

impl<T> TypedBuilder<T, HeapAllocator>
where T: Owned,

source

pub fn new_default() -> Self

source§

impl<T, A> TypedBuilder<T, A>
where T: Owned, A: Allocator,

source

pub fn new(message: Builder<A>) -> Self

source

pub fn init_root(&mut self) -> T::Builder<'_>

source

pub fn initn_root(&mut self, length: u32) -> T::Builder<'_>

source

pub fn get_root(&mut self) -> Result<T::Builder<'_>>

source

pub fn get_root_as_reader(&self) -> Result<T::Reader<'_>>

source

pub fn set_root(&mut self, value: T::Reader<'_>) -> Result<()>

source

pub fn into_inner(self) -> Builder<A>

source

pub fn borrow_inner(&self) -> &Builder<A>

source

pub fn borrow_inner_mut(&mut self) -> &mut Builder<A>

source

pub fn into_reader(self) -> TypedReader<Builder<A>, T>

Trait Implementations§

source§

impl<T> Default for TypedBuilder<T, HeapAllocator>
where T: Owned,

source§

fn default() -> Self

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

impl<T, A> From<Builder<A>> for TypedBuilder<T, A>
where T: Owned, A: Allocator,

source§

fn from(builder: Builder<A>) -> Self

Converts to this type from the input type.
source§

impl<A, T> From<TypedBuilder<T, A>> for TypedReader<Builder<A>, T>
where A: Allocator, T: Owned,

source§

fn from(builder: TypedBuilder<T, A>) -> Self

Converts to this type from the input type.

Auto Trait Implementations§

§

impl<T, A> RefUnwindSafe for TypedBuilder<T, A>

§

impl<T, A> Send for TypedBuilder<T, A>
where A: Send, T: Send,

§

impl<T, A = HeapAllocator> !Sync for TypedBuilder<T, A>

§

impl<T, A> Unpin for TypedBuilder<T, A>
where A: Unpin, T: Unpin,

§

impl<T, A> UnwindSafe for TypedBuilder<T, A>
where A: UnwindSafe, T: UnwindSafe,

Blanket Implementations§

source§

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

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

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

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where 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 T
where 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 T
where 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 T
where 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.