blob: 045c08102c22db6fe4903124c5c27fc0981fec82 [file] [log] [blame]
// DO NOT EDIT: This file is machine-generated by fidlgen
#![warn(clippy::all)]
#![allow(unused_parens, unused_variables, unused_mut, unused_imports, unreachable_code)]
pub mod natural {
#[derive(PartialEq, Clone, Debug, Default)]
pub struct LocalTablePayload {
pub a: ::core::option::Option<u16>,
}
impl LocalTablePayload {
fn __max_ordinal(&self) -> usize {
if self.a.is_some() {
return 1;
}
0
}
}
unsafe impl<___E> ::fidl_next::Encode<crate::wire::LocalTablePayload<'static>, ___E>
for LocalTablePayload
where
___E: ::fidl_next::Encoder + ?Sized,
{
#[inline]
fn encode(
mut self,
encoder: &mut ___E,
out: &mut ::core::mem::MaybeUninit<crate::wire::LocalTablePayload<'static>>,
_: (),
) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
::fidl_next::munge!(let crate::wire::LocalTablePayload { table } = out);
let max_ord = self.__max_ordinal();
let mut out = ::core::mem::MaybeUninit::<::fidl_next::WireEnvelope>::uninit();
::fidl_next::Wire::zero_padding(&mut out);
let mut preallocated =
::fidl_next::EncoderExt::preallocate::<::fidl_next::WireEnvelope>(encoder, max_ord);
for i in 1..=max_ord {
match i {
1 => {
if let Some(value) = self.a.take() {
::fidl_next::WireEnvelope::encode_value::<::fidl_next::WireU16, ___E>(
value,
preallocated.encoder,
&mut out,
(),
)?;
} else {
::fidl_next::WireEnvelope::encode_zero(&mut out)
}
}
_ => ::fidl_next::WireEnvelope::encode_zero(&mut out),
}
unsafe {
preallocated.write_next(out.assume_init_ref());
}
}
::fidl_next::WireTable::encode_len(table, max_ord);
Ok(())
}
}
unsafe impl<'a, ___E> ::fidl_next::Encode<crate::wire::LocalTablePayload<'static>, ___E>
for &'a LocalTablePayload
where
___E: ::fidl_next::Encoder + ?Sized,
{
#[inline]
fn encode(
self,
encoder: &mut ___E,
out: &mut ::core::mem::MaybeUninit<crate::wire::LocalTablePayload<'static>>,
_: (),
) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
::fidl_next::munge!(let crate::wire::LocalTablePayload { table } = out);
let max_ord = self.__max_ordinal();
let mut out = ::core::mem::MaybeUninit::<::fidl_next::WireEnvelope>::uninit();
::fidl_next::Wire::zero_padding(&mut out);
let mut preallocated =
::fidl_next::EncoderExt::preallocate::<::fidl_next::WireEnvelope>(encoder, max_ord);
for i in 1..=max_ord {
match i {
1 => {
if let Some(value) = &self.a {
::fidl_next::WireEnvelope::encode_value::<::fidl_next::WireU16, ___E>(
value,
preallocated.encoder,
&mut out,
(),
)?;
} else {
::fidl_next::WireEnvelope::encode_zero(&mut out)
}
}
_ => ::fidl_next::WireEnvelope::encode_zero(&mut out),
}
unsafe {
preallocated.write_next(out.assume_init_ref());
}
}
::fidl_next::WireTable::encode_len(table, max_ord);
Ok(())
}
}
impl<'de> ::fidl_next::FromWire<crate::wire::LocalTablePayload<'de>> for LocalTablePayload {
#[inline]
fn from_wire(wire_: crate::wire::LocalTablePayload<'de>) -> Self {
let wire_ = ::core::mem::ManuallyDrop::new(wire_);
let a = wire_.table.get(1);
Self {
a: a.map(|envelope| {
::fidl_next::FromWire::from_wire(unsafe {
envelope.read_unchecked::<::fidl_next::WireU16>()
})
}),
}
}
}
impl<'de> ::fidl_next::FromWireRef<crate::wire::LocalTablePayload<'de>> for LocalTablePayload {
#[inline]
fn from_wire_ref(wire: &crate::wire::LocalTablePayload<'de>) -> Self {
Self {
a: wire.table.get(1).map(|envelope| {
::fidl_next::FromWireRef::from_wire_ref(unsafe {
envelope.deref_unchecked::<::fidl_next::WireU16>()
})
}),
}
}
}
#[derive(PartialEq, Clone, Debug)]
pub enum LocalUnionPayload {
B(bool),
UnknownOrdinal_(u64),
}
impl LocalUnionPayload {
pub fn is_unknown(&self) -> bool {
#[allow(unreachable_patterns)]
match self {
Self::UnknownOrdinal_(_) => true,
_ => false,
}
}
}
unsafe impl<___E> ::fidl_next::Encode<crate::wire::LocalUnionPayload<'static>, ___E>
for LocalUnionPayload
where
___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
___E: ::fidl_next::Encoder,
{
#[inline]
fn encode(
self,
encoder: &mut ___E,
out: &mut ::core::mem::MaybeUninit<crate::wire::LocalUnionPayload<'static>>,
_: (),
) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
::fidl_next::munge!(let crate::wire::LocalUnionPayload { raw, _phantom: _ } = out);
match self {
Self::B(value) => {
::fidl_next::RawWireUnion::encode_as::<___E, bool>(value, 1, encoder, raw, ())?
}
Self::UnknownOrdinal_(ordinal) => {
return Err(::fidl_next::EncodeError::UnknownUnionOrdinal(ordinal as usize));
}
}
Ok(())
}
}
unsafe impl<'a, ___E> ::fidl_next::Encode<crate::wire::LocalUnionPayload<'static>, ___E>
for &'a LocalUnionPayload
where
___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
___E: ::fidl_next::Encoder,
{
#[inline]
fn encode(
self,
encoder: &mut ___E,
out: &mut ::core::mem::MaybeUninit<crate::wire::LocalUnionPayload<'static>>,
_: (),
) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
::fidl_next::munge!(let crate::wire::LocalUnionPayload { raw, _phantom: _ } = out);
match self {
LocalUnionPayload::B(value) => {
::fidl_next::RawWireUnion::encode_as::<___E, bool>(value, 1, encoder, raw, ())?
}
LocalUnionPayload::UnknownOrdinal_(ordinal) => {
return Err(::fidl_next::EncodeError::UnknownUnionOrdinal(*ordinal as usize));
}
}
Ok(())
}
}
unsafe impl<___E>
::fidl_next::EncodeOption<crate::wire_optional::LocalUnionPayload<'static>, ___E>
for LocalUnionPayload
where
___E: ?Sized,
LocalUnionPayload: ::fidl_next::Encode<crate::wire::LocalUnionPayload<'static>, ___E>,
{
#[inline]
fn encode_option(
this: ::core::option::Option<Self>,
encoder: &mut ___E,
out: &mut ::core::mem::MaybeUninit<crate::wire_optional::LocalUnionPayload<'static>>,
_: (),
) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
::fidl_next::munge!(let crate::wire_optional::LocalUnionPayload { raw, _phantom: _ } = &mut *out);
if let Some(inner) = this {
let value_out = unsafe { &mut *out.as_mut_ptr().cast() };
::fidl_next::Encode::encode(inner, encoder, value_out, ())?;
} else {
::fidl_next::RawWireUnion::encode_absent(raw);
}
Ok(())
}
}
unsafe impl<'a, ___E>
::fidl_next::EncodeOption<crate::wire_optional::LocalUnionPayload<'static>, ___E>
for &'a LocalUnionPayload
where
___E: ?Sized,
&'a LocalUnionPayload: ::fidl_next::Encode<crate::wire::LocalUnionPayload<'static>, ___E>,
{
#[inline]
fn encode_option(
this: ::core::option::Option<Self>,
encoder: &mut ___E,
out: &mut ::core::mem::MaybeUninit<crate::wire_optional::LocalUnionPayload<'static>>,
_: (),
) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
::fidl_next::munge!(let crate::wire_optional::LocalUnionPayload { raw, _phantom: _ } = &mut *out);
if let Some(inner) = this {
let value_out = unsafe { &mut *out.as_mut_ptr().cast() };
::fidl_next::Encode::encode(inner, encoder, value_out, ())?;
} else {
::fidl_next::RawWireUnion::encode_absent(raw);
}
Ok(())
}
}
impl<'de> ::fidl_next::FromWire<crate::wire::LocalUnionPayload<'de>> for LocalUnionPayload {
#[inline]
fn from_wire(wire: crate::wire::LocalUnionPayload<'de>) -> Self {
let wire = ::core::mem::ManuallyDrop::new(wire);
match wire.raw.ordinal() {
1 => Self::B(::fidl_next::FromWire::from_wire(unsafe {
wire.raw.get().read_unchecked::<bool>()
})),
ord => return Self::UnknownOrdinal_(ord as u64),
}
}
}
impl<'de> ::fidl_next::FromWireRef<crate::wire::LocalUnionPayload<'de>> for LocalUnionPayload {
#[inline]
fn from_wire_ref(wire: &crate::wire::LocalUnionPayload<'de>) -> Self {
match wire.raw.ordinal() {
1 => Self::B(::fidl_next::FromWireRef::from_wire_ref(unsafe {
wire.raw.get().deref_unchecked::<bool>()
})),
ord => return Self::UnknownOrdinal_(ord as u64),
}
}
}
impl<'de> ::fidl_next::FromWireOption<crate::wire_optional::LocalUnionPayload<'de>>
for LocalUnionPayload
{
#[inline]
fn from_wire_option(
wire: crate::wire_optional::LocalUnionPayload<'de>,
) -> ::core::option::Option<Self> {
if let Some(inner) = wire.into_option() {
Some(::fidl_next::FromWire::from_wire(inner))
} else {
None
}
}
}
impl<'de> ::fidl_next::FromWireOption<crate::wire_optional::LocalUnionPayload<'de>>
for Box<LocalUnionPayload>
{
#[inline]
fn from_wire_option(
wire: crate::wire_optional::LocalUnionPayload<'de>,
) -> ::core::option::Option<Self> {
<LocalUnionPayload as ::fidl_next::FromWireOption<
crate::wire_optional::LocalUnionPayload<'de>,
>>::from_wire_option(wire)
.map(Box::new)
}
}
impl<'de> ::fidl_next::FromWireOptionRef<crate::wire_optional::LocalUnionPayload<'de>>
for Box<LocalUnionPayload>
{
#[inline]
fn from_wire_option_ref(
wire: &crate::wire_optional::LocalUnionPayload<'de>,
) -> ::core::option::Option<Self> {
if let Some(inner) = wire.as_ref() {
Some(Box::new(::fidl_next::FromWireRef::from_wire_ref(inner)))
} else {
None
}
}
}
#[derive(PartialEq, Clone, Debug, Default)]
pub struct MainProtocolOneWayAnonRequest {
pub a: ::core::option::Option<u16>,
}
impl MainProtocolOneWayAnonRequest {
fn __max_ordinal(&self) -> usize {
if self.a.is_some() {
return 1;
}
0
}
}
unsafe impl<___E> ::fidl_next::Encode<crate::wire::MainProtocolOneWayAnonRequest<'static>, ___E>
for MainProtocolOneWayAnonRequest
where
___E: ::fidl_next::Encoder + ?Sized,
{
#[inline]
fn encode(
mut self,
encoder: &mut ___E,
out: &mut ::core::mem::MaybeUninit<crate::wire::MainProtocolOneWayAnonRequest<'static>>,
_: (),
) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
::fidl_next::munge!(let crate::wire::MainProtocolOneWayAnonRequest { table } = out);
let max_ord = self.__max_ordinal();
let mut out = ::core::mem::MaybeUninit::<::fidl_next::WireEnvelope>::uninit();
::fidl_next::Wire::zero_padding(&mut out);
let mut preallocated =
::fidl_next::EncoderExt::preallocate::<::fidl_next::WireEnvelope>(encoder, max_ord);
for i in 1..=max_ord {
match i {
1 => {
if let Some(value) = self.a.take() {
::fidl_next::WireEnvelope::encode_value::<::fidl_next::WireU16, ___E>(
value,
preallocated.encoder,
&mut out,
(),
)?;
} else {
::fidl_next::WireEnvelope::encode_zero(&mut out)
}
}
_ => ::fidl_next::WireEnvelope::encode_zero(&mut out),
}
unsafe {
preallocated.write_next(out.assume_init_ref());
}
}
::fidl_next::WireTable::encode_len(table, max_ord);
Ok(())
}
}
unsafe impl<'a, ___E>
::fidl_next::Encode<crate::wire::MainProtocolOneWayAnonRequest<'static>, ___E>
for &'a MainProtocolOneWayAnonRequest
where
___E: ::fidl_next::Encoder + ?Sized,
{
#[inline]
fn encode(
self,
encoder: &mut ___E,
out: &mut ::core::mem::MaybeUninit<crate::wire::MainProtocolOneWayAnonRequest<'static>>,
_: (),
) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
::fidl_next::munge!(let crate::wire::MainProtocolOneWayAnonRequest { table } = out);
let max_ord = self.__max_ordinal();
let mut out = ::core::mem::MaybeUninit::<::fidl_next::WireEnvelope>::uninit();
::fidl_next::Wire::zero_padding(&mut out);
let mut preallocated =
::fidl_next::EncoderExt::preallocate::<::fidl_next::WireEnvelope>(encoder, max_ord);
for i in 1..=max_ord {
match i {
1 => {
if let Some(value) = &self.a {
::fidl_next::WireEnvelope::encode_value::<::fidl_next::WireU16, ___E>(
value,
preallocated.encoder,
&mut out,
(),
)?;
} else {
::fidl_next::WireEnvelope::encode_zero(&mut out)
}
}
_ => ::fidl_next::WireEnvelope::encode_zero(&mut out),
}
unsafe {
preallocated.write_next(out.assume_init_ref());
}
}
::fidl_next::WireTable::encode_len(table, max_ord);
Ok(())
}
}
impl<'de> ::fidl_next::FromWire<crate::wire::MainProtocolOneWayAnonRequest<'de>>
for MainProtocolOneWayAnonRequest
{
#[inline]
fn from_wire(wire_: crate::wire::MainProtocolOneWayAnonRequest<'de>) -> Self {
let wire_ = ::core::mem::ManuallyDrop::new(wire_);
let a = wire_.table.get(1);
Self {
a: a.map(|envelope| {
::fidl_next::FromWire::from_wire(unsafe {
envelope.read_unchecked::<::fidl_next::WireU16>()
})
}),
}
}
}
impl<'de> ::fidl_next::FromWireRef<crate::wire::MainProtocolOneWayAnonRequest<'de>>
for MainProtocolOneWayAnonRequest
{
#[inline]
fn from_wire_ref(wire: &crate::wire::MainProtocolOneWayAnonRequest<'de>) -> Self {
Self {
a: wire.table.get(1).map(|envelope| {
::fidl_next::FromWireRef::from_wire_ref(unsafe {
envelope.deref_unchecked::<::fidl_next::WireU16>()
})
}),
}
}
}
#[derive(PartialEq, Clone, Debug)]
pub enum MainProtocolTwoWayAnonRequest {
B(bool),
UnknownOrdinal_(u64),
}
impl MainProtocolTwoWayAnonRequest {
pub fn is_unknown(&self) -> bool {
#[allow(unreachable_patterns)]
match self {
Self::UnknownOrdinal_(_) => true,
_ => false,
}
}
}
unsafe impl<___E> ::fidl_next::Encode<crate::wire::MainProtocolTwoWayAnonRequest<'static>, ___E>
for MainProtocolTwoWayAnonRequest
where
___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
___E: ::fidl_next::Encoder,
{
#[inline]
fn encode(
self,
encoder: &mut ___E,
out: &mut ::core::mem::MaybeUninit<crate::wire::MainProtocolTwoWayAnonRequest<'static>>,
_: (),
) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
::fidl_next::munge!(let crate::wire::MainProtocolTwoWayAnonRequest { raw, _phantom: _ } = out);
match self {
Self::B(value) => {
::fidl_next::RawWireUnion::encode_as::<___E, bool>(value, 1, encoder, raw, ())?
}
Self::UnknownOrdinal_(ordinal) => {
return Err(::fidl_next::EncodeError::UnknownUnionOrdinal(ordinal as usize));
}
}
Ok(())
}
}
unsafe impl<'a, ___E>
::fidl_next::Encode<crate::wire::MainProtocolTwoWayAnonRequest<'static>, ___E>
for &'a MainProtocolTwoWayAnonRequest
where
___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
___E: ::fidl_next::Encoder,
{
#[inline]
fn encode(
self,
encoder: &mut ___E,
out: &mut ::core::mem::MaybeUninit<crate::wire::MainProtocolTwoWayAnonRequest<'static>>,
_: (),
) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
::fidl_next::munge!(let crate::wire::MainProtocolTwoWayAnonRequest { raw, _phantom: _ } = out);
match self {
MainProtocolTwoWayAnonRequest::B(value) => {
::fidl_next::RawWireUnion::encode_as::<___E, bool>(value, 1, encoder, raw, ())?
}
MainProtocolTwoWayAnonRequest::UnknownOrdinal_(ordinal) => {
return Err(::fidl_next::EncodeError::UnknownUnionOrdinal(*ordinal as usize));
}
}
Ok(())
}
}
unsafe impl<___E>
::fidl_next::EncodeOption<
crate::wire_optional::MainProtocolTwoWayAnonRequest<'static>,
___E,
> for MainProtocolTwoWayAnonRequest
where
___E: ?Sized,
MainProtocolTwoWayAnonRequest:
::fidl_next::Encode<crate::wire::MainProtocolTwoWayAnonRequest<'static>, ___E>,
{
#[inline]
fn encode_option(
this: ::core::option::Option<Self>,
encoder: &mut ___E,
out: &mut ::core::mem::MaybeUninit<
crate::wire_optional::MainProtocolTwoWayAnonRequest<'static>,
>,
_: (),
) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
::fidl_next::munge!(let crate::wire_optional::MainProtocolTwoWayAnonRequest { raw, _phantom: _ } = &mut *out);
if let Some(inner) = this {
let value_out = unsafe { &mut *out.as_mut_ptr().cast() };
::fidl_next::Encode::encode(inner, encoder, value_out, ())?;
} else {
::fidl_next::RawWireUnion::encode_absent(raw);
}
Ok(())
}
}
unsafe impl<'a, ___E>
::fidl_next::EncodeOption<
crate::wire_optional::MainProtocolTwoWayAnonRequest<'static>,
___E,
> for &'a MainProtocolTwoWayAnonRequest
where
___E: ?Sized,
&'a MainProtocolTwoWayAnonRequest:
::fidl_next::Encode<crate::wire::MainProtocolTwoWayAnonRequest<'static>, ___E>,
{
#[inline]
fn encode_option(
this: ::core::option::Option<Self>,
encoder: &mut ___E,
out: &mut ::core::mem::MaybeUninit<
crate::wire_optional::MainProtocolTwoWayAnonRequest<'static>,
>,
_: (),
) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
::fidl_next::munge!(let crate::wire_optional::MainProtocolTwoWayAnonRequest { raw, _phantom: _ } = &mut *out);
if let Some(inner) = this {
let value_out = unsafe { &mut *out.as_mut_ptr().cast() };
::fidl_next::Encode::encode(inner, encoder, value_out, ())?;
} else {
::fidl_next::RawWireUnion::encode_absent(raw);
}
Ok(())
}
}
impl<'de> ::fidl_next::FromWire<crate::wire::MainProtocolTwoWayAnonRequest<'de>>
for MainProtocolTwoWayAnonRequest
{
#[inline]
fn from_wire(wire: crate::wire::MainProtocolTwoWayAnonRequest<'de>) -> Self {
let wire = ::core::mem::ManuallyDrop::new(wire);
match wire.raw.ordinal() {
1 => Self::B(::fidl_next::FromWire::from_wire(unsafe {
wire.raw.get().read_unchecked::<bool>()
})),
ord => return Self::UnknownOrdinal_(ord as u64),
}
}
}
impl<'de> ::fidl_next::FromWireRef<crate::wire::MainProtocolTwoWayAnonRequest<'de>>
for MainProtocolTwoWayAnonRequest
{
#[inline]
fn from_wire_ref(wire: &crate::wire::MainProtocolTwoWayAnonRequest<'de>) -> Self {
match wire.raw.ordinal() {
1 => Self::B(::fidl_next::FromWireRef::from_wire_ref(unsafe {
wire.raw.get().deref_unchecked::<bool>()
})),
ord => return Self::UnknownOrdinal_(ord as u64),
}
}
}
impl<'de> ::fidl_next::FromWireOption<crate::wire_optional::MainProtocolTwoWayAnonRequest<'de>>
for MainProtocolTwoWayAnonRequest
{
#[inline]
fn from_wire_option(
wire: crate::wire_optional::MainProtocolTwoWayAnonRequest<'de>,
) -> ::core::option::Option<Self> {
if let Some(inner) = wire.into_option() {
Some(::fidl_next::FromWire::from_wire(inner))
} else {
None
}
}
}
impl<'de> ::fidl_next::FromWireOption<crate::wire_optional::MainProtocolTwoWayAnonRequest<'de>>
for Box<MainProtocolTwoWayAnonRequest>
{
#[inline]
fn from_wire_option(
wire: crate::wire_optional::MainProtocolTwoWayAnonRequest<'de>,
) -> ::core::option::Option<Self> {
<MainProtocolTwoWayAnonRequest as ::fidl_next::FromWireOption<
crate::wire_optional::MainProtocolTwoWayAnonRequest<'de>,
>>::from_wire_option(wire)
.map(Box::new)
}
}
impl<'de>
::fidl_next::FromWireOptionRef<crate::wire_optional::MainProtocolTwoWayAnonRequest<'de>>
for Box<MainProtocolTwoWayAnonRequest>
{
#[inline]
fn from_wire_option_ref(
wire: &crate::wire_optional::MainProtocolTwoWayAnonRequest<'de>,
) -> ::core::option::Option<Self> {
if let Some(inner) = wire.as_ref() {
Some(Box::new(::fidl_next::FromWireRef::from_wire_ref(inner)))
} else {
None
}
}
}
#[derive(PartialEq, Clone, Debug, Default)]
pub struct MainProtocolTwoWayAnonResponse {
pub a: ::core::option::Option<u16>,
}
impl MainProtocolTwoWayAnonResponse {
fn __max_ordinal(&self) -> usize {
if self.a.is_some() {
return 1;
}
0
}
}
unsafe impl<___E>
::fidl_next::Encode<crate::wire::MainProtocolTwoWayAnonResponse<'static>, ___E>
for MainProtocolTwoWayAnonResponse
where
___E: ::fidl_next::Encoder + ?Sized,
{
#[inline]
fn encode(
mut self,
encoder: &mut ___E,
out: &mut ::core::mem::MaybeUninit<
crate::wire::MainProtocolTwoWayAnonResponse<'static>,
>,
_: (),
) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
::fidl_next::munge!(let crate::wire::MainProtocolTwoWayAnonResponse { table } = out);
let max_ord = self.__max_ordinal();
let mut out = ::core::mem::MaybeUninit::<::fidl_next::WireEnvelope>::uninit();
::fidl_next::Wire::zero_padding(&mut out);
let mut preallocated =
::fidl_next::EncoderExt::preallocate::<::fidl_next::WireEnvelope>(encoder, max_ord);
for i in 1..=max_ord {
match i {
1 => {
if let Some(value) = self.a.take() {
::fidl_next::WireEnvelope::encode_value::<::fidl_next::WireU16, ___E>(
value,
preallocated.encoder,
&mut out,
(),
)?;
} else {
::fidl_next::WireEnvelope::encode_zero(&mut out)
}
}
_ => ::fidl_next::WireEnvelope::encode_zero(&mut out),
}
unsafe {
preallocated.write_next(out.assume_init_ref());
}
}
::fidl_next::WireTable::encode_len(table, max_ord);
Ok(())
}
}
unsafe impl<'a, ___E>
::fidl_next::Encode<crate::wire::MainProtocolTwoWayAnonResponse<'static>, ___E>
for &'a MainProtocolTwoWayAnonResponse
where
___E: ::fidl_next::Encoder + ?Sized,
{
#[inline]
fn encode(
self,
encoder: &mut ___E,
out: &mut ::core::mem::MaybeUninit<
crate::wire::MainProtocolTwoWayAnonResponse<'static>,
>,
_: (),
) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
::fidl_next::munge!(let crate::wire::MainProtocolTwoWayAnonResponse { table } = out);
let max_ord = self.__max_ordinal();
let mut out = ::core::mem::MaybeUninit::<::fidl_next::WireEnvelope>::uninit();
::fidl_next::Wire::zero_padding(&mut out);
let mut preallocated =
::fidl_next::EncoderExt::preallocate::<::fidl_next::WireEnvelope>(encoder, max_ord);
for i in 1..=max_ord {
match i {
1 => {
if let Some(value) = &self.a {
::fidl_next::WireEnvelope::encode_value::<::fidl_next::WireU16, ___E>(
value,
preallocated.encoder,
&mut out,
(),
)?;
} else {
::fidl_next::WireEnvelope::encode_zero(&mut out)
}
}
_ => ::fidl_next::WireEnvelope::encode_zero(&mut out),
}
unsafe {
preallocated.write_next(out.assume_init_ref());
}
}
::fidl_next::WireTable::encode_len(table, max_ord);
Ok(())
}
}
impl<'de> ::fidl_next::FromWire<crate::wire::MainProtocolTwoWayAnonResponse<'de>>
for MainProtocolTwoWayAnonResponse
{
#[inline]
fn from_wire(wire_: crate::wire::MainProtocolTwoWayAnonResponse<'de>) -> Self {
let wire_ = ::core::mem::ManuallyDrop::new(wire_);
let a = wire_.table.get(1);
Self {
a: a.map(|envelope| {
::fidl_next::FromWire::from_wire(unsafe {
envelope.read_unchecked::<::fidl_next::WireU16>()
})
}),
}
}
}
impl<'de> ::fidl_next::FromWireRef<crate::wire::MainProtocolTwoWayAnonResponse<'de>>
for MainProtocolTwoWayAnonResponse
{
#[inline]
fn from_wire_ref(wire: &crate::wire::MainProtocolTwoWayAnonResponse<'de>) -> Self {
Self {
a: wire.table.get(1).map(|envelope| {
::fidl_next::FromWireRef::from_wire_ref(unsafe {
envelope.deref_unchecked::<::fidl_next::WireU16>()
})
}),
}
}
}
#[derive(PartialEq, Clone, Debug, Default)]
pub struct MainProtocolTwoWayAnonWithErrorRequest {
pub a: ::core::option::Option<u16>,
}
impl MainProtocolTwoWayAnonWithErrorRequest {
fn __max_ordinal(&self) -> usize {
if self.a.is_some() {
return 1;
}
0
}
}
unsafe impl<___E>
::fidl_next::Encode<crate::wire::MainProtocolTwoWayAnonWithErrorRequest<'static>, ___E>
for MainProtocolTwoWayAnonWithErrorRequest
where
___E: ::fidl_next::Encoder + ?Sized,
{
#[inline]
fn encode(
mut self,
encoder: &mut ___E,
out: &mut ::core::mem::MaybeUninit<
crate::wire::MainProtocolTwoWayAnonWithErrorRequest<'static>,
>,
_: (),
) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
::fidl_next::munge!(let crate::wire::MainProtocolTwoWayAnonWithErrorRequest { table } = out);
let max_ord = self.__max_ordinal();
let mut out = ::core::mem::MaybeUninit::<::fidl_next::WireEnvelope>::uninit();
::fidl_next::Wire::zero_padding(&mut out);
let mut preallocated =
::fidl_next::EncoderExt::preallocate::<::fidl_next::WireEnvelope>(encoder, max_ord);
for i in 1..=max_ord {
match i {
1 => {
if let Some(value) = self.a.take() {
::fidl_next::WireEnvelope::encode_value::<::fidl_next::WireU16, ___E>(
value,
preallocated.encoder,
&mut out,
(),
)?;
} else {
::fidl_next::WireEnvelope::encode_zero(&mut out)
}
}
_ => ::fidl_next::WireEnvelope::encode_zero(&mut out),
}
unsafe {
preallocated.write_next(out.assume_init_ref());
}
}
::fidl_next::WireTable::encode_len(table, max_ord);
Ok(())
}
}
unsafe impl<'a, ___E>
::fidl_next::Encode<crate::wire::MainProtocolTwoWayAnonWithErrorRequest<'static>, ___E>
for &'a MainProtocolTwoWayAnonWithErrorRequest
where
___E: ::fidl_next::Encoder + ?Sized,
{
#[inline]
fn encode(
self,
encoder: &mut ___E,
out: &mut ::core::mem::MaybeUninit<
crate::wire::MainProtocolTwoWayAnonWithErrorRequest<'static>,
>,
_: (),
) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
::fidl_next::munge!(let crate::wire::MainProtocolTwoWayAnonWithErrorRequest { table } = out);
let max_ord = self.__max_ordinal();
let mut out = ::core::mem::MaybeUninit::<::fidl_next::WireEnvelope>::uninit();
::fidl_next::Wire::zero_padding(&mut out);
let mut preallocated =
::fidl_next::EncoderExt::preallocate::<::fidl_next::WireEnvelope>(encoder, max_ord);
for i in 1..=max_ord {
match i {
1 => {
if let Some(value) = &self.a {
::fidl_next::WireEnvelope::encode_value::<::fidl_next::WireU16, ___E>(
value,
preallocated.encoder,
&mut out,
(),
)?;
} else {
::fidl_next::WireEnvelope::encode_zero(&mut out)
}
}
_ => ::fidl_next::WireEnvelope::encode_zero(&mut out),
}
unsafe {
preallocated.write_next(out.assume_init_ref());
}
}
::fidl_next::WireTable::encode_len(table, max_ord);
Ok(())
}
}
impl<'de> ::fidl_next::FromWire<crate::wire::MainProtocolTwoWayAnonWithErrorRequest<'de>>
for MainProtocolTwoWayAnonWithErrorRequest
{
#[inline]
fn from_wire(wire_: crate::wire::MainProtocolTwoWayAnonWithErrorRequest<'de>) -> Self {
let wire_ = ::core::mem::ManuallyDrop::new(wire_);
let a = wire_.table.get(1);
Self {
a: a.map(|envelope| {
::fidl_next::FromWire::from_wire(unsafe {
envelope.read_unchecked::<::fidl_next::WireU16>()
})
}),
}
}
}
impl<'de> ::fidl_next::FromWireRef<crate::wire::MainProtocolTwoWayAnonWithErrorRequest<'de>>
for MainProtocolTwoWayAnonWithErrorRequest
{
#[inline]
fn from_wire_ref(wire: &crate::wire::MainProtocolTwoWayAnonWithErrorRequest<'de>) -> Self {
Self {
a: wire.table.get(1).map(|envelope| {
::fidl_next::FromWireRef::from_wire_ref(unsafe {
envelope.deref_unchecked::<::fidl_next::WireU16>()
})
}),
}
}
}
#[derive(PartialEq, Clone, Debug)]
pub enum MainProtocolTwoWayAnonWithErrorResponse {
B(bool),
UnknownOrdinal_(u64),
}
impl MainProtocolTwoWayAnonWithErrorResponse {
pub fn is_unknown(&self) -> bool {
#[allow(unreachable_patterns)]
match self {
Self::UnknownOrdinal_(_) => true,
_ => false,
}
}
}
unsafe impl<___E>
::fidl_next::Encode<crate::wire::MainProtocolTwoWayAnonWithErrorResponse<'static>, ___E>
for MainProtocolTwoWayAnonWithErrorResponse
where
___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
___E: ::fidl_next::Encoder,
{
#[inline]
fn encode(
self,
encoder: &mut ___E,
out: &mut ::core::mem::MaybeUninit<
crate::wire::MainProtocolTwoWayAnonWithErrorResponse<'static>,
>,
_: (),
) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
::fidl_next::munge!(let crate::wire::MainProtocolTwoWayAnonWithErrorResponse { raw, _phantom: _ } = out);
match self {
Self::B(value) => {
::fidl_next::RawWireUnion::encode_as::<___E, bool>(value, 1, encoder, raw, ())?
}
Self::UnknownOrdinal_(ordinal) => {
return Err(::fidl_next::EncodeError::UnknownUnionOrdinal(ordinal as usize));
}
}
Ok(())
}
}
unsafe impl<'a, ___E>
::fidl_next::Encode<crate::wire::MainProtocolTwoWayAnonWithErrorResponse<'static>, ___E>
for &'a MainProtocolTwoWayAnonWithErrorResponse
where
___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
___E: ::fidl_next::Encoder,
{
#[inline]
fn encode(
self,
encoder: &mut ___E,
out: &mut ::core::mem::MaybeUninit<
crate::wire::MainProtocolTwoWayAnonWithErrorResponse<'static>,
>,
_: (),
) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
::fidl_next::munge!(let crate::wire::MainProtocolTwoWayAnonWithErrorResponse { raw, _phantom: _ } = out);
match self {
MainProtocolTwoWayAnonWithErrorResponse::B(value) => {
::fidl_next::RawWireUnion::encode_as::<___E, bool>(value, 1, encoder, raw, ())?
}
MainProtocolTwoWayAnonWithErrorResponse::UnknownOrdinal_(ordinal) => {
return Err(::fidl_next::EncodeError::UnknownUnionOrdinal(*ordinal as usize));
}
}
Ok(())
}
}
unsafe impl<___E>
::fidl_next::EncodeOption<
crate::wire_optional::MainProtocolTwoWayAnonWithErrorResponse<'static>,
___E,
> for MainProtocolTwoWayAnonWithErrorResponse
where
___E: ?Sized,
MainProtocolTwoWayAnonWithErrorResponse: ::fidl_next::Encode<crate::wire::MainProtocolTwoWayAnonWithErrorResponse<'static>, ___E>,
{
#[inline]
fn encode_option(
this: ::core::option::Option<Self>,
encoder: &mut ___E,
out: &mut ::core::mem::MaybeUninit<
crate::wire_optional::MainProtocolTwoWayAnonWithErrorResponse<'static>,
>,
_: (),
) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
::fidl_next::munge!(let crate::wire_optional::MainProtocolTwoWayAnonWithErrorResponse { raw, _phantom: _ } = &mut *out);
if let Some(inner) = this {
let value_out = unsafe { &mut *out.as_mut_ptr().cast() };
::fidl_next::Encode::encode(inner, encoder, value_out, ())?;
} else {
::fidl_next::RawWireUnion::encode_absent(raw);
}
Ok(())
}
}
unsafe impl<'a, ___E>
::fidl_next::EncodeOption<
crate::wire_optional::MainProtocolTwoWayAnonWithErrorResponse<'static>,
___E,
> for &'a MainProtocolTwoWayAnonWithErrorResponse
where
___E: ?Sized,
&'a MainProtocolTwoWayAnonWithErrorResponse: ::fidl_next::Encode<crate::wire::MainProtocolTwoWayAnonWithErrorResponse<'static>, ___E>,
{
#[inline]
fn encode_option(
this: ::core::option::Option<Self>,
encoder: &mut ___E,
out: &mut ::core::mem::MaybeUninit<
crate::wire_optional::MainProtocolTwoWayAnonWithErrorResponse<'static>,
>,
_: (),
) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
::fidl_next::munge!(let crate::wire_optional::MainProtocolTwoWayAnonWithErrorResponse { raw, _phantom: _ } = &mut *out);
if let Some(inner) = this {
let value_out = unsafe { &mut *out.as_mut_ptr().cast() };
::fidl_next::Encode::encode(inner, encoder, value_out, ())?;
} else {
::fidl_next::RawWireUnion::encode_absent(raw);
}
Ok(())
}
}
impl<'de> ::fidl_next::FromWire<crate::wire::MainProtocolTwoWayAnonWithErrorResponse<'de>>
for MainProtocolTwoWayAnonWithErrorResponse
{
#[inline]
fn from_wire(wire: crate::wire::MainProtocolTwoWayAnonWithErrorResponse<'de>) -> Self {
let wire = ::core::mem::ManuallyDrop::new(wire);
match wire.raw.ordinal() {
1 => Self::B(::fidl_next::FromWire::from_wire(unsafe {
wire.raw.get().read_unchecked::<bool>()
})),
ord => return Self::UnknownOrdinal_(ord as u64),
}
}
}
impl<'de> ::fidl_next::FromWireRef<crate::wire::MainProtocolTwoWayAnonWithErrorResponse<'de>>
for MainProtocolTwoWayAnonWithErrorResponse
{
#[inline]
fn from_wire_ref(wire: &crate::wire::MainProtocolTwoWayAnonWithErrorResponse<'de>) -> Self {
match wire.raw.ordinal() {
1 => Self::B(::fidl_next::FromWireRef::from_wire_ref(unsafe {
wire.raw.get().deref_unchecked::<bool>()
})),
ord => return Self::UnknownOrdinal_(ord as u64),
}
}
}
impl<'de>
::fidl_next::FromWireOption<
crate::wire_optional::MainProtocolTwoWayAnonWithErrorResponse<'de>,
> for MainProtocolTwoWayAnonWithErrorResponse
{
#[inline]
fn from_wire_option(
wire: crate::wire_optional::MainProtocolTwoWayAnonWithErrorResponse<'de>,
) -> ::core::option::Option<Self> {
if let Some(inner) = wire.into_option() {
Some(::fidl_next::FromWire::from_wire(inner))
} else {
None
}
}
}
impl<'de>
::fidl_next::FromWireOption<
crate::wire_optional::MainProtocolTwoWayAnonWithErrorResponse<'de>,
> for Box<MainProtocolTwoWayAnonWithErrorResponse>
{
#[inline]
fn from_wire_option(
wire: crate::wire_optional::MainProtocolTwoWayAnonWithErrorResponse<'de>,
) -> ::core::option::Option<Self> {
<MainProtocolTwoWayAnonWithErrorResponse as ::fidl_next::FromWireOption<
crate::wire_optional::MainProtocolTwoWayAnonWithErrorResponse<'de>,
>>::from_wire_option(wire)
.map(Box::new)
}
}
impl<'de>
::fidl_next::FromWireOptionRef<
crate::wire_optional::MainProtocolTwoWayAnonWithErrorResponse<'de>,
> for Box<MainProtocolTwoWayAnonWithErrorResponse>
{
#[inline]
fn from_wire_option_ref(
wire: &crate::wire_optional::MainProtocolTwoWayAnonWithErrorResponse<'de>,
) -> ::core::option::Option<Self> {
if let Some(inner) = wire.as_ref() {
Some(Box::new(::fidl_next::FromWireRef::from_wire_ref(inner)))
} else {
None
}
}
}
#[derive(PartialEq, Clone, Debug)]
pub enum MainProtocolOnAnonRequest {
B(bool),
UnknownOrdinal_(u64),
}
impl MainProtocolOnAnonRequest {
pub fn is_unknown(&self) -> bool {
#[allow(unreachable_patterns)]
match self {
Self::UnknownOrdinal_(_) => true,
_ => false,
}
}
}
unsafe impl<___E> ::fidl_next::Encode<crate::wire::MainProtocolOnAnonRequest<'static>, ___E>
for MainProtocolOnAnonRequest
where
___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
___E: ::fidl_next::Encoder,
{
#[inline]
fn encode(
self,
encoder: &mut ___E,
out: &mut ::core::mem::MaybeUninit<crate::wire::MainProtocolOnAnonRequest<'static>>,
_: (),
) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
::fidl_next::munge!(let crate::wire::MainProtocolOnAnonRequest { raw, _phantom: _ } = out);
match self {
Self::B(value) => {
::fidl_next::RawWireUnion::encode_as::<___E, bool>(value, 1, encoder, raw, ())?
}
Self::UnknownOrdinal_(ordinal) => {
return Err(::fidl_next::EncodeError::UnknownUnionOrdinal(ordinal as usize));
}
}
Ok(())
}
}
unsafe impl<'a, ___E> ::fidl_next::Encode<crate::wire::MainProtocolOnAnonRequest<'static>, ___E>
for &'a MainProtocolOnAnonRequest
where
___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
___E: ::fidl_next::Encoder,
{
#[inline]
fn encode(
self,
encoder: &mut ___E,
out: &mut ::core::mem::MaybeUninit<crate::wire::MainProtocolOnAnonRequest<'static>>,
_: (),
) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
::fidl_next::munge!(let crate::wire::MainProtocolOnAnonRequest { raw, _phantom: _ } = out);
match self {
MainProtocolOnAnonRequest::B(value) => {
::fidl_next::RawWireUnion::encode_as::<___E, bool>(value, 1, encoder, raw, ())?
}
MainProtocolOnAnonRequest::UnknownOrdinal_(ordinal) => {
return Err(::fidl_next::EncodeError::UnknownUnionOrdinal(*ordinal as usize));
}
}
Ok(())
}
}
unsafe impl<___E>
::fidl_next::EncodeOption<crate::wire_optional::MainProtocolOnAnonRequest<'static>, ___E>
for MainProtocolOnAnonRequest
where
___E: ?Sized,
MainProtocolOnAnonRequest:
::fidl_next::Encode<crate::wire::MainProtocolOnAnonRequest<'static>, ___E>,
{
#[inline]
fn encode_option(
this: ::core::option::Option<Self>,
encoder: &mut ___E,
out: &mut ::core::mem::MaybeUninit<
crate::wire_optional::MainProtocolOnAnonRequest<'static>,
>,
_: (),
) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
::fidl_next::munge!(let crate::wire_optional::MainProtocolOnAnonRequest { raw, _phantom: _ } = &mut *out);
if let Some(inner) = this {
let value_out = unsafe { &mut *out.as_mut_ptr().cast() };
::fidl_next::Encode::encode(inner, encoder, value_out, ())?;
} else {
::fidl_next::RawWireUnion::encode_absent(raw);
}
Ok(())
}
}
unsafe impl<'a, ___E>
::fidl_next::EncodeOption<crate::wire_optional::MainProtocolOnAnonRequest<'static>, ___E>
for &'a MainProtocolOnAnonRequest
where
___E: ?Sized,
&'a MainProtocolOnAnonRequest:
::fidl_next::Encode<crate::wire::MainProtocolOnAnonRequest<'static>, ___E>,
{
#[inline]
fn encode_option(
this: ::core::option::Option<Self>,
encoder: &mut ___E,
out: &mut ::core::mem::MaybeUninit<
crate::wire_optional::MainProtocolOnAnonRequest<'static>,
>,
_: (),
) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
::fidl_next::munge!(let crate::wire_optional::MainProtocolOnAnonRequest { raw, _phantom: _ } = &mut *out);
if let Some(inner) = this {
let value_out = unsafe { &mut *out.as_mut_ptr().cast() };
::fidl_next::Encode::encode(inner, encoder, value_out, ())?;
} else {
::fidl_next::RawWireUnion::encode_absent(raw);
}
Ok(())
}
}
impl<'de> ::fidl_next::FromWire<crate::wire::MainProtocolOnAnonRequest<'de>>
for MainProtocolOnAnonRequest
{
#[inline]
fn from_wire(wire: crate::wire::MainProtocolOnAnonRequest<'de>) -> Self {
let wire = ::core::mem::ManuallyDrop::new(wire);
match wire.raw.ordinal() {
1 => Self::B(::fidl_next::FromWire::from_wire(unsafe {
wire.raw.get().read_unchecked::<bool>()
})),
ord => return Self::UnknownOrdinal_(ord as u64),
}
}
}
impl<'de> ::fidl_next::FromWireRef<crate::wire::MainProtocolOnAnonRequest<'de>>
for MainProtocolOnAnonRequest
{
#[inline]
fn from_wire_ref(wire: &crate::wire::MainProtocolOnAnonRequest<'de>) -> Self {
match wire.raw.ordinal() {
1 => Self::B(::fidl_next::FromWireRef::from_wire_ref(unsafe {
wire.raw.get().deref_unchecked::<bool>()
})),
ord => return Self::UnknownOrdinal_(ord as u64),
}
}
}
impl<'de> ::fidl_next::FromWireOption<crate::wire_optional::MainProtocolOnAnonRequest<'de>>
for MainProtocolOnAnonRequest
{
#[inline]
fn from_wire_option(
wire: crate::wire_optional::MainProtocolOnAnonRequest<'de>,
) -> ::core::option::Option<Self> {
if let Some(inner) = wire.into_option() {
Some(::fidl_next::FromWire::from_wire(inner))
} else {
None
}
}
}
impl<'de> ::fidl_next::FromWireOption<crate::wire_optional::MainProtocolOnAnonRequest<'de>>
for Box<MainProtocolOnAnonRequest>
{
#[inline]
fn from_wire_option(
wire: crate::wire_optional::MainProtocolOnAnonRequest<'de>,
) -> ::core::option::Option<Self> {
<MainProtocolOnAnonRequest as ::fidl_next::FromWireOption<
crate::wire_optional::MainProtocolOnAnonRequest<'de>,
>>::from_wire_option(wire)
.map(Box::new)
}
}
impl<'de> ::fidl_next::FromWireOptionRef<crate::wire_optional::MainProtocolOnAnonRequest<'de>>
for Box<MainProtocolOnAnonRequest>
{
#[inline]
fn from_wire_option_ref(
wire: &crate::wire_optional::MainProtocolOnAnonRequest<'de>,
) -> ::core::option::Option<Self> {
if let Some(inner) = wire.as_ref() {
Some(Box::new(::fidl_next::FromWireRef::from_wire_ref(inner)))
} else {
None
}
}
}
}
pub mod wire {
/// The wire type corresponding to [`LocalTablePayload`].
#[repr(C)]
pub struct LocalTablePayload<'de> {
pub(crate) table: ::fidl_next::WireTable<'de>,
}
impl<'de> Drop for LocalTablePayload<'de> {
fn drop(&mut self) {
let _ = self
.table
.get(1)
.map(|envelope| unsafe { envelope.read_unchecked::<::fidl_next::WireU16>() });
}
}
unsafe impl ::fidl_next::Wire for LocalTablePayload<'static> {
type Decoded<'de> = LocalTablePayload<'de>;
#[inline]
fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
::fidl_next::munge!(let Self { table } = out);
::fidl_next::WireTable::zero_padding(table);
}
}
unsafe impl<___D> ::fidl_next::Decode<___D> for LocalTablePayload<'static>
where
___D: ::fidl_next::Decoder + ?Sized,
{
fn decode(
slot: ::fidl_next::Slot<'_, Self>,
decoder: &mut ___D,
_: (),
) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
::fidl_next::munge!(let Self { table } = slot);
::fidl_next::WireTable::decode_with(table, decoder, |ordinal, mut slot, decoder| {
match ordinal {
0 => unsafe { ::core::hint::unreachable_unchecked() },
1 => {
::fidl_next::WireEnvelope::decode_as::<___D, ::fidl_next::WireU16>(
slot.as_mut(),
decoder,
(),
)?;
Ok(())
}
_ => ::fidl_next::WireEnvelope::decode_unknown(slot, decoder),
}
})
}
}
impl<'de> LocalTablePayload<'de> {
pub fn a(&self) -> ::core::option::Option<&::fidl_next::WireU16> {
unsafe { Some(self.table.get(1)?.deref_unchecked()) }
}
}
impl<'de> ::core::fmt::Debug for LocalTablePayload<'de> {
fn fmt(
&self,
f: &mut ::core::fmt::Formatter<'_>,
) -> ::core::result::Result<(), ::core::fmt::Error> {
f.debug_struct("LocalTablePayload").field("a", &self.a()).finish()
}
}
impl<'de> ::fidl_next::IntoNatural for LocalTablePayload<'de> {
type Natural = crate::natural::LocalTablePayload;
}
impl ::fidl_next::Unconstrained for LocalTablePayload<'_> {}
/// The wire type corresponding to [`LocalUnionPayload`].
#[repr(transparent)]
pub struct LocalUnionPayload<'de> {
pub(crate) raw: ::fidl_next::RawWireUnion,
pub(crate) _phantom: ::core::marker::PhantomData<&'de mut [::fidl_next::Chunk]>,
}
impl<'de> Drop for LocalUnionPayload<'de> {
fn drop(&mut self) {
match self.raw.ordinal() {
1 => {
let _ = unsafe { self.raw.get().read_unchecked::<bool>() };
}
_ => (),
}
}
}
unsafe impl ::fidl_next::Wire for LocalUnionPayload<'static> {
type Decoded<'de> = LocalUnionPayload<'de>;
#[inline]
fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
::fidl_next::munge!(let Self { raw, _phantom: _ } = out);
::fidl_next::RawWireUnion::zero_padding(raw);
}
}
pub mod local_union_payload {
pub enum Ref<'de> {
B(&'de bool),
UnknownOrdinal_(u64),
}
}
impl<'de> LocalUnionPayload<'de> {
pub fn as_ref(&self) -> crate::wire::local_union_payload::Ref<'_> {
match self.raw.ordinal() {
1 => crate::wire::local_union_payload::Ref::B(unsafe {
self.raw.get().deref_unchecked::<bool>()
}),
unknown => crate::wire::local_union_payload::Ref::UnknownOrdinal_(unknown),
}
}
}
unsafe impl<___D> ::fidl_next::Decode<___D> for LocalUnionPayload<'static>
where
___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
___D: ::fidl_next::Decoder,
{
fn decode(
mut slot: ::fidl_next::Slot<'_, Self>,
decoder: &mut ___D,
_: (),
) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
::fidl_next::munge!(let Self { mut raw, _phantom: _ } = slot.as_mut());
match ::fidl_next::RawWireUnion::encoded_ordinal(raw.as_mut()) {
1 => ::fidl_next::RawWireUnion::decode_as::<___D, bool>(raw, decoder, ())?,
_ => ::fidl_next::RawWireUnion::decode_unknown(raw, decoder)?,
}
Ok(())
}
}
impl<'de> ::core::fmt::Debug for LocalUnionPayload<'de> {
fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
match self.raw.ordinal() {
1 => unsafe { self.raw.get().deref_unchecked::<bool>().fmt(f) },
_ => unsafe { ::core::hint::unreachable_unchecked() },
}
}
}
impl<'de> ::fidl_next::IntoNatural for LocalUnionPayload<'de> {
type Natural = crate::natural::LocalUnionPayload;
}
impl ::fidl_next::Unconstrained for LocalUnionPayload<'static> {}
/// The wire type corresponding to [`MainProtocolOneWayAnonRequest`].
#[repr(C)]
pub struct MainProtocolOneWayAnonRequest<'de> {
pub(crate) table: ::fidl_next::WireTable<'de>,
}
impl<'de> Drop for MainProtocolOneWayAnonRequest<'de> {
fn drop(&mut self) {
let _ = self
.table
.get(1)
.map(|envelope| unsafe { envelope.read_unchecked::<::fidl_next::WireU16>() });
}
}
unsafe impl ::fidl_next::Wire for MainProtocolOneWayAnonRequest<'static> {
type Decoded<'de> = MainProtocolOneWayAnonRequest<'de>;
#[inline]
fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
::fidl_next::munge!(let Self { table } = out);
::fidl_next::WireTable::zero_padding(table);
}
}
unsafe impl<___D> ::fidl_next::Decode<___D> for MainProtocolOneWayAnonRequest<'static>
where
___D: ::fidl_next::Decoder + ?Sized,
{
fn decode(
slot: ::fidl_next::Slot<'_, Self>,
decoder: &mut ___D,
_: (),
) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
::fidl_next::munge!(let Self { table } = slot);
::fidl_next::WireTable::decode_with(table, decoder, |ordinal, mut slot, decoder| {
match ordinal {
0 => unsafe { ::core::hint::unreachable_unchecked() },
1 => {
::fidl_next::WireEnvelope::decode_as::<___D, ::fidl_next::WireU16>(
slot.as_mut(),
decoder,
(),
)?;
Ok(())
}
_ => ::fidl_next::WireEnvelope::decode_unknown(slot, decoder),
}
})
}
}
impl<'de> MainProtocolOneWayAnonRequest<'de> {
pub fn a(&self) -> ::core::option::Option<&::fidl_next::WireU16> {
unsafe { Some(self.table.get(1)?.deref_unchecked()) }
}
}
impl<'de> ::core::fmt::Debug for MainProtocolOneWayAnonRequest<'de> {
fn fmt(
&self,
f: &mut ::core::fmt::Formatter<'_>,
) -> ::core::result::Result<(), ::core::fmt::Error> {
f.debug_struct("MainProtocolOneWayAnonRequest").field("a", &self.a()).finish()
}
}
impl<'de> ::fidl_next::IntoNatural for MainProtocolOneWayAnonRequest<'de> {
type Natural = crate::natural::MainProtocolOneWayAnonRequest;
}
impl ::fidl_next::Unconstrained for MainProtocolOneWayAnonRequest<'_> {}
/// The wire type corresponding to [`MainProtocolTwoWayAnonRequest`].
#[repr(transparent)]
pub struct MainProtocolTwoWayAnonRequest<'de> {
pub(crate) raw: ::fidl_next::RawWireUnion,
pub(crate) _phantom: ::core::marker::PhantomData<&'de mut [::fidl_next::Chunk]>,
}
impl<'de> Drop for MainProtocolTwoWayAnonRequest<'de> {
fn drop(&mut self) {
match self.raw.ordinal() {
1 => {
let _ = unsafe { self.raw.get().read_unchecked::<bool>() };
}
_ => (),
}
}
}
unsafe impl ::fidl_next::Wire for MainProtocolTwoWayAnonRequest<'static> {
type Decoded<'de> = MainProtocolTwoWayAnonRequest<'de>;
#[inline]
fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
::fidl_next::munge!(let Self { raw, _phantom: _ } = out);
::fidl_next::RawWireUnion::zero_padding(raw);
}
}
pub mod main_protocol_two_way_anon_request {
pub enum Ref<'de> {
B(&'de bool),
UnknownOrdinal_(u64),
}
}
impl<'de> MainProtocolTwoWayAnonRequest<'de> {
pub fn as_ref(&self) -> crate::wire::main_protocol_two_way_anon_request::Ref<'_> {
match self.raw.ordinal() {
1 => crate::wire::main_protocol_two_way_anon_request::Ref::B(unsafe {
self.raw.get().deref_unchecked::<bool>()
}),
unknown => {
crate::wire::main_protocol_two_way_anon_request::Ref::UnknownOrdinal_(unknown)
}
}
}
}
unsafe impl<___D> ::fidl_next::Decode<___D> for MainProtocolTwoWayAnonRequest<'static>
where
___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
___D: ::fidl_next::Decoder,
{
fn decode(
mut slot: ::fidl_next::Slot<'_, Self>,
decoder: &mut ___D,
_: (),
) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
::fidl_next::munge!(let Self { mut raw, _phantom: _ } = slot.as_mut());
match ::fidl_next::RawWireUnion::encoded_ordinal(raw.as_mut()) {
1 => ::fidl_next::RawWireUnion::decode_as::<___D, bool>(raw, decoder, ())?,
_ => ::fidl_next::RawWireUnion::decode_unknown(raw, decoder)?,
}
Ok(())
}
}
impl<'de> ::core::fmt::Debug for MainProtocolTwoWayAnonRequest<'de> {
fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
match self.raw.ordinal() {
1 => unsafe { self.raw.get().deref_unchecked::<bool>().fmt(f) },
_ => unsafe { ::core::hint::unreachable_unchecked() },
}
}
}
impl<'de> ::fidl_next::IntoNatural for MainProtocolTwoWayAnonRequest<'de> {
type Natural = crate::natural::MainProtocolTwoWayAnonRequest;
}
impl ::fidl_next::Unconstrained for MainProtocolTwoWayAnonRequest<'static> {}
/// The wire type corresponding to [`MainProtocolTwoWayAnonResponse`].
#[repr(C)]
pub struct MainProtocolTwoWayAnonResponse<'de> {
pub(crate) table: ::fidl_next::WireTable<'de>,
}
impl<'de> Drop for MainProtocolTwoWayAnonResponse<'de> {
fn drop(&mut self) {
let _ = self
.table
.get(1)
.map(|envelope| unsafe { envelope.read_unchecked::<::fidl_next::WireU16>() });
}
}
unsafe impl ::fidl_next::Wire for MainProtocolTwoWayAnonResponse<'static> {
type Decoded<'de> = MainProtocolTwoWayAnonResponse<'de>;
#[inline]
fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
::fidl_next::munge!(let Self { table } = out);
::fidl_next::WireTable::zero_padding(table);
}
}
unsafe impl<___D> ::fidl_next::Decode<___D> for MainProtocolTwoWayAnonResponse<'static>
where
___D: ::fidl_next::Decoder + ?Sized,
{
fn decode(
slot: ::fidl_next::Slot<'_, Self>,
decoder: &mut ___D,
_: (),
) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
::fidl_next::munge!(let Self { table } = slot);
::fidl_next::WireTable::decode_with(table, decoder, |ordinal, mut slot, decoder| {
match ordinal {
0 => unsafe { ::core::hint::unreachable_unchecked() },
1 => {
::fidl_next::WireEnvelope::decode_as::<___D, ::fidl_next::WireU16>(
slot.as_mut(),
decoder,
(),
)?;
Ok(())
}
_ => ::fidl_next::WireEnvelope::decode_unknown(slot, decoder),
}
})
}
}
impl<'de> MainProtocolTwoWayAnonResponse<'de> {
pub fn a(&self) -> ::core::option::Option<&::fidl_next::WireU16> {
unsafe { Some(self.table.get(1)?.deref_unchecked()) }
}
}
impl<'de> ::core::fmt::Debug for MainProtocolTwoWayAnonResponse<'de> {
fn fmt(
&self,
f: &mut ::core::fmt::Formatter<'_>,
) -> ::core::result::Result<(), ::core::fmt::Error> {
f.debug_struct("MainProtocolTwoWayAnonResponse").field("a", &self.a()).finish()
}
}
impl<'de> ::fidl_next::IntoNatural for MainProtocolTwoWayAnonResponse<'de> {
type Natural = crate::natural::MainProtocolTwoWayAnonResponse;
}
impl ::fidl_next::Unconstrained for MainProtocolTwoWayAnonResponse<'_> {}
/// The wire type corresponding to [`MainProtocolTwoWayAnonWithErrorRequest`].
#[repr(C)]
pub struct MainProtocolTwoWayAnonWithErrorRequest<'de> {
pub(crate) table: ::fidl_next::WireTable<'de>,
}
impl<'de> Drop for MainProtocolTwoWayAnonWithErrorRequest<'de> {
fn drop(&mut self) {
let _ = self
.table
.get(1)
.map(|envelope| unsafe { envelope.read_unchecked::<::fidl_next::WireU16>() });
}
}
unsafe impl ::fidl_next::Wire for MainProtocolTwoWayAnonWithErrorRequest<'static> {
type Decoded<'de> = MainProtocolTwoWayAnonWithErrorRequest<'de>;
#[inline]
fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
::fidl_next::munge!(let Self { table } = out);
::fidl_next::WireTable::zero_padding(table);
}
}
unsafe impl<___D> ::fidl_next::Decode<___D> for MainProtocolTwoWayAnonWithErrorRequest<'static>
where
___D: ::fidl_next::Decoder + ?Sized,
{
fn decode(
slot: ::fidl_next::Slot<'_, Self>,
decoder: &mut ___D,
_: (),
) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
::fidl_next::munge!(let Self { table } = slot);
::fidl_next::WireTable::decode_with(table, decoder, |ordinal, mut slot, decoder| {
match ordinal {
0 => unsafe { ::core::hint::unreachable_unchecked() },
1 => {
::fidl_next::WireEnvelope::decode_as::<___D, ::fidl_next::WireU16>(
slot.as_mut(),
decoder,
(),
)?;
Ok(())
}
_ => ::fidl_next::WireEnvelope::decode_unknown(slot, decoder),
}
})
}
}
impl<'de> MainProtocolTwoWayAnonWithErrorRequest<'de> {
pub fn a(&self) -> ::core::option::Option<&::fidl_next::WireU16> {
unsafe { Some(self.table.get(1)?.deref_unchecked()) }
}
}
impl<'de> ::core::fmt::Debug for MainProtocolTwoWayAnonWithErrorRequest<'de> {
fn fmt(
&self,
f: &mut ::core::fmt::Formatter<'_>,
) -> ::core::result::Result<(), ::core::fmt::Error> {
f.debug_struct("MainProtocolTwoWayAnonWithErrorRequest").field("a", &self.a()).finish()
}
}
impl<'de> ::fidl_next::IntoNatural for MainProtocolTwoWayAnonWithErrorRequest<'de> {
type Natural = crate::natural::MainProtocolTwoWayAnonWithErrorRequest;
}
impl ::fidl_next::Unconstrained for MainProtocolTwoWayAnonWithErrorRequest<'_> {}
/// The wire type corresponding to [`MainProtocolTwoWayAnonWithErrorResponse`].
#[repr(transparent)]
pub struct MainProtocolTwoWayAnonWithErrorResponse<'de> {
pub(crate) raw: ::fidl_next::RawWireUnion,
pub(crate) _phantom: ::core::marker::PhantomData<&'de mut [::fidl_next::Chunk]>,
}
impl<'de> Drop for MainProtocolTwoWayAnonWithErrorResponse<'de> {
fn drop(&mut self) {
match self.raw.ordinal() {
1 => {
let _ = unsafe { self.raw.get().read_unchecked::<bool>() };
}
_ => (),
}
}
}
unsafe impl ::fidl_next::Wire for MainProtocolTwoWayAnonWithErrorResponse<'static> {
type Decoded<'de> = MainProtocolTwoWayAnonWithErrorResponse<'de>;
#[inline]
fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
::fidl_next::munge!(let Self { raw, _phantom: _ } = out);
::fidl_next::RawWireUnion::zero_padding(raw);
}
}
pub mod main_protocol_two_way_anon_with_error_response {
pub enum Ref<'de> {
B(&'de bool),
UnknownOrdinal_(u64),
}
}
impl<'de> MainProtocolTwoWayAnonWithErrorResponse<'de> {
pub fn as_ref(
&self,
) -> crate::wire::main_protocol_two_way_anon_with_error_response::Ref<'_> {
match self.raw.ordinal() {
1 => crate::wire::main_protocol_two_way_anon_with_error_response::Ref::B(
unsafe { self.raw.get().deref_unchecked::<bool>() }
),
unknown => crate::wire::main_protocol_two_way_anon_with_error_response::Ref::UnknownOrdinal_(unknown),
}
}
}
unsafe impl<___D> ::fidl_next::Decode<___D> for MainProtocolTwoWayAnonWithErrorResponse<'static>
where
___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
___D: ::fidl_next::Decoder,
{
fn decode(
mut slot: ::fidl_next::Slot<'_, Self>,
decoder: &mut ___D,
_: (),
) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
::fidl_next::munge!(let Self { mut raw, _phantom: _ } = slot.as_mut());
match ::fidl_next::RawWireUnion::encoded_ordinal(raw.as_mut()) {
1 => ::fidl_next::RawWireUnion::decode_as::<___D, bool>(raw, decoder, ())?,
_ => ::fidl_next::RawWireUnion::decode_unknown(raw, decoder)?,
}
Ok(())
}
}
impl<'de> ::core::fmt::Debug for MainProtocolTwoWayAnonWithErrorResponse<'de> {
fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
match self.raw.ordinal() {
1 => unsafe { self.raw.get().deref_unchecked::<bool>().fmt(f) },
_ => unsafe { ::core::hint::unreachable_unchecked() },
}
}
}
impl<'de> ::fidl_next::IntoNatural for MainProtocolTwoWayAnonWithErrorResponse<'de> {
type Natural = crate::natural::MainProtocolTwoWayAnonWithErrorResponse;
}
impl ::fidl_next::Unconstrained for MainProtocolTwoWayAnonWithErrorResponse<'static> {}
/// The wire type corresponding to [`MainProtocolOnAnonRequest`].
#[repr(transparent)]
pub struct MainProtocolOnAnonRequest<'de> {
pub(crate) raw: ::fidl_next::RawWireUnion,
pub(crate) _phantom: ::core::marker::PhantomData<&'de mut [::fidl_next::Chunk]>,
}
impl<'de> Drop for MainProtocolOnAnonRequest<'de> {
fn drop(&mut self) {
match self.raw.ordinal() {
1 => {
let _ = unsafe { self.raw.get().read_unchecked::<bool>() };
}
_ => (),
}
}
}
unsafe impl ::fidl_next::Wire for MainProtocolOnAnonRequest<'static> {
type Decoded<'de> = MainProtocolOnAnonRequest<'de>;
#[inline]
fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
::fidl_next::munge!(let Self { raw, _phantom: _ } = out);
::fidl_next::RawWireUnion::zero_padding(raw);
}
}
pub mod main_protocol_on_anon_request {
pub enum Ref<'de> {
B(&'de bool),
UnknownOrdinal_(u64),
}
}
impl<'de> MainProtocolOnAnonRequest<'de> {
pub fn as_ref(&self) -> crate::wire::main_protocol_on_anon_request::Ref<'_> {
match self.raw.ordinal() {
1 => crate::wire::main_protocol_on_anon_request::Ref::B(unsafe {
self.raw.get().deref_unchecked::<bool>()
}),
unknown => {
crate::wire::main_protocol_on_anon_request::Ref::UnknownOrdinal_(unknown)
}
}
}
}
unsafe impl<___D> ::fidl_next::Decode<___D> for MainProtocolOnAnonRequest<'static>
where
___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
___D: ::fidl_next::Decoder,
{
fn decode(
mut slot: ::fidl_next::Slot<'_, Self>,
decoder: &mut ___D,
_: (),
) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
::fidl_next::munge!(let Self { mut raw, _phantom: _ } = slot.as_mut());
match ::fidl_next::RawWireUnion::encoded_ordinal(raw.as_mut()) {
1 => ::fidl_next::RawWireUnion::decode_as::<___D, bool>(raw, decoder, ())?,
_ => ::fidl_next::RawWireUnion::decode_unknown(raw, decoder)?,
}
Ok(())
}
}
impl<'de> ::core::fmt::Debug for MainProtocolOnAnonRequest<'de> {
fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
match self.raw.ordinal() {
1 => unsafe { self.raw.get().deref_unchecked::<bool>().fmt(f) },
_ => unsafe { ::core::hint::unreachable_unchecked() },
}
}
}
impl<'de> ::fidl_next::IntoNatural for MainProtocolOnAnonRequest<'de> {
type Natural = crate::natural::MainProtocolOnAnonRequest;
}
impl ::fidl_next::Unconstrained for MainProtocolOnAnonRequest<'static> {}
}
pub mod wire_optional {
#[repr(transparent)]
pub struct LocalUnionPayload<'de> {
pub(crate) raw: ::fidl_next::RawWireUnion,
pub(crate) _phantom: ::core::marker::PhantomData<&'de mut [::fidl_next::Chunk]>,
}
unsafe impl ::fidl_next::Wire for LocalUnionPayload<'static> {
type Decoded<'de> = LocalUnionPayload<'de>;
#[inline]
fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
::fidl_next::munge!(let Self { raw, _phantom: _ } = out);
::fidl_next::RawWireUnion::zero_padding(raw);
}
}
impl<'de> LocalUnionPayload<'de> {
pub fn is_some(&self) -> bool {
self.raw.is_some()
}
pub fn is_none(&self) -> bool {
self.raw.is_none()
}
pub fn as_ref(&self) -> ::core::option::Option<&crate::wire::LocalUnionPayload<'de>> {
if self.is_some() { Some(unsafe { &*(self as *const Self).cast() }) } else { None }
}
pub fn into_option(self) -> ::core::option::Option<crate::wire::LocalUnionPayload<'de>> {
if self.is_some() {
Some(crate::wire::LocalUnionPayload {
raw: self.raw,
_phantom: ::core::marker::PhantomData,
})
} else {
None
}
}
}
unsafe impl<___D> ::fidl_next::Decode<___D> for LocalUnionPayload<'static>
where
___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
___D: ::fidl_next::Decoder,
{
fn decode(
mut slot: ::fidl_next::Slot<'_, Self>,
decoder: &mut ___D,
_: (),
) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
::fidl_next::munge!(let Self { mut raw, _phantom: _ } = slot.as_mut());
match ::fidl_next::RawWireUnion::encoded_ordinal(raw.as_mut()) {
1 => ::fidl_next::RawWireUnion::decode_as::<___D, bool>(raw, decoder, ())?,
0 => ::fidl_next::RawWireUnion::decode_absent(raw)?,
_ => ::fidl_next::RawWireUnion::decode_unknown(raw, decoder)?,
}
Ok(())
}
}
impl<'de> ::core::fmt::Debug for LocalUnionPayload<'de> {
fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
self.as_ref().fmt(f)
}
}
impl<'de> ::fidl_next::IntoNatural for LocalUnionPayload<'de> {
type Natural = ::core::option::Option<crate::natural::LocalUnionPayload>;
}
impl ::fidl_next::Unconstrained for LocalUnionPayload<'static> {}
#[repr(transparent)]
pub struct MainProtocolTwoWayAnonRequest<'de> {
pub(crate) raw: ::fidl_next::RawWireUnion,
pub(crate) _phantom: ::core::marker::PhantomData<&'de mut [::fidl_next::Chunk]>,
}
unsafe impl ::fidl_next::Wire for MainProtocolTwoWayAnonRequest<'static> {
type Decoded<'de> = MainProtocolTwoWayAnonRequest<'de>;
#[inline]
fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
::fidl_next::munge!(let Self { raw, _phantom: _ } = out);
::fidl_next::RawWireUnion::zero_padding(raw);
}
}
impl<'de> MainProtocolTwoWayAnonRequest<'de> {
pub fn is_some(&self) -> bool {
self.raw.is_some()
}
pub fn is_none(&self) -> bool {
self.raw.is_none()
}
pub fn as_ref(
&self,
) -> ::core::option::Option<&crate::wire::MainProtocolTwoWayAnonRequest<'de>> {
if self.is_some() { Some(unsafe { &*(self as *const Self).cast() }) } else { None }
}
pub fn into_option(
self,
) -> ::core::option::Option<crate::wire::MainProtocolTwoWayAnonRequest<'de>> {
if self.is_some() {
Some(crate::wire::MainProtocolTwoWayAnonRequest {
raw: self.raw,
_phantom: ::core::marker::PhantomData,
})
} else {
None
}
}
}
unsafe impl<___D> ::fidl_next::Decode<___D> for MainProtocolTwoWayAnonRequest<'static>
where
___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
___D: ::fidl_next::Decoder,
{
fn decode(
mut slot: ::fidl_next::Slot<'_, Self>,
decoder: &mut ___D,
_: (),
) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
::fidl_next::munge!(let Self { mut raw, _phantom: _ } = slot.as_mut());
match ::fidl_next::RawWireUnion::encoded_ordinal(raw.as_mut()) {
1 => ::fidl_next::RawWireUnion::decode_as::<___D, bool>(raw, decoder, ())?,
0 => ::fidl_next::RawWireUnion::decode_absent(raw)?,
_ => ::fidl_next::RawWireUnion::decode_unknown(raw, decoder)?,
}
Ok(())
}
}
impl<'de> ::core::fmt::Debug for MainProtocolTwoWayAnonRequest<'de> {
fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
self.as_ref().fmt(f)
}
}
impl<'de> ::fidl_next::IntoNatural for MainProtocolTwoWayAnonRequest<'de> {
type Natural = ::core::option::Option<crate::natural::MainProtocolTwoWayAnonRequest>;
}
impl ::fidl_next::Unconstrained for MainProtocolTwoWayAnonRequest<'static> {}
#[repr(transparent)]
pub struct MainProtocolTwoWayAnonWithErrorResponse<'de> {
pub(crate) raw: ::fidl_next::RawWireUnion,
pub(crate) _phantom: ::core::marker::PhantomData<&'de mut [::fidl_next::Chunk]>,
}
unsafe impl ::fidl_next::Wire for MainProtocolTwoWayAnonWithErrorResponse<'static> {
type Decoded<'de> = MainProtocolTwoWayAnonWithErrorResponse<'de>;
#[inline]
fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
::fidl_next::munge!(let Self { raw, _phantom: _ } = out);
::fidl_next::RawWireUnion::zero_padding(raw);
}
}
impl<'de> MainProtocolTwoWayAnonWithErrorResponse<'de> {
pub fn is_some(&self) -> bool {
self.raw.is_some()
}
pub fn is_none(&self) -> bool {
self.raw.is_none()
}
pub fn as_ref(
&self,
) -> ::core::option::Option<&crate::wire::MainProtocolTwoWayAnonWithErrorResponse<'de>>
{
if self.is_some() { Some(unsafe { &*(self as *const Self).cast() }) } else { None }
}
pub fn into_option(
self,
) -> ::core::option::Option<crate::wire::MainProtocolTwoWayAnonWithErrorResponse<'de>>
{
if self.is_some() {
Some(crate::wire::MainProtocolTwoWayAnonWithErrorResponse {
raw: self.raw,
_phantom: ::core::marker::PhantomData,
})
} else {
None
}
}
}
unsafe impl<___D> ::fidl_next::Decode<___D> for MainProtocolTwoWayAnonWithErrorResponse<'static>
where
___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
___D: ::fidl_next::Decoder,
{
fn decode(
mut slot: ::fidl_next::Slot<'_, Self>,
decoder: &mut ___D,
_: (),
) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
::fidl_next::munge!(let Self { mut raw, _phantom: _ } = slot.as_mut());
match ::fidl_next::RawWireUnion::encoded_ordinal(raw.as_mut()) {
1 => ::fidl_next::RawWireUnion::decode_as::<___D, bool>(raw, decoder, ())?,
0 => ::fidl_next::RawWireUnion::decode_absent(raw)?,
_ => ::fidl_next::RawWireUnion::decode_unknown(raw, decoder)?,
}
Ok(())
}
}
impl<'de> ::core::fmt::Debug for MainProtocolTwoWayAnonWithErrorResponse<'de> {
fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
self.as_ref().fmt(f)
}
}
impl<'de> ::fidl_next::IntoNatural for MainProtocolTwoWayAnonWithErrorResponse<'de> {
type Natural =
::core::option::Option<crate::natural::MainProtocolTwoWayAnonWithErrorResponse>;
}
impl ::fidl_next::Unconstrained for MainProtocolTwoWayAnonWithErrorResponse<'static> {}
#[repr(transparent)]
pub struct MainProtocolOnAnonRequest<'de> {
pub(crate) raw: ::fidl_next::RawWireUnion,
pub(crate) _phantom: ::core::marker::PhantomData<&'de mut [::fidl_next::Chunk]>,
}
unsafe impl ::fidl_next::Wire for MainProtocolOnAnonRequest<'static> {
type Decoded<'de> = MainProtocolOnAnonRequest<'de>;
#[inline]
fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
::fidl_next::munge!(let Self { raw, _phantom: _ } = out);
::fidl_next::RawWireUnion::zero_padding(raw);
}
}
impl<'de> MainProtocolOnAnonRequest<'de> {
pub fn is_some(&self) -> bool {
self.raw.is_some()
}
pub fn is_none(&self) -> bool {
self.raw.is_none()
}
pub fn as_ref(
&self,
) -> ::core::option::Option<&crate::wire::MainProtocolOnAnonRequest<'de>> {
if self.is_some() { Some(unsafe { &*(self as *const Self).cast() }) } else { None }
}
pub fn into_option(
self,
) -> ::core::option::Option<crate::wire::MainProtocolOnAnonRequest<'de>> {
if self.is_some() {
Some(crate::wire::MainProtocolOnAnonRequest {
raw: self.raw,
_phantom: ::core::marker::PhantomData,
})
} else {
None
}
}
}
unsafe impl<___D> ::fidl_next::Decode<___D> for MainProtocolOnAnonRequest<'static>
where
___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
___D: ::fidl_next::Decoder,
{
fn decode(
mut slot: ::fidl_next::Slot<'_, Self>,
decoder: &mut ___D,
_: (),
) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
::fidl_next::munge!(let Self { mut raw, _phantom: _ } = slot.as_mut());
match ::fidl_next::RawWireUnion::encoded_ordinal(raw.as_mut()) {
1 => ::fidl_next::RawWireUnion::decode_as::<___D, bool>(raw, decoder, ())?,
0 => ::fidl_next::RawWireUnion::decode_absent(raw)?,
_ => ::fidl_next::RawWireUnion::decode_unknown(raw, decoder)?,
}
Ok(())
}
}
impl<'de> ::core::fmt::Debug for MainProtocolOnAnonRequest<'de> {
fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
self.as_ref().fmt(f)
}
}
impl<'de> ::fidl_next::IntoNatural for MainProtocolOnAnonRequest<'de> {
type Natural = ::core::option::Option<crate::natural::MainProtocolOnAnonRequest>;
}
impl ::fidl_next::Unconstrained for MainProtocolOnAnonRequest<'static> {}
}
pub mod generic {}
pub use self::natural::*;
/// The type corresponding to the MainProtocol protocol.
#[derive(PartialEq, Debug)]
pub struct MainProtocol;
#[cfg(target_os = "fuchsia")]
impl ::fidl_next::HasTransport for MainProtocol {
type Transport = ::fidl_next::fuchsia::zx::Channel;
}
pub mod main_protocol {
pub mod prelude {
pub use crate::{
MainProtocol, MainProtocolClientHandler, MainProtocolServerHandler, main_protocol,
};
pub use ::fidl_next_test_protocollayouts_imported::natural::ComposedProtocolOnAnonComposedRequest;
pub use ::fidl_next_test_protocollayouts_imported::natural::ComposedProtocolOneWayAnonComposedRequest;
pub use ::fidl_next_test_protocollayouts_imported::natural::ComposedProtocolTwoWayAnonComposedRequest;
pub use ::fidl_next_test_protocollayouts_imported::natural::ComposedProtocolTwoWayAnonComposedResponse;
pub use ::fidl_next_test_protocollayouts_imported::natural::ComposedProtocolTwoWayAnonComposedWithErrorRequest;
pub use ::fidl_next_test_protocollayouts_imported::natural::ComposedProtocolTwoWayAnonComposedWithErrorResponse;
pub use ::fidl_next_test_protocollayouts_imported::natural::ImportTablePayload;
pub use ::fidl_next_test_protocollayouts_imported::natural::ImportUnionPayload;
pub use crate::natural::LocalTablePayload;
pub use crate::natural::LocalUnionPayload;
pub use crate::natural::MainProtocolOnAnonRequest;
pub use crate::natural::MainProtocolOneWayAnonRequest;
pub use crate::natural::MainProtocolTwoWayAnonRequest;
pub use crate::natural::MainProtocolTwoWayAnonResponse;
pub use crate::natural::MainProtocolTwoWayAnonWithErrorRequest;
pub use crate::natural::MainProtocolTwoWayAnonWithErrorResponse;
}
pub struct OneWayAnonComposed;
impl ::fidl_next::Method for OneWayAnonComposed {
const ORDINAL: u64 = 467706262354916833;
const FLEXIBILITY: ::fidl_next::protocol::Flexibility =
::fidl_next::protocol::Flexibility::Strict;
type Protocol = crate::MainProtocol;
type Request = ::fidl_next_test_protocollayouts_imported::wire::ComposedProtocolOneWayAnonComposedRequest<'static>;
type Response = ::fidl_next::util::Never;
}
pub struct TwoWayAnonComposed;
impl ::fidl_next::Method for TwoWayAnonComposed {
const ORDINAL: u64 = 1634702755099390832;
const FLEXIBILITY: ::fidl_next::protocol::Flexibility =
::fidl_next::protocol::Flexibility::Strict;
type Protocol = crate::MainProtocol;
type Request = ::fidl_next_test_protocollayouts_imported::wire::ComposedProtocolTwoWayAnonComposedRequest;
type Response =
::fidl_next_test_protocollayouts_imported::wire::ComposedProtocolTwoWayAnonComposedResponse<'static>
;
}
impl<___R> ::fidl_next::Respond<___R> for TwoWayAnonComposed {
type Output = ___R;
fn respond(response: ___R) -> Self::Output {
response
}
}
pub struct TwoWayAnonComposedWithError;
impl ::fidl_next::Method for TwoWayAnonComposedWithError {
const ORDINAL: u64 = 3374101322700362141;
const FLEXIBILITY: ::fidl_next::protocol::Flexibility =
::fidl_next::protocol::Flexibility::Strict;
type Protocol = crate::MainProtocol;
type Request = ::fidl_next_test_protocollayouts_imported::wire::ComposedProtocolTwoWayAnonComposedWithErrorRequest<'static>;
type Response =
::fidl_next::WireResult
<
'static,
::fidl_next_test_protocollayouts_imported::wire::ComposedProtocolTwoWayAnonComposedWithErrorResponse,
::fidl_next::WireU32,
>
;
}
impl<___R> ::fidl_next::Respond<___R> for TwoWayAnonComposedWithError {
type Output = ::core::result::Result<___R, ::fidl_next::util::Never>;
fn respond(response: ___R) -> Self::Output {
::core::result::Result::Ok(response)
}
}
impl<___R> ::fidl_next::RespondErr<___R> for TwoWayAnonComposedWithError {
type Output = ::core::result::Result<::fidl_next::util::Never, ___R>;
fn respond_err(response: ___R) -> Self::Output {
::core::result::Result::Err(response)
}
}
pub struct OnAnonComposed;
impl ::fidl_next::Method for OnAnonComposed {
const ORDINAL: u64 = 9198778981238868491;
const FLEXIBILITY: ::fidl_next::protocol::Flexibility =
::fidl_next::protocol::Flexibility::Strict;
type Protocol = crate::MainProtocol;
type Request = ::fidl_next::util::Never;
type Response =
::fidl_next_test_protocollayouts_imported::wire::ComposedProtocolOnAnonComposedRequest;
}
pub struct OneWayNamedComposed;
impl ::fidl_next::Method for OneWayNamedComposed {
const ORDINAL: u64 = 6735359826241449560;
const FLEXIBILITY: ::fidl_next::protocol::Flexibility =
::fidl_next::protocol::Flexibility::Strict;
type Protocol = crate::MainProtocol;
type Request = ::fidl_next_test_protocollayouts_imported::wire::ImportTablePayload<'static>;
type Response = ::fidl_next::util::Never;
}
pub struct TwoWayNamedComposed;
impl ::fidl_next::Method for TwoWayNamedComposed {
const ORDINAL: u64 = 1110122450485917712;
const FLEXIBILITY: ::fidl_next::protocol::Flexibility =
::fidl_next::protocol::Flexibility::Strict;
type Protocol = crate::MainProtocol;
type Request = ::fidl_next_test_protocollayouts_imported::wire::ImportUnionPayload;
type Response =
::fidl_next_test_protocollayouts_imported::wire::ImportTablePayload<'static>;
}
impl<___R> ::fidl_next::Respond<___R> for TwoWayNamedComposed {
type Output = ___R;
fn respond(response: ___R) -> Self::Output {
response
}
}
pub struct TwoWayNamedComposedWithError;
impl ::fidl_next::Method for TwoWayNamedComposedWithError {
const ORDINAL: u64 = 3520341666774118271;
const FLEXIBILITY: ::fidl_next::protocol::Flexibility =
::fidl_next::protocol::Flexibility::Strict;
type Protocol = crate::MainProtocol;
type Request = ::fidl_next_test_protocollayouts_imported::wire::ImportTablePayload<'static>;
type Response = ::fidl_next::WireResult<
'static,
::fidl_next_test_protocollayouts_imported::wire::ImportUnionPayload,
::fidl_next::WireU32,
>;
}
impl<___R> ::fidl_next::Respond<___R> for TwoWayNamedComposedWithError {
type Output = ::core::result::Result<___R, ::fidl_next::util::Never>;
fn respond(response: ___R) -> Self::Output {
::core::result::Result::Ok(response)
}
}
impl<___R> ::fidl_next::RespondErr<___R> for TwoWayNamedComposedWithError {
type Output = ::core::result::Result<::fidl_next::util::Never, ___R>;
fn respond_err(response: ___R) -> Self::Output {
::core::result::Result::Err(response)
}
}
pub struct OnNamedComposed;
impl ::fidl_next::Method for OnNamedComposed {
const ORDINAL: u64 = 6802961197456477674;
const FLEXIBILITY: ::fidl_next::protocol::Flexibility =
::fidl_next::protocol::Flexibility::Strict;
type Protocol = crate::MainProtocol;
type Request = ::fidl_next::util::Never;
type Response = ::fidl_next_test_protocollayouts_imported::wire::ImportUnionPayload;
}
pub struct OneWayImport;
impl ::fidl_next::Method for OneWayImport {
const ORDINAL: u64 = 374039999976906043;
const FLEXIBILITY: ::fidl_next::protocol::Flexibility =
::fidl_next::protocol::Flexibility::Strict;
type Protocol = crate::MainProtocol;
type Request = ::fidl_next_test_protocollayouts_imported::wire::ImportTablePayload<'static>;
type Response = ::fidl_next::util::Never;
}
pub struct TwoWayImport;
impl ::fidl_next::Method for TwoWayImport {
const ORDINAL: u64 = 3167860988423964164;
const FLEXIBILITY: ::fidl_next::protocol::Flexibility =
::fidl_next::protocol::Flexibility::Strict;
type Protocol = crate::MainProtocol;
type Request = ::fidl_next_test_protocollayouts_imported::wire::ImportUnionPayload;
type Response =
::fidl_next_test_protocollayouts_imported::wire::ImportTablePayload<'static>;
}
impl<___R> ::fidl_next::Respond<___R> for TwoWayImport {
type Output = ___R;
fn respond(response: ___R) -> Self::Output {
response
}
}
pub struct TwoWayImportWithError;
impl ::fidl_next::Method for TwoWayImportWithError {
const ORDINAL: u64 = 4837028007581646602;
const FLEXIBILITY: ::fidl_next::protocol::Flexibility =
::fidl_next::protocol::Flexibility::Strict;
type Protocol = crate::MainProtocol;
type Request = ::fidl_next_test_protocollayouts_imported::wire::ImportTablePayload<'static>;
type Response = ::fidl_next::WireResult<
'static,
::fidl_next_test_protocollayouts_imported::wire::ImportUnionPayload,
::fidl_next::WireU32,
>;
}
impl<___R> ::fidl_next::Respond<___R> for TwoWayImportWithError {
type Output = ::core::result::Result<___R, ::fidl_next::util::Never>;
fn respond(response: ___R) -> Self::Output {
::core::result::Result::Ok(response)
}
}
impl<___R> ::fidl_next::RespondErr<___R> for TwoWayImportWithError {
type Output = ::core::result::Result<::fidl_next::util::Never, ___R>;
fn respond_err(response: ___R) -> Self::Output {
::core::result::Result::Err(response)
}
}
pub struct OnImport;
impl ::fidl_next::Method for OnImport {
const ORDINAL: u64 = 6584793811321990352;
const FLEXIBILITY: ::fidl_next::protocol::Flexibility =
::fidl_next::protocol::Flexibility::Strict;
type Protocol = crate::MainProtocol;
type Request = ::fidl_next::util::Never;
type Response = ::fidl_next_test_protocollayouts_imported::wire::ImportUnionPayload;
}
pub struct OneWayLocal;
impl ::fidl_next::Method for OneWayLocal {
const ORDINAL: u64 = 6085941264859402051;
const FLEXIBILITY: ::fidl_next::protocol::Flexibility =
::fidl_next::protocol::Flexibility::Strict;
type Protocol = crate::MainProtocol;
type Request = crate::wire::LocalTablePayload<'static>;
type Response = ::fidl_next::util::Never;
}
pub struct TwoWayLocal;
impl ::fidl_next::Method for TwoWayLocal {
const ORDINAL: u64 = 7763901300032164763;
const FLEXIBILITY: ::fidl_next::protocol::Flexibility =
::fidl_next::protocol::Flexibility::Strict;
type Protocol = crate::MainProtocol;
type Request = crate::wire::LocalUnionPayload<'static>;
type Response = crate::wire::LocalTablePayload<'static>;
}
impl<___R> ::fidl_next::Respond<___R> for TwoWayLocal {
type Output = ___R;
fn respond(response: ___R) -> Self::Output {
response
}
}
pub struct TwoWayLocalWithError;
impl ::fidl_next::Method for TwoWayLocalWithError {
const ORDINAL: u64 = 5609487496960056151;
const FLEXIBILITY: ::fidl_next::protocol::Flexibility =
::fidl_next::protocol::Flexibility::Strict;
type Protocol = crate::MainProtocol;
type Request = crate::wire::LocalTablePayload<'static>;
type Response = ::fidl_next::WireResult<
'static,
crate::wire::LocalUnionPayload<'static>,
::fidl_next::WireU32,
>;
}
impl<___R> ::fidl_next::Respond<___R> for TwoWayLocalWithError {
type Output = ::core::result::Result<___R, ::fidl_next::util::Never>;
fn respond(response: ___R) -> Self::Output {
::core::result::Result::Ok(response)
}
}
impl<___R> ::fidl_next::RespondErr<___R> for TwoWayLocalWithError {
type Output = ::core::result::Result<::fidl_next::util::Never, ___R>;
fn respond_err(response: ___R) -> Self::Output {
::core::result::Result::Err(response)
}
}
pub struct OnLocal;
impl ::fidl_next::Method for OnLocal {
const ORDINAL: u64 = 4199259762307646332;
const FLEXIBILITY: ::fidl_next::protocol::Flexibility =
::fidl_next::protocol::Flexibility::Strict;
type Protocol = crate::MainProtocol;
type Request = ::fidl_next::util::Never;
type Response = crate::wire::LocalUnionPayload<'static>;
}
pub struct OneWayAnon;
impl ::fidl_next::Method for OneWayAnon {
const ORDINAL: u64 = 4203317713771984620;
const FLEXIBILITY: ::fidl_next::protocol::Flexibility =
::fidl_next::protocol::Flexibility::Strict;
type Protocol = crate::MainProtocol;
type Request = crate::wire::MainProtocolOneWayAnonRequest<'static>;
type Response = ::fidl_next::util::Never;
}
pub struct TwoWayAnon;
impl ::fidl_next::Method for TwoWayAnon {
const ORDINAL: u64 = 7435080039097281487;
const FLEXIBILITY: ::fidl_next::protocol::Flexibility =
::fidl_next::protocol::Flexibility::Strict;
type Protocol = crate::MainProtocol;
type Request = crate::wire::MainProtocolTwoWayAnonRequest<'static>;
type Response = crate::wire::MainProtocolTwoWayAnonResponse<'static>;
}
impl<___R> ::fidl_next::Respond<___R> for TwoWayAnon {
type Output = ___R;
fn respond(response: ___R) -> Self::Output {
response
}
}
pub struct TwoWayAnonWithError;
impl ::fidl_next::Method for TwoWayAnonWithError {
const ORDINAL: u64 = 7770394869745610225;
const FLEXIBILITY: ::fidl_next::protocol::Flexibility =
::fidl_next::protocol::Flexibility::Strict;
type Protocol = crate::MainProtocol;
type Request = crate::wire::MainProtocolTwoWayAnonWithErrorRequest<'static>;
type Response = ::fidl_next::WireResult<
'static,
crate::wire::MainProtocolTwoWayAnonWithErrorResponse<'static>,
::fidl_next::WireU32,
>;
}
impl<___R> ::fidl_next::Respond<___R> for TwoWayAnonWithError {
type Output = ::core::result::Result<___R, ::fidl_next::util::Never>;
fn respond(response: ___R) -> Self::Output {
::core::result::Result::Ok(response)
}
}
impl<___R> ::fidl_next::RespondErr<___R> for TwoWayAnonWithError {
type Output = ::core::result::Result<::fidl_next::util::Never, ___R>;
fn respond_err(response: ___R) -> Self::Output {
::core::result::Result::Err(response)
}
}
pub struct OnAnon;
impl ::fidl_next::Method for OnAnon {
const ORDINAL: u64 = 7275479350674227467;
const FLEXIBILITY: ::fidl_next::protocol::Flexibility =
::fidl_next::protocol::Flexibility::Strict;
type Protocol = crate::MainProtocol;
type Request = ::fidl_next::util::Never;
type Response = crate::wire::MainProtocolOnAnonRequest<'static>;
}
mod ___detail {
unsafe impl<___T> ::fidl_next::HasConnectionHandles<___T> for crate::MainProtocol
where
___T: ::fidl_next::Transport,
{
type Client = MainProtocolClient<___T>;
type Server = MainProtocolServer<___T>;
}
/// The client for the `MainProtocol` protocol.
#[repr(transparent)]
pub struct MainProtocolClient<___T: ::fidl_next::Transport> {
#[allow(dead_code)]
client: ::fidl_next::protocol::Client<___T>,
}
impl<___T> MainProtocolClient<___T>
where
___T: ::fidl_next::Transport,
{
pub fn one_way_anon_composed_with<___R>(
&self,
request: ___R,
) -> ::fidl_next::SendFuture<'_, ___T>
where
___R: ::fidl_next::Encode<
::fidl_next_test_protocollayouts_imported::wire::ComposedProtocolOneWayAnonComposedRequest<'static>,
<___T as ::fidl_next::Transport>::SendBuffer,
>,
{
::fidl_next::SendFuture::from_untyped(self.client.send_one_way(
467706262354916833,
<super::OneWayAnonComposed as ::fidl_next::Method>::FLEXIBILITY,
request,
))
}
pub fn two_way_anon_composed_with<___R>(
&self,
request: ___R,
) -> ::fidl_next::TwoWayFuture<'_, super::TwoWayAnonComposed, ___T>
where
___R: ::fidl_next::Encode<
::fidl_next_test_protocollayouts_imported::wire::ComposedProtocolTwoWayAnonComposedRequest,
<___T as ::fidl_next::Transport>::SendBuffer,
>,
{
::fidl_next::TwoWayFuture::from_untyped(self.client.send_two_way(
1634702755099390832,
<super::TwoWayAnonComposed as ::fidl_next::Method>::FLEXIBILITY,
request,
))
}
pub fn two_way_anon_composed_with_error_with<___R>(
&self,
request: ___R,
) -> ::fidl_next::TwoWayFuture<'_, super::TwoWayAnonComposedWithError, ___T>
where
___R: ::fidl_next::Encode<
::fidl_next_test_protocollayouts_imported::wire::ComposedProtocolTwoWayAnonComposedWithErrorRequest<'static>,
<___T as ::fidl_next::Transport>::SendBuffer,
>,
{
::fidl_next::TwoWayFuture::from_untyped(self.client.send_two_way(
3374101322700362141,
<super::TwoWayAnonComposedWithError as ::fidl_next::Method>::FLEXIBILITY,
request,
))
}
pub fn one_way_named_composed_with<___R>(
&self,
request: ___R,
) -> ::fidl_next::SendFuture<'_, ___T>
where
___R: ::fidl_next::Encode<
::fidl_next_test_protocollayouts_imported::wire::ImportTablePayload<
'static,
>,
<___T as ::fidl_next::Transport>::SendBuffer,
>,
{
::fidl_next::SendFuture::from_untyped(self.client.send_one_way(
6735359826241449560,
<super::OneWayNamedComposed as ::fidl_next::Method>::FLEXIBILITY,
request,
))
}
pub fn two_way_named_composed_with<___R>(
&self,
request: ___R,
) -> ::fidl_next::TwoWayFuture<'_, super::TwoWayNamedComposed, ___T>
where
___R: ::fidl_next::Encode<
::fidl_next_test_protocollayouts_imported::wire::ImportUnionPayload,
<___T as ::fidl_next::Transport>::SendBuffer,
>,
{
::fidl_next::TwoWayFuture::from_untyped(self.client.send_two_way(
1110122450485917712,
<super::TwoWayNamedComposed as ::fidl_next::Method>::FLEXIBILITY,
request,
))
}
pub fn two_way_named_composed_with_error_with<___R>(
&self,
request: ___R,
) -> ::fidl_next::TwoWayFuture<'_, super::TwoWayNamedComposedWithError, ___T>
where
___R: ::fidl_next::Encode<
::fidl_next_test_protocollayouts_imported::wire::ImportTablePayload<
'static,
>,
<___T as ::fidl_next::Transport>::SendBuffer,
>,
{
::fidl_next::TwoWayFuture::from_untyped(self.client.send_two_way(
3520341666774118271,
<super::TwoWayNamedComposedWithError as ::fidl_next::Method>::FLEXIBILITY,
request,
))
}
pub fn one_way_import_with<___R>(
&self,
request: ___R,
) -> ::fidl_next::SendFuture<'_, ___T>
where
___R: ::fidl_next::Encode<
::fidl_next_test_protocollayouts_imported::wire::ImportTablePayload<
'static,
>,
<___T as ::fidl_next::Transport>::SendBuffer,
>,
{
::fidl_next::SendFuture::from_untyped(self.client.send_one_way(
374039999976906043,
<super::OneWayImport as ::fidl_next::Method>::FLEXIBILITY,
request,
))
}
pub fn two_way_import_with<___R>(
&self,
request: ___R,
) -> ::fidl_next::TwoWayFuture<'_, super::TwoWayImport, ___T>
where
___R: ::fidl_next::Encode<
::fidl_next_test_protocollayouts_imported::wire::ImportUnionPayload,
<___T as ::fidl_next::Transport>::SendBuffer,
>,
{
::fidl_next::TwoWayFuture::from_untyped(self.client.send_two_way(
3167860988423964164,
<super::TwoWayImport as ::fidl_next::Method>::FLEXIBILITY,
request,
))
}
pub fn two_way_import_with_error_with<___R>(
&self,
request: ___R,
) -> ::fidl_next::TwoWayFuture<'_, super::TwoWayImportWithError, ___T>
where
___R: ::fidl_next::Encode<
::fidl_next_test_protocollayouts_imported::wire::ImportTablePayload<
'static,
>,
<___T as ::fidl_next::Transport>::SendBuffer,
>,
{
::fidl_next::TwoWayFuture::from_untyped(self.client.send_two_way(
4837028007581646602,
<super::TwoWayImportWithError as ::fidl_next::Method>::FLEXIBILITY,
request,
))
}
pub fn one_way_local_with<___R>(
&self,
request: ___R,
) -> ::fidl_next::SendFuture<'_, ___T>
where
___R: ::fidl_next::Encode<
crate::wire::LocalTablePayload<'static>,
<___T as ::fidl_next::Transport>::SendBuffer,
>,
{
::fidl_next::SendFuture::from_untyped(self.client.send_one_way(
6085941264859402051,
<super::OneWayLocal as ::fidl_next::Method>::FLEXIBILITY,
request,
))
}
pub fn two_way_local_with<___R>(
&self,
request: ___R,
) -> ::fidl_next::TwoWayFuture<'_, super::TwoWayLocal, ___T>
where
___R: ::fidl_next::Encode<
crate::wire::LocalUnionPayload<'static>,
<___T as ::fidl_next::Transport>::SendBuffer,
>,
{
::fidl_next::TwoWayFuture::from_untyped(self.client.send_two_way(
7763901300032164763,
<super::TwoWayLocal as ::fidl_next::Method>::FLEXIBILITY,
request,
))
}
pub fn two_way_local_with_error_with<___R>(
&self,
request: ___R,
) -> ::fidl_next::TwoWayFuture<'_, super::TwoWayLocalWithError, ___T>
where
___R: ::fidl_next::Encode<
crate::wire::LocalTablePayload<'static>,
<___T as ::fidl_next::Transport>::SendBuffer,
>,
{
::fidl_next::TwoWayFuture::from_untyped(self.client.send_two_way(
5609487496960056151,
<super::TwoWayLocalWithError as ::fidl_next::Method>::FLEXIBILITY,
request,
))
}
pub fn one_way_anon_with<___R>(
&self,
request: ___R,
) -> ::fidl_next::SendFuture<'_, ___T>
where
___R: ::fidl_next::Encode<
crate::wire::MainProtocolOneWayAnonRequest<'static>,
<___T as ::fidl_next::Transport>::SendBuffer,
>,
{
::fidl_next::SendFuture::from_untyped(self.client.send_one_way(
4203317713771984620,
<super::OneWayAnon as ::fidl_next::Method>::FLEXIBILITY,
request,
))
}
pub fn two_way_anon_with<___R>(
&self,
request: ___R,
) -> ::fidl_next::TwoWayFuture<'_, super::TwoWayAnon, ___T>
where
___R: ::fidl_next::Encode<
crate::wire::MainProtocolTwoWayAnonRequest<'static>,
<___T as ::fidl_next::Transport>::SendBuffer,
>,
{
::fidl_next::TwoWayFuture::from_untyped(self.client.send_two_way(
7435080039097281487,
<super::TwoWayAnon as ::fidl_next::Method>::FLEXIBILITY,
request,
))
}
pub fn two_way_anon_with_error_with<___R>(
&self,
request: ___R,
) -> ::fidl_next::TwoWayFuture<'_, super::TwoWayAnonWithError, ___T>
where
___R: ::fidl_next::Encode<
crate::wire::MainProtocolTwoWayAnonWithErrorRequest<'static>,
<___T as ::fidl_next::Transport>::SendBuffer,
>,
{
::fidl_next::TwoWayFuture::from_untyped(self.client.send_two_way(
7770394869745610225,
<super::TwoWayAnonWithError as ::fidl_next::Method>::FLEXIBILITY,
request,
))
}
}
/// The server for the `MainProtocol` protocol.
#[repr(transparent)]
pub struct MainProtocolServer<___T: ::fidl_next::Transport> {
server: ::fidl_next::protocol::Server<___T>,
}
impl<___T> MainProtocolServer<___T>
where
___T: ::fidl_next::Transport,
{
pub fn on_anon_composed_with<___R>(
&self,
request: ___R,
) -> ::fidl_next::SendFuture<'_, ___T>
where
___R: ::fidl_next::Encode<
<super::OnAnonComposed as ::fidl_next::Method>::Response,
<___T as ::fidl_next::Transport>::SendBuffer,
>,
{
::fidl_next::SendFuture::from_untyped(self.server.send_event(
9198778981238868491,
<super::OnAnonComposed as ::fidl_next::Method>::FLEXIBILITY,
request,
))
}
pub fn on_named_composed_with<___R>(
&self,
request: ___R,
) -> ::fidl_next::SendFuture<'_, ___T>
where
___R: ::fidl_next::Encode<
<super::OnNamedComposed as ::fidl_next::Method>::Response,
<___T as ::fidl_next::Transport>::SendBuffer,
>,
{
::fidl_next::SendFuture::from_untyped(self.server.send_event(
6802961197456477674,
<super::OnNamedComposed as ::fidl_next::Method>::FLEXIBILITY,
request,
))
}
pub fn on_import_with<___R>(&self, request: ___R) -> ::fidl_next::SendFuture<'_, ___T>
where
___R: ::fidl_next::Encode<
<super::OnImport as ::fidl_next::Method>::Response,
<___T as ::fidl_next::Transport>::SendBuffer,
>,
{
::fidl_next::SendFuture::from_untyped(self.server.send_event(
6584793811321990352,
<super::OnImport as ::fidl_next::Method>::FLEXIBILITY,
request,
))
}
pub fn on_local_with<___R>(&self, request: ___R) -> ::fidl_next::SendFuture<'_, ___T>
where
___R: ::fidl_next::Encode<
<super::OnLocal as ::fidl_next::Method>::Response,
<___T as ::fidl_next::Transport>::SendBuffer,
>,
{
::fidl_next::SendFuture::from_untyped(self.server.send_event(
4199259762307646332,
<super::OnLocal as ::fidl_next::Method>::FLEXIBILITY,
request,
))
}
pub fn on_anon_with<___R>(&self, request: ___R) -> ::fidl_next::SendFuture<'_, ___T>
where
___R: ::fidl_next::Encode<
<super::OnAnon as ::fidl_next::Method>::Response,
<___T as ::fidl_next::Transport>::SendBuffer,
>,
{
::fidl_next::SendFuture::from_untyped(self.server.send_event(
7275479350674227467,
<super::OnAnon as ::fidl_next::Method>::FLEXIBILITY,
request,
))
}
}
}
}
/// A client handler for the MainProtocol protocol.
///
/// See [`MainProtocol`] for more details.
pub trait MainProtocolClientHandler<
#[cfg(target_os = "fuchsia")] ___T: ::fidl_next::Transport = ::fidl_next::fuchsia::zx::Channel,
#[cfg(not(target_os = "fuchsia"))] ___T: ::fidl_next::Transport,
>
{
fn on_anon_composed(
&mut self,
event: ::fidl_next::Response<main_protocol::OnAnonComposed, ___T>,
) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send;
fn on_named_composed(
&mut self,
event: ::fidl_next::Response<main_protocol::OnNamedComposed, ___T>,
) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send;
fn on_import(
&mut self,
event: ::fidl_next::Response<main_protocol::OnImport, ___T>,
) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send;
fn on_local(
&mut self,
event: ::fidl_next::Response<main_protocol::OnLocal, ___T>,
) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send;
fn on_anon(
&mut self,
event: ::fidl_next::Response<main_protocol::OnAnon, ___T>,
) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send;
}
impl<___T> MainProtocolClientHandler<___T> for ::fidl_next::IgnoreEvents
where
___T: ::fidl_next::Transport,
{
async fn on_anon_composed(
&mut self,
_: ::fidl_next::Response<main_protocol::OnAnonComposed, ___T>,
) {
}
async fn on_named_composed(
&mut self,
_: ::fidl_next::Response<main_protocol::OnNamedComposed, ___T>,
) {
}
async fn on_import(&mut self, _: ::fidl_next::Response<main_protocol::OnImport, ___T>) {}
async fn on_local(&mut self, _: ::fidl_next::Response<main_protocol::OnLocal, ___T>) {}
async fn on_anon(&mut self, _: ::fidl_next::Response<main_protocol::OnAnon, ___T>) {}
}
impl<___H, ___T> ::fidl_next::DispatchClientMessage<___H, ___T> for MainProtocol
where
___H: MainProtocolClientHandler<___T> + ::core::marker::Send,
___T: ::fidl_next::Transport,
<main_protocol::TwoWayAnonComposed as ::fidl_next::Method>::Response:
::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
<main_protocol::TwoWayAnonComposedWithError as ::fidl_next::Method>::Response:
::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
<main_protocol::OnAnonComposed as ::fidl_next::Method>::Response:
::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
<main_protocol::TwoWayNamedComposed as ::fidl_next::Method>::Response:
::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
<main_protocol::TwoWayNamedComposedWithError as ::fidl_next::Method>::Response:
::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
<main_protocol::OnNamedComposed as ::fidl_next::Method>::Response:
::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
<main_protocol::TwoWayImport as ::fidl_next::Method>::Response:
::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
<main_protocol::TwoWayImportWithError as ::fidl_next::Method>::Response:
::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
<main_protocol::OnImport as ::fidl_next::Method>::Response:
::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
<main_protocol::TwoWayLocal as ::fidl_next::Method>::Response:
::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
<main_protocol::TwoWayLocalWithError as ::fidl_next::Method>::Response:
::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
<main_protocol::OnLocal as ::fidl_next::Method>::Response:
::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
<main_protocol::TwoWayAnon as ::fidl_next::Method>::Response:
::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
<main_protocol::TwoWayAnonWithError as ::fidl_next::Method>::Response:
::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
<main_protocol::OnAnon as ::fidl_next::Method>::Response:
::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
{
async fn on_event(
handler: &mut ___H,
ordinal: u64,
flexibility: ::fidl_next::protocol::Flexibility,
buffer: ___T::RecvBuffer,
) -> ::core::result::Result<(), ::fidl_next::ProtocolError<___T::Error>> {
match ordinal {
9198778981238868491 => match ::fidl_next::DecoderExt::decode(buffer) {
Ok(decoded) => {
handler.on_anon_composed(decoded).await;
Ok(())
}
Err(error) => Err(::fidl_next::ProtocolError::InvalidMessage {
ordinal: 9198778981238868491,
error,
}),
},
6802961197456477674 => match ::fidl_next::DecoderExt::decode(buffer) {
Ok(decoded) => {
handler.on_named_composed(decoded).await;
Ok(())
}
Err(error) => Err(::fidl_next::ProtocolError::InvalidMessage {
ordinal: 6802961197456477674,
error,
}),
},
6584793811321990352 => match ::fidl_next::DecoderExt::decode(buffer) {
Ok(decoded) => {
handler.on_import(decoded).await;
Ok(())
}
Err(error) => Err(::fidl_next::ProtocolError::InvalidMessage {
ordinal: 6584793811321990352,
error,
}),
},
4199259762307646332 => match ::fidl_next::DecoderExt::decode(buffer) {
Ok(decoded) => {
handler.on_local(decoded).await;
Ok(())
}
Err(error) => Err(::fidl_next::ProtocolError::InvalidMessage {
ordinal: 4199259762307646332,
error,
}),
},
7275479350674227467 => match ::fidl_next::DecoderExt::decode(buffer) {
Ok(decoded) => {
handler.on_anon(decoded).await;
Ok(())
}
Err(error) => Err(::fidl_next::ProtocolError::InvalidMessage {
ordinal: 7275479350674227467,
error,
}),
},
ordinal => Err(::fidl_next::ProtocolError::UnknownOrdinal(ordinal)),
}
}
}
/// A server handler for the MainProtocol protocol.
///
/// See [`MainProtocol`] for more details.
pub trait MainProtocolServerHandler<
#[cfg(target_os = "fuchsia")] ___T: ::fidl_next::Transport = ::fidl_next::fuchsia::zx::Channel,
#[cfg(not(target_os = "fuchsia"))] ___T: ::fidl_next::Transport,
>
{
fn one_way_anon_composed(
&mut self,
request: ::fidl_next::Request<main_protocol::OneWayAnonComposed, ___T>,
) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send;
fn two_way_anon_composed(
&mut self,
request: ::fidl_next::Request<main_protocol::TwoWayAnonComposed, ___T>,
responder: ::fidl_next::Responder<main_protocol::TwoWayAnonComposed, ___T>,
) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send;
fn two_way_anon_composed_with_error(
&mut self,
request: ::fidl_next::Request<main_protocol::TwoWayAnonComposedWithError, ___T>,
responder: ::fidl_next::Responder<main_protocol::TwoWayAnonComposedWithError, ___T>,
) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send;
fn one_way_named_composed(
&mut self,
request: ::fidl_next::Request<main_protocol::OneWayNamedComposed, ___T>,
) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send;
fn two_way_named_composed(
&mut self,
request: ::fidl_next::Request<main_protocol::TwoWayNamedComposed, ___T>,
responder: ::fidl_next::Responder<main_protocol::TwoWayNamedComposed, ___T>,
) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send;
fn two_way_named_composed_with_error(
&mut self,
request: ::fidl_next::Request<main_protocol::TwoWayNamedComposedWithError, ___T>,
responder: ::fidl_next::Responder<main_protocol::TwoWayNamedComposedWithError, ___T>,
) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send;
fn one_way_import(
&mut self,
request: ::fidl_next::Request<main_protocol::OneWayImport, ___T>,
) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send;
fn two_way_import(
&mut self,
request: ::fidl_next::Request<main_protocol::TwoWayImport, ___T>,
responder: ::fidl_next::Responder<main_protocol::TwoWayImport, ___T>,
) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send;
fn two_way_import_with_error(
&mut self,
request: ::fidl_next::Request<main_protocol::TwoWayImportWithError, ___T>,
responder: ::fidl_next::Responder<main_protocol::TwoWayImportWithError, ___T>,
) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send;
fn one_way_local(
&mut self,
request: ::fidl_next::Request<main_protocol::OneWayLocal, ___T>,
) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send;
fn two_way_local(
&mut self,
request: ::fidl_next::Request<main_protocol::TwoWayLocal, ___T>,
responder: ::fidl_next::Responder<main_protocol::TwoWayLocal, ___T>,
) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send;
fn two_way_local_with_error(
&mut self,
request: ::fidl_next::Request<main_protocol::TwoWayLocalWithError, ___T>,
responder: ::fidl_next::Responder<main_protocol::TwoWayLocalWithError, ___T>,
) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send;
fn one_way_anon(
&mut self,
request: ::fidl_next::Request<main_protocol::OneWayAnon, ___T>,
) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send;
fn two_way_anon(
&mut self,
request: ::fidl_next::Request<main_protocol::TwoWayAnon, ___T>,
responder: ::fidl_next::Responder<main_protocol::TwoWayAnon, ___T>,
) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send;
fn two_way_anon_with_error(
&mut self,
request: ::fidl_next::Request<main_protocol::TwoWayAnonWithError, ___T>,
responder: ::fidl_next::Responder<main_protocol::TwoWayAnonWithError, ___T>,
) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send;
}
impl<___H, ___T> ::fidl_next::DispatchServerMessage<___H, ___T> for MainProtocol
where
___H: MainProtocolServerHandler<___T> + ::core::marker::Send,
___T: ::fidl_next::Transport,
<main_protocol::OneWayAnonComposed as ::fidl_next::Method>::Request:
::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
<main_protocol::TwoWayAnonComposed as ::fidl_next::Method>::Request:
::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
<main_protocol::TwoWayAnonComposedWithError as ::fidl_next::Method>::Request:
::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
<main_protocol::OneWayNamedComposed as ::fidl_next::Method>::Request:
::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
<main_protocol::TwoWayNamedComposed as ::fidl_next::Method>::Request:
::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
<main_protocol::TwoWayNamedComposedWithError as ::fidl_next::Method>::Request:
::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
<main_protocol::OneWayImport as ::fidl_next::Method>::Request:
::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
<main_protocol::TwoWayImport as ::fidl_next::Method>::Request:
::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
<main_protocol::TwoWayImportWithError as ::fidl_next::Method>::Request:
::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
<main_protocol::OneWayLocal as ::fidl_next::Method>::Request:
::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
<main_protocol::TwoWayLocal as ::fidl_next::Method>::Request:
::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
<main_protocol::TwoWayLocalWithError as ::fidl_next::Method>::Request:
::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
<main_protocol::OneWayAnon as ::fidl_next::Method>::Request:
::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
<main_protocol::TwoWayAnon as ::fidl_next::Method>::Request:
::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
<main_protocol::TwoWayAnonWithError as ::fidl_next::Method>::Request:
::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
{
async fn on_one_way(
handler: &mut ___H,
ordinal: u64,
flexibility: ::fidl_next::protocol::Flexibility,
buffer: ___T::RecvBuffer,
) -> ::core::result::Result<
(),
::fidl_next::ProtocolError<<___T as ::fidl_next::Transport>::Error>,
> {
match ordinal {
467706262354916833 => match ::fidl_next::DecoderExt::decode(buffer) {
Ok(decoded) => {
handler.one_way_anon_composed(decoded).await;
Ok(())
}
Err(error) => Err(::fidl_next::ProtocolError::InvalidMessage {
ordinal: 467706262354916833,
error,
}),
},
6735359826241449560 => match ::fidl_next::DecoderExt::decode(buffer) {
Ok(decoded) => {
handler.one_way_named_composed(decoded).await;
Ok(())
}
Err(error) => Err(::fidl_next::ProtocolError::InvalidMessage {
ordinal: 6735359826241449560,
error,
}),
},
374039999976906043 => match ::fidl_next::DecoderExt::decode(buffer) {
Ok(decoded) => {
handler.one_way_import(decoded).await;
Ok(())
}
Err(error) => Err(::fidl_next::ProtocolError::InvalidMessage {
ordinal: 374039999976906043,
error,
}),
},
6085941264859402051 => match ::fidl_next::DecoderExt::decode(buffer) {
Ok(decoded) => {
handler.one_way_local(decoded).await;
Ok(())
}
Err(error) => Err(::fidl_next::ProtocolError::InvalidMessage {
ordinal: 6085941264859402051,
error,
}),
},
4203317713771984620 => match ::fidl_next::DecoderExt::decode(buffer) {
Ok(decoded) => {
handler.one_way_anon(decoded).await;
Ok(())
}
Err(error) => Err(::fidl_next::ProtocolError::InvalidMessage {
ordinal: 4203317713771984620,
error,
}),
},
ordinal => Err(::fidl_next::ProtocolError::UnknownOrdinal(ordinal)),
}
}
async fn on_two_way(
handler: &mut ___H,
ordinal: u64,
flexibility: ::fidl_next::protocol::Flexibility,
buffer: ___T::RecvBuffer,
responder: ::fidl_next::protocol::Responder<___T>,
) -> ::core::result::Result<
(),
::fidl_next::ProtocolError<<___T as ::fidl_next::Transport>::Error>,
> {
match ordinal {
1634702755099390832 => {
let responder = ::fidl_next::Responder::from_untyped(responder);
match ::fidl_next::DecoderExt::decode(buffer) {
Ok(decoded) => {
handler.two_way_anon_composed(decoded, responder).await;
Ok(())
}
Err(error) => Err(::fidl_next::ProtocolError::InvalidMessage {
ordinal: 1634702755099390832,
error,
}),
}
}
3374101322700362141 => {
let responder = ::fidl_next::Responder::from_untyped(responder);
match ::fidl_next::DecoderExt::decode(buffer) {
Ok(decoded) => {
handler.two_way_anon_composed_with_error(decoded, responder).await;
Ok(())
}
Err(error) => Err(::fidl_next::ProtocolError::InvalidMessage {
ordinal: 3374101322700362141,
error,
}),
}
}
1110122450485917712 => {
let responder = ::fidl_next::Responder::from_untyped(responder);
match ::fidl_next::DecoderExt::decode(buffer) {
Ok(decoded) => {
handler.two_way_named_composed(decoded, responder).await;
Ok(())
}
Err(error) => Err(::fidl_next::ProtocolError::InvalidMessage {
ordinal: 1110122450485917712,
error,
}),
}
}
3520341666774118271 => {
let responder = ::fidl_next::Responder::from_untyped(responder);
match ::fidl_next::DecoderExt::decode(buffer) {
Ok(decoded) => {
handler.two_way_named_composed_with_error(decoded, responder).await;
Ok(())
}
Err(error) => Err(::fidl_next::ProtocolError::InvalidMessage {
ordinal: 3520341666774118271,
error,
}),
}
}
3167860988423964164 => {
let responder = ::fidl_next::Responder::from_untyped(responder);
match ::fidl_next::DecoderExt::decode(buffer) {
Ok(decoded) => {
handler.two_way_import(decoded, responder).await;
Ok(())
}
Err(error) => Err(::fidl_next::ProtocolError::InvalidMessage {
ordinal: 3167860988423964164,
error,
}),
}
}
4837028007581646602 => {
let responder = ::fidl_next::Responder::from_untyped(responder);
match ::fidl_next::DecoderExt::decode(buffer) {
Ok(decoded) => {
handler.two_way_import_with_error(decoded, responder).await;
Ok(())
}
Err(error) => Err(::fidl_next::ProtocolError::InvalidMessage {
ordinal: 4837028007581646602,
error,
}),
}
}
7763901300032164763 => {
let responder = ::fidl_next::Responder::from_untyped(responder);
match ::fidl_next::DecoderExt::decode(buffer) {
Ok(decoded) => {
handler.two_way_local(decoded, responder).await;
Ok(())
}
Err(error) => Err(::fidl_next::ProtocolError::InvalidMessage {
ordinal: 7763901300032164763,
error,
}),
}
}
5609487496960056151 => {
let responder = ::fidl_next::Responder::from_untyped(responder);
match ::fidl_next::DecoderExt::decode(buffer) {
Ok(decoded) => {
handler.two_way_local_with_error(decoded, responder).await;
Ok(())
}
Err(error) => Err(::fidl_next::ProtocolError::InvalidMessage {
ordinal: 5609487496960056151,
error,
}),
}
}
7435080039097281487 => {
let responder = ::fidl_next::Responder::from_untyped(responder);
match ::fidl_next::DecoderExt::decode(buffer) {
Ok(decoded) => {
handler.two_way_anon(decoded, responder).await;
Ok(())
}
Err(error) => Err(::fidl_next::ProtocolError::InvalidMessage {
ordinal: 7435080039097281487,
error,
}),
}
}
7770394869745610225 => {
let responder = ::fidl_next::Responder::from_untyped(responder);
match ::fidl_next::DecoderExt::decode(buffer) {
Ok(decoded) => {
handler.two_way_anon_with_error(decoded, responder).await;
Ok(())
}
Err(error) => Err(::fidl_next::ProtocolError::InvalidMessage {
ordinal: 7770394869745610225,
error,
}),
}
}
ordinal => Err(::fidl_next::ProtocolError::UnknownOrdinal(ordinal)),
}
}
}
/// The type corresponding to the OpenProtocol protocol.
#[derive(PartialEq, Debug)]
pub struct OpenProtocol;
#[cfg(target_os = "fuchsia")]
impl ::fidl_next::HasTransport for OpenProtocol {
type Transport = ::fidl_next::fuchsia::zx::Channel;
}
pub mod open_protocol {
pub mod prelude {
pub use crate::{
OpenProtocol, OpenProtocolClientHandler, OpenProtocolServerHandler, open_protocol,
};
pub use ::fidl_next_test_protocollayouts_imported::natural::ComposedOpenProtocolFlexibleEventRequest;
pub use ::fidl_next_test_protocollayouts_imported::natural::ComposedOpenProtocolFlexibleOneWayRequest;
pub use ::fidl_next_test_protocollayouts_imported::natural::ComposedOpenProtocolFlexibleTwoWayNoErrorRequest;
pub use ::fidl_next_test_protocollayouts_imported::natural::ComposedOpenProtocolFlexibleTwoWayWithErrorRequest;
pub use ::fidl_next_test_protocollayouts_imported::natural::ComposedOpenProtocolStrictEventRequest;
pub use ::fidl_next_test_protocollayouts_imported::natural::ComposedOpenProtocolStrictOneWayRequest;
pub use ::fidl_next_test_protocollayouts_imported::natural::ComposedOpenProtocolStrictTwoWayNoErrorRequest;
pub use ::fidl_next_test_protocollayouts_imported::natural::ComposedOpenProtocolStrictTwoWayNoErrorResponse;
pub use ::fidl_next_test_protocollayouts_imported::natural::ComposedOpenProtocolStrictTwoWayWithErrorRequest;
pub use ::fidl_next_test_protocollayouts_imported::natural::ComposedOpenProtocolFlexibleTwoWayNoErrorResponse;
pub use ::fidl_next_test_protocollayouts_imported::natural::ComposedOpenProtocolFlexibleTwoWayWithErrorResponse;
pub use ::fidl_next_test_protocollayouts_imported::natural::ComposedOpenProtocolStrictTwoWayWithErrorResponse;
pub use ::fidl_next_test_protocollayouts_imported::natural::ImportStructPayload;
}
pub struct FlexibleOneWay;
impl ::fidl_next::Method for FlexibleOneWay {
const ORDINAL: u64 = 3516779973873009953;
const FLEXIBILITY: ::fidl_next::protocol::Flexibility =
::fidl_next::protocol::Flexibility::Flexible;
type Protocol = crate::OpenProtocol;
type Request = ::fidl_next_test_protocollayouts_imported::wire::ComposedOpenProtocolFlexibleOneWayRequest;
type Response = ::fidl_next::util::Never;
}
pub struct FlexibleTwoWayNoError;
impl ::fidl_next::Method for FlexibleTwoWayNoError {
const ORDINAL: u64 = 5572735551219638488;
const FLEXIBILITY: ::fidl_next::protocol::Flexibility =
::fidl_next::protocol::Flexibility::Flexible;
type Protocol = crate::OpenProtocol;
type Request = ::fidl_next_test_protocollayouts_imported::wire::ComposedOpenProtocolFlexibleTwoWayNoErrorRequest;
type Response =
::fidl_next::WireFlexible<
'static,
::fidl_next_test_protocollayouts_imported::wire::ComposedOpenProtocolFlexibleTwoWayNoErrorResponse
>
;
}
impl<___R> ::fidl_next::Respond<___R> for FlexibleTwoWayNoError {
type Output =
::fidl_next::Flexible<::fidl_next_test_protocollayouts_imported::generic::ComposedOpenProtocolFlexibleTwoWayNoErrorResponse<___R>>
;
fn respond(response: ___R) -> Self::Output {
::fidl_next::Flexible::Ok(
::fidl_next_test_protocollayouts_imported::generic::ComposedOpenProtocolFlexibleTwoWayNoErrorResponse {
value: response,
}
)
}
}
pub struct FlexibleTwoWayWithError;
impl ::fidl_next::Method for FlexibleTwoWayWithError {
const ORDINAL: u64 = 3504132377779779458;
const FLEXIBILITY: ::fidl_next::protocol::Flexibility =
::fidl_next::protocol::Flexibility::Flexible;
type Protocol = crate::OpenProtocol;
type Request = ::fidl_next_test_protocollayouts_imported::wire::ComposedOpenProtocolFlexibleTwoWayWithErrorRequest;
type Response =
::fidl_next::WireFlexibleResult
<
'static,
::fidl_next_test_protocollayouts_imported::wire::ComposedOpenProtocolFlexibleTwoWayWithErrorResponse,
::fidl_next::WireI32,
>
;
}
impl<___R> ::fidl_next::Respond<___R> for FlexibleTwoWayWithError {
type Output =
::fidl_next::FlexibleResult
<
::fidl_next_test_protocollayouts_imported::generic::ComposedOpenProtocolFlexibleTwoWayWithErrorResponse<___R>,
::fidl_next::util::Never,
>;
fn respond(response: ___R) -> Self::Output {
::fidl_next::FlexibleResult::Ok
(::fidl_next_test_protocollayouts_imported::generic::ComposedOpenProtocolFlexibleTwoWayWithErrorResponse {
value: response,
})
}
}
impl<___R> ::fidl_next::RespondErr<___R> for FlexibleTwoWayWithError {
type Output = ::fidl_next::FlexibleResult<::fidl_next::util::Never, ___R>;
fn respond_err(response: ___R) -> Self::Output {
::fidl_next::FlexibleResult::Err(response)
}
}
pub struct FlexibleEvent;
impl ::fidl_next::Method for FlexibleEvent {
const ORDINAL: u64 = 9152311661656086484;
const FLEXIBILITY: ::fidl_next::protocol::Flexibility =
::fidl_next::protocol::Flexibility::Flexible;
type Protocol = crate::OpenProtocol;
type Request = ::fidl_next::util::Never;
type Response =
::fidl_next_test_protocollayouts_imported::wire::ComposedOpenProtocolFlexibleEventRequest
;
}
pub struct StrictOneWay;
impl ::fidl_next::Method for StrictOneWay {
const ORDINAL: u64 = 8790149921168801703;
const FLEXIBILITY: ::fidl_next::protocol::Flexibility =
::fidl_next::protocol::Flexibility::Strict;
type Protocol = crate::OpenProtocol;
type Request = ::fidl_next_test_protocollayouts_imported::wire::ComposedOpenProtocolStrictOneWayRequest;
type Response = ::fidl_next::util::Never;
}
pub struct StrictTwoWayNoError;
impl ::fidl_next::Method for StrictTwoWayNoError {
const ORDINAL: u64 = 3690935745864999300;
const FLEXIBILITY: ::fidl_next::protocol::Flexibility =
::fidl_next::protocol::Flexibility::Strict;
type Protocol = crate::OpenProtocol;
type Request = ::fidl_next_test_protocollayouts_imported::wire::ComposedOpenProtocolStrictTwoWayNoErrorRequest;
type Response =
::fidl_next_test_protocollayouts_imported::wire::ComposedOpenProtocolStrictTwoWayNoErrorResponse
;
}
impl<___R> ::fidl_next::Respond<___R> for StrictTwoWayNoError {
type Output =
::fidl_next_test_protocollayouts_imported::generic::ComposedOpenProtocolStrictTwoWayNoErrorResponse<___R>
;
fn respond(response: ___R) -> Self::Output {
::fidl_next_test_protocollayouts_imported::generic::ComposedOpenProtocolStrictTwoWayNoErrorResponse {
value: response,
}
}
}
pub struct StrictTwoWayWithError;
impl ::fidl_next::Method for StrictTwoWayWithError {
const ORDINAL: u64 = 5364624536440098871;
const FLEXIBILITY: ::fidl_next::protocol::Flexibility =
::fidl_next::protocol::Flexibility::Strict;
type Protocol = crate::OpenProtocol;
type Request = ::fidl_next_test_protocollayouts_imported::wire::ComposedOpenProtocolStrictTwoWayWithErrorRequest;
type Response =
::fidl_next::WireResult
<
'static,
::fidl_next_test_protocollayouts_imported::wire::ComposedOpenProtocolStrictTwoWayWithErrorResponse,
::fidl_next::WireI32,
>
;
}
impl<___R> ::fidl_next::Respond<___R> for StrictTwoWayWithError {
type Output =
::core::result::Result
<
::fidl_next_test_protocollayouts_imported::generic::ComposedOpenProtocolStrictTwoWayWithErrorResponse<___R>,
::fidl_next::util::Never,
>;
fn respond(response: ___R) -> Self::Output {
::core::result::Result::Ok
(::fidl_next_test_protocollayouts_imported::generic::ComposedOpenProtocolStrictTwoWayWithErrorResponse {
value: response,
})
}
}
impl<___R> ::fidl_next::RespondErr<___R> for StrictTwoWayWithError {
type Output = ::core::result::Result<::fidl_next::util::Never, ___R>;
fn respond_err(response: ___R) -> Self::Output {
::core::result::Result::Err(response)
}
}
pub struct StrictEvent;
impl ::fidl_next::Method for StrictEvent {
const ORDINAL: u64 = 3921073878922106269;
const FLEXIBILITY: ::fidl_next::protocol::Flexibility =
::fidl_next::protocol::Flexibility::Strict;
type Protocol = crate::OpenProtocol;
type Request = ::fidl_next::util::Never;
type Response =
::fidl_next_test_protocollayouts_imported::wire::ComposedOpenProtocolStrictEventRequest;
}
pub struct FlexibleOneWayNamedPayload;
impl ::fidl_next::Method for FlexibleOneWayNamedPayload {
const ORDINAL: u64 = 1525606789639046512;
const FLEXIBILITY: ::fidl_next::protocol::Flexibility =
::fidl_next::protocol::Flexibility::Flexible;
type Protocol = crate::OpenProtocol;
type Request = ::fidl_next_test_protocollayouts_imported::wire::ImportStructPayload;
type Response = ::fidl_next::util::Never;
}
mod ___detail {
unsafe impl<___T> ::fidl_next::HasConnectionHandles<___T> for crate::OpenProtocol
where
___T: ::fidl_next::Transport,
{
type Client = OpenProtocolClient<___T>;
type Server = OpenProtocolServer<___T>;
}
/// The client for the `OpenProtocol` protocol.
#[repr(transparent)]
pub struct OpenProtocolClient<___T: ::fidl_next::Transport> {
#[allow(dead_code)]
client: ::fidl_next::protocol::Client<___T>,
}
impl<___T> OpenProtocolClient<___T>
where
___T: ::fidl_next::Transport,
{
pub fn flexible_one_way(
&self,
value: impl ::fidl_next::Encode<
::fidl_next::WireI32,
<___T as ::fidl_next::Transport>::SendBuffer,
>,
) -> ::fidl_next::SendFuture<'_, ___T>
where
<___T as ::fidl_next::Transport>::SendBuffer:
::fidl_next::encoder::InternalHandleEncoder,
{
self.flexible_one_way_with(::fidl_next_test_protocollayouts_imported::generic::ComposedOpenProtocolFlexibleOneWayRequest {
value,
})
}
pub fn flexible_one_way_with<___R>(
&self,
request: ___R,
) -> ::fidl_next::SendFuture<'_, ___T>
where
___R: ::fidl_next::Encode<
::fidl_next_test_protocollayouts_imported::wire::ComposedOpenProtocolFlexibleOneWayRequest,
<___T as ::fidl_next::Transport>::SendBuffer,
>,
{
::fidl_next::SendFuture::from_untyped(self.client.send_one_way(
3516779973873009953,
<super::FlexibleOneWay as ::fidl_next::Method>::FLEXIBILITY,
request,
))
}
pub fn flexible_two_way_no_error(
&self,
value: impl ::fidl_next::Encode<
::fidl_next::WireI32,
<___T as ::fidl_next::Transport>::SendBuffer,
>,
) -> ::fidl_next::TwoWayFuture<'_, super::FlexibleTwoWayNoError, ___T>
where
<___T as ::fidl_next::Transport>::SendBuffer:
::fidl_next::encoder::InternalHandleEncoder,
{
self.flexible_two_way_no_error_with(::fidl_next_test_protocollayouts_imported::generic::ComposedOpenProtocolFlexibleTwoWayNoErrorRequest {
value,
})
}
pub fn flexible_two_way_no_error_with<___R>(
&self,
request: ___R,
) -> ::fidl_next::TwoWayFuture<'_, super::FlexibleTwoWayNoError, ___T>
where
___R: ::fidl_next::Encode<
::fidl_next_test_protocollayouts_imported::wire::ComposedOpenProtocolFlexibleTwoWayNoErrorRequest,
<___T as ::fidl_next::Transport>::SendBuffer,
>,
{
::fidl_next::TwoWayFuture::from_untyped(self.client.send_two_way(
5572735551219638488,
<super::FlexibleTwoWayNoError as ::fidl_next::Method>::FLEXIBILITY,
request,
))
}
pub fn flexible_two_way_with_error(
&self,
value: impl ::fidl_next::Encode<
::fidl_next::WireI32,
<___T as ::fidl_next::Transport>::SendBuffer,
>,
) -> ::fidl_next::TwoWayFuture<'_, super::FlexibleTwoWayWithError, ___T>
where
<___T as ::fidl_next::Transport>::SendBuffer:
::fidl_next::encoder::InternalHandleEncoder,
{
self.flexible_two_way_with_error_with(::fidl_next_test_protocollayouts_imported::generic::ComposedOpenProtocolFlexibleTwoWayWithErrorRequest {
value,
})
}
pub fn flexible_two_way_with_error_with<___R>(
&self,
request: ___R,
) -> ::fidl_next::TwoWayFuture<'_, super::FlexibleTwoWayWithError, ___T>
where
___R: ::fidl_next::Encode<
::fidl_next_test_protocollayouts_imported::wire::ComposedOpenProtocolFlexibleTwoWayWithErrorRequest,
<___T as ::fidl_next::Transport>::SendBuffer,
>,
{
::fidl_next::TwoWayFuture::from_untyped(self.client.send_two_way(
3504132377779779458,
<super::FlexibleTwoWayWithError as ::fidl_next::Method>::FLEXIBILITY,
request,
))
}
pub fn strict_one_way(
&self,
value: impl ::fidl_next::Encode<
::fidl_next::WireI32,
<___T as ::fidl_next::Transport>::SendBuffer,
>,
) -> ::fidl_next::SendFuture<'_, ___T>
where
<___T as ::fidl_next::Transport>::SendBuffer:
::fidl_next::encoder::InternalHandleEncoder,
{
self.strict_one_way_with(::fidl_next_test_protocollayouts_imported::generic::ComposedOpenProtocolStrictOneWayRequest {
value,
})
}
pub fn strict_one_way_with<___R>(
&self,
request: ___R,
) -> ::fidl_next::SendFuture<'_, ___T>
where
___R: ::fidl_next::Encode<
::fidl_next_test_protocollayouts_imported::wire::ComposedOpenProtocolStrictOneWayRequest,
<___T as ::fidl_next::Transport>::SendBuffer,
>,
{
::fidl_next::SendFuture::from_untyped(self.client.send_one_way(
8790149921168801703,
<super::StrictOneWay as ::fidl_next::Method>::FLEXIBILITY,
request,
))
}
pub fn strict_two_way_no_error(
&self,
value: impl ::fidl_next::Encode<
::fidl_next::WireI32,
<___T as ::fidl_next::Transport>::SendBuffer,
>,
) -> ::fidl_next::TwoWayFuture<'_, super::StrictTwoWayNoError, ___T>
where
<___T as ::fidl_next::Transport>::SendBuffer:
::fidl_next::encoder::InternalHandleEncoder,
{
self.strict_two_way_no_error_with(::fidl_next_test_protocollayouts_imported::generic::ComposedOpenProtocolStrictTwoWayNoErrorRequest {
value,
})
}
pub fn strict_two_way_no_error_with<___R>(
&self,
request: ___R,
) -> ::fidl_next::TwoWayFuture<'_, super::StrictTwoWayNoError, ___T>
where
___R: ::fidl_next::Encode<
::fidl_next_test_protocollayouts_imported::wire::ComposedOpenProtocolStrictTwoWayNoErrorRequest,
<___T as ::fidl_next::Transport>::SendBuffer,
>,
{
::fidl_next::TwoWayFuture::from_untyped(self.client.send_two_way(
3690935745864999300,
<super::StrictTwoWayNoError as ::fidl_next::Method>::FLEXIBILITY,
request,
))
}
pub fn strict_two_way_with_error(
&self,
value: impl ::fidl_next::Encode<
::fidl_next::WireI32,
<___T as ::fidl_next::Transport>::SendBuffer,
>,
) -> ::fidl_next::TwoWayFuture<'_, super::StrictTwoWayWithError, ___T>
where
<___T as ::fidl_next::Transport>::SendBuffer:
::fidl_next::encoder::InternalHandleEncoder,
{
self.strict_two_way_with_error_with(::fidl_next_test_protocollayouts_imported::generic::ComposedOpenProtocolStrictTwoWayWithErrorRequest {
value,
})
}
pub fn strict_two_way_with_error_with<___R>(
&self,
request: ___R,
) -> ::fidl_next::TwoWayFuture<'_, super::StrictTwoWayWithError, ___T>
where
___R: ::fidl_next::Encode<
::fidl_next_test_protocollayouts_imported::wire::ComposedOpenProtocolStrictTwoWayWithErrorRequest,
<___T as ::fidl_next::Transport>::SendBuffer,
>,
{
::fidl_next::TwoWayFuture::from_untyped(self.client.send_two_way(
5364624536440098871,
<super::StrictTwoWayWithError as ::fidl_next::Method>::FLEXIBILITY,
request,
))
}
pub fn flexible_one_way_named_payload(
&self,
value: impl ::fidl_next::Encode<
::fidl_next::WireI32,
<___T as ::fidl_next::Transport>::SendBuffer,
>,
) -> ::fidl_next::SendFuture<'_, ___T>
where
<___T as ::fidl_next::Transport>::SendBuffer:
::fidl_next::encoder::InternalHandleEncoder,
{
self.flexible_one_way_named_payload_with(
::fidl_next_test_protocollayouts_imported::generic::ImportStructPayload {
value,
},
)
}
pub fn flexible_one_way_named_payload_with<___R>(
&self,
request: ___R,
) -> ::fidl_next::SendFuture<'_, ___T>
where
___R: ::fidl_next::Encode<
::fidl_next_test_protocollayouts_imported::wire::ImportStructPayload,
<___T as ::fidl_next::Transport>::SendBuffer,
>,
{
::fidl_next::SendFuture::from_untyped(self.client.send_one_way(
1525606789639046512,
<super::FlexibleOneWayNamedPayload as ::fidl_next::Method>::FLEXIBILITY,
request,
))
}
}
/// The server for the `OpenProtocol` protocol.
#[repr(transparent)]
pub struct OpenProtocolServer<___T: ::fidl_next::Transport> {
server: ::fidl_next::protocol::Server<___T>,
}
impl<___T> OpenProtocolServer<___T>
where
___T: ::fidl_next::Transport,
{
pub fn flexible_event(
&self,
value: impl ::fidl_next::Encode<
::fidl_next::WireI32,
<___T as ::fidl_next::Transport>::SendBuffer,
>,
) -> ::fidl_next::SendFuture<'_, ___T>
where
<___T as ::fidl_next::Transport>::SendBuffer:
::fidl_next::encoder::InternalHandleEncoder,
{
self.flexible_event_with(::fidl_next_test_protocollayouts_imported::generic::ComposedOpenProtocolFlexibleEventRequest {
value,
})
}
pub fn flexible_event_with<___R>(
&self,
request: ___R,
) -> ::fidl_next::SendFuture<'_, ___T>
where
___R: ::fidl_next::Encode<
<super::FlexibleEvent as ::fidl_next::Method>::Response,
<___T as ::fidl_next::Transport>::SendBuffer,
>,
{
::fidl_next::SendFuture::from_untyped(self.server.send_event(
9152311661656086484,
<super::FlexibleEvent as ::fidl_next::Method>::FLEXIBILITY,
request,
))
}
pub fn strict_event(
&self,
value: impl ::fidl_next::Encode<
::fidl_next::WireI32,
<___T as ::fidl_next::Transport>::SendBuffer,
>,
) -> ::fidl_next::SendFuture<'_, ___T>
where
<___T as ::fidl_next::Transport>::SendBuffer:
::fidl_next::encoder::InternalHandleEncoder,
{
self.strict_event_with(::fidl_next_test_protocollayouts_imported::generic::ComposedOpenProtocolStrictEventRequest {
value,
})
}
pub fn strict_event_with<___R>(
&self,
request: ___R,
) -> ::fidl_next::SendFuture<'_, ___T>
where
___R: ::fidl_next::Encode<
<super::StrictEvent as ::fidl_next::Method>::Response,
<___T as ::fidl_next::Transport>::SendBuffer,
>,
{
::fidl_next::SendFuture::from_untyped(self.server.send_event(
3921073878922106269,
<super::StrictEvent as ::fidl_next::Method>::FLEXIBILITY,
request,
))
}
}
}
}
/// A client handler for the OpenProtocol protocol.
///
/// See [`OpenProtocol`] for more details.
pub trait OpenProtocolClientHandler<
#[cfg(target_os = "fuchsia")] ___T: ::fidl_next::Transport = ::fidl_next::fuchsia::zx::Channel,
#[cfg(not(target_os = "fuchsia"))] ___T: ::fidl_next::Transport,
>
{
fn flexible_event(
&mut self,
event: ::fidl_next::Response<open_protocol::FlexibleEvent, ___T>,
) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send;
fn strict_event(
&mut self,
event: ::fidl_next::Response<open_protocol::StrictEvent, ___T>,
) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send;
fn on_unknown_interaction(
&mut self,
ordinal: u64,
) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send {
::core::future::ready(())
}
}
impl<___T> OpenProtocolClientHandler<___T> for ::fidl_next::IgnoreEvents
where
___T: ::fidl_next::Transport,
{
async fn flexible_event(
&mut self,
_: ::fidl_next::Response<open_protocol::FlexibleEvent, ___T>,
) {
}
async fn strict_event(&mut self, _: ::fidl_next::Response<open_protocol::StrictEvent, ___T>) {}
async fn on_unknown_interaction(&mut self, _: u64) {}
}
impl<___H, ___T> ::fidl_next::DispatchClientMessage<___H, ___T> for OpenProtocol
where
___H: OpenProtocolClientHandler<___T> + ::core::marker::Send,
___T: ::fidl_next::Transport,
<open_protocol::FlexibleTwoWayNoError as ::fidl_next::Method>::Response:
::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
<open_protocol::FlexibleTwoWayWithError as ::fidl_next::Method>::Response:
::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
<open_protocol::FlexibleEvent as ::fidl_next::Method>::Response:
::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
<open_protocol::StrictTwoWayNoError as ::fidl_next::Method>::Response:
::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
<open_protocol::StrictTwoWayWithError as ::fidl_next::Method>::Response:
::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
<open_protocol::StrictEvent as ::fidl_next::Method>::Response:
::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
{
async fn on_event(
handler: &mut ___H,
ordinal: u64,
flexibility: ::fidl_next::protocol::Flexibility,
buffer: ___T::RecvBuffer,
) -> ::core::result::Result<(), ::fidl_next::ProtocolError<___T::Error>> {
match ordinal {
9152311661656086484 => match ::fidl_next::DecoderExt::decode(buffer) {
Ok(decoded) => {
handler.flexible_event(decoded).await;
Ok(())
}
Err(error) => Err(::fidl_next::ProtocolError::InvalidMessage {
ordinal: 9152311661656086484,
error,
}),
},
3921073878922106269 => match ::fidl_next::DecoderExt::decode(buffer) {
Ok(decoded) => {
handler.strict_event(decoded).await;
Ok(())
}
Err(error) => Err(::fidl_next::ProtocolError::InvalidMessage {
ordinal: 3921073878922106269,
error,
}),
},
ordinal => {
handler.on_unknown_interaction(ordinal).await;
if ::core::matches!(flexibility, ::fidl_next::protocol::Flexibility::Strict) {
Err(::fidl_next::ProtocolError::UnknownOrdinal(ordinal))
} else {
Ok(())
}
}
}
}
}
/// A server handler for the OpenProtocol protocol.
///
/// See [`OpenProtocol`] for more details.
pub trait OpenProtocolServerHandler<
#[cfg(target_os = "fuchsia")] ___T: ::fidl_next::Transport = ::fidl_next::fuchsia::zx::Channel,
#[cfg(not(target_os = "fuchsia"))] ___T: ::fidl_next::Transport,
>
{
fn flexible_one_way(
&mut self,
request: ::fidl_next::Request<open_protocol::FlexibleOneWay, ___T>,
) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send;
fn flexible_two_way_no_error(
&mut self,
request: ::fidl_next::Request<open_protocol::FlexibleTwoWayNoError, ___T>,
responder: ::fidl_next::Responder<open_protocol::FlexibleTwoWayNoError, ___T>,
) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send;
fn flexible_two_way_with_error(
&mut self,
request: ::fidl_next::Request<open_protocol::FlexibleTwoWayWithError, ___T>,
responder: ::fidl_next::Responder<open_protocol::FlexibleTwoWayWithError, ___T>,
) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send;
fn strict_one_way(
&mut self,
request: ::fidl_next::Request<open_protocol::StrictOneWay, ___T>,
) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send;
fn strict_two_way_no_error(
&mut self,
request: ::fidl_next::Request<open_protocol::StrictTwoWayNoError, ___T>,
responder: ::fidl_next::Responder<open_protocol::StrictTwoWayNoError, ___T>,
) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send;
fn strict_two_way_with_error(
&mut self,
request: ::fidl_next::Request<open_protocol::StrictTwoWayWithError, ___T>,
responder: ::fidl_next::Responder<open_protocol::StrictTwoWayWithError, ___T>,
) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send;
fn flexible_one_way_named_payload(
&mut self,
request: ::fidl_next::Request<open_protocol::FlexibleOneWayNamedPayload, ___T>,
) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send;
fn on_unknown_interaction(
&mut self,
ordinal: u64,
) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send {
::core::future::ready(())
}
}
impl<___H, ___T> ::fidl_next::DispatchServerMessage<___H, ___T> for OpenProtocol
where
___H: OpenProtocolServerHandler<___T> + ::core::marker::Send,
___T: ::fidl_next::Transport,
<open_protocol::FlexibleOneWay as ::fidl_next::Method>::Request:
::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
<open_protocol::FlexibleTwoWayNoError as ::fidl_next::Method>::Request:
::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
<open_protocol::FlexibleTwoWayWithError as ::fidl_next::Method>::Request:
::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
<open_protocol::StrictOneWay as ::fidl_next::Method>::Request:
::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
<open_protocol::StrictTwoWayNoError as ::fidl_next::Method>::Request:
::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
<open_protocol::StrictTwoWayWithError as ::fidl_next::Method>::Request:
::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
<open_protocol::FlexibleOneWayNamedPayload as ::fidl_next::Method>::Request:
::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
{
async fn on_one_way(
handler: &mut ___H,
ordinal: u64,
flexibility: ::fidl_next::protocol::Flexibility,
buffer: ___T::RecvBuffer,
) -> ::core::result::Result<
(),
::fidl_next::ProtocolError<<___T as ::fidl_next::Transport>::Error>,
> {
match ordinal {
3516779973873009953 => match ::fidl_next::DecoderExt::decode(buffer) {
Ok(decoded) => {
handler.flexible_one_way(decoded).await;
Ok(())
}
Err(error) => Err(::fidl_next::ProtocolError::InvalidMessage {
ordinal: 3516779973873009953,
error,
}),
},
8790149921168801703 => match ::fidl_next::DecoderExt::decode(buffer) {
Ok(decoded) => {
handler.strict_one_way(decoded).await;
Ok(())
}
Err(error) => Err(::fidl_next::ProtocolError::InvalidMessage {
ordinal: 8790149921168801703,
error,
}),
},
1525606789639046512 => match ::fidl_next::DecoderExt::decode(buffer) {
Ok(decoded) => {
handler.flexible_one_way_named_payload(decoded).await;
Ok(())
}
Err(error) => Err(::fidl_next::ProtocolError::InvalidMessage {
ordinal: 1525606789639046512,
error,
}),
},
ordinal => {
handler.on_unknown_interaction(ordinal).await;
if ::core::matches!(flexibility, ::fidl_next::protocol::Flexibility::Strict) {
Err(::fidl_next::ProtocolError::UnknownOrdinal(ordinal))
} else {
Ok(())
}
}
}
}
async fn on_two_way(
handler: &mut ___H,
ordinal: u64,
flexibility: ::fidl_next::protocol::Flexibility,
buffer: ___T::RecvBuffer,
responder: ::fidl_next::protocol::Responder<___T>,
) -> ::core::result::Result<
(),
::fidl_next::ProtocolError<<___T as ::fidl_next::Transport>::Error>,
> {
match ordinal {
5572735551219638488 => {
let responder = ::fidl_next::Responder::from_untyped(responder);
match ::fidl_next::DecoderExt::decode(buffer) {
Ok(decoded) => {
handler.flexible_two_way_no_error(decoded, responder).await;
Ok(())
}
Err(error) => Err(::fidl_next::ProtocolError::InvalidMessage {
ordinal: 5572735551219638488,
error,
}),
}
}
3504132377779779458 => {
let responder = ::fidl_next::Responder::from_untyped(responder);
match ::fidl_next::DecoderExt::decode(buffer) {
Ok(decoded) => {
handler.flexible_two_way_with_error(decoded, responder).await;
Ok(())
}
Err(error) => Err(::fidl_next::ProtocolError::InvalidMessage {
ordinal: 3504132377779779458,
error,
}),
}
}
3690935745864999300 => {
let responder = ::fidl_next::Responder::from_untyped(responder);
match ::fidl_next::DecoderExt::decode(buffer) {
Ok(decoded) => {
handler.strict_two_way_no_error(decoded, responder).await;
Ok(())
}
Err(error) => Err(::fidl_next::ProtocolError::InvalidMessage {
ordinal: 3690935745864999300,
error,
}),
}
}
5364624536440098871 => {
let responder = ::fidl_next::Responder::from_untyped(responder);
match ::fidl_next::DecoderExt::decode(buffer) {
Ok(decoded) => {
handler.strict_two_way_with_error(decoded, responder).await;
Ok(())
}
Err(error) => Err(::fidl_next::ProtocolError::InvalidMessage {
ordinal: 5364624536440098871,
error,
}),
}
}
ordinal => {
handler.on_unknown_interaction(ordinal).await;
if ::core::matches!(flexibility, ::fidl_next::protocol::Flexibility::Strict) {
Err(::fidl_next::ProtocolError::UnknownOrdinal(ordinal))
} else {
responder
.respond(
ordinal,
flexibility,
::fidl_next::Flexible::<()>::FrameworkErr(
::fidl_next::FrameworkError::UnknownMethod,
),
)
.expect("encoding a framework error should never fail")
.await?;
Ok(())
}
}
}
}
}
/// Compatibility shims which mimic some API surfaces of the current Rust bindings.
pub mod compat {
impl ::fidl_next::CompatFrom<crate::LocalTablePayload>
for ::fidl_test_protocollayouts::LocalTablePayload
{
fn compat_from(value: crate::LocalTablePayload) -> Self {
Self {
a: ::fidl_next::CompatFrom::compat_from(value.a),
__source_breaking: ::fidl::marker::SourceBreaking,
}
}
}
impl ::fidl_next::CompatFrom<::fidl_test_protocollayouts::LocalTablePayload>
for crate::LocalTablePayload
{
fn compat_from(value: ::fidl_test_protocollayouts::LocalTablePayload) -> Self {
Self { a: ::fidl_next::CompatFrom::compat_from(value.a) }
}
}
impl ::fidl_next::CompatFrom<crate::LocalUnionPayload>
for ::fidl_test_protocollayouts::LocalUnionPayload
{
fn compat_from(value: crate::LocalUnionPayload) -> Self {
match value {
crate::LocalUnionPayload::B(value) => {
Self::B(::fidl_next::CompatFrom::compat_from(value))
}
crate::LocalUnionPayload::UnknownOrdinal_(unknown_ordinal) => {
Self::__SourceBreaking { unknown_ordinal }
}
}
}
}
impl ::fidl_next::CompatFrom<::fidl_test_protocollayouts::LocalUnionPayload>
for crate::LocalUnionPayload
{
fn compat_from(value: ::fidl_test_protocollayouts::LocalUnionPayload) -> Self {
match value {
::fidl_test_protocollayouts::LocalUnionPayload::B(value) => {
Self::B(::fidl_next::CompatFrom::compat_from(value))
}
::fidl_test_protocollayouts::LocalUnionPayload::__SourceBreaking {
unknown_ordinal,
} => Self::UnknownOrdinal_(unknown_ordinal),
}
}
}
impl ::fidl_next::CompatFrom<crate::MainProtocolOneWayAnonRequest>
for ::fidl_test_protocollayouts::MainProtocolOneWayAnonRequest
{
fn compat_from(value: crate::MainProtocolOneWayAnonRequest) -> Self {
Self {
a: ::fidl_next::CompatFrom::compat_from(value.a),
__source_breaking: ::fidl::marker::SourceBreaking,
}
}
}
impl ::fidl_next::CompatFrom<::fidl_test_protocollayouts::MainProtocolOneWayAnonRequest>
for crate::MainProtocolOneWayAnonRequest
{
fn compat_from(value: ::fidl_test_protocollayouts::MainProtocolOneWayAnonRequest) -> Self {
Self { a: ::fidl_next::CompatFrom::compat_from(value.a) }
}
}
impl ::fidl_next::CompatFrom<crate::MainProtocolTwoWayAnonRequest>
for ::fidl_test_protocollayouts::MainProtocolTwoWayAnonRequest
{
fn compat_from(value: crate::MainProtocolTwoWayAnonRequest) -> Self {
match value {
crate::MainProtocolTwoWayAnonRequest::B(value) => {
Self::B(::fidl_next::CompatFrom::compat_from(value))
}
crate::MainProtocolTwoWayAnonRequest::UnknownOrdinal_(unknown_ordinal) => {
Self::__SourceBreaking { unknown_ordinal }
}
}
}
}
impl ::fidl_next::CompatFrom<::fidl_test_protocollayouts::MainProtocolTwoWayAnonRequest>
for crate::MainProtocolTwoWayAnonRequest
{
fn compat_from(value: ::fidl_test_protocollayouts::MainProtocolTwoWayAnonRequest) -> Self {
match value {
::fidl_test_protocollayouts::MainProtocolTwoWayAnonRequest::B(value) => {
Self::B(::fidl_next::CompatFrom::compat_from(value))
}
::fidl_test_protocollayouts::MainProtocolTwoWayAnonRequest::__SourceBreaking {
unknown_ordinal,
} => Self::UnknownOrdinal_(unknown_ordinal),
}
}
}
impl ::fidl_next::CompatFrom<crate::MainProtocolTwoWayAnonResponse>
for ::fidl_test_protocollayouts::MainProtocolTwoWayAnonResponse
{
fn compat_from(value: crate::MainProtocolTwoWayAnonResponse) -> Self {
Self {
a: ::fidl_next::CompatFrom::compat_from(value.a),
__source_breaking: ::fidl::marker::SourceBreaking,
}
}
}
impl ::fidl_next::CompatFrom<::fidl_test_protocollayouts::MainProtocolTwoWayAnonResponse>
for crate::MainProtocolTwoWayAnonResponse
{
fn compat_from(value: ::fidl_test_protocollayouts::MainProtocolTwoWayAnonResponse) -> Self {
Self { a: ::fidl_next::CompatFrom::compat_from(value.a) }
}
}
impl ::fidl_next::CompatFrom<crate::MainProtocolTwoWayAnonWithErrorRequest>
for ::fidl_test_protocollayouts::MainProtocolTwoWayAnonWithErrorRequest
{
fn compat_from(value: crate::MainProtocolTwoWayAnonWithErrorRequest) -> Self {
Self {
a: ::fidl_next::CompatFrom::compat_from(value.a),
__source_breaking: ::fidl::marker::SourceBreaking,
}
}
}
impl
::fidl_next::CompatFrom<::fidl_test_protocollayouts::MainProtocolTwoWayAnonWithErrorRequest>
for crate::MainProtocolTwoWayAnonWithErrorRequest
{
fn compat_from(
value: ::fidl_test_protocollayouts::MainProtocolTwoWayAnonWithErrorRequest,
) -> Self {
Self { a: ::fidl_next::CompatFrom::compat_from(value.a) }
}
}
impl ::fidl_next::CompatFrom<crate::MainProtocolTwoWayAnonWithErrorResponse>
for ::fidl_test_protocollayouts::MainProtocolTwoWayAnonWithErrorResponse
{
fn compat_from(value: crate::MainProtocolTwoWayAnonWithErrorResponse) -> Self {
match value {
crate::MainProtocolTwoWayAnonWithErrorResponse::B(value) => {
Self::B(::fidl_next::CompatFrom::compat_from(value))
}
crate::MainProtocolTwoWayAnonWithErrorResponse::UnknownOrdinal_(
unknown_ordinal,
) => Self::__SourceBreaking { unknown_ordinal },
}
}
}
impl
::fidl_next::CompatFrom<
::fidl_test_protocollayouts::MainProtocolTwoWayAnonWithErrorResponse,
> for crate::MainProtocolTwoWayAnonWithErrorResponse
{
fn compat_from(
value: ::fidl_test_protocollayouts::MainProtocolTwoWayAnonWithErrorResponse,
) -> Self {
match value {
::fidl_test_protocollayouts::MainProtocolTwoWayAnonWithErrorResponse::B(value) =>
Self::B(::fidl_next::CompatFrom::compat_from(value)),
::fidl_test_protocollayouts::MainProtocolTwoWayAnonWithErrorResponse::__SourceBreaking { unknown_ordinal } =>
Self::UnknownOrdinal_(unknown_ordinal),
}
}
}
impl ::fidl_next::CompatFrom<crate::MainProtocolOnAnonRequest>
for ::fidl_test_protocollayouts::MainProtocolOnAnonRequest
{
fn compat_from(value: crate::MainProtocolOnAnonRequest) -> Self {
match value {
crate::MainProtocolOnAnonRequest::B(value) => {
Self::B(::fidl_next::CompatFrom::compat_from(value))
}
crate::MainProtocolOnAnonRequest::UnknownOrdinal_(unknown_ordinal) => {
Self::__SourceBreaking { unknown_ordinal }
}
}
}
}
impl ::fidl_next::CompatFrom<::fidl_test_protocollayouts::MainProtocolOnAnonRequest>
for crate::MainProtocolOnAnonRequest
{
fn compat_from(value: ::fidl_test_protocollayouts::MainProtocolOnAnonRequest) -> Self {
match value {
::fidl_test_protocollayouts::MainProtocolOnAnonRequest::B(value) => {
Self::B(::fidl_next::CompatFrom::compat_from(value))
}
::fidl_test_protocollayouts::MainProtocolOnAnonRequest::__SourceBreaking {
unknown_ordinal,
} => Self::UnknownOrdinal_(unknown_ordinal),
}
}
}
#[cfg(target_os = "fuchsia")]
/// An alias for a client over `zx::Channel` for the `MainProtocol`
/// protocol.
pub type MainProtocolProxy = ::fidl_next::Client<crate::MainProtocol>;
impl ::fidl_next::CompatFrom<crate::MainProtocol>
for ::fidl_test_protocollayouts::MainProtocolMarker
{
fn compat_from(_: crate::MainProtocol) -> Self {
Self
}
}
impl ::fidl_next::CompatFrom<::fidl_test_protocollayouts::MainProtocolMarker>
for crate::MainProtocol
{
fn compat_from(_: ::fidl_test_protocollayouts::MainProtocolMarker) -> Self {
Self
}
}
#[cfg(target_os = "fuchsia")]
impl ::fidl_next::ClientCompatFrom<::fidl_test_protocollayouts::MainProtocolProxy>
for crate::MainProtocol
{
fn client_compat_from(
proxy: ::fidl_test_protocollayouts::MainProtocolProxy,
) -> ::fidl_next::ClientDispatcher<Self, ::fidl_next::fuchsia::zx::Channel> {
let channel = ::fidl::endpoints::Proxy::into_channel(proxy).unwrap().into_zx_channel();
let client_end = ::fidl_next::ClientEnd::from_untyped(channel);
::fidl_next::ClientDispatcher::new(client_end)
}
}
#[cfg(target_os = "fuchsia")]
/// An alias for a client over `zx::Channel` for the `OpenProtocol`
/// protocol.
pub type OpenProtocolProxy = ::fidl_next::Client<crate::OpenProtocol>;
impl ::fidl_next::CompatFrom<crate::OpenProtocol>
for ::fidl_test_protocollayouts::OpenProtocolMarker
{
fn compat_from(_: crate::OpenProtocol) -> Self {
Self
}
}
impl ::fidl_next::CompatFrom<::fidl_test_protocollayouts::OpenProtocolMarker>
for crate::OpenProtocol
{
fn compat_from(_: ::fidl_test_protocollayouts::OpenProtocolMarker) -> Self {
Self
}
}
#[cfg(target_os = "fuchsia")]
impl ::fidl_next::ClientCompatFrom<::fidl_test_protocollayouts::OpenProtocolProxy>
for crate::OpenProtocol
{
fn client_compat_from(
proxy: ::fidl_test_protocollayouts::OpenProtocolProxy,
) -> ::fidl_next::ClientDispatcher<Self, ::fidl_next::fuchsia::zx::Channel> {
let channel = ::fidl::endpoints::Proxy::into_channel(proxy).unwrap().into_zx_channel();
let client_end = ::fidl_next::ClientEnd::from_untyped(channel);
::fidl_next::ClientDispatcher::new(client_end)
}
}
}