blob: ce8dc219d57b2dec37c44d4ac9b94b04b918011d [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)]
#[derive(Clone, Debug)]
#[repr(C)]
pub struct LocalStructPayload {
pub a: u32,
pub b: u32,
}
impl ::fidl_next::Encodable for LocalStructPayload {
const COPY_OPTIMIZATION: ::fidl_next::CopyOptimization<Self> = unsafe {
::fidl_next::CopyOptimization::enable_if(
true && <u32 as ::fidl_next::Encodable>::COPY_OPTIMIZATION.is_enabled()
&& <u32 as ::fidl_next::Encodable>::COPY_OPTIMIZATION.is_enabled(),
)
};
type Encoded = WireLocalStructPayload;
}
impl<___E> ::fidl_next::Encode<___E> for LocalStructPayload
where
___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
{
#[inline]
fn encode(
&mut self,
encoder: &mut ___E,
slot: ::fidl_next::Slot<'_, Self::Encoded>,
) -> Result<(), ::fidl_next::EncodeError> {
::fidl_next::munge! {
let Self::Encoded {
a,
b,
} = slot;
}
::fidl_next::Encode::encode(&mut self.a, encoder, a)?;
::fidl_next::Encode::encode(&mut self.b, encoder, b)?;
Ok(())
}
}
impl ::fidl_next::EncodableOption for Box<LocalStructPayload> {
type EncodedOption = ::fidl_next::WireBox<WireLocalStructPayload>;
}
impl<___E> ::fidl_next::EncodeOption<___E> for Box<LocalStructPayload>
where
___E: ::fidl_next::Encoder + ?Sized,
LocalStructPayload: ::fidl_next::Encode<___E>,
{
#[inline]
fn encode_option(
this: Option<&mut Self>,
encoder: &mut ___E,
slot: ::fidl_next::Slot<'_, Self::EncodedOption>,
) -> Result<(), ::fidl_next::EncodeError> {
if let Some(inner) = this {
::fidl_next::EncoderExt::encode_next(encoder, inner)?;
::fidl_next::WireBox::encode_present(slot);
} else {
::fidl_next::WireBox::encode_absent(slot);
}
Ok(())
}
}
impl ::fidl_next::TakeFrom<WireLocalStructPayload> for LocalStructPayload {
const COPY_OPTIMIZATION: ::fidl_next::CopyOptimization<Self> = unsafe {
::fidl_next::CopyOptimization::enable_if(
true && <u32 as ::fidl_next::Encodable>::COPY_OPTIMIZATION.is_enabled()
&& <u32 as ::fidl_next::Encodable>::COPY_OPTIMIZATION.is_enabled(),
)
};
#[inline]
fn take_from(from: &WireLocalStructPayload) -> Self {
Self {
a: ::fidl_next::TakeFrom::take_from(&from.a),
b: ::fidl_next::TakeFrom::take_from(&from.b),
}
}
}
/// The wire type corersponding to [`LocalStructPayload`].
#[derive(Clone, Debug)]
#[repr(C)]
pub struct WireLocalStructPayload {
pub a: ::fidl_next::u32_le,
pub b: ::fidl_next::u32_le,
}
unsafe impl<___D> ::fidl_next::Decode<___D> for WireLocalStructPayload
where
___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
{
fn decode(
slot: ::fidl_next::Slot<'_, Self>,
decoder: &mut ___D,
) -> Result<(), ::fidl_next::DecodeError> {
::fidl_next::munge! {
let Self {
mut a,
mut b,
} = slot;
}
::fidl_next::Decode::decode(a.as_mut(), decoder)?;
::fidl_next::Decode::decode(b.as_mut(), decoder)?;
Ok(())
}
}
#[derive(Clone, Debug)]
pub enum MainProtocolTwoWayLocalWithErrorResult {
Response(crate::LocalStructPayload),
Err(u32),
}
impl ::fidl_next::Encodable for MainProtocolTwoWayLocalWithErrorResult {
type Encoded = WireMainProtocolTwoWayLocalWithErrorResult;
}
impl<___E> ::fidl_next::Encode<___E> for MainProtocolTwoWayLocalWithErrorResult
where
___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
___E: ::fidl_next::Encoder,
{
#[inline]
fn encode(
&mut self,
encoder: &mut ___E,
slot: ::fidl_next::Slot<'_, Self::Encoded>,
) -> Result<(), ::fidl_next::EncodeError> {
::fidl_next::munge!(let WireMainProtocolTwoWayLocalWithErrorResult { raw } = slot);
match self {
Self::Response(value) => ::fidl_next::RawWireUnion::encode_as::<
___E,
crate::LocalStructPayload,
>(value, 1, encoder, raw)?,
Self::Err(value) => {
::fidl_next::RawWireUnion::encode_as::<___E, u32>(value, 2, encoder, raw)?
}
}
Ok(())
}
}
impl ::fidl_next::EncodableOption for Box<MainProtocolTwoWayLocalWithErrorResult> {
type EncodedOption = WireOptionalMainProtocolTwoWayLocalWithErrorResult;
}
impl<___E> ::fidl_next::EncodeOption<___E> for Box<MainProtocolTwoWayLocalWithErrorResult>
where
___E: ?Sized,
MainProtocolTwoWayLocalWithErrorResult: ::fidl_next::Encode<___E>,
{
#[inline]
fn encode_option(
this: Option<&mut Self>,
encoder: &mut ___E,
mut slot: ::fidl_next::Slot<'_, Self::EncodedOption>,
) -> Result<(), ::fidl_next::EncodeError> {
::fidl_next::munge!(let WireOptionalMainProtocolTwoWayLocalWithErrorResult { raw } = slot.as_mut());
if let Some(inner) = this {
let slot = unsafe { ::fidl_next::Slot::new_unchecked(slot.as_mut_ptr().cast()) };
::fidl_next::Encode::encode(&mut **inner, encoder, slot)?;
} else {
::fidl_next::RawWireUnion::encode_absent(raw);
}
Ok(())
}
}
impl ::fidl_next::TakeFrom<WireMainProtocolTwoWayLocalWithErrorResult>
for MainProtocolTwoWayLocalWithErrorResult
{
#[inline]
fn take_from(from: &WireMainProtocolTwoWayLocalWithErrorResult) -> Self {
match from.raw.ordinal() {
1 => Self::Response(::fidl_next::TakeFrom::take_from(unsafe {
from.raw.get().deref_unchecked()
})),
2 => Self::Err(::fidl_next::TakeFrom::take_from(unsafe {
from.raw.get().deref_unchecked()
})),
_ => unsafe { ::core::hint::unreachable_unchecked() },
}
}
}
impl ::fidl_next::TakeFrom<WireOptionalMainProtocolTwoWayLocalWithErrorResult>
for Option<Box<MainProtocolTwoWayLocalWithErrorResult>>
{
#[inline]
fn take_from(from: &WireOptionalMainProtocolTwoWayLocalWithErrorResult) -> Self {
if let Some(inner) = from.as_ref() {
Some(::fidl_next::TakeFrom::take_from(inner))
} else {
None
}
}
}
/// The wire type corresponding to [`MainProtocolTwoWayLocalWithErrorResult`].
#[repr(transparent)]
pub struct WireMainProtocolTwoWayLocalWithErrorResult {
raw: ::fidl_next::RawWireUnion,
}
pub mod main_protocol_two_way_local_with_error_result {
pub enum Ref<'union> {
Response(&'union crate::WireLocalStructPayload),
Err(&'union ::fidl_next::u32_le),
}
}
impl WireMainProtocolTwoWayLocalWithErrorResult {
pub fn as_ref(&self) -> crate::main_protocol_two_way_local_with_error_result::Ref<'_> {
match self.raw.ordinal() {
1 => crate::main_protocol_two_way_local_with_error_result::Ref::Response(unsafe {
self.raw.get().deref_unchecked()
}),
2 => crate::main_protocol_two_way_local_with_error_result::Ref::Err(unsafe {
self.raw.get().deref_unchecked()
}),
_ => unsafe { ::core::hint::unreachable_unchecked() },
}
}
}
unsafe impl<___D> ::fidl_next::Decode<___D> for WireMainProtocolTwoWayLocalWithErrorResult
where
___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
___D: ::fidl_next::Decoder,
{
fn decode(
mut slot: ::fidl_next::Slot<'_, Self>,
decoder: &mut ___D,
) -> Result<(), ::fidl_next::DecodeError> {
::fidl_next::munge!(let Self { mut raw } = slot.as_mut());
match ::fidl_next::RawWireUnion::encoded_ordinal(raw.as_mut()) {
1 => ::fidl_next::RawWireUnion::decode_as::<___D, crate::WireLocalStructPayload>(
raw, decoder,
)?,
2 => ::fidl_next::RawWireUnion::decode_as::<___D, ::fidl_next::u32_le>(raw, decoder)?,
ord => return Err(::fidl_next::DecodeError::InvalidUnionOrdinal(ord as usize)),
}
Ok(())
}
}
impl ::core::fmt::Debug for WireMainProtocolTwoWayLocalWithErrorResult {
fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
match self.raw.ordinal() {
1 => unsafe {
self.raw.get().deref_unchecked::<crate::WireLocalStructPayload>().fmt(f)
},
2 => unsafe { self.raw.get().deref_unchecked::<::fidl_next::u32_le>().fmt(f) },
_ => unsafe { ::core::hint::unreachable_unchecked() },
}
}
}
#[repr(transparent)]
pub struct WireOptionalMainProtocolTwoWayLocalWithErrorResult {
raw: ::fidl_next::RawWireUnion,
}
impl WireOptionalMainProtocolTwoWayLocalWithErrorResult {
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) -> Option<&WireMainProtocolTwoWayLocalWithErrorResult> {
if self.is_some() {
Some(unsafe { &*(self as *const Self).cast() })
} else {
None
}
}
}
unsafe impl<___D> ::fidl_next::Decode<___D> for WireOptionalMainProtocolTwoWayLocalWithErrorResult
where
___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
___D: ::fidl_next::Decoder,
{
fn decode(
mut slot: ::fidl_next::Slot<'_, Self>,
decoder: &mut ___D,
) -> Result<(), ::fidl_next::DecodeError> {
::fidl_next::munge!(let Self { mut raw } = slot.as_mut());
match ::fidl_next::RawWireUnion::encoded_ordinal(raw.as_mut()) {
1 => ::fidl_next::RawWireUnion::decode_as::<___D, crate::WireLocalStructPayload>(
raw, decoder,
)?,
2 => ::fidl_next::RawWireUnion::decode_as::<___D, ::fidl_next::u32_le>(raw, decoder)?,
0 => ::fidl_next::RawWireUnion::decode_absent(raw)?,
_ => ::fidl_next::RawWireUnion::decode_unknown(raw, decoder)?,
}
Ok(())
}
}
impl ::core::fmt::Debug for WireOptionalMainProtocolTwoWayLocalWithErrorResult {
fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
self.as_ref().fmt(f)
}
}
#[derive(Clone, Debug)]
pub enum MainProtocolTwoWayImportWithErrorResult {
Response(::fidl_next_test_protocolpayloads_imported::ImportStructPayload),
Err(u32),
}
impl ::fidl_next::Encodable for MainProtocolTwoWayImportWithErrorResult {
type Encoded = WireMainProtocolTwoWayImportWithErrorResult;
}
impl<___E> ::fidl_next::Encode<___E> for MainProtocolTwoWayImportWithErrorResult
where
___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
{
#[inline]
fn encode(
&mut self,
encoder: &mut ___E,
slot: ::fidl_next::Slot<'_, Self::Encoded>,
) -> Result<(), ::fidl_next::EncodeError> {
::fidl_next::munge!(let WireMainProtocolTwoWayImportWithErrorResult { raw } = slot);
match self {
Self::Response(value) => ::fidl_next::RawWireUnion::encode_as_static::<
___E,
::fidl_next_test_protocolpayloads_imported::ImportStructPayload,
>(value, 1, encoder, raw)?,
Self::Err(value) => {
::fidl_next::RawWireUnion::encode_as_static::<___E, u32>(value, 2, encoder, raw)?
}
}
Ok(())
}
}
impl ::fidl_next::EncodableOption for Box<MainProtocolTwoWayImportWithErrorResult> {
type EncodedOption = WireOptionalMainProtocolTwoWayImportWithErrorResult;
}
impl<___E> ::fidl_next::EncodeOption<___E> for Box<MainProtocolTwoWayImportWithErrorResult>
where
___E: ?Sized,
MainProtocolTwoWayImportWithErrorResult: ::fidl_next::Encode<___E>,
{
#[inline]
fn encode_option(
this: Option<&mut Self>,
encoder: &mut ___E,
mut slot: ::fidl_next::Slot<'_, Self::EncodedOption>,
) -> Result<(), ::fidl_next::EncodeError> {
::fidl_next::munge!(let WireOptionalMainProtocolTwoWayImportWithErrorResult { raw } = slot.as_mut());
if let Some(inner) = this {
let slot = unsafe { ::fidl_next::Slot::new_unchecked(slot.as_mut_ptr().cast()) };
::fidl_next::Encode::encode(&mut **inner, encoder, slot)?;
} else {
::fidl_next::RawWireUnion::encode_absent(raw);
}
Ok(())
}
}
impl ::fidl_next::TakeFrom<WireMainProtocolTwoWayImportWithErrorResult>
for MainProtocolTwoWayImportWithErrorResult
{
#[inline]
fn take_from(from: &WireMainProtocolTwoWayImportWithErrorResult) -> Self {
match from.raw.ordinal() {
1 => Self::Response(::fidl_next::TakeFrom::take_from(unsafe {
from.raw.get().deref_unchecked()
})),
2 => Self::Err(::fidl_next::TakeFrom::take_from(unsafe {
from.raw.get().deref_unchecked()
})),
_ => unsafe { ::core::hint::unreachable_unchecked() },
}
}
}
impl ::fidl_next::TakeFrom<WireOptionalMainProtocolTwoWayImportWithErrorResult>
for Option<Box<MainProtocolTwoWayImportWithErrorResult>>
{
#[inline]
fn take_from(from: &WireOptionalMainProtocolTwoWayImportWithErrorResult) -> Self {
if let Some(inner) = from.as_ref() {
Some(::fidl_next::TakeFrom::take_from(inner))
} else {
None
}
}
}
/// The wire type corresponding to [`MainProtocolTwoWayImportWithErrorResult`].
#[repr(transparent)]
pub struct WireMainProtocolTwoWayImportWithErrorResult {
raw: ::fidl_next::RawWireUnion,
}
pub mod main_protocol_two_way_import_with_error_result {
pub enum Ref<'union> {
Response(&'union ::fidl_next_test_protocolpayloads_imported::WireImportStructPayload),
Err(&'union ::fidl_next::u32_le),
}
}
impl WireMainProtocolTwoWayImportWithErrorResult {
pub fn as_ref(&self) -> crate::main_protocol_two_way_import_with_error_result::Ref<'_> {
match self.raw.ordinal() {
1 => crate::main_protocol_two_way_import_with_error_result::Ref::Response(unsafe {
self.raw.get().deref_unchecked()
}),
2 => crate::main_protocol_two_way_import_with_error_result::Ref::Err(unsafe {
self.raw.get().deref_unchecked()
}),
_ => unsafe { ::core::hint::unreachable_unchecked() },
}
}
}
impl Clone for WireMainProtocolTwoWayImportWithErrorResult {
fn clone(&self) -> Self {
match self.raw.ordinal() {
1 => Self {
raw: unsafe {
self.raw.clone_unchecked::<::fidl_next_test_protocolpayloads_imported::WireImportStructPayload>()
},
},
2 => Self { raw: unsafe { self.raw.clone_unchecked::<::fidl_next::u32_le>() } },
_ => unsafe { ::core::hint::unreachable_unchecked() },
}
}
}
unsafe impl<___D> ::fidl_next::Decode<___D> for WireMainProtocolTwoWayImportWithErrorResult
where
___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
{
fn decode(
mut slot: ::fidl_next::Slot<'_, Self>,
decoder: &mut ___D,
) -> Result<(), ::fidl_next::DecodeError> {
::fidl_next::munge!(let Self { mut raw } = slot.as_mut());
match ::fidl_next::RawWireUnion::encoded_ordinal(raw.as_mut()) {
1 => ::fidl_next::RawWireUnion::decode_as_static::<
___D,
::fidl_next_test_protocolpayloads_imported::WireImportStructPayload,
>(raw, decoder)?,
2 => ::fidl_next::RawWireUnion::decode_as_static::<___D, ::fidl_next::u32_le>(
raw, decoder,
)?,
ord => return Err(::fidl_next::DecodeError::InvalidUnionOrdinal(ord as usize)),
}
Ok(())
}
}
impl ::core::fmt::Debug for WireMainProtocolTwoWayImportWithErrorResult {
fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
match self.raw.ordinal() {
1 => unsafe {
self.raw.get().deref_unchecked::<
::fidl_next_test_protocolpayloads_imported::WireImportStructPayload
>().fmt(f)
},
2 => unsafe { self.raw.get().deref_unchecked::<::fidl_next::u32_le>().fmt(f) },
_ => unsafe { ::core::hint::unreachable_unchecked() },
}
}
}
#[repr(transparent)]
pub struct WireOptionalMainProtocolTwoWayImportWithErrorResult {
raw: ::fidl_next::RawWireUnion,
}
impl WireOptionalMainProtocolTwoWayImportWithErrorResult {
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) -> Option<&WireMainProtocolTwoWayImportWithErrorResult> {
if self.is_some() {
Some(unsafe { &*(self as *const Self).cast() })
} else {
None
}
}
}
impl Clone for WireOptionalMainProtocolTwoWayImportWithErrorResult {
fn clone(&self) -> Self {
if self.is_none() {
return WireOptionalMainProtocolTwoWayImportWithErrorResult {
raw: ::fidl_next::RawWireUnion::absent(),
};
}
match self.raw.ordinal() {
1 => Self {
raw: unsafe {
self.raw.clone_unchecked::<::fidl_next_test_protocolpayloads_imported::WireImportStructPayload>()
},
},
2 => Self { raw: unsafe { self.raw.clone_unchecked::<::fidl_next::u32_le>() } },
_ => unsafe { ::core::hint::unreachable_unchecked() },
}
}
}
unsafe impl<___D> ::fidl_next::Decode<___D> for WireOptionalMainProtocolTwoWayImportWithErrorResult
where
___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
{
fn decode(
mut slot: ::fidl_next::Slot<'_, Self>,
decoder: &mut ___D,
) -> Result<(), ::fidl_next::DecodeError> {
::fidl_next::munge!(let Self { mut raw } = slot.as_mut());
match ::fidl_next::RawWireUnion::encoded_ordinal(raw.as_mut()) {
1 => ::fidl_next::RawWireUnion::decode_as_static::<
___D,
::fidl_next_test_protocolpayloads_imported::WireImportStructPayload,
>(raw, decoder)?,
2 => ::fidl_next::RawWireUnion::decode_as_static::<___D, ::fidl_next::u32_le>(
raw, decoder,
)?,
0 => ::fidl_next::RawWireUnion::decode_absent(raw)?,
_ => ::fidl_next::RawWireUnion::decode_unknown_static(raw, decoder)?,
}
Ok(())
}
}
impl ::core::fmt::Debug for WireOptionalMainProtocolTwoWayImportWithErrorResult {
fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
self.as_ref().fmt(f)
}
}
#[derive(Clone, Debug)]
#[repr(C)]
pub struct MainProtocolOneWayAnonRequest {
pub a: u32,
pub b: u32,
}
impl ::fidl_next::Encodable for MainProtocolOneWayAnonRequest {
const COPY_OPTIMIZATION: ::fidl_next::CopyOptimization<Self> = unsafe {
::fidl_next::CopyOptimization::enable_if(
true && <u32 as ::fidl_next::Encodable>::COPY_OPTIMIZATION.is_enabled()
&& <u32 as ::fidl_next::Encodable>::COPY_OPTIMIZATION.is_enabled(),
)
};
type Encoded = WireMainProtocolOneWayAnonRequest;
}
impl<___E> ::fidl_next::Encode<___E> for MainProtocolOneWayAnonRequest
where
___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
{
#[inline]
fn encode(
&mut self,
encoder: &mut ___E,
slot: ::fidl_next::Slot<'_, Self::Encoded>,
) -> Result<(), ::fidl_next::EncodeError> {
::fidl_next::munge! {
let Self::Encoded {
a,
b,
} = slot;
}
::fidl_next::Encode::encode(&mut self.a, encoder, a)?;
::fidl_next::Encode::encode(&mut self.b, encoder, b)?;
Ok(())
}
}
impl ::fidl_next::EncodableOption for Box<MainProtocolOneWayAnonRequest> {
type EncodedOption = ::fidl_next::WireBox<WireMainProtocolOneWayAnonRequest>;
}
impl<___E> ::fidl_next::EncodeOption<___E> for Box<MainProtocolOneWayAnonRequest>
where
___E: ::fidl_next::Encoder + ?Sized,
MainProtocolOneWayAnonRequest: ::fidl_next::Encode<___E>,
{
#[inline]
fn encode_option(
this: Option<&mut Self>,
encoder: &mut ___E,
slot: ::fidl_next::Slot<'_, Self::EncodedOption>,
) -> Result<(), ::fidl_next::EncodeError> {
if let Some(inner) = this {
::fidl_next::EncoderExt::encode_next(encoder, inner)?;
::fidl_next::WireBox::encode_present(slot);
} else {
::fidl_next::WireBox::encode_absent(slot);
}
Ok(())
}
}
impl ::fidl_next::TakeFrom<WireMainProtocolOneWayAnonRequest> for MainProtocolOneWayAnonRequest {
const COPY_OPTIMIZATION: ::fidl_next::CopyOptimization<Self> = unsafe {
::fidl_next::CopyOptimization::enable_if(
true && <u32 as ::fidl_next::Encodable>::COPY_OPTIMIZATION.is_enabled()
&& <u32 as ::fidl_next::Encodable>::COPY_OPTIMIZATION.is_enabled(),
)
};
#[inline]
fn take_from(from: &WireMainProtocolOneWayAnonRequest) -> Self {
Self {
a: ::fidl_next::TakeFrom::take_from(&from.a),
b: ::fidl_next::TakeFrom::take_from(&from.b),
}
}
}
/// The wire type corersponding to [`MainProtocolOneWayAnonRequest`].
#[derive(Clone, Debug)]
#[repr(C)]
pub struct WireMainProtocolOneWayAnonRequest {
pub a: ::fidl_next::u32_le,
pub b: ::fidl_next::u32_le,
}
unsafe impl<___D> ::fidl_next::Decode<___D> for WireMainProtocolOneWayAnonRequest
where
___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
{
fn decode(
slot: ::fidl_next::Slot<'_, Self>,
decoder: &mut ___D,
) -> Result<(), ::fidl_next::DecodeError> {
::fidl_next::munge! {
let Self {
mut a,
mut b,
} = slot;
}
::fidl_next::Decode::decode(a.as_mut(), decoder)?;
::fidl_next::Decode::decode(b.as_mut(), decoder)?;
Ok(())
}
}
#[derive(Clone, Debug)]
#[repr(C)]
pub struct MainProtocolTwoWayAnonRequest {
pub a: u32,
pub b: u32,
}
impl ::fidl_next::Encodable for MainProtocolTwoWayAnonRequest {
const COPY_OPTIMIZATION: ::fidl_next::CopyOptimization<Self> = unsafe {
::fidl_next::CopyOptimization::enable_if(
true && <u32 as ::fidl_next::Encodable>::COPY_OPTIMIZATION.is_enabled()
&& <u32 as ::fidl_next::Encodable>::COPY_OPTIMIZATION.is_enabled(),
)
};
type Encoded = WireMainProtocolTwoWayAnonRequest;
}
impl<___E> ::fidl_next::Encode<___E> for MainProtocolTwoWayAnonRequest
where
___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
{
#[inline]
fn encode(
&mut self,
encoder: &mut ___E,
slot: ::fidl_next::Slot<'_, Self::Encoded>,
) -> Result<(), ::fidl_next::EncodeError> {
::fidl_next::munge! {
let Self::Encoded {
a,
b,
} = slot;
}
::fidl_next::Encode::encode(&mut self.a, encoder, a)?;
::fidl_next::Encode::encode(&mut self.b, encoder, b)?;
Ok(())
}
}
impl ::fidl_next::EncodableOption for Box<MainProtocolTwoWayAnonRequest> {
type EncodedOption = ::fidl_next::WireBox<WireMainProtocolTwoWayAnonRequest>;
}
impl<___E> ::fidl_next::EncodeOption<___E> for Box<MainProtocolTwoWayAnonRequest>
where
___E: ::fidl_next::Encoder + ?Sized,
MainProtocolTwoWayAnonRequest: ::fidl_next::Encode<___E>,
{
#[inline]
fn encode_option(
this: Option<&mut Self>,
encoder: &mut ___E,
slot: ::fidl_next::Slot<'_, Self::EncodedOption>,
) -> Result<(), ::fidl_next::EncodeError> {
if let Some(inner) = this {
::fidl_next::EncoderExt::encode_next(encoder, inner)?;
::fidl_next::WireBox::encode_present(slot);
} else {
::fidl_next::WireBox::encode_absent(slot);
}
Ok(())
}
}
impl ::fidl_next::TakeFrom<WireMainProtocolTwoWayAnonRequest> for MainProtocolTwoWayAnonRequest {
const COPY_OPTIMIZATION: ::fidl_next::CopyOptimization<Self> = unsafe {
::fidl_next::CopyOptimization::enable_if(
true && <u32 as ::fidl_next::Encodable>::COPY_OPTIMIZATION.is_enabled()
&& <u32 as ::fidl_next::Encodable>::COPY_OPTIMIZATION.is_enabled(),
)
};
#[inline]
fn take_from(from: &WireMainProtocolTwoWayAnonRequest) -> Self {
Self {
a: ::fidl_next::TakeFrom::take_from(&from.a),
b: ::fidl_next::TakeFrom::take_from(&from.b),
}
}
}
/// The wire type corersponding to [`MainProtocolTwoWayAnonRequest`].
#[derive(Clone, Debug)]
#[repr(C)]
pub struct WireMainProtocolTwoWayAnonRequest {
pub a: ::fidl_next::u32_le,
pub b: ::fidl_next::u32_le,
}
unsafe impl<___D> ::fidl_next::Decode<___D> for WireMainProtocolTwoWayAnonRequest
where
___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
{
fn decode(
slot: ::fidl_next::Slot<'_, Self>,
decoder: &mut ___D,
) -> Result<(), ::fidl_next::DecodeError> {
::fidl_next::munge! {
let Self {
mut a,
mut b,
} = slot;
}
::fidl_next::Decode::decode(a.as_mut(), decoder)?;
::fidl_next::Decode::decode(b.as_mut(), decoder)?;
Ok(())
}
}
#[derive(Clone, Debug)]
#[repr(C)]
pub struct MainProtocolTwoWayAnonResponse {
pub a: u32,
pub b: u32,
}
impl ::fidl_next::Encodable for MainProtocolTwoWayAnonResponse {
const COPY_OPTIMIZATION: ::fidl_next::CopyOptimization<Self> = unsafe {
::fidl_next::CopyOptimization::enable_if(
true && <u32 as ::fidl_next::Encodable>::COPY_OPTIMIZATION.is_enabled()
&& <u32 as ::fidl_next::Encodable>::COPY_OPTIMIZATION.is_enabled(),
)
};
type Encoded = WireMainProtocolTwoWayAnonResponse;
}
impl<___E> ::fidl_next::Encode<___E> for MainProtocolTwoWayAnonResponse
where
___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
{
#[inline]
fn encode(
&mut self,
encoder: &mut ___E,
slot: ::fidl_next::Slot<'_, Self::Encoded>,
) -> Result<(), ::fidl_next::EncodeError> {
::fidl_next::munge! {
let Self::Encoded {
a,
b,
} = slot;
}
::fidl_next::Encode::encode(&mut self.a, encoder, a)?;
::fidl_next::Encode::encode(&mut self.b, encoder, b)?;
Ok(())
}
}
impl ::fidl_next::EncodableOption for Box<MainProtocolTwoWayAnonResponse> {
type EncodedOption = ::fidl_next::WireBox<WireMainProtocolTwoWayAnonResponse>;
}
impl<___E> ::fidl_next::EncodeOption<___E> for Box<MainProtocolTwoWayAnonResponse>
where
___E: ::fidl_next::Encoder + ?Sized,
MainProtocolTwoWayAnonResponse: ::fidl_next::Encode<___E>,
{
#[inline]
fn encode_option(
this: Option<&mut Self>,
encoder: &mut ___E,
slot: ::fidl_next::Slot<'_, Self::EncodedOption>,
) -> Result<(), ::fidl_next::EncodeError> {
if let Some(inner) = this {
::fidl_next::EncoderExt::encode_next(encoder, inner)?;
::fidl_next::WireBox::encode_present(slot);
} else {
::fidl_next::WireBox::encode_absent(slot);
}
Ok(())
}
}
impl ::fidl_next::TakeFrom<WireMainProtocolTwoWayAnonResponse> for MainProtocolTwoWayAnonResponse {
const COPY_OPTIMIZATION: ::fidl_next::CopyOptimization<Self> = unsafe {
::fidl_next::CopyOptimization::enable_if(
true && <u32 as ::fidl_next::Encodable>::COPY_OPTIMIZATION.is_enabled()
&& <u32 as ::fidl_next::Encodable>::COPY_OPTIMIZATION.is_enabled(),
)
};
#[inline]
fn take_from(from: &WireMainProtocolTwoWayAnonResponse) -> Self {
Self {
a: ::fidl_next::TakeFrom::take_from(&from.a),
b: ::fidl_next::TakeFrom::take_from(&from.b),
}
}
}
/// The wire type corersponding to [`MainProtocolTwoWayAnonResponse`].
#[derive(Clone, Debug)]
#[repr(C)]
pub struct WireMainProtocolTwoWayAnonResponse {
pub a: ::fidl_next::u32_le,
pub b: ::fidl_next::u32_le,
}
unsafe impl<___D> ::fidl_next::Decode<___D> for WireMainProtocolTwoWayAnonResponse
where
___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
{
fn decode(
slot: ::fidl_next::Slot<'_, Self>,
decoder: &mut ___D,
) -> Result<(), ::fidl_next::DecodeError> {
::fidl_next::munge! {
let Self {
mut a,
mut b,
} = slot;
}
::fidl_next::Decode::decode(a.as_mut(), decoder)?;
::fidl_next::Decode::decode(b.as_mut(), decoder)?;
Ok(())
}
}
#[derive(Clone, Debug)]
#[repr(C)]
pub struct MainProtocolTwoWayAnonWithErrorRequest {
pub a: u32,
pub b: u32,
}
impl ::fidl_next::Encodable for MainProtocolTwoWayAnonWithErrorRequest {
const COPY_OPTIMIZATION: ::fidl_next::CopyOptimization<Self> = unsafe {
::fidl_next::CopyOptimization::enable_if(
true && <u32 as ::fidl_next::Encodable>::COPY_OPTIMIZATION.is_enabled()
&& <u32 as ::fidl_next::Encodable>::COPY_OPTIMIZATION.is_enabled(),
)
};
type Encoded = WireMainProtocolTwoWayAnonWithErrorRequest;
}
impl<___E> ::fidl_next::Encode<___E> for MainProtocolTwoWayAnonWithErrorRequest
where
___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
{
#[inline]
fn encode(
&mut self,
encoder: &mut ___E,
slot: ::fidl_next::Slot<'_, Self::Encoded>,
) -> Result<(), ::fidl_next::EncodeError> {
::fidl_next::munge! {
let Self::Encoded {
a,
b,
} = slot;
}
::fidl_next::Encode::encode(&mut self.a, encoder, a)?;
::fidl_next::Encode::encode(&mut self.b, encoder, b)?;
Ok(())
}
}
impl ::fidl_next::EncodableOption for Box<MainProtocolTwoWayAnonWithErrorRequest> {
type EncodedOption = ::fidl_next::WireBox<WireMainProtocolTwoWayAnonWithErrorRequest>;
}
impl<___E> ::fidl_next::EncodeOption<___E> for Box<MainProtocolTwoWayAnonWithErrorRequest>
where
___E: ::fidl_next::Encoder + ?Sized,
MainProtocolTwoWayAnonWithErrorRequest: ::fidl_next::Encode<___E>,
{
#[inline]
fn encode_option(
this: Option<&mut Self>,
encoder: &mut ___E,
slot: ::fidl_next::Slot<'_, Self::EncodedOption>,
) -> Result<(), ::fidl_next::EncodeError> {
if let Some(inner) = this {
::fidl_next::EncoderExt::encode_next(encoder, inner)?;
::fidl_next::WireBox::encode_present(slot);
} else {
::fidl_next::WireBox::encode_absent(slot);
}
Ok(())
}
}
impl ::fidl_next::TakeFrom<WireMainProtocolTwoWayAnonWithErrorRequest>
for MainProtocolTwoWayAnonWithErrorRequest
{
const COPY_OPTIMIZATION: ::fidl_next::CopyOptimization<Self> = unsafe {
::fidl_next::CopyOptimization::enable_if(
true && <u32 as ::fidl_next::Encodable>::COPY_OPTIMIZATION.is_enabled()
&& <u32 as ::fidl_next::Encodable>::COPY_OPTIMIZATION.is_enabled(),
)
};
#[inline]
fn take_from(from: &WireMainProtocolTwoWayAnonWithErrorRequest) -> Self {
Self {
a: ::fidl_next::TakeFrom::take_from(&from.a),
b: ::fidl_next::TakeFrom::take_from(&from.b),
}
}
}
/// The wire type corersponding to [`MainProtocolTwoWayAnonWithErrorRequest`].
#[derive(Clone, Debug)]
#[repr(C)]
pub struct WireMainProtocolTwoWayAnonWithErrorRequest {
pub a: ::fidl_next::u32_le,
pub b: ::fidl_next::u32_le,
}
unsafe impl<___D> ::fidl_next::Decode<___D> for WireMainProtocolTwoWayAnonWithErrorRequest
where
___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
{
fn decode(
slot: ::fidl_next::Slot<'_, Self>,
decoder: &mut ___D,
) -> Result<(), ::fidl_next::DecodeError> {
::fidl_next::munge! {
let Self {
mut a,
mut b,
} = slot;
}
::fidl_next::Decode::decode(a.as_mut(), decoder)?;
::fidl_next::Decode::decode(b.as_mut(), decoder)?;
Ok(())
}
}
#[derive(Clone, Debug)]
#[repr(C)]
pub struct MainProtocolTwoWayAnonWithErrorResponse {
pub a: u32,
pub b: u32,
}
impl ::fidl_next::Encodable for MainProtocolTwoWayAnonWithErrorResponse {
const COPY_OPTIMIZATION: ::fidl_next::CopyOptimization<Self> = unsafe {
::fidl_next::CopyOptimization::enable_if(
true && <u32 as ::fidl_next::Encodable>::COPY_OPTIMIZATION.is_enabled()
&& <u32 as ::fidl_next::Encodable>::COPY_OPTIMIZATION.is_enabled(),
)
};
type Encoded = WireMainProtocolTwoWayAnonWithErrorResponse;
}
impl<___E> ::fidl_next::Encode<___E> for MainProtocolTwoWayAnonWithErrorResponse
where
___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
{
#[inline]
fn encode(
&mut self,
encoder: &mut ___E,
slot: ::fidl_next::Slot<'_, Self::Encoded>,
) -> Result<(), ::fidl_next::EncodeError> {
::fidl_next::munge! {
let Self::Encoded {
a,
b,
} = slot;
}
::fidl_next::Encode::encode(&mut self.a, encoder, a)?;
::fidl_next::Encode::encode(&mut self.b, encoder, b)?;
Ok(())
}
}
impl ::fidl_next::EncodableOption for Box<MainProtocolTwoWayAnonWithErrorResponse> {
type EncodedOption = ::fidl_next::WireBox<WireMainProtocolTwoWayAnonWithErrorResponse>;
}
impl<___E> ::fidl_next::EncodeOption<___E> for Box<MainProtocolTwoWayAnonWithErrorResponse>
where
___E: ::fidl_next::Encoder + ?Sized,
MainProtocolTwoWayAnonWithErrorResponse: ::fidl_next::Encode<___E>,
{
#[inline]
fn encode_option(
this: Option<&mut Self>,
encoder: &mut ___E,
slot: ::fidl_next::Slot<'_, Self::EncodedOption>,
) -> Result<(), ::fidl_next::EncodeError> {
if let Some(inner) = this {
::fidl_next::EncoderExt::encode_next(encoder, inner)?;
::fidl_next::WireBox::encode_present(slot);
} else {
::fidl_next::WireBox::encode_absent(slot);
}
Ok(())
}
}
impl ::fidl_next::TakeFrom<WireMainProtocolTwoWayAnonWithErrorResponse>
for MainProtocolTwoWayAnonWithErrorResponse
{
const COPY_OPTIMIZATION: ::fidl_next::CopyOptimization<Self> = unsafe {
::fidl_next::CopyOptimization::enable_if(
true && <u32 as ::fidl_next::Encodable>::COPY_OPTIMIZATION.is_enabled()
&& <u32 as ::fidl_next::Encodable>::COPY_OPTIMIZATION.is_enabled(),
)
};
#[inline]
fn take_from(from: &WireMainProtocolTwoWayAnonWithErrorResponse) -> Self {
Self {
a: ::fidl_next::TakeFrom::take_from(&from.a),
b: ::fidl_next::TakeFrom::take_from(&from.b),
}
}
}
/// The wire type corersponding to [`MainProtocolTwoWayAnonWithErrorResponse`].
#[derive(Clone, Debug)]
#[repr(C)]
pub struct WireMainProtocolTwoWayAnonWithErrorResponse {
pub a: ::fidl_next::u32_le,
pub b: ::fidl_next::u32_le,
}
unsafe impl<___D> ::fidl_next::Decode<___D> for WireMainProtocolTwoWayAnonWithErrorResponse
where
___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
{
fn decode(
slot: ::fidl_next::Slot<'_, Self>,
decoder: &mut ___D,
) -> Result<(), ::fidl_next::DecodeError> {
::fidl_next::munge! {
let Self {
mut a,
mut b,
} = slot;
}
::fidl_next::Decode::decode(a.as_mut(), decoder)?;
::fidl_next::Decode::decode(b.as_mut(), decoder)?;
Ok(())
}
}
#[derive(Clone, Debug)]
pub enum MainProtocolTwoWayAnonWithErrorResult {
Response(crate::MainProtocolTwoWayAnonWithErrorResponse),
Err(u32),
}
impl ::fidl_next::Encodable for MainProtocolTwoWayAnonWithErrorResult {
type Encoded = WireMainProtocolTwoWayAnonWithErrorResult;
}
impl<___E> ::fidl_next::Encode<___E> for MainProtocolTwoWayAnonWithErrorResult
where
___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
___E: ::fidl_next::Encoder,
{
#[inline]
fn encode(
&mut self,
encoder: &mut ___E,
slot: ::fidl_next::Slot<'_, Self::Encoded>,
) -> Result<(), ::fidl_next::EncodeError> {
::fidl_next::munge!(let WireMainProtocolTwoWayAnonWithErrorResult { raw } = slot);
match self {
Self::Response(value) => ::fidl_next::RawWireUnion::encode_as::<
___E,
crate::MainProtocolTwoWayAnonWithErrorResponse,
>(value, 1, encoder, raw)?,
Self::Err(value) => {
::fidl_next::RawWireUnion::encode_as::<___E, u32>(value, 2, encoder, raw)?
}
}
Ok(())
}
}
impl ::fidl_next::EncodableOption for Box<MainProtocolTwoWayAnonWithErrorResult> {
type EncodedOption = WireOptionalMainProtocolTwoWayAnonWithErrorResult;
}
impl<___E> ::fidl_next::EncodeOption<___E> for Box<MainProtocolTwoWayAnonWithErrorResult>
where
___E: ?Sized,
MainProtocolTwoWayAnonWithErrorResult: ::fidl_next::Encode<___E>,
{
#[inline]
fn encode_option(
this: Option<&mut Self>,
encoder: &mut ___E,
mut slot: ::fidl_next::Slot<'_, Self::EncodedOption>,
) -> Result<(), ::fidl_next::EncodeError> {
::fidl_next::munge!(let WireOptionalMainProtocolTwoWayAnonWithErrorResult { raw } = slot.as_mut());
if let Some(inner) = this {
let slot = unsafe { ::fidl_next::Slot::new_unchecked(slot.as_mut_ptr().cast()) };
::fidl_next::Encode::encode(&mut **inner, encoder, slot)?;
} else {
::fidl_next::RawWireUnion::encode_absent(raw);
}
Ok(())
}
}
impl ::fidl_next::TakeFrom<WireMainProtocolTwoWayAnonWithErrorResult>
for MainProtocolTwoWayAnonWithErrorResult
{
#[inline]
fn take_from(from: &WireMainProtocolTwoWayAnonWithErrorResult) -> Self {
match from.raw.ordinal() {
1 => Self::Response(::fidl_next::TakeFrom::take_from(unsafe {
from.raw.get().deref_unchecked()
})),
2 => Self::Err(::fidl_next::TakeFrom::take_from(unsafe {
from.raw.get().deref_unchecked()
})),
_ => unsafe { ::core::hint::unreachable_unchecked() },
}
}
}
impl ::fidl_next::TakeFrom<WireOptionalMainProtocolTwoWayAnonWithErrorResult>
for Option<Box<MainProtocolTwoWayAnonWithErrorResult>>
{
#[inline]
fn take_from(from: &WireOptionalMainProtocolTwoWayAnonWithErrorResult) -> Self {
if let Some(inner) = from.as_ref() {
Some(::fidl_next::TakeFrom::take_from(inner))
} else {
None
}
}
}
/// The wire type corresponding to [`MainProtocolTwoWayAnonWithErrorResult`].
#[repr(transparent)]
pub struct WireMainProtocolTwoWayAnonWithErrorResult {
raw: ::fidl_next::RawWireUnion,
}
pub mod main_protocol_two_way_anon_with_error_result {
pub enum Ref<'union> {
Response(&'union crate::WireMainProtocolTwoWayAnonWithErrorResponse),
Err(&'union ::fidl_next::u32_le),
}
}
impl WireMainProtocolTwoWayAnonWithErrorResult {
pub fn as_ref(&self) -> crate::main_protocol_two_way_anon_with_error_result::Ref<'_> {
match self.raw.ordinal() {
1 => crate::main_protocol_two_way_anon_with_error_result::Ref::Response(unsafe {
self.raw.get().deref_unchecked()
}),
2 => crate::main_protocol_two_way_anon_with_error_result::Ref::Err(unsafe {
self.raw.get().deref_unchecked()
}),
_ => unsafe { ::core::hint::unreachable_unchecked() },
}
}
}
unsafe impl<___D> ::fidl_next::Decode<___D> for WireMainProtocolTwoWayAnonWithErrorResult
where
___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
___D: ::fidl_next::Decoder,
{
fn decode(
mut slot: ::fidl_next::Slot<'_, Self>,
decoder: &mut ___D,
) -> Result<(), ::fidl_next::DecodeError> {
::fidl_next::munge!(let Self { mut raw } = slot.as_mut());
match ::fidl_next::RawWireUnion::encoded_ordinal(raw.as_mut()) {
1 => ::fidl_next::RawWireUnion::decode_as::<
___D,
crate::WireMainProtocolTwoWayAnonWithErrorResponse,
>(raw, decoder)?,
2 => ::fidl_next::RawWireUnion::decode_as::<___D, ::fidl_next::u32_le>(raw, decoder)?,
ord => return Err(::fidl_next::DecodeError::InvalidUnionOrdinal(ord as usize)),
}
Ok(())
}
}
impl ::core::fmt::Debug for WireMainProtocolTwoWayAnonWithErrorResult {
fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
match self.raw.ordinal() {
1 => unsafe {
self.raw
.get()
.deref_unchecked::<crate::WireMainProtocolTwoWayAnonWithErrorResponse>()
.fmt(f)
},
2 => unsafe { self.raw.get().deref_unchecked::<::fidl_next::u32_le>().fmt(f) },
_ => unsafe { ::core::hint::unreachable_unchecked() },
}
}
}
#[repr(transparent)]
pub struct WireOptionalMainProtocolTwoWayAnonWithErrorResult {
raw: ::fidl_next::RawWireUnion,
}
impl WireOptionalMainProtocolTwoWayAnonWithErrorResult {
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) -> Option<&WireMainProtocolTwoWayAnonWithErrorResult> {
if self.is_some() {
Some(unsafe { &*(self as *const Self).cast() })
} else {
None
}
}
}
unsafe impl<___D> ::fidl_next::Decode<___D> for WireOptionalMainProtocolTwoWayAnonWithErrorResult
where
___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
___D: ::fidl_next::Decoder,
{
fn decode(
mut slot: ::fidl_next::Slot<'_, Self>,
decoder: &mut ___D,
) -> Result<(), ::fidl_next::DecodeError> {
::fidl_next::munge!(let Self { mut raw } = slot.as_mut());
match ::fidl_next::RawWireUnion::encoded_ordinal(raw.as_mut()) {
1 => ::fidl_next::RawWireUnion::decode_as::<
___D,
crate::WireMainProtocolTwoWayAnonWithErrorResponse,
>(raw, decoder)?,
2 => ::fidl_next::RawWireUnion::decode_as::<___D, ::fidl_next::u32_le>(raw, decoder)?,
0 => ::fidl_next::RawWireUnion::decode_absent(raw)?,
_ => ::fidl_next::RawWireUnion::decode_unknown(raw, decoder)?,
}
Ok(())
}
}
impl ::core::fmt::Debug for WireOptionalMainProtocolTwoWayAnonWithErrorResult {
fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
self.as_ref().fmt(f)
}
}
#[derive(Clone, Debug)]
#[repr(C)]
pub struct MainProtocolOnAnonRequest {
pub a: u32,
pub b: u32,
}
impl ::fidl_next::Encodable for MainProtocolOnAnonRequest {
const COPY_OPTIMIZATION: ::fidl_next::CopyOptimization<Self> = unsafe {
::fidl_next::CopyOptimization::enable_if(
true && <u32 as ::fidl_next::Encodable>::COPY_OPTIMIZATION.is_enabled()
&& <u32 as ::fidl_next::Encodable>::COPY_OPTIMIZATION.is_enabled(),
)
};
type Encoded = WireMainProtocolOnAnonRequest;
}
impl<___E> ::fidl_next::Encode<___E> for MainProtocolOnAnonRequest
where
___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
{
#[inline]
fn encode(
&mut self,
encoder: &mut ___E,
slot: ::fidl_next::Slot<'_, Self::Encoded>,
) -> Result<(), ::fidl_next::EncodeError> {
::fidl_next::munge! {
let Self::Encoded {
a,
b,
} = slot;
}
::fidl_next::Encode::encode(&mut self.a, encoder, a)?;
::fidl_next::Encode::encode(&mut self.b, encoder, b)?;
Ok(())
}
}
impl ::fidl_next::EncodableOption for Box<MainProtocolOnAnonRequest> {
type EncodedOption = ::fidl_next::WireBox<WireMainProtocolOnAnonRequest>;
}
impl<___E> ::fidl_next::EncodeOption<___E> for Box<MainProtocolOnAnonRequest>
where
___E: ::fidl_next::Encoder + ?Sized,
MainProtocolOnAnonRequest: ::fidl_next::Encode<___E>,
{
#[inline]
fn encode_option(
this: Option<&mut Self>,
encoder: &mut ___E,
slot: ::fidl_next::Slot<'_, Self::EncodedOption>,
) -> Result<(), ::fidl_next::EncodeError> {
if let Some(inner) = this {
::fidl_next::EncoderExt::encode_next(encoder, inner)?;
::fidl_next::WireBox::encode_present(slot);
} else {
::fidl_next::WireBox::encode_absent(slot);
}
Ok(())
}
}
impl ::fidl_next::TakeFrom<WireMainProtocolOnAnonRequest> for MainProtocolOnAnonRequest {
const COPY_OPTIMIZATION: ::fidl_next::CopyOptimization<Self> = unsafe {
::fidl_next::CopyOptimization::enable_if(
true && <u32 as ::fidl_next::Encodable>::COPY_OPTIMIZATION.is_enabled()
&& <u32 as ::fidl_next::Encodable>::COPY_OPTIMIZATION.is_enabled(),
)
};
#[inline]
fn take_from(from: &WireMainProtocolOnAnonRequest) -> Self {
Self {
a: ::fidl_next::TakeFrom::take_from(&from.a),
b: ::fidl_next::TakeFrom::take_from(&from.b),
}
}
}
/// The wire type corersponding to [`MainProtocolOnAnonRequest`].
#[derive(Clone, Debug)]
#[repr(C)]
pub struct WireMainProtocolOnAnonRequest {
pub a: ::fidl_next::u32_le,
pub b: ::fidl_next::u32_le,
}
unsafe impl<___D> ::fidl_next::Decode<___D> for WireMainProtocolOnAnonRequest
where
___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
{
fn decode(
slot: ::fidl_next::Slot<'_, Self>,
decoder: &mut ___D,
) -> Result<(), ::fidl_next::DecodeError> {
::fidl_next::munge! {
let Self {
mut a,
mut b,
} = slot;
}
::fidl_next::Decode::decode(a.as_mut(), decoder)?;
::fidl_next::Decode::decode(b.as_mut(), decoder)?;
Ok(())
}
}
/// The type corresponding to the MainProtocol protocol.
#[derive(Debug)]
pub struct MainProtocol;
pub mod main_protocol {
pub struct OneWayComposed;
impl ::fidl_next::bind::Method for OneWayComposed {
const ORDINAL: u64 = 2602591870026304272;
type Protocol = crate::MainProtocol;
type Request = ::fidl_next_test_protocolpayloads_imported::WireImportStructPayload;
type Response = ::fidl_next::bind::Never;
}
pub struct TwoWayComposed;
impl ::fidl_next::bind::Method for TwoWayComposed {
const ORDINAL: u64 = 2542459230546612144;
type Protocol = crate::MainProtocol;
type Request = ::fidl_next_test_protocolpayloads_imported::WireImportStructPayload;
type Response = ::fidl_next_test_protocolpayloads_imported::WireImportStructPayload;
}
pub struct TwoWayComposedWithError;
impl ::fidl_next::bind::Method for TwoWayComposedWithError {
const ORDINAL: u64 = 7681984876526769495;
type Protocol = crate::MainProtocol;
type Request = ::fidl_next_test_protocolpayloads_imported::WireImportStructPayload;
type Response = ::fidl_next_test_protocolpayloads_imported::WireComposedProtocolTwoWayComposedWithErrorResult;
}
pub struct OnComposed;
impl ::fidl_next::bind::Method for OnComposed {
const ORDINAL: u64 = 1872339328378152762;
type Protocol = crate::MainProtocol;
type Request = ::fidl_next::bind::Never;
type Response = ::fidl_next_test_protocolpayloads_imported::WireImportStructPayload;
}
pub struct OneWayLocal;
impl ::fidl_next::bind::Method for OneWayLocal {
const ORDINAL: u64 = 7755175439334311701;
type Protocol = crate::MainProtocol;
type Request = crate::WireLocalStructPayload;
type Response = ::fidl_next::bind::Never;
}
pub struct TwoWayLocal;
impl ::fidl_next::bind::Method for TwoWayLocal {
const ORDINAL: u64 = 8374292137648566031;
type Protocol = crate::MainProtocol;
type Request = crate::WireLocalStructPayload;
type Response = crate::WireLocalStructPayload;
}
pub struct TwoWayLocalWithError;
impl ::fidl_next::bind::Method for TwoWayLocalWithError {
const ORDINAL: u64 = 2898559119954589948;
type Protocol = crate::MainProtocol;
type Request = crate::WireLocalStructPayload;
type Response = crate::WireMainProtocolTwoWayLocalWithErrorResult;
}
pub struct OnLocal;
impl ::fidl_next::bind::Method for OnLocal {
const ORDINAL: u64 = 5135782819583756313;
type Protocol = crate::MainProtocol;
type Request = ::fidl_next::bind::Never;
type Response = crate::WireLocalStructPayload;
}
pub struct OneWayImport;
impl ::fidl_next::bind::Method for OneWayImport {
const ORDINAL: u64 = 3344777159365288972;
type Protocol = crate::MainProtocol;
type Request = ::fidl_next_test_protocolpayloads_imported::WireImportStructPayload;
type Response = ::fidl_next::bind::Never;
}
pub struct TwoWayImport;
impl ::fidl_next::bind::Method for TwoWayImport {
const ORDINAL: u64 = 2374708679656510579;
type Protocol = crate::MainProtocol;
type Request = ::fidl_next_test_protocolpayloads_imported::WireImportStructPayload;
type Response = ::fidl_next_test_protocolpayloads_imported::WireImportStructPayload;
}
pub struct TwoWayImportWithError;
impl ::fidl_next::bind::Method for TwoWayImportWithError {
const ORDINAL: u64 = 4286143084949642173;
type Protocol = crate::MainProtocol;
type Request = ::fidl_next_test_protocolpayloads_imported::WireImportStructPayload;
type Response = crate::WireMainProtocolTwoWayImportWithErrorResult;
}
pub struct OnImport;
impl ::fidl_next::bind::Method for OnImport {
const ORDINAL: u64 = 1996489653379631369;
type Protocol = crate::MainProtocol;
type Request = ::fidl_next::bind::Never;
type Response = ::fidl_next_test_protocolpayloads_imported::WireImportStructPayload;
}
pub struct OneWayAnon;
impl ::fidl_next::bind::Method for OneWayAnon {
const ORDINAL: u64 = 811587311021806764;
type Protocol = crate::MainProtocol;
type Request = crate::WireMainProtocolOneWayAnonRequest;
type Response = ::fidl_next::bind::Never;
}
pub struct TwoWayAnon;
impl ::fidl_next::bind::Method for TwoWayAnon {
const ORDINAL: u64 = 629880979996923737;
type Protocol = crate::MainProtocol;
type Request = crate::WireMainProtocolTwoWayAnonRequest;
type Response = crate::WireMainProtocolTwoWayAnonResponse;
}
pub struct TwoWayAnonWithError;
impl ::fidl_next::bind::Method for TwoWayAnonWithError {
const ORDINAL: u64 = 6368863385719175734;
type Protocol = crate::MainProtocol;
type Request = crate::WireMainProtocolTwoWayAnonWithErrorRequest;
type Response = crate::WireMainProtocolTwoWayAnonWithErrorResult;
}
pub struct OnAnon;
impl ::fidl_next::bind::Method for OnAnon {
const ORDINAL: u64 = 4815229650203439104;
type Protocol = crate::MainProtocol;
type Request = ::fidl_next::bind::Never;
type Response = crate::WireMainProtocolOnAnonRequest;
}
}
/// A helper trait for the `MainProtocol` client sender.
pub trait MainProtocolClientSender<___T: ::fidl_next::protocol::Transport> {
fn one_way_composed<___R>(
&self,
request: &mut ___R,
) -> Result<___T::SendFuture<'_>, ::fidl_next::EncodeError>
where
___R: ::fidl_next::Encode<
___T::SendBuffer,
Encoded = ::fidl_next_test_protocolpayloads_imported::WireImportStructPayload,
>;
fn two_way_composed<___R>(
&self,
request: &mut ___R,
) -> Result<
::fidl_next::bind::ResponseFuture<'_, ___T, main_protocol::TwoWayComposed>,
::fidl_next::EncodeError,
>
where
___R: ::fidl_next::Encode<
___T::SendBuffer,
Encoded = ::fidl_next_test_protocolpayloads_imported::WireImportStructPayload,
>;
fn two_way_composed_with_error<___R>(
&self,
request: &mut ___R,
) -> Result<
::fidl_next::bind::ResponseFuture<'_, ___T, main_protocol::TwoWayComposedWithError>,
::fidl_next::EncodeError,
>
where
___R: ::fidl_next::Encode<
___T::SendBuffer,
Encoded = ::fidl_next_test_protocolpayloads_imported::WireImportStructPayload,
>;
fn one_way_local<___R>(
&self,
request: &mut ___R,
) -> Result<___T::SendFuture<'_>, ::fidl_next::EncodeError>
where
___R: ::fidl_next::Encode<___T::SendBuffer, Encoded = crate::WireLocalStructPayload>;
fn two_way_local<___R>(
&self,
request: &mut ___R,
) -> Result<
::fidl_next::bind::ResponseFuture<'_, ___T, main_protocol::TwoWayLocal>,
::fidl_next::EncodeError,
>
where
___R: ::fidl_next::Encode<___T::SendBuffer, Encoded = crate::WireLocalStructPayload>;
fn two_way_local_with_error<___R>(
&self,
request: &mut ___R,
) -> Result<
::fidl_next::bind::ResponseFuture<'_, ___T, main_protocol::TwoWayLocalWithError>,
::fidl_next::EncodeError,
>
where
___R: ::fidl_next::Encode<___T::SendBuffer, Encoded = crate::WireLocalStructPayload>;
fn one_way_import<___R>(
&self,
request: &mut ___R,
) -> Result<___T::SendFuture<'_>, ::fidl_next::EncodeError>
where
___R: ::fidl_next::Encode<
___T::SendBuffer,
Encoded = ::fidl_next_test_protocolpayloads_imported::WireImportStructPayload,
>;
fn two_way_import<___R>(
&self,
request: &mut ___R,
) -> Result<
::fidl_next::bind::ResponseFuture<'_, ___T, main_protocol::TwoWayImport>,
::fidl_next::EncodeError,
>
where
___R: ::fidl_next::Encode<
___T::SendBuffer,
Encoded = ::fidl_next_test_protocolpayloads_imported::WireImportStructPayload,
>;
fn two_way_import_with_error<___R>(
&self,
request: &mut ___R,
) -> Result<
::fidl_next::bind::ResponseFuture<'_, ___T, main_protocol::TwoWayImportWithError>,
::fidl_next::EncodeError,
>
where
___R: ::fidl_next::Encode<
___T::SendBuffer,
Encoded = ::fidl_next_test_protocolpayloads_imported::WireImportStructPayload,
>;
fn one_way_anon<___R>(
&self,
request: &mut ___R,
) -> Result<___T::SendFuture<'_>, ::fidl_next::EncodeError>
where
___R: ::fidl_next::Encode<
___T::SendBuffer,
Encoded = crate::WireMainProtocolOneWayAnonRequest,
>;
fn two_way_anon<___R>(
&self,
request: &mut ___R,
) -> Result<
::fidl_next::bind::ResponseFuture<'_, ___T, main_protocol::TwoWayAnon>,
::fidl_next::EncodeError,
>
where
___R: ::fidl_next::Encode<
___T::SendBuffer,
Encoded = crate::WireMainProtocolTwoWayAnonRequest,
>;
fn two_way_anon_with_error<___R>(
&self,
request: &mut ___R,
) -> Result<
::fidl_next::bind::ResponseFuture<'_, ___T, main_protocol::TwoWayAnonWithError>,
::fidl_next::EncodeError,
>
where
___R: ::fidl_next::Encode<
___T::SendBuffer,
Encoded = crate::WireMainProtocolTwoWayAnonWithErrorRequest,
>;
}
impl<___T> MainProtocolClientSender<___T> for ::fidl_next::bind::ClientSender<___T, MainProtocol>
where
___T: ::fidl_next::protocol::Transport,
{
fn one_way_composed<___R>(
&self,
request: &mut ___R,
) -> Result<___T::SendFuture<'_>, ::fidl_next::EncodeError>
where
___R: ::fidl_next::Encode<
___T::SendBuffer,
Encoded = ::fidl_next_test_protocolpayloads_imported::WireImportStructPayload,
>,
{
self.as_untyped().send_one_way(2602591870026304272, request)
}
fn two_way_composed<___R>(
&self,
request: &mut ___R,
) -> Result<
::fidl_next::bind::ResponseFuture<'_, ___T, main_protocol::TwoWayComposed>,
::fidl_next::EncodeError,
>
where
___R: ::fidl_next::Encode<
___T::SendBuffer,
Encoded = ::fidl_next_test_protocolpayloads_imported::WireImportStructPayload,
>,
{
self.as_untyped()
.send_two_way(2542459230546612144, request)
.map(::fidl_next::bind::ResponseFuture::from_untyped)
}
fn two_way_composed_with_error<___R>(
&self,
request: &mut ___R,
) -> Result<
::fidl_next::bind::ResponseFuture<'_, ___T, main_protocol::TwoWayComposedWithError>,
::fidl_next::EncodeError,
>
where
___R: ::fidl_next::Encode<
___T::SendBuffer,
Encoded = ::fidl_next_test_protocolpayloads_imported::WireImportStructPayload,
>,
{
self.as_untyped()
.send_two_way(7681984876526769495, request)
.map(::fidl_next::bind::ResponseFuture::from_untyped)
}
fn one_way_local<___R>(
&self,
request: &mut ___R,
) -> Result<___T::SendFuture<'_>, ::fidl_next::EncodeError>
where
___R: ::fidl_next::Encode<___T::SendBuffer, Encoded = crate::WireLocalStructPayload>,
{
self.as_untyped().send_one_way(7755175439334311701, request)
}
fn two_way_local<___R>(
&self,
request: &mut ___R,
) -> Result<
::fidl_next::bind::ResponseFuture<'_, ___T, main_protocol::TwoWayLocal>,
::fidl_next::EncodeError,
>
where
___R: ::fidl_next::Encode<___T::SendBuffer, Encoded = crate::WireLocalStructPayload>,
{
self.as_untyped()
.send_two_way(8374292137648566031, request)
.map(::fidl_next::bind::ResponseFuture::from_untyped)
}
fn two_way_local_with_error<___R>(
&self,
request: &mut ___R,
) -> Result<
::fidl_next::bind::ResponseFuture<'_, ___T, main_protocol::TwoWayLocalWithError>,
::fidl_next::EncodeError,
>
where
___R: ::fidl_next::Encode<___T::SendBuffer, Encoded = crate::WireLocalStructPayload>,
{
self.as_untyped()
.send_two_way(2898559119954589948, request)
.map(::fidl_next::bind::ResponseFuture::from_untyped)
}
fn one_way_import<___R>(
&self,
request: &mut ___R,
) -> Result<___T::SendFuture<'_>, ::fidl_next::EncodeError>
where
___R: ::fidl_next::Encode<
___T::SendBuffer,
Encoded = ::fidl_next_test_protocolpayloads_imported::WireImportStructPayload,
>,
{
self.as_untyped().send_one_way(3344777159365288972, request)
}
fn two_way_import<___R>(
&self,
request: &mut ___R,
) -> Result<
::fidl_next::bind::ResponseFuture<'_, ___T, main_protocol::TwoWayImport>,
::fidl_next::EncodeError,
>
where
___R: ::fidl_next::Encode<
___T::SendBuffer,
Encoded = ::fidl_next_test_protocolpayloads_imported::WireImportStructPayload,
>,
{
self.as_untyped()
.send_two_way(2374708679656510579, request)
.map(::fidl_next::bind::ResponseFuture::from_untyped)
}
fn two_way_import_with_error<___R>(
&self,
request: &mut ___R,
) -> Result<
::fidl_next::bind::ResponseFuture<'_, ___T, main_protocol::TwoWayImportWithError>,
::fidl_next::EncodeError,
>
where
___R: ::fidl_next::Encode<
___T::SendBuffer,
Encoded = ::fidl_next_test_protocolpayloads_imported::WireImportStructPayload,
>,
{
self.as_untyped()
.send_two_way(4286143084949642173, request)
.map(::fidl_next::bind::ResponseFuture::from_untyped)
}
fn one_way_anon<___R>(
&self,
request: &mut ___R,
) -> Result<___T::SendFuture<'_>, ::fidl_next::EncodeError>
where
___R: ::fidl_next::Encode<
___T::SendBuffer,
Encoded = crate::WireMainProtocolOneWayAnonRequest,
>,
{
self.as_untyped().send_one_way(811587311021806764, request)
}
fn two_way_anon<___R>(
&self,
request: &mut ___R,
) -> Result<
::fidl_next::bind::ResponseFuture<'_, ___T, main_protocol::TwoWayAnon>,
::fidl_next::EncodeError,
>
where
___R: ::fidl_next::Encode<
___T::SendBuffer,
Encoded = crate::WireMainProtocolTwoWayAnonRequest,
>,
{
self.as_untyped()
.send_two_way(629880979996923737, request)
.map(::fidl_next::bind::ResponseFuture::from_untyped)
}
fn two_way_anon_with_error<___R>(
&self,
request: &mut ___R,
) -> Result<
::fidl_next::bind::ResponseFuture<'_, ___T, main_protocol::TwoWayAnonWithError>,
::fidl_next::EncodeError,
>
where
___R: ::fidl_next::Encode<
___T::SendBuffer,
Encoded = crate::WireMainProtocolTwoWayAnonWithErrorRequest,
>,
{
self.as_untyped()
.send_two_way(6368863385719175734, request)
.map(::fidl_next::bind::ResponseFuture::from_untyped)
}
}
/// A client handler for the MainProtocol protocol.
///
/// See [`MainProtocol`] for more details.
pub trait MainProtocolClientHandler<___T: ::fidl_next::protocol::Transport> {
fn on_composed(
&mut self,
sender: &::fidl_next::bind::ClientSender<___T, MainProtocol>,
message: ::fidl_next::bind::ResponseBuffer<___T, main_protocol::OnComposed>,
);
fn on_local(
&mut self,
sender: &::fidl_next::bind::ClientSender<___T, MainProtocol>,
message: ::fidl_next::bind::ResponseBuffer<___T, main_protocol::OnLocal>,
);
fn on_import(
&mut self,
sender: &::fidl_next::bind::ClientSender<___T, MainProtocol>,
message: ::fidl_next::bind::ResponseBuffer<___T, main_protocol::OnImport>,
);
fn on_anon(
&mut self,
sender: &::fidl_next::bind::ClientSender<___T, MainProtocol>,
message: ::fidl_next::bind::ResponseBuffer<___T, main_protocol::OnAnon>,
);
}
impl<___T, ___H> ::fidl_next::bind::ClientProtocol<___T, ___H> for MainProtocol
where
___T: ::fidl_next::protocol::Transport,
___H: MainProtocolClientHandler<___T>,
::fidl_next_test_protocolpayloads_imported::WireImportStructPayload:
::fidl_next::Decode<<___T as ::fidl_next::protocol::Transport>::RecvBuffer>,
::fidl_next_test_protocolpayloads_imported::WireComposedProtocolTwoWayComposedWithErrorResult:
::fidl_next::Decode<<___T as ::fidl_next::protocol::Transport>::RecvBuffer>,
::fidl_next_test_protocolpayloads_imported::WireImportStructPayload:
::fidl_next::Decode<<___T as ::fidl_next::protocol::Transport>::RecvBuffer>,
crate::WireLocalStructPayload:
::fidl_next::Decode<<___T as ::fidl_next::protocol::Transport>::RecvBuffer>,
crate::WireMainProtocolTwoWayLocalWithErrorResult:
::fidl_next::Decode<<___T as ::fidl_next::protocol::Transport>::RecvBuffer>,
crate::WireLocalStructPayload:
::fidl_next::Decode<<___T as ::fidl_next::protocol::Transport>::RecvBuffer>,
::fidl_next_test_protocolpayloads_imported::WireImportStructPayload:
::fidl_next::Decode<<___T as ::fidl_next::protocol::Transport>::RecvBuffer>,
crate::WireMainProtocolTwoWayImportWithErrorResult:
::fidl_next::Decode<<___T as ::fidl_next::protocol::Transport>::RecvBuffer>,
::fidl_next_test_protocolpayloads_imported::WireImportStructPayload:
::fidl_next::Decode<<___T as ::fidl_next::protocol::Transport>::RecvBuffer>,
crate::WireMainProtocolTwoWayAnonResponse:
::fidl_next::Decode<<___T as ::fidl_next::protocol::Transport>::RecvBuffer>,
crate::WireMainProtocolTwoWayAnonWithErrorResult:
::fidl_next::Decode<<___T as ::fidl_next::protocol::Transport>::RecvBuffer>,
crate::WireMainProtocolOnAnonRequest:
::fidl_next::Decode<<___T as ::fidl_next::protocol::Transport>::RecvBuffer>,
{
fn on_event(
handler: &mut ___H,
sender: &::fidl_next::bind::ClientSender<___T, Self>,
ordinal: u64,
buffer: ___T::RecvBuffer,
) {
match ordinal {
1872339328378152762 => {
let buffer = ::fidl_next::bind::ResponseBuffer::from_untyped(buffer);
handler.on_composed(sender, buffer);
}
5135782819583756313 => {
let buffer = ::fidl_next::bind::ResponseBuffer::from_untyped(buffer);
handler.on_local(sender, buffer);
}
1996489653379631369 => {
let buffer = ::fidl_next::bind::ResponseBuffer::from_untyped(buffer);
handler.on_import(sender, buffer);
}
4815229650203439104 => {
let buffer = ::fidl_next::bind::ResponseBuffer::from_untyped(buffer);
handler.on_anon(sender, buffer);
}
ordinal => {
sender.close();
}
}
}
}
/// A helper trait for the `MainProtocol` server sender.
pub trait MainProtocolServerSender<___T: ::fidl_next::protocol::Transport> {
fn on_composed<___R>(
&self,
request: &mut ___R,
) -> Result<___T::SendFuture<'_>, ::fidl_next::EncodeError>
where
___R: ::fidl_next::Encode<
___T::SendBuffer,
Encoded = ::fidl_next_test_protocolpayloads_imported::WireImportStructPayload,
>;
fn on_local<___R>(
&self,
request: &mut ___R,
) -> Result<___T::SendFuture<'_>, ::fidl_next::EncodeError>
where
___R: ::fidl_next::Encode<___T::SendBuffer, Encoded = crate::WireLocalStructPayload>;
fn on_import<___R>(
&self,
request: &mut ___R,
) -> Result<___T::SendFuture<'_>, ::fidl_next::EncodeError>
where
___R: ::fidl_next::Encode<
___T::SendBuffer,
Encoded = ::fidl_next_test_protocolpayloads_imported::WireImportStructPayload,
>;
fn on_anon<___R>(
&self,
request: &mut ___R,
) -> Result<___T::SendFuture<'_>, ::fidl_next::EncodeError>
where
___R: ::fidl_next::Encode<___T::SendBuffer, Encoded = crate::WireMainProtocolOnAnonRequest>;
}
impl<___T> MainProtocolServerSender<___T> for ::fidl_next::bind::ServerSender<___T, MainProtocol>
where
___T: ::fidl_next::protocol::Transport,
{
fn on_composed<___R>(
&self,
request: &mut ___R,
) -> Result<___T::SendFuture<'_>, ::fidl_next::EncodeError>
where
___R: ::fidl_next::Encode<
___T::SendBuffer,
Encoded = ::fidl_next_test_protocolpayloads_imported::WireImportStructPayload,
>,
{
self.as_untyped().send_event(1872339328378152762, request)
}
fn on_local<___R>(
&self,
request: &mut ___R,
) -> Result<___T::SendFuture<'_>, ::fidl_next::EncodeError>
where
___R: ::fidl_next::Encode<___T::SendBuffer, Encoded = crate::WireLocalStructPayload>,
{
self.as_untyped().send_event(5135782819583756313, request)
}
fn on_import<___R>(
&self,
request: &mut ___R,
) -> Result<___T::SendFuture<'_>, ::fidl_next::EncodeError>
where
___R: ::fidl_next::Encode<
___T::SendBuffer,
Encoded = ::fidl_next_test_protocolpayloads_imported::WireImportStructPayload,
>,
{
self.as_untyped().send_event(1996489653379631369, request)
}
fn on_anon<___R>(
&self,
request: &mut ___R,
) -> Result<___T::SendFuture<'_>, ::fidl_next::EncodeError>
where
___R: ::fidl_next::Encode<___T::SendBuffer, Encoded = crate::WireMainProtocolOnAnonRequest>,
{
self.as_untyped().send_event(4815229650203439104, request)
}
}
/// A server handler for the MainProtocol protocol.
///
/// See [`MainProtocol`] for more details.
pub trait MainProtocolServerHandler<___T: ::fidl_next::protocol::Transport> {
fn one_way_composed(
&mut self,
sender: &::fidl_next::bind::ServerSender<___T, MainProtocol>,
request: ::fidl_next::bind::RequestBuffer<___T, main_protocol::OneWayComposed>,
);
fn two_way_composed(
&mut self,
sender: &::fidl_next::bind::ServerSender<___T, MainProtocol>,
request: ::fidl_next::bind::RequestBuffer<___T, main_protocol::TwoWayComposed>,
responder: ::fidl_next::bind::Responder<main_protocol::TwoWayComposed>,
);
fn two_way_composed_with_error(
&mut self,
sender: &::fidl_next::bind::ServerSender<___T, MainProtocol>,
request: ::fidl_next::bind::RequestBuffer<___T, main_protocol::TwoWayComposedWithError>,
responder: ::fidl_next::bind::Responder<main_protocol::TwoWayComposedWithError>,
);
fn one_way_local(
&mut self,
sender: &::fidl_next::bind::ServerSender<___T, MainProtocol>,
request: ::fidl_next::bind::RequestBuffer<___T, main_protocol::OneWayLocal>,
);
fn two_way_local(
&mut self,
sender: &::fidl_next::bind::ServerSender<___T, MainProtocol>,
request: ::fidl_next::bind::RequestBuffer<___T, main_protocol::TwoWayLocal>,
responder: ::fidl_next::bind::Responder<main_protocol::TwoWayLocal>,
);
fn two_way_local_with_error(
&mut self,
sender: &::fidl_next::bind::ServerSender<___T, MainProtocol>,
request: ::fidl_next::bind::RequestBuffer<___T, main_protocol::TwoWayLocalWithError>,
responder: ::fidl_next::bind::Responder<main_protocol::TwoWayLocalWithError>,
);
fn one_way_import(
&mut self,
sender: &::fidl_next::bind::ServerSender<___T, MainProtocol>,
request: ::fidl_next::bind::RequestBuffer<___T, main_protocol::OneWayImport>,
);
fn two_way_import(
&mut self,
sender: &::fidl_next::bind::ServerSender<___T, MainProtocol>,
request: ::fidl_next::bind::RequestBuffer<___T, main_protocol::TwoWayImport>,
responder: ::fidl_next::bind::Responder<main_protocol::TwoWayImport>,
);
fn two_way_import_with_error(
&mut self,
sender: &::fidl_next::bind::ServerSender<___T, MainProtocol>,
request: ::fidl_next::bind::RequestBuffer<___T, main_protocol::TwoWayImportWithError>,
responder: ::fidl_next::bind::Responder<main_protocol::TwoWayImportWithError>,
);
fn one_way_anon(
&mut self,
sender: &::fidl_next::bind::ServerSender<___T, MainProtocol>,
request: ::fidl_next::bind::RequestBuffer<___T, main_protocol::OneWayAnon>,
);
fn two_way_anon(
&mut self,
sender: &::fidl_next::bind::ServerSender<___T, MainProtocol>,
request: ::fidl_next::bind::RequestBuffer<___T, main_protocol::TwoWayAnon>,
responder: ::fidl_next::bind::Responder<main_protocol::TwoWayAnon>,
);
fn two_way_anon_with_error(
&mut self,
sender: &::fidl_next::bind::ServerSender<___T, MainProtocol>,
request: ::fidl_next::bind::RequestBuffer<___T, main_protocol::TwoWayAnonWithError>,
responder: ::fidl_next::bind::Responder<main_protocol::TwoWayAnonWithError>,
);
}
impl<___T, ___H> ::fidl_next::bind::ServerProtocol<___T, ___H> for MainProtocol
where
___T: ::fidl_next::protocol::Transport,
___H: MainProtocolServerHandler<___T>,
::fidl_next_test_protocolpayloads_imported::WireImportStructPayload:
::fidl_next::Decode<<___T as ::fidl_next::protocol::Transport>::RecvBuffer>,
::fidl_next_test_protocolpayloads_imported::WireImportStructPayload:
::fidl_next::Decode<<___T as ::fidl_next::protocol::Transport>::RecvBuffer>,
::fidl_next_test_protocolpayloads_imported::WireImportStructPayload:
::fidl_next::Decode<<___T as ::fidl_next::protocol::Transport>::RecvBuffer>,
crate::WireLocalStructPayload:
::fidl_next::Decode<<___T as ::fidl_next::protocol::Transport>::RecvBuffer>,
crate::WireLocalStructPayload:
::fidl_next::Decode<<___T as ::fidl_next::protocol::Transport>::RecvBuffer>,
crate::WireLocalStructPayload:
::fidl_next::Decode<<___T as ::fidl_next::protocol::Transport>::RecvBuffer>,
::fidl_next_test_protocolpayloads_imported::WireImportStructPayload:
::fidl_next::Decode<<___T as ::fidl_next::protocol::Transport>::RecvBuffer>,
::fidl_next_test_protocolpayloads_imported::WireImportStructPayload:
::fidl_next::Decode<<___T as ::fidl_next::protocol::Transport>::RecvBuffer>,
::fidl_next_test_protocolpayloads_imported::WireImportStructPayload:
::fidl_next::Decode<<___T as ::fidl_next::protocol::Transport>::RecvBuffer>,
crate::WireMainProtocolOneWayAnonRequest:
::fidl_next::Decode<<___T as ::fidl_next::protocol::Transport>::RecvBuffer>,
crate::WireMainProtocolTwoWayAnonRequest:
::fidl_next::Decode<<___T as ::fidl_next::protocol::Transport>::RecvBuffer>,
crate::WireMainProtocolTwoWayAnonWithErrorRequest:
::fidl_next::Decode<<___T as ::fidl_next::protocol::Transport>::RecvBuffer>,
{
fn on_one_way(
handler: &mut ___H,
sender: &::fidl_next::bind::ServerSender<___T, Self>,
ordinal: u64,
buffer: ___T::RecvBuffer,
) {
match ordinal {
2602591870026304272 => {
let buffer = ::fidl_next::bind::RequestBuffer::from_untyped(buffer);
handler.one_way_composed(sender, buffer);
}
7755175439334311701 => {
let buffer = ::fidl_next::bind::RequestBuffer::from_untyped(buffer);
handler.one_way_local(sender, buffer);
}
3344777159365288972 => {
let buffer = ::fidl_next::bind::RequestBuffer::from_untyped(buffer);
handler.one_way_import(sender, buffer);
}
811587311021806764 => {
let buffer = ::fidl_next::bind::RequestBuffer::from_untyped(buffer);
handler.one_way_anon(sender, buffer);
}
ordinal => {
sender.close();
}
}
}
fn on_two_way(
handler: &mut ___H,
sender: &::fidl_next::bind::ServerSender<___T, Self>,
ordinal: u64,
buffer: ___T::RecvBuffer,
responder: ::fidl_next::protocol::Responder,
) {
match ordinal {
2542459230546612144 => {
let responder = ::fidl_next::bind::Responder::from_untyped(responder);
let buffer = ::fidl_next::bind::RequestBuffer::from_untyped(buffer);
handler.two_way_composed(sender, buffer, responder);
}
7681984876526769495 => {
let responder = ::fidl_next::bind::Responder::from_untyped(responder);
let buffer = ::fidl_next::bind::RequestBuffer::from_untyped(buffer);
handler.two_way_composed_with_error(sender, buffer, responder);
}
8374292137648566031 => {
let responder = ::fidl_next::bind::Responder::from_untyped(responder);
let buffer = ::fidl_next::bind::RequestBuffer::from_untyped(buffer);
handler.two_way_local(sender, buffer, responder);
}
2898559119954589948 => {
let responder = ::fidl_next::bind::Responder::from_untyped(responder);
let buffer = ::fidl_next::bind::RequestBuffer::from_untyped(buffer);
handler.two_way_local_with_error(sender, buffer, responder);
}
2374708679656510579 => {
let responder = ::fidl_next::bind::Responder::from_untyped(responder);
let buffer = ::fidl_next::bind::RequestBuffer::from_untyped(buffer);
handler.two_way_import(sender, buffer, responder);
}
4286143084949642173 => {
let responder = ::fidl_next::bind::Responder::from_untyped(responder);
let buffer = ::fidl_next::bind::RequestBuffer::from_untyped(buffer);
handler.two_way_import_with_error(sender, buffer, responder);
}
629880979996923737 => {
let responder = ::fidl_next::bind::Responder::from_untyped(responder);
let buffer = ::fidl_next::bind::RequestBuffer::from_untyped(buffer);
handler.two_way_anon(sender, buffer, responder);
}
6368863385719175734 => {
let responder = ::fidl_next::bind::Responder::from_untyped(responder);
let buffer = ::fidl_next::bind::RequestBuffer::from_untyped(buffer);
handler.two_way_anon_with_error(sender, buffer, responder);
}
ordinal => {
sender.close();
}
}
}
}