Enum capnp::dynamic_value::Builder

source ·
pub enum Builder<'a> {
Show 19 variants Void, Bool(bool), Int8(i8), Int16(i16), Int32(i32), Int64(i64), UInt8(u8), UInt16(u16), UInt32(u32), UInt64(u64), Float32(f32), Float64(f64), Enum(Enum), Text(Builder<'a>), Data(Builder<'a>), Struct(Builder<'a>), List(Builder<'a>), AnyPointer(Builder<'a>), Capability(Capability),
}
Expand description

A dynamically-typed value with mutable interior.

Variants§

§

Void

§

Bool(bool)

§

Int8(i8)

§

Int16(i16)

§

Int32(i32)

§

Int64(i64)

§

UInt8(u8)

§

UInt16(u16)

§

UInt32(u32)

§

UInt64(u64)

§

Float32(f32)

§

Float64(f64)

§

Enum(Enum)

§

Text(Builder<'a>)

§

Data(Builder<'a>)

§

Struct(Builder<'a>)

§

List(Builder<'a>)

§

AnyPointer(Builder<'a>)

§

Capability(Capability)

Implementations§

source§

impl<'a> Builder<'a>

source

pub fn reborrow(&mut self) -> Builder<'_>

source

pub fn into_reader(self) -> Reader<'a>

source

pub fn downcast<T: DowncastBuilder<'a>>(self) -> T

Downcasts the Builder into a more specific type. Panics if the expected type does not match the value.

source

pub fn downcast_struct<T: OwnedStruct>(self) -> T::Builder<'a>

Downcasts the Builder into a specific struct type. Panics if the expected type does not match the value.

Design note: instead of this method, it would be better to add a blanket impl of the DowncastBuilder trait that covered every struct type. Unfortunately, the current way the Introspect and OwnedStruct traits are set up does not seem to allow this.

Trait Implementations§

source§

impl<'a> From<&'a mut [u8]> for Builder<'a>

source§

fn from(d: Builder<'a>) -> Builder<'a>

Converts to this type from the input type.
source§

impl<'a> From<Builder<'a>> for Builder<'a>

source§

fn from(builder: Builder<'a>) -> Self

Converts to this type from the input type.
source§

impl<'a> From<Builder<'a>> for Builder<'a>

source§

fn from(builder: Builder<'a>) -> Self

Converts to this type from the input type.
source§

impl<'a> From<Builder<'a>> for Builder<'a>

source§

fn from(builder: Builder<'a>) -> Self

Converts to this type from the input type.
source§

impl<'a> From<Builder<'a>> for Builder<'a>

source§

fn from(builder: Builder<'a>) -> Self

Converts to this type from the input type.
source§

impl<'a> From<Builder<'a>> for Builder<'a>

source§

fn from(builder: Builder<'a>) -> Self

Converts to this type from the input type.
source§

impl<'a> From<Builder<'a>> for Builder<'a>

source§

fn from(builder: Builder<'a>) -> Self

Converts to this type from the input type.
source§

impl<'a> From<Builder<'a>> for Builder<'a>

source§

fn from(builder: Builder<'a>) -> Self

Converts to this type from the input type.
source§

impl<'a> From<Builder<'a>> for Builder<'a>

source§

fn from(builder: Builder<'a>) -> Self

Converts to this type from the input type.
source§

impl<'a> From<Builder<'a>> for Builder<'a>

source§

fn from(builder: Builder<'a>) -> Self

Converts to this type from the input type.
source§

impl<'a> From<Builder<'a>> for Builder<'a>

source§

fn from(builder: Builder<'a>) -> Self

Converts to this type from the input type.
source§

impl<'a> From<Builder<'a>> for Builder<'a>

source§

fn from(builder: Builder<'a>) -> Self

Converts to this type from the input type.
source§

impl<'a> From<Builder<'a>> for Builder<'a>

source§

fn from(builder: Builder<'a>) -> Self

Converts to this type from the input type.
source§

impl<'a> From<Builder<'a>> for Builder<'a>

source§

fn from(builder: Builder<'a>) -> Self

Converts to this type from the input type.
source§

impl<'a> From<Builder<'a>> for Builder<'a>

source§

fn from(builder: Builder<'a>) -> Self

Converts to this type from the input type.
source§

impl<'a> From<Builder<'a>> for Builder<'a>

source§

fn from(builder: Builder<'a>) -> Self

Converts to this type from the input type.
source§

impl<'a> From<Builder<'a>> for Builder<'a>

source§

fn from(builder: Builder<'a>) -> Self

Converts to this type from the input type.
source§

impl<'a> From<Builder<'a>> for Builder<'a>

source§

fn from(builder: Builder<'a>) -> Self

Converts to this type from the input type.
source§

impl<'a> From<Builder<'a>> for Builder<'a>

source§

fn from(builder: Builder<'a>) -> Self

Converts to this type from the input type.
source§

impl<'a> From<Builder<'a>> for Builder<'a>

source§

fn from(builder: Builder<'a>) -> Self

Converts to this type from the input type.
source§

impl<'a> From<Builder<'a>> for Builder<'a>

source§

fn from(builder: Builder<'a>) -> Self

Converts to this type from the input type.
source§

impl<'a> From<Builder<'a>> for Builder<'a>

source§

fn from(builder: Builder<'a>) -> Self

Converts to this type from the input type.
source§

impl<'a> From<Builder<'a>> for Builder<'a>

source§

fn from(builder: Builder<'a>) -> Self

Converts to this type from the input type.
source§

impl<'a> From<Builder<'a>> for Builder<'a>

source§

fn from(builder: Builder<'a>) -> Self

Converts to this type from the input type.
source§

impl<'a> From<Builder<'a>> for Builder<'a>

source§

fn from(builder: Builder<'a>) -> Self

Converts to this type from the input type.
source§

impl<'a> From<Builder<'a>> for Builder<'a>

source§

fn from(builder: Builder<'a>) -> Self

Converts to this type from the input type.
source§

impl<'a> From<Builder<'a>> for Builder<'a>

source§

fn from(builder: Builder<'a>) -> Self

Converts to this type from the input type.
source§

impl<'a> From<Builder<'a>> for Builder<'a>

source§

fn from(builder: Builder<'a>) -> Self

Converts to this type from the input type.
source§

impl<'a> From<Builder<'a>> for Builder<'a>

source§

fn from(builder: Builder<'a>) -> Self

Converts to this type from the input type.
source§

impl<'a> From<Builder<'a>> for Builder<'a>

source§

fn from(builder: Builder<'a>) -> Self

Converts to this type from the input type.
source§

impl<'a> From<Builder<'a>> for Builder<'a>

source§

fn from(a: Builder<'a>) -> Builder<'a>

Converts to this type from the input type.
source§

impl<'a> From<Builder<'a>> for Builder<'a>

source§

fn from(t: Builder<'a>) -> Builder<'a>

Converts to this type from the input type.
source§

impl<'a> From<Builder<'a>> for Builder<'a>

source§

fn from(t: Builder<'a>) -> Builder<'a>

Converts to this type from the input type.
source§

impl<'a> From<Builder<'a>> for Builder<'a>

source§

fn from(x: Builder<'a>) -> Builder<'a>

Converts to this type from the input type.
source§

impl<'a> From<Builder<'a>> for Builder<'a>

source§

fn from(x: Builder<'a>) -> Builder<'a>

Converts to this type from the input type.
source§

impl<'a> From<Builder<'a>> for Builder<'a>

source§

fn from(builder: Builder<'a>) -> Self

Converts to this type from the input type.
source§

impl<'a> From<Builder<'a>> for Builder<'a>

source§

fn from(t: Builder<'a>) -> Builder<'a>

Converts to this type from the input type.
source§

impl<'a> From<Builder<'a>> for Builder<'a>

source§

fn from(t: Builder<'a>) -> Builder<'a>

Converts to this type from the input type.
source§

impl<'a> From<Builder<'a>> for Builder<'a>

source§

fn from(builder: Builder<'a>) -> Self

Converts to this type from the input type.
source§

impl<'a> From<Builder<'a>> for Builder<'a>

source§

fn from(builder: Builder<'a>) -> Self

Converts to this type from the input type.
source§

impl<'a> From<Builder<'a>> for Builder<'a>

source§

fn from(builder: Builder<'a>) -> Self

Converts to this type from the input type.
source§

impl<'a> From<Builder<'a>> for Builder<'a>

source§

fn from(builder: Builder<'a>) -> Self

Converts to this type from the input type.
source§

impl<'a> From<Builder<'a>> for Builder<'a>

source§

fn from(builder: Builder<'a>) -> Self

Converts to this type from the input type.
source§

impl<'a, T: FromClientHook> From<Builder<'a, T>> for Builder<'a>

source§

fn from(t: Builder<'a, T>) -> Builder<'a>

Converts to this type from the input type.
source§

impl<'a, T: TryFrom<u16, Error = NotInSchema> + Introspect> From<Builder<'a, T>> for Builder<'a>

source§

fn from(t: Builder<'a, T>) -> Builder<'a>

Converts to this type from the input type.
source§

impl<'a, T: Owned> From<Builder<'a, T>> for Builder<'a>

source§

fn from(t: Builder<'a, T>) -> Builder<'a>

Converts to this type from the input type.
source§

impl<'a, T: PrimitiveElement + Introspect> From<Builder<'a, T>> for Builder<'a>

source§

fn from(t: Builder<'a, T>) -> Builder<'a>

Converts to this type from the input type.
source§

impl<'a, T: OwnedStruct> From<Builder<'a, T>> for Builder<'a>

source§

fn from(t: Builder<'a, T>) -> Builder<'a>

Converts to this type from the input type.
source§

impl<'a> From<Capability> for Builder<'a>

source§

fn from(c: Capability) -> Builder<'a>

Converts to this type from the input type.
source§

impl<'a> From<Enum> for Builder<'a>

source§

fn from(e: Enum) -> Builder<'a>

Converts to this type from the input type.

Auto Trait Implementations§

§

impl<'a> Freeze for Builder<'a>

§

impl<'a> !RefUnwindSafe for Builder<'a>

§

impl<'a> !Send for Builder<'a>

§

impl<'a> !Sync for Builder<'a>

§

impl<'a> Unpin for Builder<'a>

§

impl<'a> !UnwindSafe for Builder<'a>

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>,

source§

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>,

source§

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.