// @generated by the capnpc-rust plugin to the Cap'n Proto schema compiler. // DO NOT EDIT. // source: wikimedia.capnp pub mod chunk { #[derive(Copy, Clone)] pub struct Owned(()); 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; } #[derive(Clone, Copy)] pub struct Reader<'a> { reader: ::capnp::private::layout::StructReader<'a> } 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,> { fn from(reader: ::capnp::private::layout::StructReader<'a>) -> Self { Self { reader, } } } 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 { ::core::result::Result::Ok(reader.get_struct(default)?.into()) } } 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,> { fn imbue(&mut self, cap_table: &'a ::capnp::private::layout::CapTable) { self.reader.imbue(::capnp::private::layout::CapTableReader::Plain(cap_table)) } } impl <'a,> Reader<'a,> { pub fn reborrow(&self) -> Reader<'_,> { Self { .. *self } } pub fn total_size(&self) -> ::capnp::Result<::capnp::MessageSize> { self.reader.total_size() } #[inline] pub fn get_pages(self) -> ::capnp::Result<::capnp::struct_list::Reader<'a,crate::capnp::wikimedia_capnp::page::Owned>> { ::capnp::traits::FromPointerReader::get_from_pointer(&self.reader.get_pointer_field(0), ::core::option::Option::None) } #[inline] pub fn has_pages(&self) -> bool { !self.reader.get_pointer_field(0).is_null() } } 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: 1 }; } 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,> { fn from(builder: ::capnp::private::layout::StructBuilder<'a>) -> Self { Self { builder, } } } 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)) } } impl <'a,> ::capnp::traits::FromPointerBuilder<'a> for Builder<'a,> { fn init_pointer(builder: ::capnp::private::layout::PointerBuilder<'a>, _size: u32) -> Self { builder.init_struct(::STRUCT_SIZE).into() } fn get_from_pointer(builder: ::capnp::private::layout::PointerBuilder<'a>, default: ::core::option::Option<&'a [capnp::Word]>) -> ::capnp::Result { ::core::result::Result::Ok(builder.get_struct(::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,> 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) -> ::capnp::Result<::capnp::MessageSize> { self.builder.as_reader().total_size() } #[inline] pub fn get_pages(self) -> ::capnp::Result<::capnp::struct_list::Builder<'a,crate::capnp::wikimedia_capnp::page::Owned>> { ::capnp::traits::FromPointerBuilder::get_from_pointer(self.builder.get_pointer_field(0), ::core::option::Option::None) } #[inline] pub fn set_pages(&mut self, value: ::capnp::struct_list::Reader<'a,crate::capnp::wikimedia_capnp::page::Owned>) -> ::capnp::Result<()> { ::capnp::traits::SetPointerBuilder::set_pointer_builder(self.builder.reborrow().get_pointer_field(0), value, false) } #[inline] pub fn init_pages(self, size: u32) -> ::capnp::struct_list::Builder<'a,crate::capnp::wikimedia_capnp::page::Owned> { ::capnp::traits::FromPointerBuilder::init_pointer(self.builder.get_pointer_field(0), size) } #[inline] pub fn has_pages(&self) -> bool { !self.builder.is_pointer_field_null(0) } } 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, } } } impl Pipeline { } mod _private { pub const TYPE_ID: u64 = 0xeb17_70b3_ac9e_2969; } } pub mod page { #[derive(Copy, Clone)] pub struct Owned(()); 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; } #[derive(Clone, Copy)] pub struct Reader<'a> { reader: ::capnp::private::layout::StructReader<'a> } 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,> { fn from(reader: ::capnp::private::layout::StructReader<'a>) -> Self { Self { reader, } } } 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 { ::core::result::Result::Ok(reader.get_struct(default)?.into()) } } 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,> { fn imbue(&mut self, cap_table: &'a ::capnp::private::layout::CapTable) { self.reader.imbue(::capnp::private::layout::CapTableReader::Plain(cap_table)) } } impl <'a,> Reader<'a,> { pub fn reborrow(&self) -> Reader<'_,> { Self { .. *self } } pub fn total_size(&self) -> ::capnp::Result<::capnp::MessageSize> { self.reader.total_size() } #[inline] pub fn get_ns_id(self) -> u64 { self.reader.get_data_field::(0) } #[inline] pub fn get_id(self) -> u64 { self.reader.get_data_field::(1) } #[inline] pub fn get_title(self) -> ::capnp::Result<::capnp::text::Reader<'a>> { ::capnp::traits::FromPointerReader::get_from_pointer(&self.reader.get_pointer_field(0), ::core::option::Option::None) } #[inline] pub fn has_title(&self) -> bool { !self.reader.get_pointer_field(0).is_null() } #[inline] pub fn get_revision(self) -> ::capnp::Result> { ::capnp::traits::FromPointerReader::get_from_pointer(&self.reader.get_pointer_field(1), ::core::option::Option::None) } #[inline] pub fn has_revision(&self) -> bool { !self.reader.get_pointer_field(1).is_null() } } 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 }; } 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,> { fn from(builder: ::capnp::private::layout::StructBuilder<'a>) -> Self { Self { builder, } } } 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)) } } impl <'a,> ::capnp::traits::FromPointerBuilder<'a> for Builder<'a,> { fn init_pointer(builder: ::capnp::private::layout::PointerBuilder<'a>, _size: u32) -> Self { builder.init_struct(::STRUCT_SIZE).into() } fn get_from_pointer(builder: ::capnp::private::layout::PointerBuilder<'a>, default: ::core::option::Option<&'a [capnp::Word]>) -> ::capnp::Result { ::core::result::Result::Ok(builder.get_struct(::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,> 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) -> ::capnp::Result<::capnp::MessageSize> { self.builder.as_reader().total_size() } #[inline] pub fn get_ns_id(self) -> u64 { self.builder.get_data_field::(0) } #[inline] pub fn set_ns_id(&mut self, value: u64) { self.builder.set_data_field::(0, value); } #[inline] pub fn get_id(self) -> u64 { self.builder.get_data_field::(1) } #[inline] pub fn set_id(&mut self, value: u64) { self.builder.set_data_field::(1, value); } #[inline] pub fn get_title(self) -> ::capnp::Result<::capnp::text::Builder<'a>> { ::capnp::traits::FromPointerBuilder::get_from_pointer(self.builder.get_pointer_field(0), ::core::option::Option::None) } #[inline] pub fn set_title(&mut self, value: ::capnp::text::Reader<'_>) { self.builder.reborrow().get_pointer_field(0).set_text(value); } #[inline] pub fn init_title(self, size: u32) -> ::capnp::text::Builder<'a> { self.builder.get_pointer_field(0).init_text(size) } #[inline] pub fn has_title(&self) -> bool { !self.builder.is_pointer_field_null(0) } #[inline] pub fn get_revision(self) -> ::capnp::Result> { ::capnp::traits::FromPointerBuilder::get_from_pointer(self.builder.get_pointer_field(1), ::core::option::Option::None) } #[inline] pub fn set_revision(&mut self, value: crate::capnp::wikimedia_capnp::revision::Reader<'_>) -> ::capnp::Result<()> { ::capnp::traits::SetPointerBuilder::set_pointer_builder(self.builder.reborrow().get_pointer_field(1), value, false) } #[inline] pub fn init_revision(self, ) -> crate::capnp::wikimedia_capnp::revision::Builder<'a> { ::capnp::traits::FromPointerBuilder::init_pointer(self.builder.get_pointer_field(1), 0) } #[inline] pub fn has_revision(&self) -> bool { !self.builder.is_pointer_field_null(1) } } 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, } } } impl Pipeline { pub fn get_revision(&self) -> crate::capnp::wikimedia_capnp::revision::Pipeline { ::capnp::capability::FromTypelessPipeline::new(self._typeless.get_pointer_field(1)) } } mod _private { pub const TYPE_ID: u64 = 0xb7be_16a9_8c43_512e; } } pub mod revision { #[derive(Copy, Clone)] pub struct Owned(()); 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; } #[derive(Clone, Copy)] pub struct Reader<'a> { reader: ::capnp::private::layout::StructReader<'a> } 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,> { fn from(reader: ::capnp::private::layout::StructReader<'a>) -> Self { Self { reader, } } } 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 { ::core::result::Result::Ok(reader.get_struct(default)?.into()) } } 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,> { fn imbue(&mut self, cap_table: &'a ::capnp::private::layout::CapTable) { self.reader.imbue(::capnp::private::layout::CapTableReader::Plain(cap_table)) } } impl <'a,> Reader<'a,> { pub fn reborrow(&self) -> Reader<'_,> { Self { .. *self } } pub fn total_size(&self) -> ::capnp::Result<::capnp::MessageSize> { self.reader.total_size() } #[inline] pub fn get_id(self) -> u64 { self.reader.get_data_field::(0) } #[inline] pub fn get_text(self) -> ::capnp::Result<::capnp::text::Reader<'a>> { ::capnp::traits::FromPointerReader::get_from_pointer(&self.reader.get_pointer_field(0), ::core::option::Option::None) } #[inline] pub fn has_text(&self) -> bool { !self.reader.get_pointer_field(0).is_null() } } 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: 1, pointers: 1 }; } 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,> { fn from(builder: ::capnp::private::layout::StructBuilder<'a>) -> Self { Self { builder, } } } 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)) } } impl <'a,> ::capnp::traits::FromPointerBuilder<'a> for Builder<'a,> { fn init_pointer(builder: ::capnp::private::layout::PointerBuilder<'a>, _size: u32) -> Self { builder.init_struct(::STRUCT_SIZE).into() } fn get_from_pointer(builder: ::capnp::private::layout::PointerBuilder<'a>, default: ::core::option::Option<&'a [capnp::Word]>) -> ::capnp::Result { ::core::result::Result::Ok(builder.get_struct(::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,> 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) -> ::capnp::Result<::capnp::MessageSize> { self.builder.as_reader().total_size() } #[inline] pub fn get_id(self) -> u64 { self.builder.get_data_field::(0) } #[inline] pub fn set_id(&mut self, value: u64) { self.builder.set_data_field::(0, value); } #[inline] pub fn get_text(self) -> ::capnp::Result<::capnp::text::Builder<'a>> { ::capnp::traits::FromPointerBuilder::get_from_pointer(self.builder.get_pointer_field(0), ::core::option::Option::None) } #[inline] pub fn set_text(&mut self, value: ::capnp::text::Reader<'_>) { self.builder.reborrow().get_pointer_field(0).set_text(value); } #[inline] pub fn init_text(self, size: u32) -> ::capnp::text::Builder<'a> { self.builder.get_pointer_field(0).init_text(size) } #[inline] pub fn has_text(&self) -> bool { !self.builder.is_pointer_field_null(0) } } 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, } } } impl Pipeline { } mod _private { pub const TYPE_ID: u64 = 0x8498_a9bb_af58_57f4; } }