feat: fmt all
Signed-off-by: kjuulh <contact@kjuulh.io>
This commit is contained in:
parent
ca7c0c5c09
commit
595e82c064
@ -1,6 +1,6 @@
|
||||
mod logging;
|
||||
|
||||
use std::path::{PathBuf};
|
||||
use std::path::PathBuf;
|
||||
|
||||
use anyhow::anyhow;
|
||||
use clap::{Args, Parser, Subcommand};
|
||||
|
@ -2,63 +2,100 @@
|
||||
// DO NOT EDIT.
|
||||
// source: envelope.capnp
|
||||
|
||||
|
||||
pub mod envelope {
|
||||
#[derive(Copy, Clone)]
|
||||
pub struct Owned(());
|
||||
impl ::capnp::introspect::Introspect for Owned { fn introspect() -> ::capnp::introspect::Type { ::capnp::introspect::TypeVariant::Struct(::capnp::introspect::RawBrandedStructSchema { generic: &_private::RAW_SCHEMA, field_types: _private::get_field_types, annotation_types: _private::get_annotation_types }).into() } }
|
||||
impl ::capnp::traits::Owned for Owned { type Reader<'a> = Reader<'a>; type Builder<'a> = Builder<'a>; }
|
||||
impl ::capnp::traits::OwnedStruct for Owned { type Reader<'a> = Reader<'a>; type Builder<'a> = Builder<'a>; }
|
||||
impl ::capnp::traits::Pipelined for Owned { type Pipeline = Pipeline; }
|
||||
|
||||
pub struct Reader<'a> { reader: ::capnp::private::layout::StructReader<'a> }
|
||||
impl <'a,> ::core::marker::Copy for Reader<'a,> {}
|
||||
impl <'a,> ::core::clone::Clone for Reader<'a,> {
|
||||
fn clone(&self) -> Self { *self }
|
||||
impl ::capnp::introspect::Introspect for Owned {
|
||||
fn introspect() -> ::capnp::introspect::Type {
|
||||
::capnp::introspect::TypeVariant::Struct(::capnp::introspect::RawBrandedStructSchema {
|
||||
generic: &_private::RAW_SCHEMA,
|
||||
field_types: _private::get_field_types,
|
||||
annotation_types: _private::get_annotation_types,
|
||||
})
|
||||
.into()
|
||||
}
|
||||
}
|
||||
impl ::capnp::traits::Owned for Owned {
|
||||
type Reader<'a> = Reader<'a>;
|
||||
type Builder<'a> = Builder<'a>;
|
||||
}
|
||||
impl ::capnp::traits::OwnedStruct for Owned {
|
||||
type Reader<'a> = Reader<'a>;
|
||||
type Builder<'a> = Builder<'a>;
|
||||
}
|
||||
impl ::capnp::traits::Pipelined for Owned {
|
||||
type Pipeline = Pipeline;
|
||||
}
|
||||
|
||||
impl <'a,> ::capnp::traits::HasTypeId for Reader<'a,> {
|
||||
pub struct Reader<'a> {
|
||||
reader: ::capnp::private::layout::StructReader<'a>,
|
||||
}
|
||||
impl<'a> ::core::marker::Copy for Reader<'a> {}
|
||||
impl<'a> ::core::clone::Clone for Reader<'a> {
|
||||
fn clone(&self) -> Self {
|
||||
*self
|
||||
}
|
||||
}
|
||||
|
||||
impl<'a> ::capnp::traits::HasTypeId for Reader<'a> {
|
||||
const TYPE_ID: u64 = _private::TYPE_ID;
|
||||
}
|
||||
impl <'a,> ::core::convert::From<::capnp::private::layout::StructReader<'a>> for Reader<'a,> {
|
||||
impl<'a> ::core::convert::From<::capnp::private::layout::StructReader<'a>> for Reader<'a> {
|
||||
fn from(reader: ::capnp::private::layout::StructReader<'a>) -> Self {
|
||||
Self { reader, }
|
||||
Self { reader }
|
||||
}
|
||||
}
|
||||
|
||||
impl <'a,> ::core::convert::From<Reader<'a,>> for ::capnp::dynamic_value::Reader<'a> {
|
||||
fn from(reader: Reader<'a,>) -> Self {
|
||||
Self::Struct(::capnp::dynamic_struct::Reader::new(reader.reader, ::capnp::schema::StructSchema::new(::capnp::introspect::RawBrandedStructSchema { generic: &_private::RAW_SCHEMA, field_types: _private::get_field_types::<>, annotation_types: _private::get_annotation_types::<>})))
|
||||
impl<'a> ::core::convert::From<Reader<'a>> for ::capnp::dynamic_value::Reader<'a> {
|
||||
fn from(reader: Reader<'a>) -> Self {
|
||||
Self::Struct(::capnp::dynamic_struct::Reader::new(
|
||||
reader.reader,
|
||||
::capnp::schema::StructSchema::new(::capnp::introspect::RawBrandedStructSchema {
|
||||
generic: &_private::RAW_SCHEMA,
|
||||
field_types: _private::get_field_types,
|
||||
annotation_types: _private::get_annotation_types,
|
||||
}),
|
||||
))
|
||||
}
|
||||
}
|
||||
|
||||
impl <'a,> ::core::fmt::Debug for Reader<'a,> {
|
||||
fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::result::Result<(), ::core::fmt::Error> {
|
||||
core::fmt::Debug::fmt(&::core::convert::Into::<::capnp::dynamic_value::Reader<'_>>::into(*self), f)
|
||||
impl<'a> ::core::fmt::Debug for Reader<'a> {
|
||||
fn fmt(
|
||||
&self,
|
||||
f: &mut ::core::fmt::Formatter<'_>,
|
||||
) -> ::core::result::Result<(), ::core::fmt::Error> {
|
||||
core::fmt::Debug::fmt(
|
||||
&::core::convert::Into::<::capnp::dynamic_value::Reader<'_>>::into(*self),
|
||||
f,
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
impl <'a,> ::capnp::traits::FromPointerReader<'a> for Reader<'a,> {
|
||||
fn get_from_pointer(reader: &::capnp::private::layout::PointerReader<'a>, default: ::core::option::Option<&'a [::capnp::Word]>) -> ::capnp::Result<Self> {
|
||||
impl<'a> ::capnp::traits::FromPointerReader<'a> for Reader<'a> {
|
||||
fn get_from_pointer(
|
||||
reader: &::capnp::private::layout::PointerReader<'a>,
|
||||
default: ::core::option::Option<&'a [::capnp::Word]>,
|
||||
) -> ::capnp::Result<Self> {
|
||||
::core::result::Result::Ok(reader.get_struct(default)?.into())
|
||||
}
|
||||
}
|
||||
|
||||
impl <'a,> ::capnp::traits::IntoInternalStructReader<'a> for Reader<'a,> {
|
||||
impl<'a> ::capnp::traits::IntoInternalStructReader<'a> for Reader<'a> {
|
||||
fn into_internal_struct_reader(self) -> ::capnp::private::layout::StructReader<'a> {
|
||||
self.reader
|
||||
}
|
||||
}
|
||||
|
||||
impl <'a,> ::capnp::traits::Imbue<'a> for Reader<'a,> {
|
||||
impl<'a> ::capnp::traits::Imbue<'a> for Reader<'a> {
|
||||
fn imbue(&mut self, cap_table: &'a ::capnp::private::layout::CapTable) {
|
||||
self.reader.imbue(::capnp::private::layout::CapTableReader::Plain(cap_table))
|
||||
self.reader
|
||||
.imbue(::capnp::private::layout::CapTableReader::Plain(cap_table))
|
||||
}
|
||||
}
|
||||
|
||||
impl <'a,> Reader<'a,> {
|
||||
pub fn reborrow(&self) -> Reader<'_,> {
|
||||
Self { .. *self }
|
||||
impl<'a> Reader<'a> {
|
||||
pub fn reborrow(&self) -> Reader<'_> {
|
||||
Self { ..*self }
|
||||
}
|
||||
|
||||
pub fn total_size(&self) -> ::capnp::Result<::capnp::MessageSize> {
|
||||
@ -66,7 +103,10 @@ pub mod envelope {
|
||||
}
|
||||
#[inline]
|
||||
pub fn get_metadata(self) -> ::capnp::Result<crate::envelope_capnp::metadata::Reader<'a>> {
|
||||
::capnp::traits::FromPointerReader::get_from_pointer(&self.reader.get_pointer_field(0), ::core::option::Option::None)
|
||||
::capnp::traits::FromPointerReader::get_from_pointer(
|
||||
&self.reader.get_pointer_field(0),
|
||||
::core::option::Option::None,
|
||||
)
|
||||
}
|
||||
#[inline]
|
||||
pub fn has_metadata(&self) -> bool {
|
||||
@ -74,7 +114,10 @@ pub mod envelope {
|
||||
}
|
||||
#[inline]
|
||||
pub fn get_content(self) -> ::capnp::Result<::capnp::data::Reader<'a>> {
|
||||
::capnp::traits::FromPointerReader::get_from_pointer(&self.reader.get_pointer_field(1), ::core::option::Option::None)
|
||||
::capnp::traits::FromPointerReader::get_from_pointer(
|
||||
&self.reader.get_pointer_field(1),
|
||||
::core::option::Option::None,
|
||||
)
|
||||
}
|
||||
#[inline]
|
||||
pub fn has_content(&self) -> bool {
|
||||
@ -82,52 +125,86 @@ pub mod envelope {
|
||||
}
|
||||
}
|
||||
|
||||
pub struct Builder<'a> { builder: ::capnp::private::layout::StructBuilder<'a> }
|
||||
impl <'a,> ::capnp::traits::HasStructSize for Builder<'a,> {
|
||||
const STRUCT_SIZE: ::capnp::private::layout::StructSize = ::capnp::private::layout::StructSize { data: 0, pointers: 2 };
|
||||
pub struct Builder<'a> {
|
||||
builder: ::capnp::private::layout::StructBuilder<'a>,
|
||||
}
|
||||
impl <'a,> ::capnp::traits::HasTypeId for Builder<'a,> {
|
||||
impl<'a> ::capnp::traits::HasStructSize for Builder<'a> {
|
||||
const STRUCT_SIZE: ::capnp::private::layout::StructSize =
|
||||
::capnp::private::layout::StructSize {
|
||||
data: 0,
|
||||
pointers: 2,
|
||||
};
|
||||
}
|
||||
impl<'a> ::capnp::traits::HasTypeId for Builder<'a> {
|
||||
const TYPE_ID: u64 = _private::TYPE_ID;
|
||||
}
|
||||
impl <'a,> ::core::convert::From<::capnp::private::layout::StructBuilder<'a>> for Builder<'a,> {
|
||||
impl<'a> ::core::convert::From<::capnp::private::layout::StructBuilder<'a>> for Builder<'a> {
|
||||
fn from(builder: ::capnp::private::layout::StructBuilder<'a>) -> Self {
|
||||
Self { builder, }
|
||||
Self { builder }
|
||||
}
|
||||
}
|
||||
|
||||
impl <'a,> ::core::convert::From<Builder<'a,>> for ::capnp::dynamic_value::Builder<'a> {
|
||||
fn from(builder: Builder<'a,>) -> Self {
|
||||
Self::Struct(::capnp::dynamic_struct::Builder::new(builder.builder, ::capnp::schema::StructSchema::new(::capnp::introspect::RawBrandedStructSchema { generic: &_private::RAW_SCHEMA, field_types: _private::get_field_types::<>, annotation_types: _private::get_annotation_types::<>})))
|
||||
impl<'a> ::core::convert::From<Builder<'a>> for ::capnp::dynamic_value::Builder<'a> {
|
||||
fn from(builder: Builder<'a>) -> Self {
|
||||
Self::Struct(::capnp::dynamic_struct::Builder::new(
|
||||
builder.builder,
|
||||
::capnp::schema::StructSchema::new(::capnp::introspect::RawBrandedStructSchema {
|
||||
generic: &_private::RAW_SCHEMA,
|
||||
field_types: _private::get_field_types,
|
||||
annotation_types: _private::get_annotation_types,
|
||||
}),
|
||||
))
|
||||
}
|
||||
}
|
||||
|
||||
impl <'a,> ::capnp::traits::ImbueMut<'a> for Builder<'a,> {
|
||||
impl<'a> ::capnp::traits::ImbueMut<'a> for Builder<'a> {
|
||||
fn imbue_mut(&mut self, cap_table: &'a mut ::capnp::private::layout::CapTable) {
|
||||
self.builder.imbue(::capnp::private::layout::CapTableBuilder::Plain(cap_table))
|
||||
self.builder
|
||||
.imbue(::capnp::private::layout::CapTableBuilder::Plain(cap_table))
|
||||
}
|
||||
}
|
||||
|
||||
impl <'a,> ::capnp::traits::FromPointerBuilder<'a> for Builder<'a,> {
|
||||
impl<'a> ::capnp::traits::FromPointerBuilder<'a> for Builder<'a> {
|
||||
fn init_pointer(builder: ::capnp::private::layout::PointerBuilder<'a>, _size: u32) -> Self {
|
||||
builder.init_struct(<Self as ::capnp::traits::HasStructSize>::STRUCT_SIZE).into()
|
||||
builder
|
||||
.init_struct(<Self as ::capnp::traits::HasStructSize>::STRUCT_SIZE)
|
||||
.into()
|
||||
}
|
||||
fn get_from_pointer(builder: ::capnp::private::layout::PointerBuilder<'a>, default: ::core::option::Option<&'a [::capnp::Word]>) -> ::capnp::Result<Self> {
|
||||
::core::result::Result::Ok(builder.get_struct(<Self as ::capnp::traits::HasStructSize>::STRUCT_SIZE, default)?.into())
|
||||
fn get_from_pointer(
|
||||
builder: ::capnp::private::layout::PointerBuilder<'a>,
|
||||
default: ::core::option::Option<&'a [::capnp::Word]>,
|
||||
) -> ::capnp::Result<Self> {
|
||||
::core::result::Result::Ok(
|
||||
builder
|
||||
.get_struct(
|
||||
<Self as ::capnp::traits::HasStructSize>::STRUCT_SIZE,
|
||||
default,
|
||||
)?
|
||||
.into(),
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
impl <'a,> ::capnp::traits::SetPointerBuilder for Reader<'a,> {
|
||||
fn set_pointer_builder(mut pointer: ::capnp::private::layout::PointerBuilder<'_>, value: Self, canonicalize: bool) -> ::capnp::Result<()> { pointer.set_struct(&value.reader, canonicalize) }
|
||||
impl<'a> ::capnp::traits::SetPointerBuilder for Reader<'a> {
|
||||
fn set_pointer_builder(
|
||||
mut pointer: ::capnp::private::layout::PointerBuilder<'_>,
|
||||
value: Self,
|
||||
canonicalize: bool,
|
||||
) -> ::capnp::Result<()> {
|
||||
pointer.set_struct(&value.reader, canonicalize)
|
||||
}
|
||||
}
|
||||
|
||||
impl <'a,> Builder<'a,> {
|
||||
pub fn into_reader(self) -> Reader<'a,> {
|
||||
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(&mut self) -> Builder<'_> {
|
||||
Builder {
|
||||
builder: self.builder.reborrow(),
|
||||
}
|
||||
pub fn reborrow_as_reader(&self) -> Reader<'_,> {
|
||||
}
|
||||
pub fn reborrow_as_reader(&self) -> Reader<'_> {
|
||||
self.builder.as_reader().into()
|
||||
}
|
||||
|
||||
@ -136,14 +213,24 @@ pub mod envelope {
|
||||
}
|
||||
#[inline]
|
||||
pub fn get_metadata(self) -> ::capnp::Result<crate::envelope_capnp::metadata::Builder<'a>> {
|
||||
::capnp::traits::FromPointerBuilder::get_from_pointer(self.builder.get_pointer_field(0), ::core::option::Option::None)
|
||||
::capnp::traits::FromPointerBuilder::get_from_pointer(
|
||||
self.builder.get_pointer_field(0),
|
||||
::core::option::Option::None,
|
||||
)
|
||||
}
|
||||
#[inline]
|
||||
pub fn set_metadata(&mut self, value: crate::envelope_capnp::metadata::Reader<'_>) -> ::capnp::Result<()> {
|
||||
::capnp::traits::SetPointerBuilder::set_pointer_builder(self.builder.reborrow().get_pointer_field(0), value, false)
|
||||
pub fn set_metadata(
|
||||
&mut self,
|
||||
value: crate::envelope_capnp::metadata::Reader<'_>,
|
||||
) -> ::capnp::Result<()> {
|
||||
::capnp::traits::SetPointerBuilder::set_pointer_builder(
|
||||
self.builder.reborrow().get_pointer_field(0),
|
||||
value,
|
||||
false,
|
||||
)
|
||||
}
|
||||
#[inline]
|
||||
pub fn init_metadata(self, ) -> crate::envelope_capnp::metadata::Builder<'a> {
|
||||
pub fn init_metadata(self) -> crate::envelope_capnp::metadata::Builder<'a> {
|
||||
::capnp::traits::FromPointerBuilder::init_pointer(self.builder.get_pointer_field(0), 0)
|
||||
}
|
||||
#[inline]
|
||||
@ -152,7 +239,10 @@ pub mod envelope {
|
||||
}
|
||||
#[inline]
|
||||
pub fn get_content(self) -> ::capnp::Result<::capnp::data::Builder<'a>> {
|
||||
::capnp::traits::FromPointerBuilder::get_from_pointer(self.builder.get_pointer_field(1), ::core::option::Option::None)
|
||||
::capnp::traits::FromPointerBuilder::get_from_pointer(
|
||||
self.builder.get_pointer_field(1),
|
||||
::core::option::Option::None,
|
||||
)
|
||||
}
|
||||
#[inline]
|
||||
pub fn set_content(&mut self, value: ::capnp::data::Reader<'_>) {
|
||||
@ -168,10 +258,14 @@ pub mod envelope {
|
||||
}
|
||||
}
|
||||
|
||||
pub struct Pipeline { _typeless: ::capnp::any_pointer::Pipeline }
|
||||
pub struct Pipeline {
|
||||
_typeless: ::capnp::any_pointer::Pipeline,
|
||||
}
|
||||
impl ::capnp::capability::FromTypelessPipeline for Pipeline {
|
||||
fn new(typeless: ::capnp::any_pointer::Pipeline) -> Self {
|
||||
Self { _typeless: typeless, }
|
||||
Self {
|
||||
_typeless: typeless,
|
||||
}
|
||||
}
|
||||
}
|
||||
impl Pipeline {
|
||||
@ -237,16 +331,20 @@ pub mod envelope {
|
||||
_ => panic!("invalid field index {}", index),
|
||||
}
|
||||
}
|
||||
pub fn get_annotation_types(child_index: Option<u16>, index: u32) -> ::capnp::introspect::Type {
|
||||
pub fn get_annotation_types(
|
||||
child_index: Option<u16>,
|
||||
index: u32,
|
||||
) -> ::capnp::introspect::Type {
|
||||
panic!("invalid annotation indices ({:?}, {}) ", child_index, index)
|
||||
}
|
||||
pub static RAW_SCHEMA: ::capnp::introspect::RawStructSchema = ::capnp::introspect::RawStructSchema {
|
||||
pub static RAW_SCHEMA: ::capnp::introspect::RawStructSchema =
|
||||
::capnp::introspect::RawStructSchema {
|
||||
encoded_node: &ENCODED_NODE,
|
||||
nonunion_members: NONUNION_MEMBERS,
|
||||
members_by_discriminant: MEMBERS_BY_DISCRIMINANT,
|
||||
};
|
||||
pub static NONUNION_MEMBERS : &[u16] = &[0,1];
|
||||
pub static MEMBERS_BY_DISCRIMINANT : &[u16] = &[];
|
||||
pub static NONUNION_MEMBERS: &[u16] = &[0, 1];
|
||||
pub static MEMBERS_BY_DISCRIMINANT: &[u16] = &[];
|
||||
pub const TYPE_ID: u64 = 0xfa2e_5d6c_2966_b23f;
|
||||
}
|
||||
}
|
||||
@ -254,59 +352,97 @@ pub mod envelope {
|
||||
pub mod metadata {
|
||||
#[derive(Copy, Clone)]
|
||||
pub struct Owned(());
|
||||
impl ::capnp::introspect::Introspect for Owned { fn introspect() -> ::capnp::introspect::Type { ::capnp::introspect::TypeVariant::Struct(::capnp::introspect::RawBrandedStructSchema { generic: &_private::RAW_SCHEMA, field_types: _private::get_field_types, annotation_types: _private::get_annotation_types }).into() } }
|
||||
impl ::capnp::traits::Owned for Owned { type Reader<'a> = Reader<'a>; type Builder<'a> = Builder<'a>; }
|
||||
impl ::capnp::traits::OwnedStruct for Owned { type Reader<'a> = Reader<'a>; type Builder<'a> = Builder<'a>; }
|
||||
impl ::capnp::traits::Pipelined for Owned { type Pipeline = Pipeline; }
|
||||
|
||||
pub struct Reader<'a> { reader: ::capnp::private::layout::StructReader<'a> }
|
||||
impl <'a,> ::core::marker::Copy for Reader<'a,> {}
|
||||
impl <'a,> ::core::clone::Clone for Reader<'a,> {
|
||||
fn clone(&self) -> Self { *self }
|
||||
impl ::capnp::introspect::Introspect for Owned {
|
||||
fn introspect() -> ::capnp::introspect::Type {
|
||||
::capnp::introspect::TypeVariant::Struct(::capnp::introspect::RawBrandedStructSchema {
|
||||
generic: &_private::RAW_SCHEMA,
|
||||
field_types: _private::get_field_types,
|
||||
annotation_types: _private::get_annotation_types,
|
||||
})
|
||||
.into()
|
||||
}
|
||||
}
|
||||
impl ::capnp::traits::Owned for Owned {
|
||||
type Reader<'a> = Reader<'a>;
|
||||
type Builder<'a> = Builder<'a>;
|
||||
}
|
||||
impl ::capnp::traits::OwnedStruct for Owned {
|
||||
type Reader<'a> = Reader<'a>;
|
||||
type Builder<'a> = Builder<'a>;
|
||||
}
|
||||
impl ::capnp::traits::Pipelined for Owned {
|
||||
type Pipeline = Pipeline;
|
||||
}
|
||||
|
||||
impl <'a,> ::capnp::traits::HasTypeId for Reader<'a,> {
|
||||
pub struct Reader<'a> {
|
||||
reader: ::capnp::private::layout::StructReader<'a>,
|
||||
}
|
||||
impl<'a> ::core::marker::Copy for Reader<'a> {}
|
||||
impl<'a> ::core::clone::Clone for Reader<'a> {
|
||||
fn clone(&self) -> Self {
|
||||
*self
|
||||
}
|
||||
}
|
||||
|
||||
impl<'a> ::capnp::traits::HasTypeId for Reader<'a> {
|
||||
const TYPE_ID: u64 = _private::TYPE_ID;
|
||||
}
|
||||
impl <'a,> ::core::convert::From<::capnp::private::layout::StructReader<'a>> for Reader<'a,> {
|
||||
impl<'a> ::core::convert::From<::capnp::private::layout::StructReader<'a>> for Reader<'a> {
|
||||
fn from(reader: ::capnp::private::layout::StructReader<'a>) -> Self {
|
||||
Self { reader, }
|
||||
Self { reader }
|
||||
}
|
||||
}
|
||||
|
||||
impl <'a,> ::core::convert::From<Reader<'a,>> for ::capnp::dynamic_value::Reader<'a> {
|
||||
fn from(reader: Reader<'a,>) -> Self {
|
||||
Self::Struct(::capnp::dynamic_struct::Reader::new(reader.reader, ::capnp::schema::StructSchema::new(::capnp::introspect::RawBrandedStructSchema { generic: &_private::RAW_SCHEMA, field_types: _private::get_field_types::<>, annotation_types: _private::get_annotation_types::<>})))
|
||||
impl<'a> ::core::convert::From<Reader<'a>> for ::capnp::dynamic_value::Reader<'a> {
|
||||
fn from(reader: Reader<'a>) -> Self {
|
||||
Self::Struct(::capnp::dynamic_struct::Reader::new(
|
||||
reader.reader,
|
||||
::capnp::schema::StructSchema::new(::capnp::introspect::RawBrandedStructSchema {
|
||||
generic: &_private::RAW_SCHEMA,
|
||||
field_types: _private::get_field_types,
|
||||
annotation_types: _private::get_annotation_types,
|
||||
}),
|
||||
))
|
||||
}
|
||||
}
|
||||
|
||||
impl <'a,> ::core::fmt::Debug for Reader<'a,> {
|
||||
fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::result::Result<(), ::core::fmt::Error> {
|
||||
core::fmt::Debug::fmt(&::core::convert::Into::<::capnp::dynamic_value::Reader<'_>>::into(*self), f)
|
||||
impl<'a> ::core::fmt::Debug for Reader<'a> {
|
||||
fn fmt(
|
||||
&self,
|
||||
f: &mut ::core::fmt::Formatter<'_>,
|
||||
) -> ::core::result::Result<(), ::core::fmt::Error> {
|
||||
core::fmt::Debug::fmt(
|
||||
&::core::convert::Into::<::capnp::dynamic_value::Reader<'_>>::into(*self),
|
||||
f,
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
impl <'a,> ::capnp::traits::FromPointerReader<'a> for Reader<'a,> {
|
||||
fn get_from_pointer(reader: &::capnp::private::layout::PointerReader<'a>, default: ::core::option::Option<&'a [::capnp::Word]>) -> ::capnp::Result<Self> {
|
||||
impl<'a> ::capnp::traits::FromPointerReader<'a> for Reader<'a> {
|
||||
fn get_from_pointer(
|
||||
reader: &::capnp::private::layout::PointerReader<'a>,
|
||||
default: ::core::option::Option<&'a [::capnp::Word]>,
|
||||
) -> ::capnp::Result<Self> {
|
||||
::core::result::Result::Ok(reader.get_struct(default)?.into())
|
||||
}
|
||||
}
|
||||
|
||||
impl <'a,> ::capnp::traits::IntoInternalStructReader<'a> for Reader<'a,> {
|
||||
impl<'a> ::capnp::traits::IntoInternalStructReader<'a> for Reader<'a> {
|
||||
fn into_internal_struct_reader(self) -> ::capnp::private::layout::StructReader<'a> {
|
||||
self.reader
|
||||
}
|
||||
}
|
||||
|
||||
impl <'a,> ::capnp::traits::Imbue<'a> for Reader<'a,> {
|
||||
impl<'a> ::capnp::traits::Imbue<'a> for Reader<'a> {
|
||||
fn imbue(&mut self, cap_table: &'a ::capnp::private::layout::CapTable) {
|
||||
self.reader.imbue(::capnp::private::layout::CapTableReader::Plain(cap_table))
|
||||
self.reader
|
||||
.imbue(::capnp::private::layout::CapTableReader::Plain(cap_table))
|
||||
}
|
||||
}
|
||||
|
||||
impl <'a,> Reader<'a,> {
|
||||
pub fn reborrow(&self) -> Reader<'_,> {
|
||||
Self { .. *self }
|
||||
impl<'a> Reader<'a> {
|
||||
pub fn reborrow(&self) -> Reader<'_> {
|
||||
Self { ..*self }
|
||||
}
|
||||
|
||||
pub fn total_size(&self) -> ::capnp::Result<::capnp::MessageSize> {
|
||||
@ -314,7 +450,10 @@ pub mod metadata {
|
||||
}
|
||||
#[inline]
|
||||
pub fn get_domain(self) -> ::capnp::Result<::capnp::text::Reader<'a>> {
|
||||
::capnp::traits::FromPointerReader::get_from_pointer(&self.reader.get_pointer_field(0), ::core::option::Option::None)
|
||||
::capnp::traits::FromPointerReader::get_from_pointer(
|
||||
&self.reader.get_pointer_field(0),
|
||||
::core::option::Option::None,
|
||||
)
|
||||
}
|
||||
#[inline]
|
||||
pub fn has_domain(&self) -> bool {
|
||||
@ -322,7 +461,10 @@ pub mod metadata {
|
||||
}
|
||||
#[inline]
|
||||
pub fn get_entity(self) -> ::capnp::Result<::capnp::text::Reader<'a>> {
|
||||
::capnp::traits::FromPointerReader::get_from_pointer(&self.reader.get_pointer_field(1), ::core::option::Option::None)
|
||||
::capnp::traits::FromPointerReader::get_from_pointer(
|
||||
&self.reader.get_pointer_field(1),
|
||||
::core::option::Option::None,
|
||||
)
|
||||
}
|
||||
#[inline]
|
||||
pub fn has_entity(&self) -> bool {
|
||||
@ -338,52 +480,86 @@ pub mod metadata {
|
||||
}
|
||||
}
|
||||
|
||||
pub struct Builder<'a> { builder: ::capnp::private::layout::StructBuilder<'a> }
|
||||
impl <'a,> ::capnp::traits::HasStructSize for Builder<'a,> {
|
||||
const STRUCT_SIZE: ::capnp::private::layout::StructSize = ::capnp::private::layout::StructSize { data: 2, pointers: 2 };
|
||||
pub struct Builder<'a> {
|
||||
builder: ::capnp::private::layout::StructBuilder<'a>,
|
||||
}
|
||||
impl <'a,> ::capnp::traits::HasTypeId for Builder<'a,> {
|
||||
impl<'a> ::capnp::traits::HasStructSize for Builder<'a> {
|
||||
const STRUCT_SIZE: ::capnp::private::layout::StructSize =
|
||||
::capnp::private::layout::StructSize {
|
||||
data: 2,
|
||||
pointers: 2,
|
||||
};
|
||||
}
|
||||
impl<'a> ::capnp::traits::HasTypeId for Builder<'a> {
|
||||
const TYPE_ID: u64 = _private::TYPE_ID;
|
||||
}
|
||||
impl <'a,> ::core::convert::From<::capnp::private::layout::StructBuilder<'a>> for Builder<'a,> {
|
||||
impl<'a> ::core::convert::From<::capnp::private::layout::StructBuilder<'a>> for Builder<'a> {
|
||||
fn from(builder: ::capnp::private::layout::StructBuilder<'a>) -> Self {
|
||||
Self { builder, }
|
||||
Self { builder }
|
||||
}
|
||||
}
|
||||
|
||||
impl <'a,> ::core::convert::From<Builder<'a,>> for ::capnp::dynamic_value::Builder<'a> {
|
||||
fn from(builder: Builder<'a,>) -> Self {
|
||||
Self::Struct(::capnp::dynamic_struct::Builder::new(builder.builder, ::capnp::schema::StructSchema::new(::capnp::introspect::RawBrandedStructSchema { generic: &_private::RAW_SCHEMA, field_types: _private::get_field_types::<>, annotation_types: _private::get_annotation_types::<>})))
|
||||
impl<'a> ::core::convert::From<Builder<'a>> for ::capnp::dynamic_value::Builder<'a> {
|
||||
fn from(builder: Builder<'a>) -> Self {
|
||||
Self::Struct(::capnp::dynamic_struct::Builder::new(
|
||||
builder.builder,
|
||||
::capnp::schema::StructSchema::new(::capnp::introspect::RawBrandedStructSchema {
|
||||
generic: &_private::RAW_SCHEMA,
|
||||
field_types: _private::get_field_types,
|
||||
annotation_types: _private::get_annotation_types,
|
||||
}),
|
||||
))
|
||||
}
|
||||
}
|
||||
|
||||
impl <'a,> ::capnp::traits::ImbueMut<'a> for Builder<'a,> {
|
||||
impl<'a> ::capnp::traits::ImbueMut<'a> for Builder<'a> {
|
||||
fn imbue_mut(&mut self, cap_table: &'a mut ::capnp::private::layout::CapTable) {
|
||||
self.builder.imbue(::capnp::private::layout::CapTableBuilder::Plain(cap_table))
|
||||
self.builder
|
||||
.imbue(::capnp::private::layout::CapTableBuilder::Plain(cap_table))
|
||||
}
|
||||
}
|
||||
|
||||
impl <'a,> ::capnp::traits::FromPointerBuilder<'a> for Builder<'a,> {
|
||||
impl<'a> ::capnp::traits::FromPointerBuilder<'a> for Builder<'a> {
|
||||
fn init_pointer(builder: ::capnp::private::layout::PointerBuilder<'a>, _size: u32) -> Self {
|
||||
builder.init_struct(<Self as ::capnp::traits::HasStructSize>::STRUCT_SIZE).into()
|
||||
builder
|
||||
.init_struct(<Self as ::capnp::traits::HasStructSize>::STRUCT_SIZE)
|
||||
.into()
|
||||
}
|
||||
fn get_from_pointer(builder: ::capnp::private::layout::PointerBuilder<'a>, default: ::core::option::Option<&'a [::capnp::Word]>) -> ::capnp::Result<Self> {
|
||||
::core::result::Result::Ok(builder.get_struct(<Self as ::capnp::traits::HasStructSize>::STRUCT_SIZE, default)?.into())
|
||||
fn get_from_pointer(
|
||||
builder: ::capnp::private::layout::PointerBuilder<'a>,
|
||||
default: ::core::option::Option<&'a [::capnp::Word]>,
|
||||
) -> ::capnp::Result<Self> {
|
||||
::core::result::Result::Ok(
|
||||
builder
|
||||
.get_struct(
|
||||
<Self as ::capnp::traits::HasStructSize>::STRUCT_SIZE,
|
||||
default,
|
||||
)?
|
||||
.into(),
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
impl <'a,> ::capnp::traits::SetPointerBuilder for Reader<'a,> {
|
||||
fn set_pointer_builder(mut pointer: ::capnp::private::layout::PointerBuilder<'_>, value: Self, canonicalize: bool) -> ::capnp::Result<()> { pointer.set_struct(&value.reader, canonicalize) }
|
||||
impl<'a> ::capnp::traits::SetPointerBuilder for Reader<'a> {
|
||||
fn set_pointer_builder(
|
||||
mut pointer: ::capnp::private::layout::PointerBuilder<'_>,
|
||||
value: Self,
|
||||
canonicalize: bool,
|
||||
) -> ::capnp::Result<()> {
|
||||
pointer.set_struct(&value.reader, canonicalize)
|
||||
}
|
||||
}
|
||||
|
||||
impl <'a,> Builder<'a,> {
|
||||
pub fn into_reader(self) -> Reader<'a,> {
|
||||
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(&mut self) -> Builder<'_> {
|
||||
Builder {
|
||||
builder: self.builder.reborrow(),
|
||||
}
|
||||
pub fn reborrow_as_reader(&self) -> Reader<'_,> {
|
||||
}
|
||||
pub fn reborrow_as_reader(&self) -> Reader<'_> {
|
||||
self.builder.as_reader().into()
|
||||
}
|
||||
|
||||
@ -392,7 +568,10 @@ pub mod metadata {
|
||||
}
|
||||
#[inline]
|
||||
pub fn get_domain(self) -> ::capnp::Result<::capnp::text::Builder<'a>> {
|
||||
::capnp::traits::FromPointerBuilder::get_from_pointer(self.builder.get_pointer_field(0), ::core::option::Option::None)
|
||||
::capnp::traits::FromPointerBuilder::get_from_pointer(
|
||||
self.builder.get_pointer_field(0),
|
||||
::core::option::Option::None,
|
||||
)
|
||||
}
|
||||
#[inline]
|
||||
pub fn set_domain(&mut self, value: ::capnp::text::Reader<'_>) {
|
||||
@ -408,7 +587,10 @@ pub mod metadata {
|
||||
}
|
||||
#[inline]
|
||||
pub fn get_entity(self) -> ::capnp::Result<::capnp::text::Builder<'a>> {
|
||||
::capnp::traits::FromPointerBuilder::get_from_pointer(self.builder.get_pointer_field(1), ::core::option::Option::None)
|
||||
::capnp::traits::FromPointerBuilder::get_from_pointer(
|
||||
self.builder.get_pointer_field(1),
|
||||
::core::option::Option::None,
|
||||
)
|
||||
}
|
||||
#[inline]
|
||||
pub fn set_entity(&mut self, value: ::capnp::text::Reader<'_>) {
|
||||
@ -440,14 +622,17 @@ pub mod metadata {
|
||||
}
|
||||
}
|
||||
|
||||
pub struct Pipeline { _typeless: ::capnp::any_pointer::Pipeline }
|
||||
pub struct Pipeline {
|
||||
_typeless: ::capnp::any_pointer::Pipeline,
|
||||
}
|
||||
impl ::capnp::capability::FromTypelessPipeline for Pipeline {
|
||||
fn new(typeless: ::capnp::any_pointer::Pipeline) -> Self {
|
||||
Self { _typeless: typeless, }
|
||||
Self {
|
||||
_typeless: typeless,
|
||||
}
|
||||
}
|
||||
impl Pipeline {
|
||||
}
|
||||
impl Pipeline {}
|
||||
mod _private {
|
||||
pub static ENCODED_NODE: [::capnp::Word; 79] = [
|
||||
::capnp::word(0, 0, 0, 0, 5, 0, 6, 0),
|
||||
@ -539,16 +724,20 @@ pub mod metadata {
|
||||
_ => panic!("invalid field index {}", index),
|
||||
}
|
||||
}
|
||||
pub fn get_annotation_types(child_index: Option<u16>, index: u32) -> ::capnp::introspect::Type {
|
||||
pub fn get_annotation_types(
|
||||
child_index: Option<u16>,
|
||||
index: u32,
|
||||
) -> ::capnp::introspect::Type {
|
||||
panic!("invalid annotation indices ({:?}, {}) ", child_index, index)
|
||||
}
|
||||
pub static RAW_SCHEMA: ::capnp::introspect::RawStructSchema = ::capnp::introspect::RawStructSchema {
|
||||
pub static RAW_SCHEMA: ::capnp::introspect::RawStructSchema =
|
||||
::capnp::introspect::RawStructSchema {
|
||||
encoded_node: &ENCODED_NODE,
|
||||
nonunion_members: NONUNION_MEMBERS,
|
||||
members_by_discriminant: MEMBERS_BY_DISCRIMINANT,
|
||||
};
|
||||
pub static NONUNION_MEMBERS : &[u16] = &[0,1,2,3];
|
||||
pub static MEMBERS_BY_DISCRIMINANT : &[u16] = &[];
|
||||
pub static NONUNION_MEMBERS: &[u16] = &[0, 1, 2, 3];
|
||||
pub static MEMBERS_BY_DISCRIMINANT: &[u16] = &[];
|
||||
pub const TYPE_ID: u64 = 0x9344_9677_212b_0ac1;
|
||||
}
|
||||
}
|
||||
|
@ -16,8 +16,6 @@ pub struct Metadata {
|
||||
}
|
||||
|
||||
pub fn wrap<'a>(domain: &'a str, entity: &'a str, content: &'a [u8]) -> Vec<u8> {
|
||||
|
||||
|
||||
serde_json::to_vec(&Envelope {
|
||||
content: general_purpose::URL_SAFE_NO_PAD.encode(content),
|
||||
metadata: Metadata {
|
||||
|
@ -1,6 +1,7 @@
|
||||
pub mod basic {
|
||||
pub mod includes {
|
||||
pub mod my_include { use prost::Message;
|
||||
pub mod my_include {
|
||||
use prost::Message;
|
||||
include!("basic.includes.my_include.rs");
|
||||
|
||||
impl ::crunch::traits::Serializer for MyInclude {
|
||||
@ -13,7 +14,8 @@ pub mod basic {
|
||||
where
|
||||
Self: Sized,
|
||||
{
|
||||
let output = Self::decode(raw.as_slice()).map_err(::crunch::errors::DeserializeError::ProtoErr)?;
|
||||
let output = Self::decode(raw.as_slice())
|
||||
.map_err(::crunch::errors::DeserializeError::ProtoErr)?;
|
||||
Ok(output)
|
||||
}
|
||||
}
|
||||
@ -29,7 +31,8 @@ pub mod basic {
|
||||
}
|
||||
}
|
||||
}
|
||||
pub mod my_event { use prost::Message;
|
||||
pub mod my_event {
|
||||
use prost::Message;
|
||||
include!("basic.my_event.rs");
|
||||
|
||||
impl ::crunch::traits::Serializer for MyEvent {
|
||||
@ -42,7 +45,8 @@ pub mod basic {
|
||||
where
|
||||
Self: Sized,
|
||||
{
|
||||
let output = Self::decode(raw.as_slice()).map_err(::crunch::errors::DeserializeError::ProtoErr)?;
|
||||
let output = Self::decode(raw.as_slice())
|
||||
.map_err(::crunch::errors::DeserializeError::ProtoErr)?;
|
||||
Ok(output)
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user