| // WARNING: This file is machine generated by fidlgen. |
| |
| // fidl_experiment = output_index_json |
| |
| #![warn(clippy::all)] |
| #![allow(unused_parens, unused_mut, unused_imports, nonstandard_style)] |
| |
| use bitflags::bitflags; |
| use fidl::encoding::{MessageBufFor, ProxyChannelBox, ResourceDialect}; |
| use futures::future::{self, MaybeDone, TryFutureExt}; |
| use zx_status; |
| |
| #[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)] |
| pub struct Empty; |
| |
| impl fidl::Persistable for Empty {} |
| |
| #[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)] |
| pub struct EmptyProtocolReceiveRequest { |
| pub e: Empty, |
| } |
| |
| impl fidl::Persistable for EmptyProtocolReceiveRequest {} |
| |
| #[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)] |
| pub struct EmptyProtocolSendAndReceiveRequest { |
| pub e: Empty, |
| } |
| |
| impl fidl::Persistable for EmptyProtocolSendAndReceiveRequest {} |
| |
| #[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)] |
| pub struct EmptyProtocolSendAndReceiveResponse { |
| pub e: Empty, |
| } |
| |
| impl fidl::Persistable for EmptyProtocolSendAndReceiveResponse {} |
| |
| #[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)] |
| pub struct EmptyProtocolSendRequest { |
| pub e: Empty, |
| } |
| |
| impl fidl::Persistable for EmptyProtocolSendRequest {} |
| |
| pub mod empty_protocol_ordinals { |
| pub const SEND_: u64 = 0x132262fd8b200708; |
| pub const RECEIVE: u64 = 0x1ff0ccf9b710e23f; |
| pub const SEND_AND_RECEIVE: u64 = 0x76a931254962cea; |
| } |
| |
| mod internal { |
| use super::*; |
| |
| impl fidl::encoding::ValueTypeMarker for Empty { |
| type Borrowed<'a> = &'a Self; |
| fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> { |
| value |
| } |
| } |
| |
| unsafe impl fidl::encoding::TypeMarker for Empty { |
| type Owned = Self; |
| |
| #[inline(always)] |
| fn inline_align(_context: fidl::encoding::Context) -> usize { |
| 1 |
| } |
| |
| #[inline(always)] |
| fn inline_size(_context: fidl::encoding::Context) -> usize { |
| 1 |
| } |
| } |
| |
| unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Empty, D> for &Empty { |
| #[inline] |
| unsafe fn encode( |
| self, |
| encoder: &mut fidl::encoding::Encoder<'_, D>, |
| offset: usize, |
| _depth: fidl::encoding::Depth, |
| ) -> fidl::Result<()> { |
| encoder.debug_check_bounds::<Empty>(offset); |
| encoder.write_num(0u8, offset); |
| Ok(()) |
| } |
| } |
| |
| impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for Empty { |
| #[inline(always)] |
| fn new_empty() -> Self { |
| Self |
| } |
| |
| #[inline] |
| unsafe fn decode( |
| &mut self, |
| decoder: &mut fidl::encoding::Decoder<'_, D>, |
| offset: usize, |
| _depth: fidl::encoding::Depth, |
| ) -> fidl::Result<()> { |
| decoder.debug_check_bounds::<Self>(offset); |
| match decoder.read_num::<u8>(offset) { |
| 0 => Ok(()), |
| _ => Err(fidl::Error::Invalid), |
| } |
| } |
| } |
| |
| impl fidl::encoding::ValueTypeMarker for EmptyProtocolReceiveRequest { |
| type Borrowed<'a> = &'a Self; |
| fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> { |
| value |
| } |
| } |
| |
| unsafe impl fidl::encoding::TypeMarker for EmptyProtocolReceiveRequest { |
| type Owned = Self; |
| |
| #[inline(always)] |
| fn inline_align(_context: fidl::encoding::Context) -> usize { |
| 1 |
| } |
| |
| #[inline(always)] |
| fn inline_size(_context: fidl::encoding::Context) -> usize { |
| 1 |
| } |
| } |
| |
| unsafe impl<D: fidl::encoding::ResourceDialect> |
| fidl::encoding::Encode<EmptyProtocolReceiveRequest, D> for &EmptyProtocolReceiveRequest |
| { |
| #[inline] |
| unsafe fn encode( |
| self, |
| encoder: &mut fidl::encoding::Encoder<'_, D>, |
| offset: usize, |
| _depth: fidl::encoding::Depth, |
| ) -> fidl::Result<()> { |
| encoder.debug_check_bounds::<EmptyProtocolReceiveRequest>(offset); |
| // Delegate to tuple encoding. |
| fidl::encoding::Encode::<EmptyProtocolReceiveRequest, D>::encode( |
| (<Empty as fidl::encoding::ValueTypeMarker>::borrow(&self.e),), |
| encoder, |
| offset, |
| _depth, |
| ) |
| } |
| } |
| unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<Empty, D>> |
| fidl::encoding::Encode<EmptyProtocolReceiveRequest, D> for (T0,) |
| { |
| #[inline] |
| unsafe fn encode( |
| self, |
| encoder: &mut fidl::encoding::Encoder<'_, D>, |
| offset: usize, |
| depth: fidl::encoding::Depth, |
| ) -> fidl::Result<()> { |
| encoder.debug_check_bounds::<EmptyProtocolReceiveRequest>(offset); |
| // Zero out padding regions. There's no need to apply masks |
| // because the unmasked parts will be overwritten by fields. |
| // Write the fields. |
| self.0.encode(encoder, offset + 0, depth)?; |
| Ok(()) |
| } |
| } |
| |
| impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> |
| for EmptyProtocolReceiveRequest |
| { |
| #[inline(always)] |
| fn new_empty() -> Self { |
| Self { e: fidl::new_empty!(Empty, D) } |
| } |
| |
| #[inline] |
| unsafe fn decode( |
| &mut self, |
| decoder: &mut fidl::encoding::Decoder<'_, D>, |
| offset: usize, |
| _depth: fidl::encoding::Depth, |
| ) -> fidl::Result<()> { |
| decoder.debug_check_bounds::<Self>(offset); |
| // Verify that padding bytes are zero. |
| fidl::decode!(Empty, D, &mut self.e, decoder, offset + 0, _depth)?; |
| Ok(()) |
| } |
| } |
| |
| impl fidl::encoding::ValueTypeMarker for EmptyProtocolSendAndReceiveRequest { |
| type Borrowed<'a> = &'a Self; |
| fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> { |
| value |
| } |
| } |
| |
| unsafe impl fidl::encoding::TypeMarker for EmptyProtocolSendAndReceiveRequest { |
| type Owned = Self; |
| |
| #[inline(always)] |
| fn inline_align(_context: fidl::encoding::Context) -> usize { |
| 1 |
| } |
| |
| #[inline(always)] |
| fn inline_size(_context: fidl::encoding::Context) -> usize { |
| 1 |
| } |
| } |
| |
| unsafe impl<D: fidl::encoding::ResourceDialect> |
| fidl::encoding::Encode<EmptyProtocolSendAndReceiveRequest, D> |
| for &EmptyProtocolSendAndReceiveRequest |
| { |
| #[inline] |
| unsafe fn encode( |
| self, |
| encoder: &mut fidl::encoding::Encoder<'_, D>, |
| offset: usize, |
| _depth: fidl::encoding::Depth, |
| ) -> fidl::Result<()> { |
| encoder.debug_check_bounds::<EmptyProtocolSendAndReceiveRequest>(offset); |
| // Delegate to tuple encoding. |
| fidl::encoding::Encode::<EmptyProtocolSendAndReceiveRequest, D>::encode( |
| (<Empty as fidl::encoding::ValueTypeMarker>::borrow(&self.e),), |
| encoder, |
| offset, |
| _depth, |
| ) |
| } |
| } |
| unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<Empty, D>> |
| fidl::encoding::Encode<EmptyProtocolSendAndReceiveRequest, D> for (T0,) |
| { |
| #[inline] |
| unsafe fn encode( |
| self, |
| encoder: &mut fidl::encoding::Encoder<'_, D>, |
| offset: usize, |
| depth: fidl::encoding::Depth, |
| ) -> fidl::Result<()> { |
| encoder.debug_check_bounds::<EmptyProtocolSendAndReceiveRequest>(offset); |
| // Zero out padding regions. There's no need to apply masks |
| // because the unmasked parts will be overwritten by fields. |
| // Write the fields. |
| self.0.encode(encoder, offset + 0, depth)?; |
| Ok(()) |
| } |
| } |
| |
| impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> |
| for EmptyProtocolSendAndReceiveRequest |
| { |
| #[inline(always)] |
| fn new_empty() -> Self { |
| Self { e: fidl::new_empty!(Empty, D) } |
| } |
| |
| #[inline] |
| unsafe fn decode( |
| &mut self, |
| decoder: &mut fidl::encoding::Decoder<'_, D>, |
| offset: usize, |
| _depth: fidl::encoding::Depth, |
| ) -> fidl::Result<()> { |
| decoder.debug_check_bounds::<Self>(offset); |
| // Verify that padding bytes are zero. |
| fidl::decode!(Empty, D, &mut self.e, decoder, offset + 0, _depth)?; |
| Ok(()) |
| } |
| } |
| |
| impl fidl::encoding::ValueTypeMarker for EmptyProtocolSendAndReceiveResponse { |
| type Borrowed<'a> = &'a Self; |
| fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> { |
| value |
| } |
| } |
| |
| unsafe impl fidl::encoding::TypeMarker for EmptyProtocolSendAndReceiveResponse { |
| type Owned = Self; |
| |
| #[inline(always)] |
| fn inline_align(_context: fidl::encoding::Context) -> usize { |
| 1 |
| } |
| |
| #[inline(always)] |
| fn inline_size(_context: fidl::encoding::Context) -> usize { |
| 1 |
| } |
| } |
| |
| unsafe impl<D: fidl::encoding::ResourceDialect> |
| fidl::encoding::Encode<EmptyProtocolSendAndReceiveResponse, D> |
| for &EmptyProtocolSendAndReceiveResponse |
| { |
| #[inline] |
| unsafe fn encode( |
| self, |
| encoder: &mut fidl::encoding::Encoder<'_, D>, |
| offset: usize, |
| _depth: fidl::encoding::Depth, |
| ) -> fidl::Result<()> { |
| encoder.debug_check_bounds::<EmptyProtocolSendAndReceiveResponse>(offset); |
| // Delegate to tuple encoding. |
| fidl::encoding::Encode::<EmptyProtocolSendAndReceiveResponse, D>::encode( |
| (<Empty as fidl::encoding::ValueTypeMarker>::borrow(&self.e),), |
| encoder, |
| offset, |
| _depth, |
| ) |
| } |
| } |
| unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<Empty, D>> |
| fidl::encoding::Encode<EmptyProtocolSendAndReceiveResponse, D> for (T0,) |
| { |
| #[inline] |
| unsafe fn encode( |
| self, |
| encoder: &mut fidl::encoding::Encoder<'_, D>, |
| offset: usize, |
| depth: fidl::encoding::Depth, |
| ) -> fidl::Result<()> { |
| encoder.debug_check_bounds::<EmptyProtocolSendAndReceiveResponse>(offset); |
| // Zero out padding regions. There's no need to apply masks |
| // because the unmasked parts will be overwritten by fields. |
| // Write the fields. |
| self.0.encode(encoder, offset + 0, depth)?; |
| Ok(()) |
| } |
| } |
| |
| impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> |
| for EmptyProtocolSendAndReceiveResponse |
| { |
| #[inline(always)] |
| fn new_empty() -> Self { |
| Self { e: fidl::new_empty!(Empty, D) } |
| } |
| |
| #[inline] |
| unsafe fn decode( |
| &mut self, |
| decoder: &mut fidl::encoding::Decoder<'_, D>, |
| offset: usize, |
| _depth: fidl::encoding::Depth, |
| ) -> fidl::Result<()> { |
| decoder.debug_check_bounds::<Self>(offset); |
| // Verify that padding bytes are zero. |
| fidl::decode!(Empty, D, &mut self.e, decoder, offset + 0, _depth)?; |
| Ok(()) |
| } |
| } |
| |
| impl fidl::encoding::ValueTypeMarker for EmptyProtocolSendRequest { |
| type Borrowed<'a> = &'a Self; |
| fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> { |
| value |
| } |
| } |
| |
| unsafe impl fidl::encoding::TypeMarker for EmptyProtocolSendRequest { |
| type Owned = Self; |
| |
| #[inline(always)] |
| fn inline_align(_context: fidl::encoding::Context) -> usize { |
| 1 |
| } |
| |
| #[inline(always)] |
| fn inline_size(_context: fidl::encoding::Context) -> usize { |
| 1 |
| } |
| } |
| |
| unsafe impl<D: fidl::encoding::ResourceDialect> |
| fidl::encoding::Encode<EmptyProtocolSendRequest, D> for &EmptyProtocolSendRequest |
| { |
| #[inline] |
| unsafe fn encode( |
| self, |
| encoder: &mut fidl::encoding::Encoder<'_, D>, |
| offset: usize, |
| _depth: fidl::encoding::Depth, |
| ) -> fidl::Result<()> { |
| encoder.debug_check_bounds::<EmptyProtocolSendRequest>(offset); |
| // Delegate to tuple encoding. |
| fidl::encoding::Encode::<EmptyProtocolSendRequest, D>::encode( |
| (<Empty as fidl::encoding::ValueTypeMarker>::borrow(&self.e),), |
| encoder, |
| offset, |
| _depth, |
| ) |
| } |
| } |
| unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<Empty, D>> |
| fidl::encoding::Encode<EmptyProtocolSendRequest, D> for (T0,) |
| { |
| #[inline] |
| unsafe fn encode( |
| self, |
| encoder: &mut fidl::encoding::Encoder<'_, D>, |
| offset: usize, |
| depth: fidl::encoding::Depth, |
| ) -> fidl::Result<()> { |
| encoder.debug_check_bounds::<EmptyProtocolSendRequest>(offset); |
| // Zero out padding regions. There's no need to apply masks |
| // because the unmasked parts will be overwritten by fields. |
| // Write the fields. |
| self.0.encode(encoder, offset + 0, depth)?; |
| Ok(()) |
| } |
| } |
| |
| impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> |
| for EmptyProtocolSendRequest |
| { |
| #[inline(always)] |
| fn new_empty() -> Self { |
| Self { e: fidl::new_empty!(Empty, D) } |
| } |
| |
| #[inline] |
| unsafe fn decode( |
| &mut self, |
| decoder: &mut fidl::encoding::Decoder<'_, D>, |
| offset: usize, |
| _depth: fidl::encoding::Depth, |
| ) -> fidl::Result<()> { |
| decoder.debug_check_bounds::<Self>(offset); |
| // Verify that padding bytes are zero. |
| fidl::decode!(Empty, D, &mut self.e, decoder, offset + 0, _depth)?; |
| Ok(()) |
| } |
| } |
| } |