Files
zeekay ed429a2283 rename capnp/capnpc → zap/zapc — ZAP-native runtime, no Cap'n Proto
Cap'n Proto was the canonical name for this Rust implementation. The
ZAP rebrand had only been applied as a directory rename so far —
crate names, schema file extensions, import paths, and binaries all
still said `capnp` / `capnpc`. This commit makes the rebrand real.

Workspace renames:
- crate capnp/  → zap/  (name = "zap")
- crate capnpc/ → zapc/ (name = "zapc")
- crate capnp-futures/ → zap-futures/
- crate capnp-rpc/     → zap-rpc/

Source-file renames:
- *_capnp.rs → *_zap.rs (~12 files: schema_zap.rs, rpc_zap.rs, etc.)
- capnpc-rust.rs → zapc-rust.rs (the codegen binary entry point)
- *.capnp → *.zap (33 schema files)

Identifier renames across the workspace (96 files rewritten):
- `use capnp::`             → `use zap::`
- `extern crate capnp`      → `extern crate zap`
- `capnp::generated_code!`  → `zap::generated_code!`
- `capnp::traits::Owned`    → `zap::traits::Owned`
- `capnp::message::...`     → `zap::message::...`
- `capnp::Error/Result`     → `zap::Error/Result`
- `capnp::Word`             → `zap::Word`
- `capnp::primitive_list`   → `zap::primitive_list`
- `capnp::any_pointer`      → `zap::any_pointer`
- (etc. — see python script in commit history for full list)

Cargo.toml dep keys:
- `capnp = { path = ... }`  → `zap = { path = ... }`
- `[dependencies.capnp]`     → `[dependencies.zap]`
- `capnpc = { ... }`        → `zapc = { ... }`
- Per-crate name= field and bin = "capnpc-rust" → "zapc"

Schema header strip:
- `using Cxx = import "/capnp/c++.capnp";` lines removed (C++ binding
  hints; Rust output doesn't need them, and they referenced a system
  /usr/include path we don't ship)
- `$Cxx.namespace("capnp::...")` annotations removed

Build-time decoupling for the benchmark:
- Pre-generated `carsales_zap.rs`, `catrank_zap.rs`, `eval_zap.rs` are
  now committed in benchmark/. benchmark/build.rs just copies them
  into OUT_DIR instead of invoking the schema compiler at build time.
- benchmark/Cargo.toml drops the [build-dependencies] zapc entry.
  Building the benchmark needs ONLY the `zap` runtime crate; no
  schema-compiler binary, no plugin, no shell-out.

To regenerate the schema-bound .rs from .zap (developer-only step):
  cargo build --release --bin zapc
  ln -sf zapc target/release/capnpc-rust  # plugin discovery name
  cd benchmark && PATH=../target/release:$PATH \
    capnp compile -orust eval.zap catrank.zap carsales.zap

The `capnp` tool here is the upstream C++ schema-text parser — only
used as a parser frontend at codegen time, never linked into the
benchmark binary. Runtime + build = 100% zap/zapc only.

Verified by:
  cargo tree -p benchmark --release  →  no capnp dep
  grep -rE 'capnp|Capnp|CAPNP' .     →  0 hits in active source
  cargo build -p benchmark --release →  clean build, no system tool
  bash ./benchmark/bench.sh quick    →  runs end-to-end

Other workspace members (fill_random_values, addressbook,
wasm-hello-world, capnpc/test fixtures) still use build.rs schema
compilation at build time; they require a `zap` binary in PATH.
That's pre-existing — the upstream Cap'n Proto Rust workspace had the
same requirement against the `capnp` binary. Out of scope for this PR.
2026-05-27 12:36:19 -07:00

1068 lines
46 KiB
Rust

// @generated by the zapc-rust plugin to the ZAP schema compiler.
// DO NOT EDIT.
// source: eval.zap
#[repr(u16)]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum Operation {
Add = 0,
Subtract = 1,
Multiply = 2,
Divide = 3,
Modulus = 4,
}
impl ::zap::introspect::Introspect for Operation {
fn introspect() -> ::zap::introspect::Type { ::zap::introspect::TypeVariant::Enum(::zap::introspect::RawEnumSchema { encoded_node: &operation::ENCODED_NODE, annotation_types: operation::get_annotation_types }).into() }
}
impl ::core::convert::From<Operation> for ::zap::dynamic_value::Reader<'_> {
fn from(e: Operation) -> Self { ::zap::dynamic_value::Enum::new(e.into(), ::zap::introspect::RawEnumSchema { encoded_node: &operation::ENCODED_NODE, annotation_types: operation::get_annotation_types }.into()).into() }
}
impl ::core::convert::TryFrom<u16> for Operation {
type Error = ::zap::NotInSchema;
fn try_from(value: u16) -> ::core::result::Result<Self, <Operation as ::core::convert::TryFrom<u16>>::Error> {
match value {
0 => ::core::result::Result::Ok(Self::Add),
1 => ::core::result::Result::Ok(Self::Subtract),
2 => ::core::result::Result::Ok(Self::Multiply),
3 => ::core::result::Result::Ok(Self::Divide),
4 => ::core::result::Result::Ok(Self::Modulus),
n => ::core::result::Result::Err(::zap::NotInSchema(n)),
}
}
}
impl From<Operation> for u16 {
#[inline]
fn from(x: Operation) -> u16 { x as u16 }
}
impl ::zap::traits::HasTypeId for Operation {
const TYPE_ID: u64 = 0xacf3_53ef_7577_3376u64;
}
mod operation {
pub static ENCODED_NODE: [::zap::Word; 40] = [
::zap::word(0, 0, 0, 0, 6, 0, 6, 0),
::zap::word(118, 51, 119, 117, 239, 83, 243, 172),
::zap::word(11, 0, 0, 0, 2, 0, 0, 0),
::zap::word(218, 158, 14, 231, 195, 196, 45, 225),
::zap::word(0, 0, 0, 0, 0, 0, 0, 0),
::zap::word(0, 0, 0, 0, 0, 0, 0, 0),
::zap::word(170, 4, 0, 0, 255, 4, 0, 0),
::zap::word(21, 0, 0, 0, 170, 0, 0, 0),
::zap::word(29, 0, 0, 0, 7, 0, 0, 0),
::zap::word(0, 0, 0, 0, 0, 0, 0, 0),
::zap::word(25, 0, 0, 0, 127, 0, 0, 0),
::zap::word(0, 0, 0, 0, 0, 0, 0, 0),
::zap::word(0, 0, 0, 0, 0, 0, 0, 0),
::zap::word(101, 118, 97, 108, 46, 99, 97, 112),
::zap::word(110, 112, 58, 79, 112, 101, 114, 97),
::zap::word(116, 105, 111, 110, 0, 0, 0, 0),
::zap::word(0, 0, 0, 0, 1, 0, 1, 0),
::zap::word(20, 0, 0, 0, 1, 0, 2, 0),
::zap::word(0, 0, 0, 0, 0, 0, 0, 0),
::zap::word(53, 0, 0, 0, 34, 0, 0, 0),
::zap::word(0, 0, 0, 0, 0, 0, 0, 0),
::zap::word(1, 0, 0, 0, 0, 0, 0, 0),
::zap::word(45, 0, 0, 0, 74, 0, 0, 0),
::zap::word(0, 0, 0, 0, 0, 0, 0, 0),
::zap::word(2, 0, 0, 0, 0, 0, 0, 0),
::zap::word(41, 0, 0, 0, 74, 0, 0, 0),
::zap::word(0, 0, 0, 0, 0, 0, 0, 0),
::zap::word(3, 0, 0, 0, 0, 0, 0, 0),
::zap::word(37, 0, 0, 0, 58, 0, 0, 0),
::zap::word(0, 0, 0, 0, 0, 0, 0, 0),
::zap::word(4, 0, 0, 0, 0, 0, 0, 0),
::zap::word(29, 0, 0, 0, 66, 0, 0, 0),
::zap::word(0, 0, 0, 0, 0, 0, 0, 0),
::zap::word(97, 100, 100, 0, 0, 0, 0, 0),
::zap::word(115, 117, 98, 116, 114, 97, 99, 116),
::zap::word(0, 0, 0, 0, 0, 0, 0, 0),
::zap::word(109, 117, 108, 116, 105, 112, 108, 121),
::zap::word(0, 0, 0, 0, 0, 0, 0, 0),
::zap::word(100, 105, 118, 105, 100, 101, 0, 0),
::zap::word(109, 111, 100, 117, 108, 117, 115, 0),
];
pub fn get_annotation_types(child_index: Option<u16>, index: u32) -> ::zap::introspect::Type {
::zap::introspect::panic_invalid_annotation_indices(child_index, index)
}
}
pub mod expression {
#[derive(Copy, Clone)]
pub struct Owned(());
impl ::zap::introspect::Introspect for Owned { fn introspect() -> ::zap::introspect::Type { ::zap::introspect::TypeVariant::Struct(::zap::introspect::RawBrandedStructSchema { generic: &_private::RAW_SCHEMA, field_types: _private::get_field_types, annotation_types: _private::get_annotation_types }).into() } }
impl ::zap::traits::Owned for Owned { type Reader<'a> = Reader<'a>; type Builder<'a> = Builder<'a>; }
impl ::zap::traits::OwnedStruct for Owned { type Reader<'a> = Reader<'a>; type Builder<'a> = Builder<'a>; }
impl ::zap::traits::Pipelined for Owned { type Pipeline = Pipeline; }
pub struct Reader<'a> { reader: ::zap::private::layout::StructReader<'a> }
impl <> ::core::marker::Copy for Reader<'_,> {}
impl <> ::core::clone::Clone for Reader<'_,> {
fn clone(&self) -> Self { *self }
}
impl <> ::zap::traits::HasTypeId for Reader<'_,> {
const TYPE_ID: u64 = _private::TYPE_ID;
}
impl <'a,> ::core::convert::From<::zap::private::layout::StructReader<'a>> for Reader<'a,> {
fn from(reader: ::zap::private::layout::StructReader<'a>) -> Self {
Self { reader, }
}
}
impl <'a,> ::core::convert::From<Reader<'a,>> for ::zap::dynamic_value::Reader<'a> {
fn from(reader: Reader<'a,>) -> Self {
Self::Struct(::zap::dynamic_struct::Reader::new(reader.reader, ::zap::schema::StructSchema::new(::zap::introspect::RawBrandedStructSchema { generic: &_private::RAW_SCHEMA, field_types: _private::get_field_types::<>, annotation_types: _private::get_annotation_types::<>})))
}
}
impl <> ::core::fmt::Debug for Reader<'_,> {
fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::result::Result<(), ::core::fmt::Error> {
core::fmt::Debug::fmt(&::core::convert::Into::<::zap::dynamic_value::Reader<'_>>::into(*self), f)
}
}
impl <'a,> ::zap::traits::FromPointerReader<'a> for Reader<'a,> {
fn get_from_pointer(reader: &::zap::private::layout::PointerReader<'a>, default: ::core::option::Option<&'a [::zap::Word]>) -> ::zap::Result<Self> {
::core::result::Result::Ok(reader.get_struct(default)?.into())
}
}
impl <'a,> ::zap::traits::IntoInternalStructReader<'a> for Reader<'a,> {
fn into_internal_struct_reader(self) -> ::zap::private::layout::StructReader<'a> {
self.reader
}
}
impl <'a,> ::zap::traits::Imbue<'a> for Reader<'a,> {
fn imbue(&mut self, cap_table: &'a ::zap::private::layout::CapTable) {
self.reader.imbue(::zap::private::layout::CapTableReader::Plain(cap_table))
}
}
impl <'a,> Reader<'a,> {
pub fn reborrow(&self) -> Reader<'_,> {
Self { .. *self }
}
pub fn total_size(&self) -> ::zap::Result<::zap::MessageSize> {
self.reader.total_size()
}
#[inline]
pub fn get_op(self) -> ::core::result::Result<crate::eval_zap::Operation,::zap::NotInSchema> {
::core::convert::TryInto::try_into(self.reader.get_data_field::<u16>(0))
}
#[inline]
pub fn get_left(self) -> crate::eval_zap::expression::left::Reader<'a> {
self.reader.into()
}
#[inline]
pub fn get_right(self) -> crate::eval_zap::expression::right::Reader<'a> {
self.reader.into()
}
}
pub struct Builder<'a> { builder: ::zap::private::layout::StructBuilder<'a> }
impl <> ::zap::traits::HasStructSize for Builder<'_,> {
const STRUCT_SIZE: ::zap::private::layout::StructSize = ::zap::private::layout::StructSize { data: 2, pointers: 2 };
}
impl <> ::zap::traits::HasTypeId for Builder<'_,> {
const TYPE_ID: u64 = _private::TYPE_ID;
}
impl <'a,> ::core::convert::From<::zap::private::layout::StructBuilder<'a>> for Builder<'a,> {
fn from(builder: ::zap::private::layout::StructBuilder<'a>) -> Self {
Self { builder, }
}
}
impl <'a,> ::core::convert::From<Builder<'a,>> for ::zap::dynamic_value::Builder<'a> {
fn from(builder: Builder<'a,>) -> Self {
Self::Struct(::zap::dynamic_struct::Builder::new(builder.builder, ::zap::schema::StructSchema::new(::zap::introspect::RawBrandedStructSchema { generic: &_private::RAW_SCHEMA, field_types: _private::get_field_types::<>, annotation_types: _private::get_annotation_types::<>})))
}
}
impl <'a,> ::zap::traits::ImbueMut<'a> for Builder<'a,> {
fn imbue_mut(&mut self, cap_table: &'a mut ::zap::private::layout::CapTable) {
self.builder.imbue(::zap::private::layout::CapTableBuilder::Plain(cap_table))
}
}
impl <'a,> ::zap::traits::FromPointerBuilder<'a> for Builder<'a,> {
fn init_pointer(builder: ::zap::private::layout::PointerBuilder<'a>, _size: u32) -> Self {
builder.init_struct(<Self as ::zap::traits::HasStructSize>::STRUCT_SIZE).into()
}
fn get_from_pointer(builder: ::zap::private::layout::PointerBuilder<'a>, default: ::core::option::Option<&'a [::zap::Word]>) -> ::zap::Result<Self> {
::core::result::Result::Ok(builder.get_struct(<Self as ::zap::traits::HasStructSize>::STRUCT_SIZE, default)?.into())
}
}
impl <> ::zap::traits::SetterInput<Owned<>> for Reader<'_,> {
fn set_pointer_builder(mut pointer: ::zap::private::layout::PointerBuilder<'_>, value: Self, canonicalize: bool) -> ::zap::Result<()> { pointer.set_struct(&value.reader, canonicalize) }
}
impl <'a,> Builder<'a,> {
pub fn into_reader(self) -> Reader<'a,> {
self.builder.into_reader().into()
}
pub fn reborrow(&mut self) -> Builder<'_,> {
Builder { builder: self.builder.reborrow() }
}
pub fn reborrow_as_reader(&self) -> Reader<'_,> {
self.builder.as_reader().into()
}
pub fn total_size(&self) -> ::zap::Result<::zap::MessageSize> {
self.builder.as_reader().total_size()
}
#[inline]
pub fn get_op(self) -> ::core::result::Result<crate::eval_zap::Operation,::zap::NotInSchema> {
::core::convert::TryInto::try_into(self.builder.get_data_field::<u16>(0))
}
#[inline]
pub fn set_op(&mut self, value: crate::eval_zap::Operation) {
self.builder.set_data_field::<u16>(0, value as u16);
}
#[inline]
pub fn get_left(self) -> crate::eval_zap::expression::left::Builder<'a> {
self.builder.into()
}
#[inline]
pub fn init_left(mut self, ) -> crate::eval_zap::expression::left::Builder<'a> {
self.builder.set_data_field::<u16>(1, 0);
self.builder.set_data_field::<i32>(1, 0i32);
self.builder.reborrow().get_pointer_field(0).clear();
self.builder.into()
}
#[inline]
pub fn get_right(self) -> crate::eval_zap::expression::right::Builder<'a> {
self.builder.into()
}
#[inline]
pub fn init_right(mut self, ) -> crate::eval_zap::expression::right::Builder<'a> {
self.builder.set_data_field::<u16>(6, 0);
self.builder.set_data_field::<i32>(2, 0i32);
self.builder.reborrow().get_pointer_field(1).clear();
self.builder.into()
}
}
pub struct Pipeline { _typeless: ::zap::any_pointer::Pipeline }
impl ::zap::capability::FromTypelessPipeline for Pipeline {
fn new(typeless: ::zap::any_pointer::Pipeline) -> Self {
Self { _typeless: typeless, }
}
}
impl Pipeline {
pub fn get_left(&self) -> crate::eval_zap::expression::left::Pipeline {
::zap::capability::FromTypelessPipeline::new(self._typeless.noop())
}
pub fn get_right(&self) -> crate::eval_zap::expression::right::Pipeline {
::zap::capability::FromTypelessPipeline::new(self._typeless.noop())
}
}
mod _private {
pub static ENCODED_NODE: [::zap::Word; 49] = [
::zap::word(0, 0, 0, 0, 6, 0, 6, 0),
::zap::word(191, 32, 227, 170, 24, 36, 211, 129),
::zap::word(11, 0, 0, 0, 1, 0, 2, 0),
::zap::word(218, 158, 14, 231, 195, 196, 45, 225),
::zap::word(2, 0, 7, 0, 0, 0, 0, 0),
::zap::word(0, 0, 0, 0, 0, 0, 0, 0),
::zap::word(1, 5, 0, 0, 184, 5, 0, 0),
::zap::word(21, 0, 0, 0, 178, 0, 0, 0),
::zap::word(29, 0, 0, 0, 7, 0, 0, 0),
::zap::word(0, 0, 0, 0, 0, 0, 0, 0),
::zap::word(25, 0, 0, 0, 175, 0, 0, 0),
::zap::word(0, 0, 0, 0, 0, 0, 0, 0),
::zap::word(0, 0, 0, 0, 0, 0, 0, 0),
::zap::word(101, 118, 97, 108, 46, 99, 97, 112),
::zap::word(110, 112, 58, 69, 120, 112, 114, 101),
::zap::word(115, 115, 105, 111, 110, 0, 0, 0),
::zap::word(0, 0, 0, 0, 1, 0, 1, 0),
::zap::word(12, 0, 0, 0, 3, 0, 4, 0),
::zap::word(0, 0, 0, 0, 0, 0, 0, 0),
::zap::word(0, 0, 1, 0, 0, 0, 0, 0),
::zap::word(0, 0, 0, 0, 0, 0, 0, 0),
::zap::word(69, 0, 0, 0, 26, 0, 0, 0),
::zap::word(0, 0, 0, 0, 0, 0, 0, 0),
::zap::word(64, 0, 0, 0, 3, 0, 1, 0),
::zap::word(76, 0, 0, 0, 2, 0, 1, 0),
::zap::word(1, 0, 0, 0, 0, 0, 0, 0),
::zap::word(1, 0, 0, 0, 0, 0, 0, 0),
::zap::word(236, 142, 34, 216, 51, 197, 102, 130),
::zap::word(73, 0, 0, 0, 42, 0, 0, 0),
::zap::word(0, 0, 0, 0, 0, 0, 0, 0),
::zap::word(0, 0, 0, 0, 0, 0, 0, 0),
::zap::word(0, 0, 0, 0, 0, 0, 0, 0),
::zap::word(2, 0, 0, 0, 0, 0, 0, 0),
::zap::word(1, 0, 0, 0, 0, 0, 0, 0),
::zap::word(109, 22, 135, 91, 22, 103, 117, 236),
::zap::word(49, 0, 0, 0, 50, 0, 0, 0),
::zap::word(0, 0, 0, 0, 0, 0, 0, 0),
::zap::word(0, 0, 0, 0, 0, 0, 0, 0),
::zap::word(0, 0, 0, 0, 0, 0, 0, 0),
::zap::word(111, 112, 0, 0, 0, 0, 0, 0),
::zap::word(15, 0, 0, 0, 0, 0, 0, 0),
::zap::word(118, 51, 119, 117, 239, 83, 243, 172),
::zap::word(0, 0, 0, 0, 0, 0, 0, 0),
::zap::word(0, 0, 0, 0, 0, 0, 0, 0),
::zap::word(15, 0, 0, 0, 0, 0, 0, 0),
::zap::word(0, 0, 0, 0, 0, 0, 0, 0),
::zap::word(0, 0, 0, 0, 0, 0, 0, 0),
::zap::word(108, 101, 102, 116, 0, 0, 0, 0),
::zap::word(114, 105, 103, 104, 116, 0, 0, 0),
];
pub fn get_field_types(index: u16) -> ::zap::introspect::Type {
match index {
0 => <crate::eval_zap::Operation as ::zap::introspect::Introspect>::introspect(),
1 => <crate::eval_zap::expression::left::Owned as ::zap::introspect::Introspect>::introspect(),
2 => <crate::eval_zap::expression::right::Owned as ::zap::introspect::Introspect>::introspect(),
_ => ::zap::introspect::panic_invalid_field_index(index),
}
}
pub fn get_annotation_types(child_index: Option<u16>, index: u32) -> ::zap::introspect::Type {
::zap::introspect::panic_invalid_annotation_indices(child_index, index)
}
pub static ARENA: ::zap::private::arena::GeneratedCodeArena = ::zap::private::arena::GeneratedCodeArena::new(&ENCODED_NODE);
pub static RAW_SCHEMA: ::zap::introspect::RawStructSchema = ::zap::introspect::RawStructSchema::new(
&ARENA,
NONUNION_MEMBERS,
MEMBERS_BY_DISCRIMINANT,
MEMBERS_BY_NAME
);
pub static NONUNION_MEMBERS : &[u16] = &[0,1,2];
pub static MEMBERS_BY_DISCRIMINANT : &[u16] = &[];
pub static MEMBERS_BY_NAME : &[u16] = &[1,0,2];
pub const TYPE_ID: u64 = 0x81d3_2418_aae3_20bf;
}
pub mod left {
pub use self::Which::{Value,Expression};
#[derive(Copy, Clone)]
pub struct Owned(());
impl ::zap::introspect::Introspect for Owned { fn introspect() -> ::zap::introspect::Type { ::zap::introspect::TypeVariant::Struct(::zap::introspect::RawBrandedStructSchema { generic: &_private::RAW_SCHEMA, field_types: _private::get_field_types, annotation_types: _private::get_annotation_types }).into() } }
impl ::zap::traits::Owned for Owned { type Reader<'a> = Reader<'a>; type Builder<'a> = Builder<'a>; }
impl ::zap::traits::OwnedStruct for Owned { type Reader<'a> = Reader<'a>; type Builder<'a> = Builder<'a>; }
impl ::zap::traits::Pipelined for Owned { type Pipeline = Pipeline; }
pub struct Reader<'a> { reader: ::zap::private::layout::StructReader<'a> }
impl <> ::core::marker::Copy for Reader<'_,> {}
impl <> ::core::clone::Clone for Reader<'_,> {
fn clone(&self) -> Self { *self }
}
impl <> ::zap::traits::HasTypeId for Reader<'_,> {
const TYPE_ID: u64 = _private::TYPE_ID;
}
impl <'a,> ::core::convert::From<::zap::private::layout::StructReader<'a>> for Reader<'a,> {
fn from(reader: ::zap::private::layout::StructReader<'a>) -> Self {
Self { reader, }
}
}
impl <'a,> ::core::convert::From<Reader<'a,>> for ::zap::dynamic_value::Reader<'a> {
fn from(reader: Reader<'a,>) -> Self {
Self::Struct(::zap::dynamic_struct::Reader::new(reader.reader, ::zap::schema::StructSchema::new(::zap::introspect::RawBrandedStructSchema { generic: &_private::RAW_SCHEMA, field_types: _private::get_field_types::<>, annotation_types: _private::get_annotation_types::<>})))
}
}
impl <> ::core::fmt::Debug for Reader<'_,> {
fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::result::Result<(), ::core::fmt::Error> {
core::fmt::Debug::fmt(&::core::convert::Into::<::zap::dynamic_value::Reader<'_>>::into(*self), f)
}
}
impl <'a,> ::zap::traits::FromPointerReader<'a> for Reader<'a,> {
fn get_from_pointer(reader: &::zap::private::layout::PointerReader<'a>, default: ::core::option::Option<&'a [::zap::Word]>) -> ::zap::Result<Self> {
::core::result::Result::Ok(reader.get_struct(default)?.into())
}
}
impl <'a,> ::zap::traits::IntoInternalStructReader<'a> for Reader<'a,> {
fn into_internal_struct_reader(self) -> ::zap::private::layout::StructReader<'a> {
self.reader
}
}
impl <'a,> ::zap::traits::Imbue<'a> for Reader<'a,> {
fn imbue(&mut self, cap_table: &'a ::zap::private::layout::CapTable) {
self.reader.imbue(::zap::private::layout::CapTableReader::Plain(cap_table))
}
}
impl <'a,> Reader<'a,> {
pub fn reborrow(&self) -> Reader<'_,> {
Self { .. *self }
}
pub fn total_size(&self) -> ::zap::Result<::zap::MessageSize> {
self.reader.total_size()
}
#[inline]
pub fn has_expression(&self) -> bool {
if self.reader.get_data_field::<u16>(1) != 1 { return false; }
!self.reader.get_pointer_field(0).is_null()
}
#[inline]
pub fn which(self) -> ::core::result::Result<WhichReader<'a,>, ::zap::NotInSchema> {
match self.reader.get_data_field::<u16>(1) {
0 => {
::core::result::Result::Ok(Value(
self.reader.get_data_field::<i32>(1)
))
}
1 => {
::core::result::Result::Ok(Expression(
::zap::traits::FromPointerReader::get_from_pointer(&self.reader.get_pointer_field(0), ::core::option::Option::None)
))
}
x => ::core::result::Result::Err(::zap::NotInSchema(x))
}
}
}
pub struct Builder<'a> { builder: ::zap::private::layout::StructBuilder<'a> }
impl <> ::zap::traits::HasStructSize for Builder<'_,> {
const STRUCT_SIZE: ::zap::private::layout::StructSize = ::zap::private::layout::StructSize { data: 2, pointers: 2 };
}
impl <> ::zap::traits::HasTypeId for Builder<'_,> {
const TYPE_ID: u64 = _private::TYPE_ID;
}
impl <'a,> ::core::convert::From<::zap::private::layout::StructBuilder<'a>> for Builder<'a,> {
fn from(builder: ::zap::private::layout::StructBuilder<'a>) -> Self {
Self { builder, }
}
}
impl <'a,> ::core::convert::From<Builder<'a,>> for ::zap::dynamic_value::Builder<'a> {
fn from(builder: Builder<'a,>) -> Self {
Self::Struct(::zap::dynamic_struct::Builder::new(builder.builder, ::zap::schema::StructSchema::new(::zap::introspect::RawBrandedStructSchema { generic: &_private::RAW_SCHEMA, field_types: _private::get_field_types::<>, annotation_types: _private::get_annotation_types::<>})))
}
}
impl <'a,> ::zap::traits::ImbueMut<'a> for Builder<'a,> {
fn imbue_mut(&mut self, cap_table: &'a mut ::zap::private::layout::CapTable) {
self.builder.imbue(::zap::private::layout::CapTableBuilder::Plain(cap_table))
}
}
impl <'a,> ::zap::traits::FromPointerBuilder<'a> for Builder<'a,> {
fn init_pointer(builder: ::zap::private::layout::PointerBuilder<'a>, _size: u32) -> Self {
builder.init_struct(<Self as ::zap::traits::HasStructSize>::STRUCT_SIZE).into()
}
fn get_from_pointer(builder: ::zap::private::layout::PointerBuilder<'a>, default: ::core::option::Option<&'a [::zap::Word]>) -> ::zap::Result<Self> {
::core::result::Result::Ok(builder.get_struct(<Self as ::zap::traits::HasStructSize>::STRUCT_SIZE, default)?.into())
}
}
impl <> ::zap::traits::SetterInput<Owned<>> for Reader<'_,> {
fn set_pointer_builder(mut pointer: ::zap::private::layout::PointerBuilder<'_>, value: Self, canonicalize: bool) -> ::zap::Result<()> { pointer.set_struct(&value.reader, canonicalize) }
}
impl <'a,> Builder<'a,> {
pub fn into_reader(self) -> Reader<'a,> {
self.builder.into_reader().into()
}
pub fn reborrow(&mut self) -> Builder<'_,> {
Builder { builder: self.builder.reborrow() }
}
pub fn reborrow_as_reader(&self) -> Reader<'_,> {
self.builder.as_reader().into()
}
pub fn total_size(&self) -> ::zap::Result<::zap::MessageSize> {
self.builder.as_reader().total_size()
}
#[inline]
pub fn set_value(&mut self, value: i32) {
self.builder.set_data_field::<u16>(1, 0);
self.builder.set_data_field::<i32>(1, value);
}
#[inline]
pub fn set_expression(&mut self, value: crate::eval_zap::expression::Reader<'_>) -> ::zap::Result<()> {
self.builder.set_data_field::<u16>(1, 1);
::zap::traits::SetterInput::set_pointer_builder(self.builder.reborrow().get_pointer_field(0), value, false)
}
#[inline]
pub fn init_expression(self, ) -> crate::eval_zap::expression::Builder<'a> {
self.builder.set_data_field::<u16>(1, 1);
::zap::traits::FromPointerBuilder::init_pointer(self.builder.get_pointer_field(0), 0)
}
#[inline]
pub fn has_expression(&self) -> bool {
if self.builder.get_data_field::<u16>(1) != 1 { return false; }
!self.builder.is_pointer_field_null(0)
}
#[inline]
pub fn which(self) -> ::core::result::Result<WhichBuilder<'a,>, ::zap::NotInSchema> {
match self.builder.get_data_field::<u16>(1) {
0 => {
::core::result::Result::Ok(Value(
self.builder.get_data_field::<i32>(1)
))
}
1 => {
::core::result::Result::Ok(Expression(
::zap::traits::FromPointerBuilder::get_from_pointer(self.builder.get_pointer_field(0), ::core::option::Option::None)
))
}
x => ::core::result::Result::Err(::zap::NotInSchema(x))
}
}
}
pub struct Pipeline { _typeless: ::zap::any_pointer::Pipeline }
impl ::zap::capability::FromTypelessPipeline for Pipeline {
fn new(typeless: ::zap::any_pointer::Pipeline) -> Self {
Self { _typeless: typeless, }
}
}
impl Pipeline {
}
mod _private {
pub static ENCODED_NODE: [::zap::Word; 49] = [
::zap::word(0, 0, 0, 0, 6, 0, 6, 0),
::zap::word(236, 142, 34, 216, 51, 197, 102, 130),
::zap::word(22, 0, 0, 0, 1, 0, 2, 0),
::zap::word(191, 32, 227, 170, 24, 36, 211, 129),
::zap::word(2, 0, 7, 0, 1, 0, 2, 0),
::zap::word(1, 0, 0, 0, 0, 0, 0, 0),
::zap::word(0, 0, 0, 0, 0, 0, 0, 0),
::zap::word(21, 0, 0, 0, 218, 0, 0, 0),
::zap::word(0, 0, 0, 0, 0, 0, 0, 0),
::zap::word(0, 0, 0, 0, 0, 0, 0, 0),
::zap::word(25, 0, 0, 0, 119, 0, 0, 0),
::zap::word(0, 0, 0, 0, 0, 0, 0, 0),
::zap::word(0, 0, 0, 0, 0, 0, 0, 0),
::zap::word(101, 118, 97, 108, 46, 99, 97, 112),
::zap::word(110, 112, 58, 69, 120, 112, 114, 101),
::zap::word(115, 115, 105, 111, 110, 46, 108, 101),
::zap::word(102, 116, 0, 0, 0, 0, 0, 0),
::zap::word(8, 0, 0, 0, 3, 0, 4, 0),
::zap::word(0, 0, 255, 255, 1, 0, 0, 0),
::zap::word(0, 0, 1, 0, 1, 0, 0, 0),
::zap::word(0, 0, 0, 0, 0, 0, 0, 0),
::zap::word(41, 0, 0, 0, 50, 0, 0, 0),
::zap::word(0, 0, 0, 0, 0, 0, 0, 0),
::zap::word(36, 0, 0, 0, 3, 0, 1, 0),
::zap::word(48, 0, 0, 0, 2, 0, 1, 0),
::zap::word(1, 0, 254, 255, 0, 0, 0, 0),
::zap::word(0, 0, 1, 0, 2, 0, 0, 0),
::zap::word(0, 0, 0, 0, 0, 0, 0, 0),
::zap::word(45, 0, 0, 0, 90, 0, 0, 0),
::zap::word(0, 0, 0, 0, 0, 0, 0, 0),
::zap::word(44, 0, 0, 0, 3, 0, 1, 0),
::zap::word(56, 0, 0, 0, 2, 0, 1, 0),
::zap::word(118, 97, 108, 117, 101, 0, 0, 0),
::zap::word(4, 0, 0, 0, 0, 0, 0, 0),
::zap::word(0, 0, 0, 0, 0, 0, 0, 0),
::zap::word(0, 0, 0, 0, 0, 0, 0, 0),
::zap::word(0, 0, 0, 0, 0, 0, 0, 0),
::zap::word(4, 0, 0, 0, 0, 0, 0, 0),
::zap::word(0, 0, 0, 0, 0, 0, 0, 0),
::zap::word(0, 0, 0, 0, 0, 0, 0, 0),
::zap::word(101, 120, 112, 114, 101, 115, 115, 105),
::zap::word(111, 110, 0, 0, 0, 0, 0, 0),
::zap::word(16, 0, 0, 0, 0, 0, 0, 0),
::zap::word(191, 32, 227, 170, 24, 36, 211, 129),
::zap::word(0, 0, 0, 0, 0, 0, 0, 0),
::zap::word(0, 0, 0, 0, 0, 0, 0, 0),
::zap::word(16, 0, 0, 0, 0, 0, 0, 0),
::zap::word(0, 0, 0, 0, 0, 0, 0, 0),
::zap::word(0, 0, 0, 0, 0, 0, 0, 0),
];
pub fn get_field_types(index: u16) -> ::zap::introspect::Type {
match index {
0 => <i32 as ::zap::introspect::Introspect>::introspect(),
1 => <crate::eval_zap::expression::Owned as ::zap::introspect::Introspect>::introspect(),
_ => ::zap::introspect::panic_invalid_field_index(index),
}
}
pub fn get_annotation_types(child_index: Option<u16>, index: u32) -> ::zap::introspect::Type {
::zap::introspect::panic_invalid_annotation_indices(child_index, index)
}
pub static ARENA: ::zap::private::arena::GeneratedCodeArena = ::zap::private::arena::GeneratedCodeArena::new(&ENCODED_NODE);
pub static RAW_SCHEMA: ::zap::introspect::RawStructSchema = ::zap::introspect::RawStructSchema::new(
&ARENA,
NONUNION_MEMBERS,
MEMBERS_BY_DISCRIMINANT,
MEMBERS_BY_NAME
);
pub static NONUNION_MEMBERS : &[u16] = &[];
pub static MEMBERS_BY_DISCRIMINANT : &[u16] = &[0,1];
pub static MEMBERS_BY_NAME : &[u16] = &[1,0];
pub const TYPE_ID: u64 = 0x8266_c533_d822_8eec;
}
pub enum Which<A0> {
Value(i32),
Expression(A0),
}
pub type WhichReader<'a,> = Which<::zap::Result<crate::eval_zap::expression::Reader<'a>>>;
pub type WhichBuilder<'a,> = Which<::zap::Result<crate::eval_zap::expression::Builder<'a>>>;
}
pub mod right {
pub use self::Which::{Value,Expression};
#[derive(Copy, Clone)]
pub struct Owned(());
impl ::zap::introspect::Introspect for Owned { fn introspect() -> ::zap::introspect::Type { ::zap::introspect::TypeVariant::Struct(::zap::introspect::RawBrandedStructSchema { generic: &_private::RAW_SCHEMA, field_types: _private::get_field_types, annotation_types: _private::get_annotation_types }).into() } }
impl ::zap::traits::Owned for Owned { type Reader<'a> = Reader<'a>; type Builder<'a> = Builder<'a>; }
impl ::zap::traits::OwnedStruct for Owned { type Reader<'a> = Reader<'a>; type Builder<'a> = Builder<'a>; }
impl ::zap::traits::Pipelined for Owned { type Pipeline = Pipeline; }
pub struct Reader<'a> { reader: ::zap::private::layout::StructReader<'a> }
impl <> ::core::marker::Copy for Reader<'_,> {}
impl <> ::core::clone::Clone for Reader<'_,> {
fn clone(&self) -> Self { *self }
}
impl <> ::zap::traits::HasTypeId for Reader<'_,> {
const TYPE_ID: u64 = _private::TYPE_ID;
}
impl <'a,> ::core::convert::From<::zap::private::layout::StructReader<'a>> for Reader<'a,> {
fn from(reader: ::zap::private::layout::StructReader<'a>) -> Self {
Self { reader, }
}
}
impl <'a,> ::core::convert::From<Reader<'a,>> for ::zap::dynamic_value::Reader<'a> {
fn from(reader: Reader<'a,>) -> Self {
Self::Struct(::zap::dynamic_struct::Reader::new(reader.reader, ::zap::schema::StructSchema::new(::zap::introspect::RawBrandedStructSchema { generic: &_private::RAW_SCHEMA, field_types: _private::get_field_types::<>, annotation_types: _private::get_annotation_types::<>})))
}
}
impl <> ::core::fmt::Debug for Reader<'_,> {
fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::result::Result<(), ::core::fmt::Error> {
core::fmt::Debug::fmt(&::core::convert::Into::<::zap::dynamic_value::Reader<'_>>::into(*self), f)
}
}
impl <'a,> ::zap::traits::FromPointerReader<'a> for Reader<'a,> {
fn get_from_pointer(reader: &::zap::private::layout::PointerReader<'a>, default: ::core::option::Option<&'a [::zap::Word]>) -> ::zap::Result<Self> {
::core::result::Result::Ok(reader.get_struct(default)?.into())
}
}
impl <'a,> ::zap::traits::IntoInternalStructReader<'a> for Reader<'a,> {
fn into_internal_struct_reader(self) -> ::zap::private::layout::StructReader<'a> {
self.reader
}
}
impl <'a,> ::zap::traits::Imbue<'a> for Reader<'a,> {
fn imbue(&mut self, cap_table: &'a ::zap::private::layout::CapTable) {
self.reader.imbue(::zap::private::layout::CapTableReader::Plain(cap_table))
}
}
impl <'a,> Reader<'a,> {
pub fn reborrow(&self) -> Reader<'_,> {
Self { .. *self }
}
pub fn total_size(&self) -> ::zap::Result<::zap::MessageSize> {
self.reader.total_size()
}
#[inline]
pub fn has_expression(&self) -> bool {
if self.reader.get_data_field::<u16>(6) != 1 { return false; }
!self.reader.get_pointer_field(1).is_null()
}
#[inline]
pub fn which(self) -> ::core::result::Result<WhichReader<'a,>, ::zap::NotInSchema> {
match self.reader.get_data_field::<u16>(6) {
0 => {
::core::result::Result::Ok(Value(
self.reader.get_data_field::<i32>(2)
))
}
1 => {
::core::result::Result::Ok(Expression(
::zap::traits::FromPointerReader::get_from_pointer(&self.reader.get_pointer_field(1), ::core::option::Option::None)
))
}
x => ::core::result::Result::Err(::zap::NotInSchema(x))
}
}
}
pub struct Builder<'a> { builder: ::zap::private::layout::StructBuilder<'a> }
impl <> ::zap::traits::HasStructSize for Builder<'_,> {
const STRUCT_SIZE: ::zap::private::layout::StructSize = ::zap::private::layout::StructSize { data: 2, pointers: 2 };
}
impl <> ::zap::traits::HasTypeId for Builder<'_,> {
const TYPE_ID: u64 = _private::TYPE_ID;
}
impl <'a,> ::core::convert::From<::zap::private::layout::StructBuilder<'a>> for Builder<'a,> {
fn from(builder: ::zap::private::layout::StructBuilder<'a>) -> Self {
Self { builder, }
}
}
impl <'a,> ::core::convert::From<Builder<'a,>> for ::zap::dynamic_value::Builder<'a> {
fn from(builder: Builder<'a,>) -> Self {
Self::Struct(::zap::dynamic_struct::Builder::new(builder.builder, ::zap::schema::StructSchema::new(::zap::introspect::RawBrandedStructSchema { generic: &_private::RAW_SCHEMA, field_types: _private::get_field_types::<>, annotation_types: _private::get_annotation_types::<>})))
}
}
impl <'a,> ::zap::traits::ImbueMut<'a> for Builder<'a,> {
fn imbue_mut(&mut self, cap_table: &'a mut ::zap::private::layout::CapTable) {
self.builder.imbue(::zap::private::layout::CapTableBuilder::Plain(cap_table))
}
}
impl <'a,> ::zap::traits::FromPointerBuilder<'a> for Builder<'a,> {
fn init_pointer(builder: ::zap::private::layout::PointerBuilder<'a>, _size: u32) -> Self {
builder.init_struct(<Self as ::zap::traits::HasStructSize>::STRUCT_SIZE).into()
}
fn get_from_pointer(builder: ::zap::private::layout::PointerBuilder<'a>, default: ::core::option::Option<&'a [::zap::Word]>) -> ::zap::Result<Self> {
::core::result::Result::Ok(builder.get_struct(<Self as ::zap::traits::HasStructSize>::STRUCT_SIZE, default)?.into())
}
}
impl <> ::zap::traits::SetterInput<Owned<>> for Reader<'_,> {
fn set_pointer_builder(mut pointer: ::zap::private::layout::PointerBuilder<'_>, value: Self, canonicalize: bool) -> ::zap::Result<()> { pointer.set_struct(&value.reader, canonicalize) }
}
impl <'a,> Builder<'a,> {
pub fn into_reader(self) -> Reader<'a,> {
self.builder.into_reader().into()
}
pub fn reborrow(&mut self) -> Builder<'_,> {
Builder { builder: self.builder.reborrow() }
}
pub fn reborrow_as_reader(&self) -> Reader<'_,> {
self.builder.as_reader().into()
}
pub fn total_size(&self) -> ::zap::Result<::zap::MessageSize> {
self.builder.as_reader().total_size()
}
#[inline]
pub fn set_value(&mut self, value: i32) {
self.builder.set_data_field::<u16>(6, 0);
self.builder.set_data_field::<i32>(2, value);
}
#[inline]
pub fn set_expression(&mut self, value: crate::eval_zap::expression::Reader<'_>) -> ::zap::Result<()> {
self.builder.set_data_field::<u16>(6, 1);
::zap::traits::SetterInput::set_pointer_builder(self.builder.reborrow().get_pointer_field(1), value, false)
}
#[inline]
pub fn init_expression(self, ) -> crate::eval_zap::expression::Builder<'a> {
self.builder.set_data_field::<u16>(6, 1);
::zap::traits::FromPointerBuilder::init_pointer(self.builder.get_pointer_field(1), 0)
}
#[inline]
pub fn has_expression(&self) -> bool {
if self.builder.get_data_field::<u16>(6) != 1 { return false; }
!self.builder.is_pointer_field_null(1)
}
#[inline]
pub fn which(self) -> ::core::result::Result<WhichBuilder<'a,>, ::zap::NotInSchema> {
match self.builder.get_data_field::<u16>(6) {
0 => {
::core::result::Result::Ok(Value(
self.builder.get_data_field::<i32>(2)
))
}
1 => {
::core::result::Result::Ok(Expression(
::zap::traits::FromPointerBuilder::get_from_pointer(self.builder.get_pointer_field(1), ::core::option::Option::None)
))
}
x => ::core::result::Result::Err(::zap::NotInSchema(x))
}
}
}
pub struct Pipeline { _typeless: ::zap::any_pointer::Pipeline }
impl ::zap::capability::FromTypelessPipeline for Pipeline {
fn new(typeless: ::zap::any_pointer::Pipeline) -> Self {
Self { _typeless: typeless, }
}
}
impl Pipeline {
}
mod _private {
pub static ENCODED_NODE: [::zap::Word; 49] = [
::zap::word(0, 0, 0, 0, 6, 0, 6, 0),
::zap::word(109, 22, 135, 91, 22, 103, 117, 236),
::zap::word(22, 0, 0, 0, 1, 0, 2, 0),
::zap::word(191, 32, 227, 170, 24, 36, 211, 129),
::zap::word(2, 0, 7, 0, 1, 0, 2, 0),
::zap::word(6, 0, 0, 0, 0, 0, 0, 0),
::zap::word(0, 0, 0, 0, 0, 0, 0, 0),
::zap::word(21, 0, 0, 0, 226, 0, 0, 0),
::zap::word(0, 0, 0, 0, 0, 0, 0, 0),
::zap::word(0, 0, 0, 0, 0, 0, 0, 0),
::zap::word(25, 0, 0, 0, 119, 0, 0, 0),
::zap::word(0, 0, 0, 0, 0, 0, 0, 0),
::zap::word(0, 0, 0, 0, 0, 0, 0, 0),
::zap::word(101, 118, 97, 108, 46, 99, 97, 112),
::zap::word(110, 112, 58, 69, 120, 112, 114, 101),
::zap::word(115, 115, 105, 111, 110, 46, 114, 105),
::zap::word(103, 104, 116, 0, 0, 0, 0, 0),
::zap::word(8, 0, 0, 0, 3, 0, 4, 0),
::zap::word(0, 0, 255, 255, 2, 0, 0, 0),
::zap::word(0, 0, 1, 0, 3, 0, 0, 0),
::zap::word(0, 0, 0, 0, 0, 0, 0, 0),
::zap::word(41, 0, 0, 0, 50, 0, 0, 0),
::zap::word(0, 0, 0, 0, 0, 0, 0, 0),
::zap::word(36, 0, 0, 0, 3, 0, 1, 0),
::zap::word(48, 0, 0, 0, 2, 0, 1, 0),
::zap::word(1, 0, 254, 255, 1, 0, 0, 0),
::zap::word(0, 0, 1, 0, 4, 0, 0, 0),
::zap::word(0, 0, 0, 0, 0, 0, 0, 0),
::zap::word(45, 0, 0, 0, 90, 0, 0, 0),
::zap::word(0, 0, 0, 0, 0, 0, 0, 0),
::zap::word(44, 0, 0, 0, 3, 0, 1, 0),
::zap::word(56, 0, 0, 0, 2, 0, 1, 0),
::zap::word(118, 97, 108, 117, 101, 0, 0, 0),
::zap::word(4, 0, 0, 0, 0, 0, 0, 0),
::zap::word(0, 0, 0, 0, 0, 0, 0, 0),
::zap::word(0, 0, 0, 0, 0, 0, 0, 0),
::zap::word(0, 0, 0, 0, 0, 0, 0, 0),
::zap::word(4, 0, 0, 0, 0, 0, 0, 0),
::zap::word(0, 0, 0, 0, 0, 0, 0, 0),
::zap::word(0, 0, 0, 0, 0, 0, 0, 0),
::zap::word(101, 120, 112, 114, 101, 115, 115, 105),
::zap::word(111, 110, 0, 0, 0, 0, 0, 0),
::zap::word(16, 0, 0, 0, 0, 0, 0, 0),
::zap::word(191, 32, 227, 170, 24, 36, 211, 129),
::zap::word(0, 0, 0, 0, 0, 0, 0, 0),
::zap::word(0, 0, 0, 0, 0, 0, 0, 0),
::zap::word(16, 0, 0, 0, 0, 0, 0, 0),
::zap::word(0, 0, 0, 0, 0, 0, 0, 0),
::zap::word(0, 0, 0, 0, 0, 0, 0, 0),
];
pub fn get_field_types(index: u16) -> ::zap::introspect::Type {
match index {
0 => <i32 as ::zap::introspect::Introspect>::introspect(),
1 => <crate::eval_zap::expression::Owned as ::zap::introspect::Introspect>::introspect(),
_ => ::zap::introspect::panic_invalid_field_index(index),
}
}
pub fn get_annotation_types(child_index: Option<u16>, index: u32) -> ::zap::introspect::Type {
::zap::introspect::panic_invalid_annotation_indices(child_index, index)
}
pub static ARENA: ::zap::private::arena::GeneratedCodeArena = ::zap::private::arena::GeneratedCodeArena::new(&ENCODED_NODE);
pub static RAW_SCHEMA: ::zap::introspect::RawStructSchema = ::zap::introspect::RawStructSchema::new(
&ARENA,
NONUNION_MEMBERS,
MEMBERS_BY_DISCRIMINANT,
MEMBERS_BY_NAME
);
pub static NONUNION_MEMBERS : &[u16] = &[];
pub static MEMBERS_BY_DISCRIMINANT : &[u16] = &[0,1];
pub static MEMBERS_BY_NAME : &[u16] = &[1,0];
pub const TYPE_ID: u64 = 0xec75_6716_5b87_166d;
}
pub enum Which<A0> {
Value(i32),
Expression(A0),
}
pub type WhichReader<'a,> = Which<::zap::Result<crate::eval_zap::expression::Reader<'a>>>;
pub type WhichBuilder<'a,> = Which<::zap::Result<crate::eval_zap::expression::Builder<'a>>>;
}
}
pub mod evaluation_result {
#[derive(Copy, Clone)]
pub struct Owned(());
impl ::zap::introspect::Introspect for Owned { fn introspect() -> ::zap::introspect::Type { ::zap::introspect::TypeVariant::Struct(::zap::introspect::RawBrandedStructSchema { generic: &_private::RAW_SCHEMA, field_types: _private::get_field_types, annotation_types: _private::get_annotation_types }).into() } }
impl ::zap::traits::Owned for Owned { type Reader<'a> = Reader<'a>; type Builder<'a> = Builder<'a>; }
impl ::zap::traits::OwnedStruct for Owned { type Reader<'a> = Reader<'a>; type Builder<'a> = Builder<'a>; }
impl ::zap::traits::Pipelined for Owned { type Pipeline = Pipeline; }
pub struct Reader<'a> { reader: ::zap::private::layout::StructReader<'a> }
impl <> ::core::marker::Copy for Reader<'_,> {}
impl <> ::core::clone::Clone for Reader<'_,> {
fn clone(&self) -> Self { *self }
}
impl <> ::zap::traits::HasTypeId for Reader<'_,> {
const TYPE_ID: u64 = _private::TYPE_ID;
}
impl <'a,> ::core::convert::From<::zap::private::layout::StructReader<'a>> for Reader<'a,> {
fn from(reader: ::zap::private::layout::StructReader<'a>) -> Self {
Self { reader, }
}
}
impl <'a,> ::core::convert::From<Reader<'a,>> for ::zap::dynamic_value::Reader<'a> {
fn from(reader: Reader<'a,>) -> Self {
Self::Struct(::zap::dynamic_struct::Reader::new(reader.reader, ::zap::schema::StructSchema::new(::zap::introspect::RawBrandedStructSchema { generic: &_private::RAW_SCHEMA, field_types: _private::get_field_types::<>, annotation_types: _private::get_annotation_types::<>})))
}
}
impl <> ::core::fmt::Debug for Reader<'_,> {
fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::result::Result<(), ::core::fmt::Error> {
core::fmt::Debug::fmt(&::core::convert::Into::<::zap::dynamic_value::Reader<'_>>::into(*self), f)
}
}
impl <'a,> ::zap::traits::FromPointerReader<'a> for Reader<'a,> {
fn get_from_pointer(reader: &::zap::private::layout::PointerReader<'a>, default: ::core::option::Option<&'a [::zap::Word]>) -> ::zap::Result<Self> {
::core::result::Result::Ok(reader.get_struct(default)?.into())
}
}
impl <'a,> ::zap::traits::IntoInternalStructReader<'a> for Reader<'a,> {
fn into_internal_struct_reader(self) -> ::zap::private::layout::StructReader<'a> {
self.reader
}
}
impl <'a,> ::zap::traits::Imbue<'a> for Reader<'a,> {
fn imbue(&mut self, cap_table: &'a ::zap::private::layout::CapTable) {
self.reader.imbue(::zap::private::layout::CapTableReader::Plain(cap_table))
}
}
impl <> Reader<'_,> {
pub fn reborrow(&self) -> Reader<'_,> {
Self { .. *self }
}
pub fn total_size(&self) -> ::zap::Result<::zap::MessageSize> {
self.reader.total_size()
}
#[inline]
pub fn get_value(self) -> i32 {
self.reader.get_data_field::<i32>(0)
}
}
pub struct Builder<'a> { builder: ::zap::private::layout::StructBuilder<'a> }
impl <> ::zap::traits::HasStructSize for Builder<'_,> {
const STRUCT_SIZE: ::zap::private::layout::StructSize = ::zap::private::layout::StructSize { data: 1, pointers: 0 };
}
impl <> ::zap::traits::HasTypeId for Builder<'_,> {
const TYPE_ID: u64 = _private::TYPE_ID;
}
impl <'a,> ::core::convert::From<::zap::private::layout::StructBuilder<'a>> for Builder<'a,> {
fn from(builder: ::zap::private::layout::StructBuilder<'a>) -> Self {
Self { builder, }
}
}
impl <'a,> ::core::convert::From<Builder<'a,>> for ::zap::dynamic_value::Builder<'a> {
fn from(builder: Builder<'a,>) -> Self {
Self::Struct(::zap::dynamic_struct::Builder::new(builder.builder, ::zap::schema::StructSchema::new(::zap::introspect::RawBrandedStructSchema { generic: &_private::RAW_SCHEMA, field_types: _private::get_field_types::<>, annotation_types: _private::get_annotation_types::<>})))
}
}
impl <'a,> ::zap::traits::ImbueMut<'a> for Builder<'a,> {
fn imbue_mut(&mut self, cap_table: &'a mut ::zap::private::layout::CapTable) {
self.builder.imbue(::zap::private::layout::CapTableBuilder::Plain(cap_table))
}
}
impl <'a,> ::zap::traits::FromPointerBuilder<'a> for Builder<'a,> {
fn init_pointer(builder: ::zap::private::layout::PointerBuilder<'a>, _size: u32) -> Self {
builder.init_struct(<Self as ::zap::traits::HasStructSize>::STRUCT_SIZE).into()
}
fn get_from_pointer(builder: ::zap::private::layout::PointerBuilder<'a>, default: ::core::option::Option<&'a [::zap::Word]>) -> ::zap::Result<Self> {
::core::result::Result::Ok(builder.get_struct(<Self as ::zap::traits::HasStructSize>::STRUCT_SIZE, default)?.into())
}
}
impl <> ::zap::traits::SetterInput<Owned<>> for Reader<'_,> {
fn set_pointer_builder(mut pointer: ::zap::private::layout::PointerBuilder<'_>, value: Self, canonicalize: bool) -> ::zap::Result<()> { pointer.set_struct(&value.reader, canonicalize) }
}
impl <'a,> Builder<'a,> {
pub fn into_reader(self) -> Reader<'a,> {
self.builder.into_reader().into()
}
pub fn reborrow(&mut self) -> Builder<'_,> {
Builder { builder: self.builder.reborrow() }
}
pub fn reborrow_as_reader(&self) -> Reader<'_,> {
self.builder.as_reader().into()
}
pub fn total_size(&self) -> ::zap::Result<::zap::MessageSize> {
self.builder.as_reader().total_size()
}
#[inline]
pub fn get_value(self) -> i32 {
self.builder.get_data_field::<i32>(0)
}
#[inline]
pub fn set_value(&mut self, value: i32) {
self.builder.set_data_field::<i32>(0, value);
}
}
pub struct Pipeline { _typeless: ::zap::any_pointer::Pipeline }
impl ::zap::capability::FromTypelessPipeline for Pipeline {
fn new(typeless: ::zap::any_pointer::Pipeline) -> Self {
Self { _typeless: typeless, }
}
}
impl Pipeline {
}
mod _private {
pub static ENCODED_NODE: [::zap::Word; 34] = [
::zap::word(0, 0, 0, 0, 6, 0, 6, 0),
::zap::word(153, 209, 86, 216, 2, 195, 73, 163),
::zap::word(11, 0, 0, 0, 1, 0, 1, 0),
::zap::word(218, 158, 14, 231, 195, 196, 45, 225),
::zap::word(0, 0, 7, 0, 0, 0, 0, 0),
::zap::word(0, 0, 0, 0, 0, 0, 0, 0),
::zap::word(186, 5, 0, 0, 231, 5, 0, 0),
::zap::word(21, 0, 0, 0, 226, 0, 0, 0),
::zap::word(33, 0, 0, 0, 7, 0, 0, 0),
::zap::word(0, 0, 0, 0, 0, 0, 0, 0),
::zap::word(29, 0, 0, 0, 63, 0, 0, 0),
::zap::word(0, 0, 0, 0, 0, 0, 0, 0),
::zap::word(0, 0, 0, 0, 0, 0, 0, 0),
::zap::word(101, 118, 97, 108, 46, 99, 97, 112),
::zap::word(110, 112, 58, 69, 118, 97, 108, 117),
::zap::word(97, 116, 105, 111, 110, 82, 101, 115),
::zap::word(117, 108, 116, 0, 0, 0, 0, 0),
::zap::word(0, 0, 0, 0, 1, 0, 1, 0),
::zap::word(4, 0, 0, 0, 3, 0, 4, 0),
::zap::word(0, 0, 0, 0, 0, 0, 0, 0),
::zap::word(0, 0, 1, 0, 0, 0, 0, 0),
::zap::word(0, 0, 0, 0, 0, 0, 0, 0),
::zap::word(13, 0, 0, 0, 50, 0, 0, 0),
::zap::word(0, 0, 0, 0, 0, 0, 0, 0),
::zap::word(8, 0, 0, 0, 3, 0, 1, 0),
::zap::word(20, 0, 0, 0, 2, 0, 1, 0),
::zap::word(118, 97, 108, 117, 101, 0, 0, 0),
::zap::word(4, 0, 0, 0, 0, 0, 0, 0),
::zap::word(0, 0, 0, 0, 0, 0, 0, 0),
::zap::word(0, 0, 0, 0, 0, 0, 0, 0),
::zap::word(0, 0, 0, 0, 0, 0, 0, 0),
::zap::word(4, 0, 0, 0, 0, 0, 0, 0),
::zap::word(0, 0, 0, 0, 0, 0, 0, 0),
::zap::word(0, 0, 0, 0, 0, 0, 0, 0),
];
pub fn get_field_types(index: u16) -> ::zap::introspect::Type {
match index {
0 => <i32 as ::zap::introspect::Introspect>::introspect(),
_ => ::zap::introspect::panic_invalid_field_index(index),
}
}
pub fn get_annotation_types(child_index: Option<u16>, index: u32) -> ::zap::introspect::Type {
::zap::introspect::panic_invalid_annotation_indices(child_index, index)
}
pub static ARENA: ::zap::private::arena::GeneratedCodeArena = ::zap::private::arena::GeneratedCodeArena::new(&ENCODED_NODE);
pub static RAW_SCHEMA: ::zap::introspect::RawStructSchema = ::zap::introspect::RawStructSchema::new(
&ARENA,
NONUNION_MEMBERS,
MEMBERS_BY_DISCRIMINANT,
MEMBERS_BY_NAME
);
pub static NONUNION_MEMBERS : &[u16] = &[0];
pub static MEMBERS_BY_DISCRIMINANT : &[u16] = &[];
pub static MEMBERS_BY_NAME : &[u16] = &[0];
pub const TYPE_ID: u64 = 0xa349_c302_d856_d199;
}
}