[][src]Trait capnp::traits::Owned

pub trait Owned<'a> {
    type Reader: FromPointerReader<'a> + SetPointerBuilder<Self::Builder>;
    type Builder: FromPointerBuilder<'a>;
}

Associated types hackery that allows us to reason about Cap'n Proto types without needing to give them a lifetime 'a.

If Foo is a Cap'n Proto struct and Bar is a Rust-native struct, then foo::Reader<'a> is to foo::Owned as &'a Bar is to Bar, and foo::Builder<'a> is to foo::Owned as &'a mut Bar is to Bar. The relationship is formalized by an impl <'a> capnp::traits::Owned<'a> for foo::Owned. Because Cap'n Proto struct layout differs from Rust struct layout, a foo::Owned value cannot be used for anything interesting on its own; the foo::Owned type is useful nonetheless as a type parameter, e.g. for a generic container that owns a Cap'n Proto message of type T: for<'a> capnp::traits::Owned<'a>.

Associated Types

type Reader: FromPointerReader<'a> + SetPointerBuilder<Self::Builder>

type Builder: FromPointerBuilder<'a>

Loading content...

Implementors

impl<'a> Owned<'a> for capnp::any_pointer::Owned[src]

type Reader = Reader<'a>

type Builder = Builder<'a>

impl<'a> Owned<'a> for capnp::any_pointer_list::Owned[src]

type Reader = Reader<'a>

type Builder = Builder<'a>

impl<'a> Owned<'a> for capnp::data::Owned[src]

type Reader = Reader<'a>

type Builder = Builder<'a>

impl<'a> Owned<'a> for capnp::data_list::Owned[src]

type Reader = Reader<'a>

type Builder = Builder<'a>

impl<'a> Owned<'a> for capnp::text::Owned[src]

type Reader = Reader<'a>

type Builder = Builder<'a>

impl<'a> Owned<'a> for capnp::text_list::Owned[src]

type Reader = Reader<'a>

type Builder = Builder<'a>

impl<'a, T> Owned<'a> for capnp::capability_list::Owned<T> where
    T: FromClientHook
[src]

type Reader = Reader<'a, T>

type Builder = Builder<'a, T>

impl<'a, T> Owned<'a> for capnp::enum_list::Owned<T> where
    T: FromU16
[src]

type Reader = Reader<'a, T>

type Builder = Builder<'a, T>

impl<'a, T> Owned<'a> for capnp::list_list::Owned<T> where
    T: for<'b> Owned<'b>, 
[src]

type Reader = Reader<'a, T>

type Builder = Builder<'a, T>

impl<'a, T> Owned<'a> for capnp::primitive_list::Owned<T> where
    T: PrimitiveElement
[src]

type Reader = Reader<'a, T>

type Builder = Builder<'a, T>

impl<'a, T> Owned<'a> for capnp::struct_list::Owned<T> where
    T: for<'b> OwnedStruct<'b>, 
[src]

type Reader = Reader<'a, T>

type Builder = Builder<'a, T>

Loading content...