Enum capnp::dynamic_value::Builder
source · pub enum Builder<'a> {
}
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>
impl<'a> Builder<'a>
pub fn reborrow(&mut self) -> Builder<'_>
pub fn into_reader(self) -> Reader<'a>
sourcepub fn downcast<T: DowncastBuilder<'a>>(self) -> T
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.
sourcepub fn downcast_struct<T: OwnedStruct>(self) -> T::Builder<'a>
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, T: TryFrom<u16, Error = NotInSchema> + Introspect> From<Builder<'a, T>> for Builder<'a>
impl<'a, T: TryFrom<u16, Error = NotInSchema> + Introspect> From<Builder<'a, T>> for Builder<'a>
source§impl<'a, T: PrimitiveElement + Introspect> From<Builder<'a, T>> for Builder<'a>
impl<'a, T: PrimitiveElement + Introspect> From<Builder<'a, T>> for Builder<'a>
source§impl<'a> From<Capability> for Builder<'a>
impl<'a> From<Capability> for Builder<'a>
source§fn from(c: Capability) -> Builder<'a>
fn from(c: Capability) -> 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> 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