mirror of
https://github.com/zap-proto/rust.git
synced 2026-10-30 15:04:23 +00:00
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.
495 lines
21 KiB
Rust
495 lines
21 KiB
Rust
// @generated by the zapc-rust plugin to the ZAP schema compiler.
|
|
// DO NOT EDIT.
|
|
// source: catrank.zap
|
|
|
|
|
|
pub mod search_result_list {
|
|
#[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_results(self) -> ::zap::Result<::zap::struct_list::Reader<'a,crate::catrank_zap::search_result::Owned>> {
|
|
::zap::traits::FromPointerReader::get_from_pointer(&self.reader.get_pointer_field(0), ::core::option::Option::None)
|
|
}
|
|
#[inline]
|
|
pub fn has_results(&self) -> bool {
|
|
!self.reader.get_pointer_field(0).is_null()
|
|
}
|
|
}
|
|
|
|
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: 0, pointers: 1 };
|
|
}
|
|
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_results(self) -> ::zap::Result<::zap::struct_list::Builder<'a,crate::catrank_zap::search_result::Owned>> {
|
|
::zap::traits::FromPointerBuilder::get_from_pointer(self.builder.get_pointer_field(0), ::core::option::Option::None)
|
|
}
|
|
#[inline]
|
|
pub fn set_results(&mut self, value: ::zap::struct_list::Reader<'_,crate::catrank_zap::search_result::Owned>) -> ::zap::Result<()> {
|
|
::zap::traits::SetterInput::set_pointer_builder(self.builder.reborrow().get_pointer_field(0), value, false)
|
|
}
|
|
#[inline]
|
|
pub fn init_results(self, size: u32) -> ::zap::struct_list::Builder<'a,crate::catrank_zap::search_result::Owned> {
|
|
::zap::traits::FromPointerBuilder::init_pointer(self.builder.get_pointer_field(0), size)
|
|
}
|
|
#[inline]
|
|
pub fn has_results(&self) -> bool {
|
|
!self.builder.is_pointer_field_null(0)
|
|
}
|
|
}
|
|
|
|
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; 38] = [
|
|
::zap::word(0, 0, 0, 0, 6, 0, 6, 0),
|
|
::zap::word(88, 24, 39, 36, 43, 242, 16, 158),
|
|
::zap::word(14, 0, 0, 0, 1, 0, 0, 0),
|
|
::zap::word(186, 154, 247, 127, 227, 184, 190, 130),
|
|
::zap::word(1, 0, 7, 0, 0, 0, 0, 0),
|
|
::zap::word(0, 0, 0, 0, 0, 0, 0, 0),
|
|
::zap::word(170, 4, 0, 0, 230, 4, 0, 0),
|
|
::zap::word(21, 0, 0, 0, 250, 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(99, 97, 116, 114, 97, 110, 107, 46),
|
|
::zap::word(99, 97, 112, 110, 112, 58, 83, 101),
|
|
::zap::word(97, 114, 99, 104, 82, 101, 115, 117),
|
|
::zap::word(108, 116, 76, 105, 115, 116, 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, 66, 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(36, 0, 0, 0, 2, 0, 1, 0),
|
|
::zap::word(114, 101, 115, 117, 108, 116, 115, 0),
|
|
::zap::word(14, 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, 3, 0, 1, 0),
|
|
::zap::word(16, 0, 0, 0, 0, 0, 0, 0),
|
|
::zap::word(245, 23, 252, 33, 205, 192, 128, 172),
|
|
::zap::word(0, 0, 0, 0, 0, 0, 0, 0),
|
|
::zap::word(0, 0, 0, 0, 0, 0, 0, 0),
|
|
::zap::word(14, 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 => <::zap::struct_list::Owned<crate::catrank_zap::search_result::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];
|
|
pub static MEMBERS_BY_DISCRIMINANT : &[u16] = &[];
|
|
pub static MEMBERS_BY_NAME : &[u16] = &[0];
|
|
pub const TYPE_ID: u64 = 0x9e10_f22b_2427_1858;
|
|
}
|
|
}
|
|
|
|
pub mod search_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 <'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_url(self) -> ::zap::Result<::zap::text::Reader<'a>> {
|
|
::zap::traits::FromPointerReader::get_from_pointer(&self.reader.get_pointer_field(0), ::core::option::Option::None)
|
|
}
|
|
#[inline]
|
|
pub fn has_url(&self) -> bool {
|
|
!self.reader.get_pointer_field(0).is_null()
|
|
}
|
|
#[inline]
|
|
pub fn get_score(self) -> f64 {
|
|
self.reader.get_data_field::<f64>(0)
|
|
}
|
|
#[inline]
|
|
pub fn get_snippet(self) -> ::zap::Result<::zap::text::Reader<'a>> {
|
|
::zap::traits::FromPointerReader::get_from_pointer(&self.reader.get_pointer_field(1), ::core::option::Option::None)
|
|
}
|
|
#[inline]
|
|
pub fn has_snippet(&self) -> bool {
|
|
!self.reader.get_pointer_field(1).is_null()
|
|
}
|
|
}
|
|
|
|
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: 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_url(self) -> ::zap::Result<::zap::text::Builder<'a>> {
|
|
::zap::traits::FromPointerBuilder::get_from_pointer(self.builder.get_pointer_field(0), ::core::option::Option::None)
|
|
}
|
|
#[inline]
|
|
pub fn set_url(&mut self, value: impl ::zap::traits::SetterInput<::zap::text::Owned>) {
|
|
::zap::traits::SetterInput::set_pointer_builder(self.builder.reborrow().get_pointer_field(0), value, false).unwrap()
|
|
}
|
|
#[inline]
|
|
pub fn init_url(self, size: u32) -> ::zap::text::Builder<'a> {
|
|
self.builder.get_pointer_field(0).init_text(size)
|
|
}
|
|
#[inline]
|
|
pub fn has_url(&self) -> bool {
|
|
!self.builder.is_pointer_field_null(0)
|
|
}
|
|
#[inline]
|
|
pub fn get_score(self) -> f64 {
|
|
self.builder.get_data_field::<f64>(0)
|
|
}
|
|
#[inline]
|
|
pub fn set_score(&mut self, value: f64) {
|
|
self.builder.set_data_field::<f64>(0, value);
|
|
}
|
|
#[inline]
|
|
pub fn get_snippet(self) -> ::zap::Result<::zap::text::Builder<'a>> {
|
|
::zap::traits::FromPointerBuilder::get_from_pointer(self.builder.get_pointer_field(1), ::core::option::Option::None)
|
|
}
|
|
#[inline]
|
|
pub fn set_snippet(&mut self, value: impl ::zap::traits::SetterInput<::zap::text::Owned>) {
|
|
::zap::traits::SetterInput::set_pointer_builder(self.builder.reborrow().get_pointer_field(1), value, false).unwrap()
|
|
}
|
|
#[inline]
|
|
pub fn init_snippet(self, size: u32) -> ::zap::text::Builder<'a> {
|
|
self.builder.get_pointer_field(1).init_text(size)
|
|
}
|
|
#[inline]
|
|
pub fn has_snippet(&self) -> bool {
|
|
!self.builder.is_pointer_field_null(1)
|
|
}
|
|
}
|
|
|
|
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; 64] = [
|
|
::zap::word(0, 0, 0, 0, 6, 0, 6, 0),
|
|
::zap::word(245, 23, 252, 33, 205, 192, 128, 172),
|
|
::zap::word(14, 0, 0, 0, 1, 0, 1, 0),
|
|
::zap::word(186, 154, 247, 127, 227, 184, 190, 130),
|
|
::zap::word(2, 0, 7, 0, 0, 0, 0, 0),
|
|
::zap::word(0, 0, 0, 0, 0, 0, 0, 0),
|
|
::zap::word(232, 4, 0, 0, 53, 5, 0, 0),
|
|
::zap::word(21, 0, 0, 0, 218, 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, 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(99, 97, 116, 114, 97, 110, 107, 46),
|
|
::zap::word(99, 97, 112, 110, 112, 58, 83, 101),
|
|
::zap::word(97, 114, 99, 104, 82, 101, 115, 117),
|
|
::zap::word(108, 116, 0, 0, 0, 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, 34, 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(0, 0, 1, 0, 1, 0, 0, 0),
|
|
::zap::word(0, 0, 0, 0, 0, 0, 0, 0),
|
|
::zap::word(73, 0, 0, 0, 50, 0, 0, 0),
|
|
::zap::word(0, 0, 0, 0, 0, 0, 0, 0),
|
|
::zap::word(68, 0, 0, 0, 3, 0, 1, 0),
|
|
::zap::word(80, 0, 0, 0, 2, 0, 1, 0),
|
|
::zap::word(2, 0, 0, 0, 1, 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(77, 0, 0, 0, 66, 0, 0, 0),
|
|
::zap::word(0, 0, 0, 0, 0, 0, 0, 0),
|
|
::zap::word(72, 0, 0, 0, 3, 0, 1, 0),
|
|
::zap::word(84, 0, 0, 0, 2, 0, 1, 0),
|
|
::zap::word(117, 114, 108, 0, 0, 0, 0, 0),
|
|
::zap::word(12, 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(12, 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(115, 99, 111, 114, 101, 0, 0, 0),
|
|
::zap::word(11, 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(11, 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(115, 110, 105, 112, 112, 101, 116, 0),
|
|
::zap::word(12, 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(12, 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 => <::zap::text::Owned as ::zap::introspect::Introspect>::introspect(),
|
|
1 => <f64 as ::zap::introspect::Introspect>::introspect(),
|
|
2 => <::zap::text::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,2,0];
|
|
pub const TYPE_ID: u64 = 0xac80_c0cd_21fc_17f5;
|
|
}
|
|
}
|