#![warn(clippy::all)]
#![allow(unused_parens, unused_mut, unused_imports, nonstandard_style)]
use bitflags::bitflags;
use fidl::client::QueryResponseFut;
use fidl::encoding::{MessageBufFor, ProxyChannelBox, ResourceDialect};
use fidl::endpoints::{ControlHandle as _, Responder as _};
use futures::future::{self, MaybeDone, TryFutureExt};
use zx_status;
pub type BufferCollectionIdValue = u64;
pub type EventIdValue = u64;
pub type ImageIdValue = u64;
pub type LayerIdValue = u64;
pub type VsyncAckCookieValue = u64;
pub const IDENTIFIER_MAX_LEN: u32 = 128;
#[derive(Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd, Hash)]
#[repr(u8)]
pub enum VirtconMode {
Inactive = 0,
Fallback = 1,
Forced = 2,
}
impl VirtconMode {
#[inline]
pub fn from_primitive(prim: u8) -> Option<Self> {
match prim {
0 => Some(Self::Inactive),
1 => Some(Self::Fallback),
2 => Some(Self::Forced),
_ => None,
}
}
#[inline]
pub const fn into_primitive(self) -> u8 {
self as u8
}
#[deprecated = "Strict enums should not use `is_unknown`"]
#[inline]
pub fn is_unknown(&self) -> bool {
false
}
}
#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
#[repr(C)]
pub struct BufferCollectionId {
pub value: u64,
}
impl fidl::Persistable for BufferCollectionId {}
#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
#[repr(C)]
pub struct BufferId {
pub buffer_collection_id: BufferCollectionId,
pub buffer_index: u32,
}
impl fidl::Persistable for BufferId {}
#[derive(Clone, Debug, PartialEq)]
pub struct ClientCompositionOp {
pub display_id: fidl_fuchsia_hardware_display_types::DisplayId,
pub layer_id: LayerId,
pub opcode: fidl_fuchsia_hardware_display_types::ClientCompositionOpcode,
}
impl fidl::Persistable for ClientCompositionOp {}
#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
#[repr(C)]
pub struct CoordinatorAcknowledgeVsyncRequest {
pub cookie: u64,
}
impl fidl::Persistable for CoordinatorAcknowledgeVsyncRequest {}
#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
pub struct CoordinatorCheckConfigRequest {
pub discard: bool,
}
impl fidl::Persistable for CoordinatorCheckConfigRequest {}
#[derive(Clone, Debug, PartialEq)]
pub struct CoordinatorCheckConfigResponse {
pub res: fidl_fuchsia_hardware_display_types::ConfigResult,
pub ops: Vec<ClientCompositionOp>,
}
impl fidl::Persistable for CoordinatorCheckConfigResponse {}
#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
#[repr(C)]
pub struct CoordinatorDestroyLayerRequest {
pub layer_id: LayerId,
}
impl fidl::Persistable for CoordinatorDestroyLayerRequest {}
#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
pub struct CoordinatorEnableVsyncRequest {
pub enable: bool,
}
impl fidl::Persistable for CoordinatorEnableVsyncRequest {}
#[derive(Clone, Debug, PartialEq)]
pub struct CoordinatorGetLatestAppliedConfigStampResponse {
pub stamp: fidl_fuchsia_hardware_display_types::ConfigStamp,
}
impl fidl::Persistable for CoordinatorGetLatestAppliedConfigStampResponse {}
#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
pub struct CoordinatorImportBufferCollectionRequest {
pub buffer_collection_id: BufferCollectionId,
pub buffer_collection_token:
fidl::endpoints::ClientEnd<fidl_fuchsia_sysmem2::BufferCollectionTokenMarker>,
}
impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
for CoordinatorImportBufferCollectionRequest
{
}
#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
pub struct CoordinatorImportEventRequest {
pub event: fidl::Event,
pub id: EventId,
}
impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
for CoordinatorImportEventRequest
{
}
#[derive(Clone, Debug, PartialEq)]
pub struct CoordinatorImportImageRequest {
pub image_metadata: fidl_fuchsia_hardware_display_types::ImageMetadata,
pub buffer_id: BufferId,
pub image_id: ImageId,
}
impl fidl::Persistable for CoordinatorImportImageRequest {}
#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
pub struct CoordinatorListenerOnClientOwnershipChangeRequest {
pub has_ownership: bool,
}
impl fidl::Persistable for CoordinatorListenerOnClientOwnershipChangeRequest {}
#[derive(Clone, Debug, PartialEq)]
pub struct CoordinatorListenerOnDisplaysChangedRequest {
pub added: Vec<Info>,
pub removed: Vec<fidl_fuchsia_hardware_display_types::DisplayId>,
}
impl fidl::Persistable for CoordinatorListenerOnDisplaysChangedRequest {}
#[derive(Clone, Debug, PartialEq)]
pub struct CoordinatorListenerOnVsyncRequest {
pub display_id: fidl_fuchsia_hardware_display_types::DisplayId,
pub timestamp: i64,
pub applied_config_stamp: fidl_fuchsia_hardware_display_types::ConfigStamp,
pub cookie: VsyncAckCookie,
}
impl fidl::Persistable for CoordinatorListenerOnVsyncRequest {}
#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
pub struct CoordinatorOnClientOwnershipChangeRequest {
pub has_ownership: bool,
}
impl fidl::Persistable for CoordinatorOnClientOwnershipChangeRequest {}
#[derive(Clone, Debug, PartialEq)]
pub struct CoordinatorOnDisplaysChangedRequest {
pub added: Vec<Info>,
pub removed: Vec<fidl_fuchsia_hardware_display_types::DisplayId>,
}
impl fidl::Persistable for CoordinatorOnDisplaysChangedRequest {}
#[derive(Debug, PartialEq)]
pub struct CoordinatorOnVsyncRequest {
pub display_id: fidl_fuchsia_hardware_display_types::DisplayId,
pub timestamp: u64,
pub applied_config_stamp: fidl_fuchsia_hardware_display_types::ConfigStamp,
pub cookie: u64,
}
impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect> for CoordinatorOnVsyncRequest {}
#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
#[repr(C)]
pub struct CoordinatorReleaseBufferCollectionRequest {
pub buffer_collection_id: BufferCollectionId,
}
impl fidl::Persistable for CoordinatorReleaseBufferCollectionRequest {}
#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
#[repr(C)]
pub struct CoordinatorReleaseEventRequest {
pub id: EventId,
}
impl fidl::Persistable for CoordinatorReleaseEventRequest {}
#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
#[repr(C)]
pub struct CoordinatorReleaseImageRequest {
pub image_id: ImageId,
}
impl fidl::Persistable for CoordinatorReleaseImageRequest {}
#[derive(Clone, Debug, PartialEq)]
pub struct CoordinatorSetBufferCollectionConstraintsRequest {
pub buffer_collection_id: BufferCollectionId,
pub buffer_usage: fidl_fuchsia_hardware_display_types::ImageBufferUsage,
}
impl fidl::Persistable for CoordinatorSetBufferCollectionConstraintsRequest {}
#[derive(Clone, Debug, PartialEq)]
pub struct CoordinatorSetDisplayColorConversionRequest {
pub display_id: fidl_fuchsia_hardware_display_types::DisplayId,
pub preoffsets: [f32; 3],
pub coefficients: [f32; 9],
pub postoffsets: [f32; 3],
}
impl fidl::Persistable for CoordinatorSetDisplayColorConversionRequest {}
#[derive(Clone, Debug, PartialEq)]
pub struct CoordinatorSetDisplayLayersRequest {
pub display_id: fidl_fuchsia_hardware_display_types::DisplayId,
pub layer_ids: Vec<LayerId>,
}
impl fidl::Persistable for CoordinatorSetDisplayLayersRequest {}
#[derive(Clone, Debug, PartialEq)]
pub struct CoordinatorSetDisplayModeRequest {
pub display_id: fidl_fuchsia_hardware_display_types::DisplayId,
pub mode: fidl_fuchsia_hardware_display_types::Mode,
}
impl fidl::Persistable for CoordinatorSetDisplayModeRequest {}
#[derive(Clone, Debug, PartialEq)]
pub struct CoordinatorSetDisplayPowerRequest {
pub display_id: fidl_fuchsia_hardware_display_types::DisplayId,
pub power_on: bool,
}
impl fidl::Persistable for CoordinatorSetDisplayPowerRequest {}
#[derive(Clone, Debug, PartialEq)]
pub struct CoordinatorSetLayerColorConfigRequest {
pub layer_id: LayerId,
pub color: fidl_fuchsia_hardware_display_types::Color,
}
impl fidl::Persistable for CoordinatorSetLayerColorConfigRequest {}
#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
#[repr(C)]
pub struct CoordinatorSetLayerImage2Request {
pub layer_id: LayerId,
pub image_id: ImageId,
pub wait_event_id: EventId,
}
impl fidl::Persistable for CoordinatorSetLayerImage2Request {}
#[derive(Clone, Copy, Debug, PartialEq, PartialOrd)]
pub struct CoordinatorSetLayerPrimaryAlphaRequest {
pub layer_id: LayerId,
pub mode: fidl_fuchsia_hardware_display_types::AlphaMode,
pub val: f32,
}
impl fidl::Persistable for CoordinatorSetLayerPrimaryAlphaRequest {}
#[derive(Clone, Debug, PartialEq)]
pub struct CoordinatorSetLayerPrimaryConfigRequest {
pub layer_id: LayerId,
pub image_metadata: fidl_fuchsia_hardware_display_types::ImageMetadata,
}
impl fidl::Persistable for CoordinatorSetLayerPrimaryConfigRequest {}
#[derive(Clone, Debug, PartialEq)]
pub struct CoordinatorSetLayerPrimaryPositionRequest {
pub layer_id: LayerId,
pub image_source_transformation: fidl_fuchsia_hardware_display_types::CoordinateTransformation,
pub image_source: fidl_fuchsia_math::RectU,
pub display_destination: fidl_fuchsia_math::RectU,
}
impl fidl::Persistable for CoordinatorSetLayerPrimaryPositionRequest {}
#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
#[repr(C)]
pub struct CoordinatorSetMinimumRgbRequest {
pub minimum_rgb: u8,
}
impl fidl::Persistable for CoordinatorSetMinimumRgbRequest {}
#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
pub struct CoordinatorSetVirtconModeRequest {
pub mode: VirtconMode,
}
impl fidl::Persistable for CoordinatorSetVirtconModeRequest {}
#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
#[repr(C)]
pub struct CoordinatorStartCaptureRequest {
pub signal_event_id: EventId,
pub image_id: ImageId,
}
impl fidl::Persistable for CoordinatorStartCaptureRequest {}
#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
#[repr(C)]
pub struct CoordinatorCreateLayerResponse {
pub layer_id: LayerId,
}
impl fidl::Persistable for CoordinatorCreateLayerResponse {}
#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
pub struct CoordinatorIsCaptureSupportedResponse {
pub supported: bool,
}
impl fidl::Persistable for CoordinatorIsCaptureSupportedResponse {}
#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
#[repr(C)]
pub struct EventId {
pub value: u64,
}
impl fidl::Persistable for EventId {}
#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
#[repr(C)]
pub struct ImageId {
pub value: u64,
}
impl fidl::Persistable for ImageId {}
#[derive(Clone, Debug, PartialEq)]
pub struct Info {
pub id: fidl_fuchsia_hardware_display_types::DisplayId,
pub modes: Vec<fidl_fuchsia_hardware_display_types::Mode>,
pub pixel_format: Vec<fidl_fuchsia_images2::PixelFormat>,
pub manufacturer_name: String,
pub monitor_name: String,
pub monitor_serial: String,
pub horizontal_size_mm: u32,
pub vertical_size_mm: u32,
pub using_fallback_size: bool,
}
impl fidl::Persistable for Info {}
#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
#[repr(C)]
pub struct LayerId {
pub value: u64,
}
impl fidl::Persistable for LayerId {}
#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
#[repr(C)]
pub struct VsyncAckCookie {
pub value: u64,
}
impl fidl::Persistable for VsyncAckCookie {}
#[derive(Debug, Default, PartialEq)]
pub struct CoordinatorApplyConfig3Request {
pub stamp: Option<fidl_fuchsia_hardware_display_types::ConfigStamp>,
#[doc(hidden)]
pub __source_breaking: fidl::marker::SourceBreaking,
}
impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
for CoordinatorApplyConfig3Request
{
}
#[derive(Debug, Default, PartialEq)]
pub struct ProviderOpenCoordinatorWithListenerForPrimaryRequest {
pub coordinator: Option<fidl::endpoints::ServerEnd<CoordinatorMarker>>,
pub coordinator_listener: Option<fidl::endpoints::ClientEnd<CoordinatorListenerMarker>>,
#[doc(hidden)]
pub __source_breaking: fidl::marker::SourceBreaking,
}
impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
for ProviderOpenCoordinatorWithListenerForPrimaryRequest
{
}
#[derive(Debug, Default, PartialEq)]
pub struct ProviderOpenCoordinatorWithListenerForVirtconRequest {
pub coordinator: Option<fidl::endpoints::ServerEnd<CoordinatorMarker>>,
pub coordinator_listener: Option<fidl::endpoints::ClientEnd<CoordinatorListenerMarker>>,
#[doc(hidden)]
pub __source_breaking: fidl::marker::SourceBreaking,
}
impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
for ProviderOpenCoordinatorWithListenerForVirtconRequest
{
}
#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
pub struct CoordinatorMarker;
impl fidl::endpoints::ProtocolMarker for CoordinatorMarker {
type Proxy = CoordinatorProxy;
type RequestStream = CoordinatorRequestStream;
#[cfg(target_os = "fuchsia")]
type SynchronousProxy = CoordinatorSynchronousProxy;
const DEBUG_NAME: &'static str = "(anonymous) Coordinator";
}
pub type CoordinatorImportImageResult = Result<(), i32>;
pub type CoordinatorCreateLayerResult = Result<LayerId, i32>;
pub type CoordinatorImportBufferCollectionResult = Result<(), i32>;
pub type CoordinatorSetBufferCollectionConstraintsResult = Result<(), i32>;
pub type CoordinatorIsCaptureSupportedResult = Result<bool, i32>;
pub type CoordinatorStartCaptureResult = Result<(), i32>;
pub type CoordinatorSetMinimumRgbResult = Result<(), i32>;
pub type CoordinatorSetDisplayPowerResult = Result<(), i32>;
pub trait CoordinatorProxyInterface: Send + Sync {
type ImportImageResponseFut: std::future::Future<Output = Result<CoordinatorImportImageResult, fidl::Error>>
+ Send;
fn r#import_image(
&self,
image_metadata: &fidl_fuchsia_hardware_display_types::ImageMetadata,
buffer_id: &BufferId,
image_id: &ImageId,
) -> Self::ImportImageResponseFut;
fn r#release_image(&self, image_id: &ImageId) -> Result<(), fidl::Error>;
fn r#import_event(&self, event: fidl::Event, id: &EventId) -> Result<(), fidl::Error>;
fn r#release_event(&self, id: &EventId) -> Result<(), fidl::Error>;
type CreateLayerResponseFut: std::future::Future<Output = Result<CoordinatorCreateLayerResult, fidl::Error>>
+ Send;
fn r#create_layer(&self) -> Self::CreateLayerResponseFut;
fn r#destroy_layer(&self, layer_id: &LayerId) -> Result<(), fidl::Error>;
fn r#set_display_mode(
&self,
display_id: &fidl_fuchsia_hardware_display_types::DisplayId,
mode: &fidl_fuchsia_hardware_display_types::Mode,
) -> Result<(), fidl::Error>;
fn r#set_display_color_conversion(
&self,
display_id: &fidl_fuchsia_hardware_display_types::DisplayId,
preoffsets: &[f32; 3],
coefficients: &[f32; 9],
postoffsets: &[f32; 3],
) -> Result<(), fidl::Error>;
fn r#set_display_layers(
&self,
display_id: &fidl_fuchsia_hardware_display_types::DisplayId,
layer_ids: &[LayerId],
) -> Result<(), fidl::Error>;
fn r#set_layer_primary_config(
&self,
layer_id: &LayerId,
image_metadata: &fidl_fuchsia_hardware_display_types::ImageMetadata,
) -> Result<(), fidl::Error>;
fn r#set_layer_primary_position(
&self,
layer_id: &LayerId,
image_source_transformation: fidl_fuchsia_hardware_display_types::CoordinateTransformation,
image_source: &fidl_fuchsia_math::RectU,
display_destination: &fidl_fuchsia_math::RectU,
) -> Result<(), fidl::Error>;
fn r#set_layer_primary_alpha(
&self,
layer_id: &LayerId,
mode: fidl_fuchsia_hardware_display_types::AlphaMode,
val: f32,
) -> Result<(), fidl::Error>;
fn r#set_layer_color_config(
&self,
layer_id: &LayerId,
color: &fidl_fuchsia_hardware_display_types::Color,
) -> Result<(), fidl::Error>;
fn r#set_layer_image2(
&self,
layer_id: &LayerId,
image_id: &ImageId,
wait_event_id: &EventId,
) -> Result<(), fidl::Error>;
type CheckConfigResponseFut: std::future::Future<
Output = Result<
(fidl_fuchsia_hardware_display_types::ConfigResult, Vec<ClientCompositionOp>),
fidl::Error,
>,
> + Send;
fn r#check_config(&self, discard: bool) -> Self::CheckConfigResponseFut;
fn r#apply_config(&self) -> Result<(), fidl::Error>;
type GetLatestAppliedConfigStampResponseFut: std::future::Future<
Output = Result<fidl_fuchsia_hardware_display_types::ConfigStamp, fidl::Error>,
> + Send;
fn r#get_latest_applied_config_stamp(&self) -> Self::GetLatestAppliedConfigStampResponseFut;
fn r#apply_config3(&self, payload: CoordinatorApplyConfig3Request) -> Result<(), fidl::Error>;
fn r#enable_vsync(&self, enable: bool) -> Result<(), fidl::Error>;
fn r#acknowledge_vsync(&self, cookie: u64) -> Result<(), fidl::Error>;
fn r#set_virtcon_mode(&self, mode: VirtconMode) -> Result<(), fidl::Error>;
type ImportBufferCollectionResponseFut: std::future::Future<Output = Result<CoordinatorImportBufferCollectionResult, fidl::Error>>
+ Send;
fn r#import_buffer_collection(
&self,
buffer_collection_id: &BufferCollectionId,
buffer_collection_token: fidl::endpoints::ClientEnd<
fidl_fuchsia_sysmem2::BufferCollectionTokenMarker,
>,
) -> Self::ImportBufferCollectionResponseFut;
fn r#release_buffer_collection(
&self,
buffer_collection_id: &BufferCollectionId,
) -> Result<(), fidl::Error>;
type SetBufferCollectionConstraintsResponseFut: std::future::Future<
Output = Result<CoordinatorSetBufferCollectionConstraintsResult, fidl::Error>,
> + Send;
fn r#set_buffer_collection_constraints(
&self,
buffer_collection_id: &BufferCollectionId,
buffer_usage: &fidl_fuchsia_hardware_display_types::ImageBufferUsage,
) -> Self::SetBufferCollectionConstraintsResponseFut;
type IsCaptureSupportedResponseFut: std::future::Future<Output = Result<CoordinatorIsCaptureSupportedResult, fidl::Error>>
+ Send;
fn r#is_capture_supported(&self) -> Self::IsCaptureSupportedResponseFut;
type StartCaptureResponseFut: std::future::Future<Output = Result<CoordinatorStartCaptureResult, fidl::Error>>
+ Send;
fn r#start_capture(
&self,
signal_event_id: &EventId,
image_id: &ImageId,
) -> Self::StartCaptureResponseFut;
type SetMinimumRgbResponseFut: std::future::Future<Output = Result<CoordinatorSetMinimumRgbResult, fidl::Error>>
+ Send;
fn r#set_minimum_rgb(&self, minimum_rgb: u8) -> Self::SetMinimumRgbResponseFut;
type SetDisplayPowerResponseFut: std::future::Future<Output = Result<CoordinatorSetDisplayPowerResult, fidl::Error>>
+ Send;
fn r#set_display_power(
&self,
display_id: &fidl_fuchsia_hardware_display_types::DisplayId,
power_on: bool,
) -> Self::SetDisplayPowerResponseFut;
}
#[derive(Debug)]
#[cfg(target_os = "fuchsia")]
pub struct CoordinatorSynchronousProxy {
client: fidl::client::sync::Client,
}
#[cfg(target_os = "fuchsia")]
impl fidl::endpoints::SynchronousProxy for CoordinatorSynchronousProxy {
type Proxy = CoordinatorProxy;
type Protocol = CoordinatorMarker;
fn from_channel(inner: fidl::Channel) -> Self {
Self::new(inner)
}
fn into_channel(self) -> fidl::Channel {
self.client.into_channel()
}
fn as_channel(&self) -> &fidl::Channel {
self.client.as_channel()
}
}
#[cfg(target_os = "fuchsia")]
impl CoordinatorSynchronousProxy {
pub fn new(channel: fidl::Channel) -> Self {
let protocol_name = <CoordinatorMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
Self { client: fidl::client::sync::Client::new(channel, protocol_name) }
}
pub fn into_channel(self) -> fidl::Channel {
self.client.into_channel()
}
pub fn wait_for_event(
&self,
deadline: zx::MonotonicInstant,
) -> Result<CoordinatorEvent, fidl::Error> {
CoordinatorEvent::decode(self.client.wait_for_event(deadline)?)
}
pub fn r#import_image(
&self,
mut image_metadata: &fidl_fuchsia_hardware_display_types::ImageMetadata,
mut buffer_id: &BufferId,
mut image_id: &ImageId,
___deadline: zx::MonotonicInstant,
) -> Result<CoordinatorImportImageResult, fidl::Error> {
let _response = self.client.send_query::<
CoordinatorImportImageRequest,
fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
>(
(image_metadata, buffer_id, image_id,),
0x3a8636eb9656b4f4,
fidl::encoding::DynamicFlags::empty(),
___deadline,
)?;
Ok(_response.map(|x| x))
}
pub fn r#release_image(&self, mut image_id: &ImageId) -> Result<(), fidl::Error> {
self.client.send::<CoordinatorReleaseImageRequest>(
(image_id,),
0x477192230517504,
fidl::encoding::DynamicFlags::empty(),
)
}
pub fn r#import_event(
&self,
mut event: fidl::Event,
mut id: &EventId,
) -> Result<(), fidl::Error> {
self.client.send::<CoordinatorImportEventRequest>(
(event, id),
0x2864e5dc59390543,
fidl::encoding::DynamicFlags::empty(),
)
}
pub fn r#release_event(&self, mut id: &EventId) -> Result<(), fidl::Error> {
self.client.send::<CoordinatorReleaseEventRequest>(
(id,),
0x32508c2101606b87,
fidl::encoding::DynamicFlags::empty(),
)
}
pub fn r#create_layer(
&self,
___deadline: zx::MonotonicInstant,
) -> Result<CoordinatorCreateLayerResult, fidl::Error> {
let _response = self.client.send_query::<
fidl::encoding::EmptyPayload,
fidl::encoding::ResultType<CoordinatorCreateLayerResponse, i32>,
>(
(),
0x2137cfd788a3496b,
fidl::encoding::DynamicFlags::empty(),
___deadline,
)?;
Ok(_response.map(|x| x.layer_id))
}
pub fn r#destroy_layer(&self, mut layer_id: &LayerId) -> Result<(), fidl::Error> {
self.client.send::<CoordinatorDestroyLayerRequest>(
(layer_id,),
0x386e12d092bea2f8,
fidl::encoding::DynamicFlags::empty(),
)
}
pub fn r#set_display_mode(
&self,
mut display_id: &fidl_fuchsia_hardware_display_types::DisplayId,
mut mode: &fidl_fuchsia_hardware_display_types::Mode,
) -> Result<(), fidl::Error> {
self.client.send::<CoordinatorSetDisplayModeRequest>(
(display_id, mode),
0xbde3c59ee9c1777,
fidl::encoding::DynamicFlags::empty(),
)
}
pub fn r#set_display_color_conversion(
&self,
mut display_id: &fidl_fuchsia_hardware_display_types::DisplayId,
mut preoffsets: &[f32; 3],
mut coefficients: &[f32; 9],
mut postoffsets: &[f32; 3],
) -> Result<(), fidl::Error> {
self.client.send::<CoordinatorSetDisplayColorConversionRequest>(
(display_id, preoffsets, coefficients, postoffsets),
0x2f18186a987d51aa,
fidl::encoding::DynamicFlags::empty(),
)
}
pub fn r#set_display_layers(
&self,
mut display_id: &fidl_fuchsia_hardware_display_types::DisplayId,
mut layer_ids: &[LayerId],
) -> Result<(), fidl::Error> {
self.client.send::<CoordinatorSetDisplayLayersRequest>(
(display_id, layer_ids),
0x190e0f6f93be1d89,
fidl::encoding::DynamicFlags::empty(),
)
}
pub fn r#set_layer_primary_config(
&self,
mut layer_id: &LayerId,
mut image_metadata: &fidl_fuchsia_hardware_display_types::ImageMetadata,
) -> Result<(), fidl::Error> {
self.client.send::<CoordinatorSetLayerPrimaryConfigRequest>(
(layer_id, image_metadata),
0x68d89ebd518b45b9,
fidl::encoding::DynamicFlags::empty(),
)
}
pub fn r#set_layer_primary_position(
&self,
mut layer_id: &LayerId,
mut image_source_transformation: fidl_fuchsia_hardware_display_types::CoordinateTransformation,
mut image_source: &fidl_fuchsia_math::RectU,
mut display_destination: &fidl_fuchsia_math::RectU,
) -> Result<(), fidl::Error> {
self.client.send::<CoordinatorSetLayerPrimaryPositionRequest>(
(layer_id, image_source_transformation, image_source, display_destination),
0x27b192b5a43851e2,
fidl::encoding::DynamicFlags::empty(),
)
}
pub fn r#set_layer_primary_alpha(
&self,
mut layer_id: &LayerId,
mut mode: fidl_fuchsia_hardware_display_types::AlphaMode,
mut val: f32,
) -> Result<(), fidl::Error> {
self.client.send::<CoordinatorSetLayerPrimaryAlphaRequest>(
(layer_id, mode, val),
0x104cf2b18b27296d,
fidl::encoding::DynamicFlags::empty(),
)
}
pub fn r#set_layer_color_config(
&self,
mut layer_id: &LayerId,
mut color: &fidl_fuchsia_hardware_display_types::Color,
) -> Result<(), fidl::Error> {
self.client.send::<CoordinatorSetLayerColorConfigRequest>(
(layer_id, color),
0x2fa91e9a2a01875f,
fidl::encoding::DynamicFlags::empty(),
)
}
pub fn r#set_layer_image2(
&self,
mut layer_id: &LayerId,
mut image_id: &ImageId,
mut wait_event_id: &EventId,
) -> Result<(), fidl::Error> {
self.client.send::<CoordinatorSetLayerImage2Request>(
(layer_id, image_id, wait_event_id),
0x53c6376dfc13a971,
fidl::encoding::DynamicFlags::empty(),
)
}
pub fn r#check_config(
&self,
mut discard: bool,
___deadline: zx::MonotonicInstant,
) -> Result<
(fidl_fuchsia_hardware_display_types::ConfigResult, Vec<ClientCompositionOp>),
fidl::Error,
> {
let _response = self
.client
.send_query::<CoordinatorCheckConfigRequest, CoordinatorCheckConfigResponse>(
(discard,),
0x2bcfb4eb16878158,
fidl::encoding::DynamicFlags::empty(),
___deadline,
)?;
Ok((_response.res, _response.ops))
}
pub fn r#apply_config(&self) -> Result<(), fidl::Error> {
self.client.send::<fidl::encoding::EmptyPayload>(
(),
0x114b879319b4e53f,
fidl::encoding::DynamicFlags::empty(),
)
}
pub fn r#get_latest_applied_config_stamp(
&self,
___deadline: zx::MonotonicInstant,
) -> Result<fidl_fuchsia_hardware_display_types::ConfigStamp, fidl::Error> {
let _response = self.client.send_query::<
fidl::encoding::EmptyPayload,
CoordinatorGetLatestAppliedConfigStampResponse,
>(
(),
0x76a50c0537265f65,
fidl::encoding::DynamicFlags::empty(),
___deadline,
)?;
Ok(_response.stamp)
}
pub fn r#apply_config3(
&self,
mut payload: CoordinatorApplyConfig3Request,
) -> Result<(), fidl::Error> {
self.client.send::<CoordinatorApplyConfig3Request>(
&mut payload,
0x7f0fe0e4f062a67e,
fidl::encoding::DynamicFlags::empty(),
)
}
pub fn r#enable_vsync(&self, mut enable: bool) -> Result<(), fidl::Error> {
self.client.send::<CoordinatorEnableVsyncRequest>(
(enable,),
0x3e23634eb2ae6820,
fidl::encoding::DynamicFlags::empty(),
)
}
pub fn r#acknowledge_vsync(&self, mut cookie: u64) -> Result<(), fidl::Error> {
self.client.send::<CoordinatorAcknowledgeVsyncRequest>(
(cookie,),
0x25e921d26107d6ef,
fidl::encoding::DynamicFlags::empty(),
)
}
pub fn r#set_virtcon_mode(&self, mut mode: VirtconMode) -> Result<(), fidl::Error> {
self.client.send::<CoordinatorSetVirtconModeRequest>(
(mode,),
0x4fe0721526068f00,
fidl::encoding::DynamicFlags::empty(),
)
}
pub fn r#import_buffer_collection(
&self,
mut buffer_collection_id: &BufferCollectionId,
mut buffer_collection_token: fidl::endpoints::ClientEnd<
fidl_fuchsia_sysmem2::BufferCollectionTokenMarker,
>,
___deadline: zx::MonotonicInstant,
) -> Result<CoordinatorImportBufferCollectionResult, fidl::Error> {
let _response = self.client.send_query::<
CoordinatorImportBufferCollectionRequest,
fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
>(
(buffer_collection_id, buffer_collection_token,),
0x30d06f510e7f4601,
fidl::encoding::DynamicFlags::empty(),
___deadline,
)?;
Ok(_response.map(|x| x))
}
pub fn r#release_buffer_collection(
&self,
mut buffer_collection_id: &BufferCollectionId,
) -> Result<(), fidl::Error> {
self.client.send::<CoordinatorReleaseBufferCollectionRequest>(
(buffer_collection_id,),
0x1c7dd5f8b0690be0,
fidl::encoding::DynamicFlags::empty(),
)
}
pub fn r#set_buffer_collection_constraints(
&self,
mut buffer_collection_id: &BufferCollectionId,
mut buffer_usage: &fidl_fuchsia_hardware_display_types::ImageBufferUsage,
___deadline: zx::MonotonicInstant,
) -> Result<CoordinatorSetBufferCollectionConstraintsResult, fidl::Error> {
let _response = self.client.send_query::<
CoordinatorSetBufferCollectionConstraintsRequest,
fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
>(
(buffer_collection_id, buffer_usage,),
0x509a4ee9af6035df,
fidl::encoding::DynamicFlags::empty(),
___deadline,
)?;
Ok(_response.map(|x| x))
}
pub fn r#is_capture_supported(
&self,
___deadline: zx::MonotonicInstant,
) -> Result<CoordinatorIsCaptureSupportedResult, fidl::Error> {
let _response = self.client.send_query::<
fidl::encoding::EmptyPayload,
fidl::encoding::ResultType<CoordinatorIsCaptureSupportedResponse, i32>,
>(
(),
0x4ca407277277971b,
fidl::encoding::DynamicFlags::empty(),
___deadline,
)?;
Ok(_response.map(|x| x.supported))
}
pub fn r#start_capture(
&self,
mut signal_event_id: &EventId,
mut image_id: &ImageId,
___deadline: zx::MonotonicInstant,
) -> Result<CoordinatorStartCaptureResult, fidl::Error> {
let _response = self.client.send_query::<
CoordinatorStartCaptureRequest,
fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
>(
(signal_event_id, image_id,),
0x35cb38f19d96a8db,
fidl::encoding::DynamicFlags::empty(),
___deadline,
)?;
Ok(_response.map(|x| x))
}
pub fn r#set_minimum_rgb(
&self,
mut minimum_rgb: u8,
___deadline: zx::MonotonicInstant,
) -> Result<CoordinatorSetMinimumRgbResult, fidl::Error> {
let _response = self.client.send_query::<
CoordinatorSetMinimumRgbRequest,
fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
>(
(minimum_rgb,),
0x1b49251437038b0b,
fidl::encoding::DynamicFlags::empty(),
___deadline,
)?;
Ok(_response.map(|x| x))
}
pub fn r#set_display_power(
&self,
mut display_id: &fidl_fuchsia_hardware_display_types::DisplayId,
mut power_on: bool,
___deadline: zx::MonotonicInstant,
) -> Result<CoordinatorSetDisplayPowerResult, fidl::Error> {
let _response = self.client.send_query::<
CoordinatorSetDisplayPowerRequest,
fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
>(
(display_id, power_on,),
0x10feb62d11d9e92b,
fidl::encoding::DynamicFlags::empty(),
___deadline,
)?;
Ok(_response.map(|x| x))
}
}
#[derive(Debug, Clone)]
pub struct CoordinatorProxy {
client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
}
impl fidl::endpoints::Proxy for CoordinatorProxy {
type Protocol = CoordinatorMarker;
fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
Self::new(inner)
}
fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
self.client.into_channel().map_err(|client| Self { client })
}
fn as_channel(&self) -> &::fidl::AsyncChannel {
self.client.as_channel()
}
}
impl CoordinatorProxy {
pub fn new(channel: ::fidl::AsyncChannel) -> Self {
let protocol_name = <CoordinatorMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
Self { client: fidl::client::Client::new(channel, protocol_name) }
}
pub fn take_event_stream(&self) -> CoordinatorEventStream {
CoordinatorEventStream { event_receiver: self.client.take_event_receiver() }
}
pub fn r#import_image(
&self,
mut image_metadata: &fidl_fuchsia_hardware_display_types::ImageMetadata,
mut buffer_id: &BufferId,
mut image_id: &ImageId,
) -> fidl::client::QueryResponseFut<
CoordinatorImportImageResult,
fidl::encoding::DefaultFuchsiaResourceDialect,
> {
CoordinatorProxyInterface::r#import_image(self, image_metadata, buffer_id, image_id)
}
pub fn r#release_image(&self, mut image_id: &ImageId) -> Result<(), fidl::Error> {
CoordinatorProxyInterface::r#release_image(self, image_id)
}
pub fn r#import_event(
&self,
mut event: fidl::Event,
mut id: &EventId,
) -> Result<(), fidl::Error> {
CoordinatorProxyInterface::r#import_event(self, event, id)
}
pub fn r#release_event(&self, mut id: &EventId) -> Result<(), fidl::Error> {
CoordinatorProxyInterface::r#release_event(self, id)
}
pub fn r#create_layer(
&self,
) -> fidl::client::QueryResponseFut<
CoordinatorCreateLayerResult,
fidl::encoding::DefaultFuchsiaResourceDialect,
> {
CoordinatorProxyInterface::r#create_layer(self)
}
pub fn r#destroy_layer(&self, mut layer_id: &LayerId) -> Result<(), fidl::Error> {
CoordinatorProxyInterface::r#destroy_layer(self, layer_id)
}
pub fn r#set_display_mode(
&self,
mut display_id: &fidl_fuchsia_hardware_display_types::DisplayId,
mut mode: &fidl_fuchsia_hardware_display_types::Mode,
) -> Result<(), fidl::Error> {
CoordinatorProxyInterface::r#set_display_mode(self, display_id, mode)
}
pub fn r#set_display_color_conversion(
&self,
mut display_id: &fidl_fuchsia_hardware_display_types::DisplayId,
mut preoffsets: &[f32; 3],
mut coefficients: &[f32; 9],
mut postoffsets: &[f32; 3],
) -> Result<(), fidl::Error> {
CoordinatorProxyInterface::r#set_display_color_conversion(
self,
display_id,
preoffsets,
coefficients,
postoffsets,
)
}
pub fn r#set_display_layers(
&self,
mut display_id: &fidl_fuchsia_hardware_display_types::DisplayId,
mut layer_ids: &[LayerId],
) -> Result<(), fidl::Error> {
CoordinatorProxyInterface::r#set_display_layers(self, display_id, layer_ids)
}
pub fn r#set_layer_primary_config(
&self,
mut layer_id: &LayerId,
mut image_metadata: &fidl_fuchsia_hardware_display_types::ImageMetadata,
) -> Result<(), fidl::Error> {
CoordinatorProxyInterface::r#set_layer_primary_config(self, layer_id, image_metadata)
}
pub fn r#set_layer_primary_position(
&self,
mut layer_id: &LayerId,
mut image_source_transformation: fidl_fuchsia_hardware_display_types::CoordinateTransformation,
mut image_source: &fidl_fuchsia_math::RectU,
mut display_destination: &fidl_fuchsia_math::RectU,
) -> Result<(), fidl::Error> {
CoordinatorProxyInterface::r#set_layer_primary_position(
self,
layer_id,
image_source_transformation,
image_source,
display_destination,
)
}
pub fn r#set_layer_primary_alpha(
&self,
mut layer_id: &LayerId,
mut mode: fidl_fuchsia_hardware_display_types::AlphaMode,
mut val: f32,
) -> Result<(), fidl::Error> {
CoordinatorProxyInterface::r#set_layer_primary_alpha(self, layer_id, mode, val)
}
pub fn r#set_layer_color_config(
&self,
mut layer_id: &LayerId,
mut color: &fidl_fuchsia_hardware_display_types::Color,
) -> Result<(), fidl::Error> {
CoordinatorProxyInterface::r#set_layer_color_config(self, layer_id, color)
}
pub fn r#set_layer_image2(
&self,
mut layer_id: &LayerId,
mut image_id: &ImageId,
mut wait_event_id: &EventId,
) -> Result<(), fidl::Error> {
CoordinatorProxyInterface::r#set_layer_image2(self, layer_id, image_id, wait_event_id)
}
pub fn r#check_config(
&self,
mut discard: bool,
) -> fidl::client::QueryResponseFut<
(fidl_fuchsia_hardware_display_types::ConfigResult, Vec<ClientCompositionOp>),
fidl::encoding::DefaultFuchsiaResourceDialect,
> {
CoordinatorProxyInterface::r#check_config(self, discard)
}
pub fn r#apply_config(&self) -> Result<(), fidl::Error> {
CoordinatorProxyInterface::r#apply_config(self)
}
pub fn r#get_latest_applied_config_stamp(
&self,
) -> fidl::client::QueryResponseFut<
fidl_fuchsia_hardware_display_types::ConfigStamp,
fidl::encoding::DefaultFuchsiaResourceDialect,
> {
CoordinatorProxyInterface::r#get_latest_applied_config_stamp(self)
}
pub fn r#apply_config3(
&self,
mut payload: CoordinatorApplyConfig3Request,
) -> Result<(), fidl::Error> {
CoordinatorProxyInterface::r#apply_config3(self, payload)
}
pub fn r#enable_vsync(&self, mut enable: bool) -> Result<(), fidl::Error> {
CoordinatorProxyInterface::r#enable_vsync(self, enable)
}
pub fn r#acknowledge_vsync(&self, mut cookie: u64) -> Result<(), fidl::Error> {
CoordinatorProxyInterface::r#acknowledge_vsync(self, cookie)
}
pub fn r#set_virtcon_mode(&self, mut mode: VirtconMode) -> Result<(), fidl::Error> {
CoordinatorProxyInterface::r#set_virtcon_mode(self, mode)
}
pub fn r#import_buffer_collection(
&self,
mut buffer_collection_id: &BufferCollectionId,
mut buffer_collection_token: fidl::endpoints::ClientEnd<
fidl_fuchsia_sysmem2::BufferCollectionTokenMarker,
>,
) -> fidl::client::QueryResponseFut<
CoordinatorImportBufferCollectionResult,
fidl::encoding::DefaultFuchsiaResourceDialect,
> {
CoordinatorProxyInterface::r#import_buffer_collection(
self,
buffer_collection_id,
buffer_collection_token,
)
}
pub fn r#release_buffer_collection(
&self,
mut buffer_collection_id: &BufferCollectionId,
) -> Result<(), fidl::Error> {
CoordinatorProxyInterface::r#release_buffer_collection(self, buffer_collection_id)
}
pub fn r#set_buffer_collection_constraints(
&self,
mut buffer_collection_id: &BufferCollectionId,
mut buffer_usage: &fidl_fuchsia_hardware_display_types::ImageBufferUsage,
) -> fidl::client::QueryResponseFut<
CoordinatorSetBufferCollectionConstraintsResult,
fidl::encoding::DefaultFuchsiaResourceDialect,
> {
CoordinatorProxyInterface::r#set_buffer_collection_constraints(
self,
buffer_collection_id,
buffer_usage,
)
}
pub fn r#is_capture_supported(
&self,
) -> fidl::client::QueryResponseFut<
CoordinatorIsCaptureSupportedResult,
fidl::encoding::DefaultFuchsiaResourceDialect,
> {
CoordinatorProxyInterface::r#is_capture_supported(self)
}
pub fn r#start_capture(
&self,
mut signal_event_id: &EventId,
mut image_id: &ImageId,
) -> fidl::client::QueryResponseFut<
CoordinatorStartCaptureResult,
fidl::encoding::DefaultFuchsiaResourceDialect,
> {
CoordinatorProxyInterface::r#start_capture(self, signal_event_id, image_id)
}
pub fn r#set_minimum_rgb(
&self,
mut minimum_rgb: u8,
) -> fidl::client::QueryResponseFut<
CoordinatorSetMinimumRgbResult,
fidl::encoding::DefaultFuchsiaResourceDialect,
> {
CoordinatorProxyInterface::r#set_minimum_rgb(self, minimum_rgb)
}
pub fn r#set_display_power(
&self,
mut display_id: &fidl_fuchsia_hardware_display_types::DisplayId,
mut power_on: bool,
) -> fidl::client::QueryResponseFut<
CoordinatorSetDisplayPowerResult,
fidl::encoding::DefaultFuchsiaResourceDialect,
> {
CoordinatorProxyInterface::r#set_display_power(self, display_id, power_on)
}
}
impl CoordinatorProxyInterface for CoordinatorProxy {
type ImportImageResponseFut = fidl::client::QueryResponseFut<
CoordinatorImportImageResult,
fidl::encoding::DefaultFuchsiaResourceDialect,
>;
fn r#import_image(
&self,
mut image_metadata: &fidl_fuchsia_hardware_display_types::ImageMetadata,
mut buffer_id: &BufferId,
mut image_id: &ImageId,
) -> Self::ImportImageResponseFut {
fn _decode(
mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
) -> Result<CoordinatorImportImageResult, fidl::Error> {
let _response = fidl::client::decode_transaction_body::<
fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
fidl::encoding::DefaultFuchsiaResourceDialect,
0x3a8636eb9656b4f4,
>(_buf?)?;
Ok(_response.map(|x| x))
}
self.client
.send_query_and_decode::<CoordinatorImportImageRequest, CoordinatorImportImageResult>(
(image_metadata, buffer_id, image_id),
0x3a8636eb9656b4f4,
fidl::encoding::DynamicFlags::empty(),
_decode,
)
}
fn r#release_image(&self, mut image_id: &ImageId) -> Result<(), fidl::Error> {
self.client.send::<CoordinatorReleaseImageRequest>(
(image_id,),
0x477192230517504,
fidl::encoding::DynamicFlags::empty(),
)
}
fn r#import_event(&self, mut event: fidl::Event, mut id: &EventId) -> Result<(), fidl::Error> {
self.client.send::<CoordinatorImportEventRequest>(
(event, id),
0x2864e5dc59390543,
fidl::encoding::DynamicFlags::empty(),
)
}
fn r#release_event(&self, mut id: &EventId) -> Result<(), fidl::Error> {
self.client.send::<CoordinatorReleaseEventRequest>(
(id,),
0x32508c2101606b87,
fidl::encoding::DynamicFlags::empty(),
)
}
type CreateLayerResponseFut = fidl::client::QueryResponseFut<
CoordinatorCreateLayerResult,
fidl::encoding::DefaultFuchsiaResourceDialect,
>;
fn r#create_layer(&self) -> Self::CreateLayerResponseFut {
fn _decode(
mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
) -> Result<CoordinatorCreateLayerResult, fidl::Error> {
let _response = fidl::client::decode_transaction_body::<
fidl::encoding::ResultType<CoordinatorCreateLayerResponse, i32>,
fidl::encoding::DefaultFuchsiaResourceDialect,
0x2137cfd788a3496b,
>(_buf?)?;
Ok(_response.map(|x| x.layer_id))
}
self.client
.send_query_and_decode::<fidl::encoding::EmptyPayload, CoordinatorCreateLayerResult>(
(),
0x2137cfd788a3496b,
fidl::encoding::DynamicFlags::empty(),
_decode,
)
}
fn r#destroy_layer(&self, mut layer_id: &LayerId) -> Result<(), fidl::Error> {
self.client.send::<CoordinatorDestroyLayerRequest>(
(layer_id,),
0x386e12d092bea2f8,
fidl::encoding::DynamicFlags::empty(),
)
}
fn r#set_display_mode(
&self,
mut display_id: &fidl_fuchsia_hardware_display_types::DisplayId,
mut mode: &fidl_fuchsia_hardware_display_types::Mode,
) -> Result<(), fidl::Error> {
self.client.send::<CoordinatorSetDisplayModeRequest>(
(display_id, mode),
0xbde3c59ee9c1777,
fidl::encoding::DynamicFlags::empty(),
)
}
fn r#set_display_color_conversion(
&self,
mut display_id: &fidl_fuchsia_hardware_display_types::DisplayId,
mut preoffsets: &[f32; 3],
mut coefficients: &[f32; 9],
mut postoffsets: &[f32; 3],
) -> Result<(), fidl::Error> {
self.client.send::<CoordinatorSetDisplayColorConversionRequest>(
(display_id, preoffsets, coefficients, postoffsets),
0x2f18186a987d51aa,
fidl::encoding::DynamicFlags::empty(),
)
}
fn r#set_display_layers(
&self,
mut display_id: &fidl_fuchsia_hardware_display_types::DisplayId,
mut layer_ids: &[LayerId],
) -> Result<(), fidl::Error> {
self.client.send::<CoordinatorSetDisplayLayersRequest>(
(display_id, layer_ids),
0x190e0f6f93be1d89,
fidl::encoding::DynamicFlags::empty(),
)
}
fn r#set_layer_primary_config(
&self,
mut layer_id: &LayerId,
mut image_metadata: &fidl_fuchsia_hardware_display_types::ImageMetadata,
) -> Result<(), fidl::Error> {
self.client.send::<CoordinatorSetLayerPrimaryConfigRequest>(
(layer_id, image_metadata),
0x68d89ebd518b45b9,
fidl::encoding::DynamicFlags::empty(),
)
}
fn r#set_layer_primary_position(
&self,
mut layer_id: &LayerId,
mut image_source_transformation: fidl_fuchsia_hardware_display_types::CoordinateTransformation,
mut image_source: &fidl_fuchsia_math::RectU,
mut display_destination: &fidl_fuchsia_math::RectU,
) -> Result<(), fidl::Error> {
self.client.send::<CoordinatorSetLayerPrimaryPositionRequest>(
(layer_id, image_source_transformation, image_source, display_destination),
0x27b192b5a43851e2,
fidl::encoding::DynamicFlags::empty(),
)
}
fn r#set_layer_primary_alpha(
&self,
mut layer_id: &LayerId,
mut mode: fidl_fuchsia_hardware_display_types::AlphaMode,
mut val: f32,
) -> Result<(), fidl::Error> {
self.client.send::<CoordinatorSetLayerPrimaryAlphaRequest>(
(layer_id, mode, val),
0x104cf2b18b27296d,
fidl::encoding::DynamicFlags::empty(),
)
}
fn r#set_layer_color_config(
&self,
mut layer_id: &LayerId,
mut color: &fidl_fuchsia_hardware_display_types::Color,
) -> Result<(), fidl::Error> {
self.client.send::<CoordinatorSetLayerColorConfigRequest>(
(layer_id, color),
0x2fa91e9a2a01875f,
fidl::encoding::DynamicFlags::empty(),
)
}
fn r#set_layer_image2(
&self,
mut layer_id: &LayerId,
mut image_id: &ImageId,
mut wait_event_id: &EventId,
) -> Result<(), fidl::Error> {
self.client.send::<CoordinatorSetLayerImage2Request>(
(layer_id, image_id, wait_event_id),
0x53c6376dfc13a971,
fidl::encoding::DynamicFlags::empty(),
)
}
type CheckConfigResponseFut = fidl::client::QueryResponseFut<
(fidl_fuchsia_hardware_display_types::ConfigResult, Vec<ClientCompositionOp>),
fidl::encoding::DefaultFuchsiaResourceDialect,
>;
fn r#check_config(&self, mut discard: bool) -> Self::CheckConfigResponseFut {
fn _decode(
mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
) -> Result<
(fidl_fuchsia_hardware_display_types::ConfigResult, Vec<ClientCompositionOp>),
fidl::Error,
> {
let _response = fidl::client::decode_transaction_body::<
CoordinatorCheckConfigResponse,
fidl::encoding::DefaultFuchsiaResourceDialect,
0x2bcfb4eb16878158,
>(_buf?)?;
Ok((_response.res, _response.ops))
}
self.client.send_query_and_decode::<
CoordinatorCheckConfigRequest,
(fidl_fuchsia_hardware_display_types::ConfigResult, Vec<ClientCompositionOp>),
>(
(discard,),
0x2bcfb4eb16878158,
fidl::encoding::DynamicFlags::empty(),
_decode,
)
}
fn r#apply_config(&self) -> Result<(), fidl::Error> {
self.client.send::<fidl::encoding::EmptyPayload>(
(),
0x114b879319b4e53f,
fidl::encoding::DynamicFlags::empty(),
)
}
type GetLatestAppliedConfigStampResponseFut = fidl::client::QueryResponseFut<
fidl_fuchsia_hardware_display_types::ConfigStamp,
fidl::encoding::DefaultFuchsiaResourceDialect,
>;
fn r#get_latest_applied_config_stamp(&self) -> Self::GetLatestAppliedConfigStampResponseFut {
fn _decode(
mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
) -> Result<fidl_fuchsia_hardware_display_types::ConfigStamp, fidl::Error> {
let _response = fidl::client::decode_transaction_body::<
CoordinatorGetLatestAppliedConfigStampResponse,
fidl::encoding::DefaultFuchsiaResourceDialect,
0x76a50c0537265f65,
>(_buf?)?;
Ok(_response.stamp)
}
self.client.send_query_and_decode::<
fidl::encoding::EmptyPayload,
fidl_fuchsia_hardware_display_types::ConfigStamp,
>(
(),
0x76a50c0537265f65,
fidl::encoding::DynamicFlags::empty(),
_decode,
)
}
fn r#apply_config3(
&self,
mut payload: CoordinatorApplyConfig3Request,
) -> Result<(), fidl::Error> {
self.client.send::<CoordinatorApplyConfig3Request>(
&mut payload,
0x7f0fe0e4f062a67e,
fidl::encoding::DynamicFlags::empty(),
)
}
fn r#enable_vsync(&self, mut enable: bool) -> Result<(), fidl::Error> {
self.client.send::<CoordinatorEnableVsyncRequest>(
(enable,),
0x3e23634eb2ae6820,
fidl::encoding::DynamicFlags::empty(),
)
}
fn r#acknowledge_vsync(&self, mut cookie: u64) -> Result<(), fidl::Error> {
self.client.send::<CoordinatorAcknowledgeVsyncRequest>(
(cookie,),
0x25e921d26107d6ef,
fidl::encoding::DynamicFlags::empty(),
)
}
fn r#set_virtcon_mode(&self, mut mode: VirtconMode) -> Result<(), fidl::Error> {
self.client.send::<CoordinatorSetVirtconModeRequest>(
(mode,),
0x4fe0721526068f00,
fidl::encoding::DynamicFlags::empty(),
)
}
type ImportBufferCollectionResponseFut = fidl::client::QueryResponseFut<
CoordinatorImportBufferCollectionResult,
fidl::encoding::DefaultFuchsiaResourceDialect,
>;
fn r#import_buffer_collection(
&self,
mut buffer_collection_id: &BufferCollectionId,
mut buffer_collection_token: fidl::endpoints::ClientEnd<
fidl_fuchsia_sysmem2::BufferCollectionTokenMarker,
>,
) -> Self::ImportBufferCollectionResponseFut {
fn _decode(
mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
) -> Result<CoordinatorImportBufferCollectionResult, fidl::Error> {
let _response = fidl::client::decode_transaction_body::<
fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
fidl::encoding::DefaultFuchsiaResourceDialect,
0x30d06f510e7f4601,
>(_buf?)?;
Ok(_response.map(|x| x))
}
self.client.send_query_and_decode::<
CoordinatorImportBufferCollectionRequest,
CoordinatorImportBufferCollectionResult,
>(
(buffer_collection_id, buffer_collection_token,),
0x30d06f510e7f4601,
fidl::encoding::DynamicFlags::empty(),
_decode,
)
}
fn r#release_buffer_collection(
&self,
mut buffer_collection_id: &BufferCollectionId,
) -> Result<(), fidl::Error> {
self.client.send::<CoordinatorReleaseBufferCollectionRequest>(
(buffer_collection_id,),
0x1c7dd5f8b0690be0,
fidl::encoding::DynamicFlags::empty(),
)
}
type SetBufferCollectionConstraintsResponseFut = fidl::client::QueryResponseFut<
CoordinatorSetBufferCollectionConstraintsResult,
fidl::encoding::DefaultFuchsiaResourceDialect,
>;
fn r#set_buffer_collection_constraints(
&self,
mut buffer_collection_id: &BufferCollectionId,
mut buffer_usage: &fidl_fuchsia_hardware_display_types::ImageBufferUsage,
) -> Self::SetBufferCollectionConstraintsResponseFut {
fn _decode(
mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
) -> Result<CoordinatorSetBufferCollectionConstraintsResult, fidl::Error> {
let _response = fidl::client::decode_transaction_body::<
fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
fidl::encoding::DefaultFuchsiaResourceDialect,
0x509a4ee9af6035df,
>(_buf?)?;
Ok(_response.map(|x| x))
}
self.client.send_query_and_decode::<
CoordinatorSetBufferCollectionConstraintsRequest,
CoordinatorSetBufferCollectionConstraintsResult,
>(
(buffer_collection_id, buffer_usage,),
0x509a4ee9af6035df,
fidl::encoding::DynamicFlags::empty(),
_decode,
)
}
type IsCaptureSupportedResponseFut = fidl::client::QueryResponseFut<
CoordinatorIsCaptureSupportedResult,
fidl::encoding::DefaultFuchsiaResourceDialect,
>;
fn r#is_capture_supported(&self) -> Self::IsCaptureSupportedResponseFut {
fn _decode(
mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
) -> Result<CoordinatorIsCaptureSupportedResult, fidl::Error> {
let _response = fidl::client::decode_transaction_body::<
fidl::encoding::ResultType<CoordinatorIsCaptureSupportedResponse, i32>,
fidl::encoding::DefaultFuchsiaResourceDialect,
0x4ca407277277971b,
>(_buf?)?;
Ok(_response.map(|x| x.supported))
}
self.client.send_query_and_decode::<
fidl::encoding::EmptyPayload,
CoordinatorIsCaptureSupportedResult,
>(
(),
0x4ca407277277971b,
fidl::encoding::DynamicFlags::empty(),
_decode,
)
}
type StartCaptureResponseFut = fidl::client::QueryResponseFut<
CoordinatorStartCaptureResult,
fidl::encoding::DefaultFuchsiaResourceDialect,
>;
fn r#start_capture(
&self,
mut signal_event_id: &EventId,
mut image_id: &ImageId,
) -> Self::StartCaptureResponseFut {
fn _decode(
mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
) -> Result<CoordinatorStartCaptureResult, fidl::Error> {
let _response = fidl::client::decode_transaction_body::<
fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
fidl::encoding::DefaultFuchsiaResourceDialect,
0x35cb38f19d96a8db,
>(_buf?)?;
Ok(_response.map(|x| x))
}
self.client
.send_query_and_decode::<CoordinatorStartCaptureRequest, CoordinatorStartCaptureResult>(
(signal_event_id, image_id),
0x35cb38f19d96a8db,
fidl::encoding::DynamicFlags::empty(),
_decode,
)
}
type SetMinimumRgbResponseFut = fidl::client::QueryResponseFut<
CoordinatorSetMinimumRgbResult,
fidl::encoding::DefaultFuchsiaResourceDialect,
>;
fn r#set_minimum_rgb(&self, mut minimum_rgb: u8) -> Self::SetMinimumRgbResponseFut {
fn _decode(
mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
) -> Result<CoordinatorSetMinimumRgbResult, fidl::Error> {
let _response = fidl::client::decode_transaction_body::<
fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
fidl::encoding::DefaultFuchsiaResourceDialect,
0x1b49251437038b0b,
>(_buf?)?;
Ok(_response.map(|x| x))
}
self.client.send_query_and_decode::<
CoordinatorSetMinimumRgbRequest,
CoordinatorSetMinimumRgbResult,
>(
(minimum_rgb,),
0x1b49251437038b0b,
fidl::encoding::DynamicFlags::empty(),
_decode,
)
}
type SetDisplayPowerResponseFut = fidl::client::QueryResponseFut<
CoordinatorSetDisplayPowerResult,
fidl::encoding::DefaultFuchsiaResourceDialect,
>;
fn r#set_display_power(
&self,
mut display_id: &fidl_fuchsia_hardware_display_types::DisplayId,
mut power_on: bool,
) -> Self::SetDisplayPowerResponseFut {
fn _decode(
mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
) -> Result<CoordinatorSetDisplayPowerResult, fidl::Error> {
let _response = fidl::client::decode_transaction_body::<
fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
fidl::encoding::DefaultFuchsiaResourceDialect,
0x10feb62d11d9e92b,
>(_buf?)?;
Ok(_response.map(|x| x))
}
self.client.send_query_and_decode::<
CoordinatorSetDisplayPowerRequest,
CoordinatorSetDisplayPowerResult,
>(
(display_id, power_on,),
0x10feb62d11d9e92b,
fidl::encoding::DynamicFlags::empty(),
_decode,
)
}
}
pub struct CoordinatorEventStream {
event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
}
impl std::marker::Unpin for CoordinatorEventStream {}
impl futures::stream::FusedStream for CoordinatorEventStream {
fn is_terminated(&self) -> bool {
self.event_receiver.is_terminated()
}
}
impl futures::Stream for CoordinatorEventStream {
type Item = Result<CoordinatorEvent, fidl::Error>;
fn poll_next(
mut self: std::pin::Pin<&mut Self>,
cx: &mut std::task::Context<'_>,
) -> std::task::Poll<Option<Self::Item>> {
match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
&mut self.event_receiver,
cx
)?) {
Some(buf) => std::task::Poll::Ready(Some(CoordinatorEvent::decode(buf))),
None => std::task::Poll::Ready(None),
}
}
}
#[derive(Debug)]
pub enum CoordinatorEvent {
OnDisplaysChanged {
added: Vec<Info>,
removed: Vec<fidl_fuchsia_hardware_display_types::DisplayId>,
},
OnVsync {
display_id: fidl_fuchsia_hardware_display_types::DisplayId,
timestamp: u64,
applied_config_stamp: fidl_fuchsia_hardware_display_types::ConfigStamp,
cookie: u64,
},
OnClientOwnershipChange {
has_ownership: bool,
},
}
impl CoordinatorEvent {
#[allow(irrefutable_let_patterns)]
pub fn into_on_displays_changed(
self,
) -> Option<(Vec<Info>, Vec<fidl_fuchsia_hardware_display_types::DisplayId>)> {
if let CoordinatorEvent::OnDisplaysChanged { added, removed } = self {
Some((added, removed))
} else {
None
}
}
#[allow(irrefutable_let_patterns)]
pub fn into_on_vsync(
self,
) -> Option<(
fidl_fuchsia_hardware_display_types::DisplayId,
u64,
fidl_fuchsia_hardware_display_types::ConfigStamp,
u64,
)> {
if let CoordinatorEvent::OnVsync { display_id, timestamp, applied_config_stamp, cookie } =
self
{
Some((display_id, timestamp, applied_config_stamp, cookie))
} else {
None
}
}
#[allow(irrefutable_let_patterns)]
pub fn into_on_client_ownership_change(self) -> Option<bool> {
if let CoordinatorEvent::OnClientOwnershipChange { has_ownership } = self {
Some((has_ownership))
} else {
None
}
}
fn decode(
mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
) -> Result<CoordinatorEvent, fidl::Error> {
let (bytes, _handles) = buf.split_mut();
let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
debug_assert_eq!(tx_header.tx_id, 0);
match tx_header.ordinal {
0x50d168de1cc5bda3 => {
let mut out = fidl::new_empty!(
CoordinatorOnDisplaysChangedRequest,
fidl::encoding::DefaultFuchsiaResourceDialect
);
fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<CoordinatorOnDisplaysChangedRequest>(&tx_header, _body_bytes, _handles, &mut out)?;
Ok((CoordinatorEvent::OnDisplaysChanged { added: out.added, removed: out.removed }))
}
0x14b6a0155c58c05f => {
let mut out = fidl::new_empty!(
CoordinatorOnVsyncRequest,
fidl::encoding::DefaultFuchsiaResourceDialect
);
fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<CoordinatorOnVsyncRequest>(&tx_header, _body_bytes, _handles, &mut out)?;
Ok((CoordinatorEvent::OnVsync {
display_id: out.display_id,
timestamp: out.timestamp,
applied_config_stamp: out.applied_config_stamp,
cookie: out.cookie,
}))
}
0x52b7c894e1a5c2ed => {
let mut out = fidl::new_empty!(
CoordinatorOnClientOwnershipChangeRequest,
fidl::encoding::DefaultFuchsiaResourceDialect
);
fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<CoordinatorOnClientOwnershipChangeRequest>(&tx_header, _body_bytes, _handles, &mut out)?;
Ok((CoordinatorEvent::OnClientOwnershipChange { has_ownership: out.has_ownership }))
}
_ => Err(fidl::Error::UnknownOrdinal {
ordinal: tx_header.ordinal,
protocol_name: <CoordinatorMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
}),
}
}
}
pub struct CoordinatorRequestStream {
inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
is_terminated: bool,
}
impl std::marker::Unpin for CoordinatorRequestStream {}
impl futures::stream::FusedStream for CoordinatorRequestStream {
fn is_terminated(&self) -> bool {
self.is_terminated
}
}
impl fidl::endpoints::RequestStream for CoordinatorRequestStream {
type Protocol = CoordinatorMarker;
type ControlHandle = CoordinatorControlHandle;
fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
}
fn control_handle(&self) -> Self::ControlHandle {
CoordinatorControlHandle { inner: self.inner.clone() }
}
fn into_inner(
self,
) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
{
(self.inner, self.is_terminated)
}
fn from_inner(
inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
is_terminated: bool,
) -> Self {
Self { inner, is_terminated }
}
}
impl futures::Stream for CoordinatorRequestStream {
type Item = Result<CoordinatorRequest, fidl::Error>;
fn poll_next(
mut self: std::pin::Pin<&mut Self>,
cx: &mut std::task::Context<'_>,
) -> std::task::Poll<Option<Self::Item>> {
let this = &mut *self;
if this.inner.check_shutdown(cx) {
this.is_terminated = true;
return std::task::Poll::Ready(None);
}
if this.is_terminated {
panic!("polled CoordinatorRequestStream after completion");
}
fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
|bytes, handles| {
match this.inner.channel().read_etc(cx, bytes, handles) {
std::task::Poll::Ready(Ok(())) => {}
std::task::Poll::Pending => return std::task::Poll::Pending,
std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
this.is_terminated = true;
return std::task::Poll::Ready(None);
}
std::task::Poll::Ready(Err(e)) => {
return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
e.into(),
))))
}
}
let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
std::task::Poll::Ready(Some(match header.ordinal {
0x3a8636eb9656b4f4 => {
header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
let mut req = fidl::new_empty!(
CoordinatorImportImageRequest,
fidl::encoding::DefaultFuchsiaResourceDialect
);
fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<CoordinatorImportImageRequest>(&header, _body_bytes, handles, &mut req)?;
let control_handle = CoordinatorControlHandle { inner: this.inner.clone() };
Ok(CoordinatorRequest::ImportImage {
image_metadata: req.image_metadata,
buffer_id: req.buffer_id,
image_id: req.image_id,
responder: CoordinatorImportImageResponder {
control_handle: std::mem::ManuallyDrop::new(control_handle),
tx_id: header.tx_id,
},
})
}
0x477192230517504 => {
header.validate_request_tx_id(fidl::MethodType::OneWay)?;
let mut req = fidl::new_empty!(
CoordinatorReleaseImageRequest,
fidl::encoding::DefaultFuchsiaResourceDialect
);
fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<CoordinatorReleaseImageRequest>(&header, _body_bytes, handles, &mut req)?;
let control_handle = CoordinatorControlHandle { inner: this.inner.clone() };
Ok(CoordinatorRequest::ReleaseImage {
image_id: req.image_id,
control_handle,
})
}
0x2864e5dc59390543 => {
header.validate_request_tx_id(fidl::MethodType::OneWay)?;
let mut req = fidl::new_empty!(
CoordinatorImportEventRequest,
fidl::encoding::DefaultFuchsiaResourceDialect
);
fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<CoordinatorImportEventRequest>(&header, _body_bytes, handles, &mut req)?;
let control_handle = CoordinatorControlHandle { inner: this.inner.clone() };
Ok(CoordinatorRequest::ImportEvent {
event: req.event,
id: req.id,
control_handle,
})
}
0x32508c2101606b87 => {
header.validate_request_tx_id(fidl::MethodType::OneWay)?;
let mut req = fidl::new_empty!(
CoordinatorReleaseEventRequest,
fidl::encoding::DefaultFuchsiaResourceDialect
);
fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<CoordinatorReleaseEventRequest>(&header, _body_bytes, handles, &mut req)?;
let control_handle = CoordinatorControlHandle { inner: this.inner.clone() };
Ok(CoordinatorRequest::ReleaseEvent { id: req.id, control_handle })
}
0x2137cfd788a3496b => {
header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
let mut req = fidl::new_empty!(
fidl::encoding::EmptyPayload,
fidl::encoding::DefaultFuchsiaResourceDialect
);
fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
let control_handle = CoordinatorControlHandle { inner: this.inner.clone() };
Ok(CoordinatorRequest::CreateLayer {
responder: CoordinatorCreateLayerResponder {
control_handle: std::mem::ManuallyDrop::new(control_handle),
tx_id: header.tx_id,
},
})
}
0x386e12d092bea2f8 => {
header.validate_request_tx_id(fidl::MethodType::OneWay)?;
let mut req = fidl::new_empty!(
CoordinatorDestroyLayerRequest,
fidl::encoding::DefaultFuchsiaResourceDialect
);
fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<CoordinatorDestroyLayerRequest>(&header, _body_bytes, handles, &mut req)?;
let control_handle = CoordinatorControlHandle { inner: this.inner.clone() };
Ok(CoordinatorRequest::DestroyLayer {
layer_id: req.layer_id,
control_handle,
})
}
0xbde3c59ee9c1777 => {
header.validate_request_tx_id(fidl::MethodType::OneWay)?;
let mut req = fidl::new_empty!(
CoordinatorSetDisplayModeRequest,
fidl::encoding::DefaultFuchsiaResourceDialect
);
fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<CoordinatorSetDisplayModeRequest>(&header, _body_bytes, handles, &mut req)?;
let control_handle = CoordinatorControlHandle { inner: this.inner.clone() };
Ok(CoordinatorRequest::SetDisplayMode {
display_id: req.display_id,
mode: req.mode,
control_handle,
})
}
0x2f18186a987d51aa => {
header.validate_request_tx_id(fidl::MethodType::OneWay)?;
let mut req = fidl::new_empty!(
CoordinatorSetDisplayColorConversionRequest,
fidl::encoding::DefaultFuchsiaResourceDialect
);
fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<CoordinatorSetDisplayColorConversionRequest>(&header, _body_bytes, handles, &mut req)?;
let control_handle = CoordinatorControlHandle { inner: this.inner.clone() };
Ok(CoordinatorRequest::SetDisplayColorConversion {
display_id: req.display_id,
preoffsets: req.preoffsets,
coefficients: req.coefficients,
postoffsets: req.postoffsets,
control_handle,
})
}
0x190e0f6f93be1d89 => {
header.validate_request_tx_id(fidl::MethodType::OneWay)?;
let mut req = fidl::new_empty!(
CoordinatorSetDisplayLayersRequest,
fidl::encoding::DefaultFuchsiaResourceDialect
);
fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<CoordinatorSetDisplayLayersRequest>(&header, _body_bytes, handles, &mut req)?;
let control_handle = CoordinatorControlHandle { inner: this.inner.clone() };
Ok(CoordinatorRequest::SetDisplayLayers {
display_id: req.display_id,
layer_ids: req.layer_ids,
control_handle,
})
}
0x68d89ebd518b45b9 => {
header.validate_request_tx_id(fidl::MethodType::OneWay)?;
let mut req = fidl::new_empty!(
CoordinatorSetLayerPrimaryConfigRequest,
fidl::encoding::DefaultFuchsiaResourceDialect
);
fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<CoordinatorSetLayerPrimaryConfigRequest>(&header, _body_bytes, handles, &mut req)?;
let control_handle = CoordinatorControlHandle { inner: this.inner.clone() };
Ok(CoordinatorRequest::SetLayerPrimaryConfig {
layer_id: req.layer_id,
image_metadata: req.image_metadata,
control_handle,
})
}
0x27b192b5a43851e2 => {
header.validate_request_tx_id(fidl::MethodType::OneWay)?;
let mut req = fidl::new_empty!(
CoordinatorSetLayerPrimaryPositionRequest,
fidl::encoding::DefaultFuchsiaResourceDialect
);
fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<CoordinatorSetLayerPrimaryPositionRequest>(&header, _body_bytes, handles, &mut req)?;
let control_handle = CoordinatorControlHandle { inner: this.inner.clone() };
Ok(CoordinatorRequest::SetLayerPrimaryPosition {
layer_id: req.layer_id,
image_source_transformation: req.image_source_transformation,
image_source: req.image_source,
display_destination: req.display_destination,
control_handle,
})
}
0x104cf2b18b27296d => {
header.validate_request_tx_id(fidl::MethodType::OneWay)?;
let mut req = fidl::new_empty!(
CoordinatorSetLayerPrimaryAlphaRequest,
fidl::encoding::DefaultFuchsiaResourceDialect
);
fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<CoordinatorSetLayerPrimaryAlphaRequest>(&header, _body_bytes, handles, &mut req)?;
let control_handle = CoordinatorControlHandle { inner: this.inner.clone() };
Ok(CoordinatorRequest::SetLayerPrimaryAlpha {
layer_id: req.layer_id,
mode: req.mode,
val: req.val,
control_handle,
})
}
0x2fa91e9a2a01875f => {
header.validate_request_tx_id(fidl::MethodType::OneWay)?;
let mut req = fidl::new_empty!(
CoordinatorSetLayerColorConfigRequest,
fidl::encoding::DefaultFuchsiaResourceDialect
);
fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<CoordinatorSetLayerColorConfigRequest>(&header, _body_bytes, handles, &mut req)?;
let control_handle = CoordinatorControlHandle { inner: this.inner.clone() };
Ok(CoordinatorRequest::SetLayerColorConfig {
layer_id: req.layer_id,
color: req.color,
control_handle,
})
}
0x53c6376dfc13a971 => {
header.validate_request_tx_id(fidl::MethodType::OneWay)?;
let mut req = fidl::new_empty!(
CoordinatorSetLayerImage2Request,
fidl::encoding::DefaultFuchsiaResourceDialect
);
fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<CoordinatorSetLayerImage2Request>(&header, _body_bytes, handles, &mut req)?;
let control_handle = CoordinatorControlHandle { inner: this.inner.clone() };
Ok(CoordinatorRequest::SetLayerImage2 {
layer_id: req.layer_id,
image_id: req.image_id,
wait_event_id: req.wait_event_id,
control_handle,
})
}
0x2bcfb4eb16878158 => {
header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
let mut req = fidl::new_empty!(
CoordinatorCheckConfigRequest,
fidl::encoding::DefaultFuchsiaResourceDialect
);
fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<CoordinatorCheckConfigRequest>(&header, _body_bytes, handles, &mut req)?;
let control_handle = CoordinatorControlHandle { inner: this.inner.clone() };
Ok(CoordinatorRequest::CheckConfig {
discard: req.discard,
responder: CoordinatorCheckConfigResponder {
control_handle: std::mem::ManuallyDrop::new(control_handle),
tx_id: header.tx_id,
},
})
}
0x114b879319b4e53f => {
header.validate_request_tx_id(fidl::MethodType::OneWay)?;
let mut req = fidl::new_empty!(
fidl::encoding::EmptyPayload,
fidl::encoding::DefaultFuchsiaResourceDialect
);
fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
let control_handle = CoordinatorControlHandle { inner: this.inner.clone() };
Ok(CoordinatorRequest::ApplyConfig { control_handle })
}
0x76a50c0537265f65 => {
header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
let mut req = fidl::new_empty!(
fidl::encoding::EmptyPayload,
fidl::encoding::DefaultFuchsiaResourceDialect
);
fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
let control_handle = CoordinatorControlHandle { inner: this.inner.clone() };
Ok(CoordinatorRequest::GetLatestAppliedConfigStamp {
responder: CoordinatorGetLatestAppliedConfigStampResponder {
control_handle: std::mem::ManuallyDrop::new(control_handle),
tx_id: header.tx_id,
},
})
}
0x7f0fe0e4f062a67e => {
header.validate_request_tx_id(fidl::MethodType::OneWay)?;
let mut req = fidl::new_empty!(
CoordinatorApplyConfig3Request,
fidl::encoding::DefaultFuchsiaResourceDialect
);
fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<CoordinatorApplyConfig3Request>(&header, _body_bytes, handles, &mut req)?;
let control_handle = CoordinatorControlHandle { inner: this.inner.clone() };
Ok(CoordinatorRequest::ApplyConfig3 { payload: req, control_handle })
}
0x3e23634eb2ae6820 => {
header.validate_request_tx_id(fidl::MethodType::OneWay)?;
let mut req = fidl::new_empty!(
CoordinatorEnableVsyncRequest,
fidl::encoding::DefaultFuchsiaResourceDialect
);
fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<CoordinatorEnableVsyncRequest>(&header, _body_bytes, handles, &mut req)?;
let control_handle = CoordinatorControlHandle { inner: this.inner.clone() };
Ok(CoordinatorRequest::EnableVsync { enable: req.enable, control_handle })
}
0x25e921d26107d6ef => {
header.validate_request_tx_id(fidl::MethodType::OneWay)?;
let mut req = fidl::new_empty!(
CoordinatorAcknowledgeVsyncRequest,
fidl::encoding::DefaultFuchsiaResourceDialect
);
fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<CoordinatorAcknowledgeVsyncRequest>(&header, _body_bytes, handles, &mut req)?;
let control_handle = CoordinatorControlHandle { inner: this.inner.clone() };
Ok(CoordinatorRequest::AcknowledgeVsync {
cookie: req.cookie,
control_handle,
})
}
0x4fe0721526068f00 => {
header.validate_request_tx_id(fidl::MethodType::OneWay)?;
let mut req = fidl::new_empty!(
CoordinatorSetVirtconModeRequest,
fidl::encoding::DefaultFuchsiaResourceDialect
);
fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<CoordinatorSetVirtconModeRequest>(&header, _body_bytes, handles, &mut req)?;
let control_handle = CoordinatorControlHandle { inner: this.inner.clone() };
Ok(CoordinatorRequest::SetVirtconMode { mode: req.mode, control_handle })
}
0x30d06f510e7f4601 => {
header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
let mut req = fidl::new_empty!(
CoordinatorImportBufferCollectionRequest,
fidl::encoding::DefaultFuchsiaResourceDialect
);
fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<CoordinatorImportBufferCollectionRequest>(&header, _body_bytes, handles, &mut req)?;
let control_handle = CoordinatorControlHandle { inner: this.inner.clone() };
Ok(CoordinatorRequest::ImportBufferCollection {
buffer_collection_id: req.buffer_collection_id,
buffer_collection_token: req.buffer_collection_token,
responder: CoordinatorImportBufferCollectionResponder {
control_handle: std::mem::ManuallyDrop::new(control_handle),
tx_id: header.tx_id,
},
})
}
0x1c7dd5f8b0690be0 => {
header.validate_request_tx_id(fidl::MethodType::OneWay)?;
let mut req = fidl::new_empty!(
CoordinatorReleaseBufferCollectionRequest,
fidl::encoding::DefaultFuchsiaResourceDialect
);
fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<CoordinatorReleaseBufferCollectionRequest>(&header, _body_bytes, handles, &mut req)?;
let control_handle = CoordinatorControlHandle { inner: this.inner.clone() };
Ok(CoordinatorRequest::ReleaseBufferCollection {
buffer_collection_id: req.buffer_collection_id,
control_handle,
})
}
0x509a4ee9af6035df => {
header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
let mut req = fidl::new_empty!(
CoordinatorSetBufferCollectionConstraintsRequest,
fidl::encoding::DefaultFuchsiaResourceDialect
);
fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<CoordinatorSetBufferCollectionConstraintsRequest>(&header, _body_bytes, handles, &mut req)?;
let control_handle = CoordinatorControlHandle { inner: this.inner.clone() };
Ok(CoordinatorRequest::SetBufferCollectionConstraints {
buffer_collection_id: req.buffer_collection_id,
buffer_usage: req.buffer_usage,
responder: CoordinatorSetBufferCollectionConstraintsResponder {
control_handle: std::mem::ManuallyDrop::new(control_handle),
tx_id: header.tx_id,
},
})
}
0x4ca407277277971b => {
header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
let mut req = fidl::new_empty!(
fidl::encoding::EmptyPayload,
fidl::encoding::DefaultFuchsiaResourceDialect
);
fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
let control_handle = CoordinatorControlHandle { inner: this.inner.clone() };
Ok(CoordinatorRequest::IsCaptureSupported {
responder: CoordinatorIsCaptureSupportedResponder {
control_handle: std::mem::ManuallyDrop::new(control_handle),
tx_id: header.tx_id,
},
})
}
0x35cb38f19d96a8db => {
header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
let mut req = fidl::new_empty!(
CoordinatorStartCaptureRequest,
fidl::encoding::DefaultFuchsiaResourceDialect
);
fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<CoordinatorStartCaptureRequest>(&header, _body_bytes, handles, &mut req)?;
let control_handle = CoordinatorControlHandle { inner: this.inner.clone() };
Ok(CoordinatorRequest::StartCapture {
signal_event_id: req.signal_event_id,
image_id: req.image_id,
responder: CoordinatorStartCaptureResponder {
control_handle: std::mem::ManuallyDrop::new(control_handle),
tx_id: header.tx_id,
},
})
}
0x1b49251437038b0b => {
header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
let mut req = fidl::new_empty!(
CoordinatorSetMinimumRgbRequest,
fidl::encoding::DefaultFuchsiaResourceDialect
);
fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<CoordinatorSetMinimumRgbRequest>(&header, _body_bytes, handles, &mut req)?;
let control_handle = CoordinatorControlHandle { inner: this.inner.clone() };
Ok(CoordinatorRequest::SetMinimumRgb {
minimum_rgb: req.minimum_rgb,
responder: CoordinatorSetMinimumRgbResponder {
control_handle: std::mem::ManuallyDrop::new(control_handle),
tx_id: header.tx_id,
},
})
}
0x10feb62d11d9e92b => {
header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
let mut req = fidl::new_empty!(
CoordinatorSetDisplayPowerRequest,
fidl::encoding::DefaultFuchsiaResourceDialect
);
fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<CoordinatorSetDisplayPowerRequest>(&header, _body_bytes, handles, &mut req)?;
let control_handle = CoordinatorControlHandle { inner: this.inner.clone() };
Ok(CoordinatorRequest::SetDisplayPower {
display_id: req.display_id,
power_on: req.power_on,
responder: CoordinatorSetDisplayPowerResponder {
control_handle: std::mem::ManuallyDrop::new(control_handle),
tx_id: header.tx_id,
},
})
}
_ => Err(fidl::Error::UnknownOrdinal {
ordinal: header.ordinal,
protocol_name:
<CoordinatorMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
}),
}))
},
)
}
}
#[derive(Debug)]
pub enum CoordinatorRequest {
ImportImage {
image_metadata: fidl_fuchsia_hardware_display_types::ImageMetadata,
buffer_id: BufferId,
image_id: ImageId,
responder: CoordinatorImportImageResponder,
},
ReleaseImage { image_id: ImageId, control_handle: CoordinatorControlHandle },
ImportEvent { event: fidl::Event, id: EventId, control_handle: CoordinatorControlHandle },
ReleaseEvent { id: EventId, control_handle: CoordinatorControlHandle },
CreateLayer { responder: CoordinatorCreateLayerResponder },
DestroyLayer { layer_id: LayerId, control_handle: CoordinatorControlHandle },
SetDisplayMode {
display_id: fidl_fuchsia_hardware_display_types::DisplayId,
mode: fidl_fuchsia_hardware_display_types::Mode,
control_handle: CoordinatorControlHandle,
},
SetDisplayColorConversion {
display_id: fidl_fuchsia_hardware_display_types::DisplayId,
preoffsets: [f32; 3],
coefficients: [f32; 9],
postoffsets: [f32; 3],
control_handle: CoordinatorControlHandle,
},
SetDisplayLayers {
display_id: fidl_fuchsia_hardware_display_types::DisplayId,
layer_ids: Vec<LayerId>,
control_handle: CoordinatorControlHandle,
},
SetLayerPrimaryConfig {
layer_id: LayerId,
image_metadata: fidl_fuchsia_hardware_display_types::ImageMetadata,
control_handle: CoordinatorControlHandle,
},
SetLayerPrimaryPosition {
layer_id: LayerId,
image_source_transformation: fidl_fuchsia_hardware_display_types::CoordinateTransformation,
image_source: fidl_fuchsia_math::RectU,
display_destination: fidl_fuchsia_math::RectU,
control_handle: CoordinatorControlHandle,
},
SetLayerPrimaryAlpha {
layer_id: LayerId,
mode: fidl_fuchsia_hardware_display_types::AlphaMode,
val: f32,
control_handle: CoordinatorControlHandle,
},
SetLayerColorConfig {
layer_id: LayerId,
color: fidl_fuchsia_hardware_display_types::Color,
control_handle: CoordinatorControlHandle,
},
SetLayerImage2 {
layer_id: LayerId,
image_id: ImageId,
wait_event_id: EventId,
control_handle: CoordinatorControlHandle,
},
CheckConfig { discard: bool, responder: CoordinatorCheckConfigResponder },
ApplyConfig { control_handle: CoordinatorControlHandle },
GetLatestAppliedConfigStamp { responder: CoordinatorGetLatestAppliedConfigStampResponder },
ApplyConfig3 {
payload: CoordinatorApplyConfig3Request,
control_handle: CoordinatorControlHandle,
},
EnableVsync { enable: bool, control_handle: CoordinatorControlHandle },
AcknowledgeVsync { cookie: u64, control_handle: CoordinatorControlHandle },
SetVirtconMode { mode: VirtconMode, control_handle: CoordinatorControlHandle },
ImportBufferCollection {
buffer_collection_id: BufferCollectionId,
buffer_collection_token:
fidl::endpoints::ClientEnd<fidl_fuchsia_sysmem2::BufferCollectionTokenMarker>,
responder: CoordinatorImportBufferCollectionResponder,
},
ReleaseBufferCollection {
buffer_collection_id: BufferCollectionId,
control_handle: CoordinatorControlHandle,
},
SetBufferCollectionConstraints {
buffer_collection_id: BufferCollectionId,
buffer_usage: fidl_fuchsia_hardware_display_types::ImageBufferUsage,
responder: CoordinatorSetBufferCollectionConstraintsResponder,
},
IsCaptureSupported { responder: CoordinatorIsCaptureSupportedResponder },
StartCapture {
signal_event_id: EventId,
image_id: ImageId,
responder: CoordinatorStartCaptureResponder,
},
SetMinimumRgb { minimum_rgb: u8, responder: CoordinatorSetMinimumRgbResponder },
SetDisplayPower {
display_id: fidl_fuchsia_hardware_display_types::DisplayId,
power_on: bool,
responder: CoordinatorSetDisplayPowerResponder,
},
}
impl CoordinatorRequest {
#[allow(irrefutable_let_patterns)]
pub fn into_import_image(
self,
) -> Option<(
fidl_fuchsia_hardware_display_types::ImageMetadata,
BufferId,
ImageId,
CoordinatorImportImageResponder,
)> {
if let CoordinatorRequest::ImportImage { image_metadata, buffer_id, image_id, responder } =
self
{
Some((image_metadata, buffer_id, image_id, responder))
} else {
None
}
}
#[allow(irrefutable_let_patterns)]
pub fn into_release_image(self) -> Option<(ImageId, CoordinatorControlHandle)> {
if let CoordinatorRequest::ReleaseImage { image_id, control_handle } = self {
Some((image_id, control_handle))
} else {
None
}
}
#[allow(irrefutable_let_patterns)]
pub fn into_import_event(self) -> Option<(fidl::Event, EventId, CoordinatorControlHandle)> {
if let CoordinatorRequest::ImportEvent { event, id, control_handle } = self {
Some((event, id, control_handle))
} else {
None
}
}
#[allow(irrefutable_let_patterns)]
pub fn into_release_event(self) -> Option<(EventId, CoordinatorControlHandle)> {
if let CoordinatorRequest::ReleaseEvent { id, control_handle } = self {
Some((id, control_handle))
} else {
None
}
}
#[allow(irrefutable_let_patterns)]
pub fn into_create_layer(self) -> Option<(CoordinatorCreateLayerResponder)> {
if let CoordinatorRequest::CreateLayer { responder } = self {
Some((responder))
} else {
None
}
}
#[allow(irrefutable_let_patterns)]
pub fn into_destroy_layer(self) -> Option<(LayerId, CoordinatorControlHandle)> {
if let CoordinatorRequest::DestroyLayer { layer_id, control_handle } = self {
Some((layer_id, control_handle))
} else {
None
}
}
#[allow(irrefutable_let_patterns)]
pub fn into_set_display_mode(
self,
) -> Option<(
fidl_fuchsia_hardware_display_types::DisplayId,
fidl_fuchsia_hardware_display_types::Mode,
CoordinatorControlHandle,
)> {
if let CoordinatorRequest::SetDisplayMode { display_id, mode, control_handle } = self {
Some((display_id, mode, control_handle))
} else {
None
}
}
#[allow(irrefutable_let_patterns)]
pub fn into_set_display_color_conversion(
self,
) -> Option<(
fidl_fuchsia_hardware_display_types::DisplayId,
[f32; 3],
[f32; 9],
[f32; 3],
CoordinatorControlHandle,
)> {
if let CoordinatorRequest::SetDisplayColorConversion {
display_id,
preoffsets,
coefficients,
postoffsets,
control_handle,
} = self
{
Some((display_id, preoffsets, coefficients, postoffsets, control_handle))
} else {
None
}
}
#[allow(irrefutable_let_patterns)]
pub fn into_set_display_layers(
self,
) -> Option<(
fidl_fuchsia_hardware_display_types::DisplayId,
Vec<LayerId>,
CoordinatorControlHandle,
)> {
if let CoordinatorRequest::SetDisplayLayers { display_id, layer_ids, control_handle } = self
{
Some((display_id, layer_ids, control_handle))
} else {
None
}
}
#[allow(irrefutable_let_patterns)]
pub fn into_set_layer_primary_config(
self,
) -> Option<(
LayerId,
fidl_fuchsia_hardware_display_types::ImageMetadata,
CoordinatorControlHandle,
)> {
if let CoordinatorRequest::SetLayerPrimaryConfig {
layer_id,
image_metadata,
control_handle,
} = self
{
Some((layer_id, image_metadata, control_handle))
} else {
None
}
}
#[allow(irrefutable_let_patterns)]
pub fn into_set_layer_primary_position(
self,
) -> Option<(
LayerId,
fidl_fuchsia_hardware_display_types::CoordinateTransformation,
fidl_fuchsia_math::RectU,
fidl_fuchsia_math::RectU,
CoordinatorControlHandle,
)> {
if let CoordinatorRequest::SetLayerPrimaryPosition {
layer_id,
image_source_transformation,
image_source,
display_destination,
control_handle,
} = self
{
Some((
layer_id,
image_source_transformation,
image_source,
display_destination,
control_handle,
))
} else {
None
}
}
#[allow(irrefutable_let_patterns)]
pub fn into_set_layer_primary_alpha(
self,
) -> Option<(
LayerId,
fidl_fuchsia_hardware_display_types::AlphaMode,
f32,
CoordinatorControlHandle,
)> {
if let CoordinatorRequest::SetLayerPrimaryAlpha { layer_id, mode, val, control_handle } =
self
{
Some((layer_id, mode, val, control_handle))
} else {
None
}
}
#[allow(irrefutable_let_patterns)]
pub fn into_set_layer_color_config(
self,
) -> Option<(LayerId, fidl_fuchsia_hardware_display_types::Color, CoordinatorControlHandle)>
{
if let CoordinatorRequest::SetLayerColorConfig { layer_id, color, control_handle } = self {
Some((layer_id, color, control_handle))
} else {
None
}
}
#[allow(irrefutable_let_patterns)]
pub fn into_set_layer_image2(
self,
) -> Option<(LayerId, ImageId, EventId, CoordinatorControlHandle)> {
if let CoordinatorRequest::SetLayerImage2 {
layer_id,
image_id,
wait_event_id,
control_handle,
} = self
{
Some((layer_id, image_id, wait_event_id, control_handle))
} else {
None
}
}
#[allow(irrefutable_let_patterns)]
pub fn into_check_config(self) -> Option<(bool, CoordinatorCheckConfigResponder)> {
if let CoordinatorRequest::CheckConfig { discard, responder } = self {
Some((discard, responder))
} else {
None
}
}
#[allow(irrefutable_let_patterns)]
pub fn into_apply_config(self) -> Option<(CoordinatorControlHandle)> {
if let CoordinatorRequest::ApplyConfig { control_handle } = self {
Some((control_handle))
} else {
None
}
}
#[allow(irrefutable_let_patterns)]
pub fn into_get_latest_applied_config_stamp(
self,
) -> Option<(CoordinatorGetLatestAppliedConfigStampResponder)> {
if let CoordinatorRequest::GetLatestAppliedConfigStamp { responder } = self {
Some((responder))
} else {
None
}
}
#[allow(irrefutable_let_patterns)]
pub fn into_apply_config3(
self,
) -> Option<(CoordinatorApplyConfig3Request, CoordinatorControlHandle)> {
if let CoordinatorRequest::ApplyConfig3 { payload, control_handle } = self {
Some((payload, control_handle))
} else {
None
}
}
#[allow(irrefutable_let_patterns)]
pub fn into_enable_vsync(self) -> Option<(bool, CoordinatorControlHandle)> {
if let CoordinatorRequest::EnableVsync { enable, control_handle } = self {
Some((enable, control_handle))
} else {
None
}
}
#[allow(irrefutable_let_patterns)]
pub fn into_acknowledge_vsync(self) -> Option<(u64, CoordinatorControlHandle)> {
if let CoordinatorRequest::AcknowledgeVsync { cookie, control_handle } = self {
Some((cookie, control_handle))
} else {
None
}
}
#[allow(irrefutable_let_patterns)]
pub fn into_set_virtcon_mode(self) -> Option<(VirtconMode, CoordinatorControlHandle)> {
if let CoordinatorRequest::SetVirtconMode { mode, control_handle } = self {
Some((mode, control_handle))
} else {
None
}
}
#[allow(irrefutable_let_patterns)]
pub fn into_import_buffer_collection(
self,
) -> Option<(
BufferCollectionId,
fidl::endpoints::ClientEnd<fidl_fuchsia_sysmem2::BufferCollectionTokenMarker>,
CoordinatorImportBufferCollectionResponder,
)> {
if let CoordinatorRequest::ImportBufferCollection {
buffer_collection_id,
buffer_collection_token,
responder,
} = self
{
Some((buffer_collection_id, buffer_collection_token, responder))
} else {
None
}
}
#[allow(irrefutable_let_patterns)]
pub fn into_release_buffer_collection(
self,
) -> Option<(BufferCollectionId, CoordinatorControlHandle)> {
if let CoordinatorRequest::ReleaseBufferCollection {
buffer_collection_id,
control_handle,
} = self
{
Some((buffer_collection_id, control_handle))
} else {
None
}
}
#[allow(irrefutable_let_patterns)]
pub fn into_set_buffer_collection_constraints(
self,
) -> Option<(
BufferCollectionId,
fidl_fuchsia_hardware_display_types::ImageBufferUsage,
CoordinatorSetBufferCollectionConstraintsResponder,
)> {
if let CoordinatorRequest::SetBufferCollectionConstraints {
buffer_collection_id,
buffer_usage,
responder,
} = self
{
Some((buffer_collection_id, buffer_usage, responder))
} else {
None
}
}
#[allow(irrefutable_let_patterns)]
pub fn into_is_capture_supported(self) -> Option<(CoordinatorIsCaptureSupportedResponder)> {
if let CoordinatorRequest::IsCaptureSupported { responder } = self {
Some((responder))
} else {
None
}
}
#[allow(irrefutable_let_patterns)]
pub fn into_start_capture(
self,
) -> Option<(EventId, ImageId, CoordinatorStartCaptureResponder)> {
if let CoordinatorRequest::StartCapture { signal_event_id, image_id, responder } = self {
Some((signal_event_id, image_id, responder))
} else {
None
}
}
#[allow(irrefutable_let_patterns)]
pub fn into_set_minimum_rgb(self) -> Option<(u8, CoordinatorSetMinimumRgbResponder)> {
if let CoordinatorRequest::SetMinimumRgb { minimum_rgb, responder } = self {
Some((minimum_rgb, responder))
} else {
None
}
}
#[allow(irrefutable_let_patterns)]
pub fn into_set_display_power(
self,
) -> Option<(
fidl_fuchsia_hardware_display_types::DisplayId,
bool,
CoordinatorSetDisplayPowerResponder,
)> {
if let CoordinatorRequest::SetDisplayPower { display_id, power_on, responder } = self {
Some((display_id, power_on, responder))
} else {
None
}
}
pub fn method_name(&self) -> &'static str {
match *self {
CoordinatorRequest::ImportImage { .. } => "import_image",
CoordinatorRequest::ReleaseImage { .. } => "release_image",
CoordinatorRequest::ImportEvent { .. } => "import_event",
CoordinatorRequest::ReleaseEvent { .. } => "release_event",
CoordinatorRequest::CreateLayer { .. } => "create_layer",
CoordinatorRequest::DestroyLayer { .. } => "destroy_layer",
CoordinatorRequest::SetDisplayMode { .. } => "set_display_mode",
CoordinatorRequest::SetDisplayColorConversion { .. } => "set_display_color_conversion",
CoordinatorRequest::SetDisplayLayers { .. } => "set_display_layers",
CoordinatorRequest::SetLayerPrimaryConfig { .. } => "set_layer_primary_config",
CoordinatorRequest::SetLayerPrimaryPosition { .. } => "set_layer_primary_position",
CoordinatorRequest::SetLayerPrimaryAlpha { .. } => "set_layer_primary_alpha",
CoordinatorRequest::SetLayerColorConfig { .. } => "set_layer_color_config",
CoordinatorRequest::SetLayerImage2 { .. } => "set_layer_image2",
CoordinatorRequest::CheckConfig { .. } => "check_config",
CoordinatorRequest::ApplyConfig { .. } => "apply_config",
CoordinatorRequest::GetLatestAppliedConfigStamp { .. } => {
"get_latest_applied_config_stamp"
}
CoordinatorRequest::ApplyConfig3 { .. } => "apply_config3",
CoordinatorRequest::EnableVsync { .. } => "enable_vsync",
CoordinatorRequest::AcknowledgeVsync { .. } => "acknowledge_vsync",
CoordinatorRequest::SetVirtconMode { .. } => "set_virtcon_mode",
CoordinatorRequest::ImportBufferCollection { .. } => "import_buffer_collection",
CoordinatorRequest::ReleaseBufferCollection { .. } => "release_buffer_collection",
CoordinatorRequest::SetBufferCollectionConstraints { .. } => {
"set_buffer_collection_constraints"
}
CoordinatorRequest::IsCaptureSupported { .. } => "is_capture_supported",
CoordinatorRequest::StartCapture { .. } => "start_capture",
CoordinatorRequest::SetMinimumRgb { .. } => "set_minimum_rgb",
CoordinatorRequest::SetDisplayPower { .. } => "set_display_power",
}
}
}
#[derive(Debug, Clone)]
pub struct CoordinatorControlHandle {
inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
}
impl fidl::endpoints::ControlHandle for CoordinatorControlHandle {
fn shutdown(&self) {
self.inner.shutdown()
}
fn shutdown_with_epitaph(&self, status: zx_status::Status) {
self.inner.shutdown_with_epitaph(status)
}
fn is_closed(&self) -> bool {
self.inner.channel().is_closed()
}
fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
self.inner.channel().on_closed()
}
#[cfg(target_os = "fuchsia")]
fn signal_peer(
&self,
clear_mask: zx::Signals,
set_mask: zx::Signals,
) -> Result<(), zx_status::Status> {
use fidl::Peered;
self.inner.channel().signal_peer(clear_mask, set_mask)
}
}
impl CoordinatorControlHandle {
pub fn send_on_displays_changed(
&self,
mut added: &[Info],
mut removed: &[fidl_fuchsia_hardware_display_types::DisplayId],
) -> Result<(), fidl::Error> {
self.inner.send::<CoordinatorOnDisplaysChangedRequest>(
(added, removed),
0,
0x50d168de1cc5bda3,
fidl::encoding::DynamicFlags::empty(),
)
}
pub fn send_on_vsync(
&self,
mut display_id: &fidl_fuchsia_hardware_display_types::DisplayId,
mut timestamp: u64,
mut applied_config_stamp: &fidl_fuchsia_hardware_display_types::ConfigStamp,
mut cookie: u64,
) -> Result<(), fidl::Error> {
self.inner.send::<CoordinatorOnVsyncRequest>(
(display_id, timestamp, applied_config_stamp, cookie),
0,
0x14b6a0155c58c05f,
fidl::encoding::DynamicFlags::empty(),
)
}
pub fn send_on_client_ownership_change(
&self,
mut has_ownership: bool,
) -> Result<(), fidl::Error> {
self.inner.send::<CoordinatorOnClientOwnershipChangeRequest>(
(has_ownership,),
0,
0x52b7c894e1a5c2ed,
fidl::encoding::DynamicFlags::empty(),
)
}
}
#[must_use = "FIDL methods require a response to be sent"]
#[derive(Debug)]
pub struct CoordinatorImportImageResponder {
control_handle: std::mem::ManuallyDrop<CoordinatorControlHandle>,
tx_id: u32,
}
impl std::ops::Drop for CoordinatorImportImageResponder {
fn drop(&mut self) {
self.control_handle.shutdown();
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
}
}
impl fidl::endpoints::Responder for CoordinatorImportImageResponder {
type ControlHandle = CoordinatorControlHandle;
fn control_handle(&self) -> &CoordinatorControlHandle {
&self.control_handle
}
fn drop_without_shutdown(mut self) {
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
std::mem::forget(self);
}
}
impl CoordinatorImportImageResponder {
pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
let _result = self.send_raw(result);
if _result.is_err() {
self.control_handle.shutdown();
}
self.drop_without_shutdown();
_result
}
pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
let _result = self.send_raw(result);
self.drop_without_shutdown();
_result
}
fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
self.control_handle
.inner
.send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>>(
result,
self.tx_id,
0x3a8636eb9656b4f4,
fidl::encoding::DynamicFlags::empty(),
)
}
}
#[must_use = "FIDL methods require a response to be sent"]
#[derive(Debug)]
pub struct CoordinatorCreateLayerResponder {
control_handle: std::mem::ManuallyDrop<CoordinatorControlHandle>,
tx_id: u32,
}
impl std::ops::Drop for CoordinatorCreateLayerResponder {
fn drop(&mut self) {
self.control_handle.shutdown();
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
}
}
impl fidl::endpoints::Responder for CoordinatorCreateLayerResponder {
type ControlHandle = CoordinatorControlHandle;
fn control_handle(&self) -> &CoordinatorControlHandle {
&self.control_handle
}
fn drop_without_shutdown(mut self) {
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
std::mem::forget(self);
}
}
impl CoordinatorCreateLayerResponder {
pub fn send(self, mut result: Result<&LayerId, i32>) -> Result<(), fidl::Error> {
let _result = self.send_raw(result);
if _result.is_err() {
self.control_handle.shutdown();
}
self.drop_without_shutdown();
_result
}
pub fn send_no_shutdown_on_err(
self,
mut result: Result<&LayerId, i32>,
) -> Result<(), fidl::Error> {
let _result = self.send_raw(result);
self.drop_without_shutdown();
_result
}
fn send_raw(&self, mut result: Result<&LayerId, i32>) -> Result<(), fidl::Error> {
self.control_handle
.inner
.send::<fidl::encoding::ResultType<CoordinatorCreateLayerResponse, i32>>(
result.map(|layer_id| (layer_id,)),
self.tx_id,
0x2137cfd788a3496b,
fidl::encoding::DynamicFlags::empty(),
)
}
}
#[must_use = "FIDL methods require a response to be sent"]
#[derive(Debug)]
pub struct CoordinatorCheckConfigResponder {
control_handle: std::mem::ManuallyDrop<CoordinatorControlHandle>,
tx_id: u32,
}
impl std::ops::Drop for CoordinatorCheckConfigResponder {
fn drop(&mut self) {
self.control_handle.shutdown();
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
}
}
impl fidl::endpoints::Responder for CoordinatorCheckConfigResponder {
type ControlHandle = CoordinatorControlHandle;
fn control_handle(&self) -> &CoordinatorControlHandle {
&self.control_handle
}
fn drop_without_shutdown(mut self) {
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
std::mem::forget(self);
}
}
impl CoordinatorCheckConfigResponder {
pub fn send(
self,
mut res: fidl_fuchsia_hardware_display_types::ConfigResult,
mut ops: &[ClientCompositionOp],
) -> Result<(), fidl::Error> {
let _result = self.send_raw(res, ops);
if _result.is_err() {
self.control_handle.shutdown();
}
self.drop_without_shutdown();
_result
}
pub fn send_no_shutdown_on_err(
self,
mut res: fidl_fuchsia_hardware_display_types::ConfigResult,
mut ops: &[ClientCompositionOp],
) -> Result<(), fidl::Error> {
let _result = self.send_raw(res, ops);
self.drop_without_shutdown();
_result
}
fn send_raw(
&self,
mut res: fidl_fuchsia_hardware_display_types::ConfigResult,
mut ops: &[ClientCompositionOp],
) -> Result<(), fidl::Error> {
self.control_handle.inner.send::<CoordinatorCheckConfigResponse>(
(res, ops),
self.tx_id,
0x2bcfb4eb16878158,
fidl::encoding::DynamicFlags::empty(),
)
}
}
#[must_use = "FIDL methods require a response to be sent"]
#[derive(Debug)]
pub struct CoordinatorGetLatestAppliedConfigStampResponder {
control_handle: std::mem::ManuallyDrop<CoordinatorControlHandle>,
tx_id: u32,
}
impl std::ops::Drop for CoordinatorGetLatestAppliedConfigStampResponder {
fn drop(&mut self) {
self.control_handle.shutdown();
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
}
}
impl fidl::endpoints::Responder for CoordinatorGetLatestAppliedConfigStampResponder {
type ControlHandle = CoordinatorControlHandle;
fn control_handle(&self) -> &CoordinatorControlHandle {
&self.control_handle
}
fn drop_without_shutdown(mut self) {
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
std::mem::forget(self);
}
}
impl CoordinatorGetLatestAppliedConfigStampResponder {
pub fn send(
self,
mut stamp: &fidl_fuchsia_hardware_display_types::ConfigStamp,
) -> Result<(), fidl::Error> {
let _result = self.send_raw(stamp);
if _result.is_err() {
self.control_handle.shutdown();
}
self.drop_without_shutdown();
_result
}
pub fn send_no_shutdown_on_err(
self,
mut stamp: &fidl_fuchsia_hardware_display_types::ConfigStamp,
) -> Result<(), fidl::Error> {
let _result = self.send_raw(stamp);
self.drop_without_shutdown();
_result
}
fn send_raw(
&self,
mut stamp: &fidl_fuchsia_hardware_display_types::ConfigStamp,
) -> Result<(), fidl::Error> {
self.control_handle.inner.send::<CoordinatorGetLatestAppliedConfigStampResponse>(
(stamp,),
self.tx_id,
0x76a50c0537265f65,
fidl::encoding::DynamicFlags::empty(),
)
}
}
#[must_use = "FIDL methods require a response to be sent"]
#[derive(Debug)]
pub struct CoordinatorImportBufferCollectionResponder {
control_handle: std::mem::ManuallyDrop<CoordinatorControlHandle>,
tx_id: u32,
}
impl std::ops::Drop for CoordinatorImportBufferCollectionResponder {
fn drop(&mut self) {
self.control_handle.shutdown();
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
}
}
impl fidl::endpoints::Responder for CoordinatorImportBufferCollectionResponder {
type ControlHandle = CoordinatorControlHandle;
fn control_handle(&self) -> &CoordinatorControlHandle {
&self.control_handle
}
fn drop_without_shutdown(mut self) {
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
std::mem::forget(self);
}
}
impl CoordinatorImportBufferCollectionResponder {
pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
let _result = self.send_raw(result);
if _result.is_err() {
self.control_handle.shutdown();
}
self.drop_without_shutdown();
_result
}
pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
let _result = self.send_raw(result);
self.drop_without_shutdown();
_result
}
fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
self.control_handle
.inner
.send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>>(
result,
self.tx_id,
0x30d06f510e7f4601,
fidl::encoding::DynamicFlags::empty(),
)
}
}
#[must_use = "FIDL methods require a response to be sent"]
#[derive(Debug)]
pub struct CoordinatorSetBufferCollectionConstraintsResponder {
control_handle: std::mem::ManuallyDrop<CoordinatorControlHandle>,
tx_id: u32,
}
impl std::ops::Drop for CoordinatorSetBufferCollectionConstraintsResponder {
fn drop(&mut self) {
self.control_handle.shutdown();
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
}
}
impl fidl::endpoints::Responder for CoordinatorSetBufferCollectionConstraintsResponder {
type ControlHandle = CoordinatorControlHandle;
fn control_handle(&self) -> &CoordinatorControlHandle {
&self.control_handle
}
fn drop_without_shutdown(mut self) {
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
std::mem::forget(self);
}
}
impl CoordinatorSetBufferCollectionConstraintsResponder {
pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
let _result = self.send_raw(result);
if _result.is_err() {
self.control_handle.shutdown();
}
self.drop_without_shutdown();
_result
}
pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
let _result = self.send_raw(result);
self.drop_without_shutdown();
_result
}
fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
self.control_handle
.inner
.send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>>(
result,
self.tx_id,
0x509a4ee9af6035df,
fidl::encoding::DynamicFlags::empty(),
)
}
}
#[must_use = "FIDL methods require a response to be sent"]
#[derive(Debug)]
pub struct CoordinatorIsCaptureSupportedResponder {
control_handle: std::mem::ManuallyDrop<CoordinatorControlHandle>,
tx_id: u32,
}
impl std::ops::Drop for CoordinatorIsCaptureSupportedResponder {
fn drop(&mut self) {
self.control_handle.shutdown();
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
}
}
impl fidl::endpoints::Responder for CoordinatorIsCaptureSupportedResponder {
type ControlHandle = CoordinatorControlHandle;
fn control_handle(&self) -> &CoordinatorControlHandle {
&self.control_handle
}
fn drop_without_shutdown(mut self) {
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
std::mem::forget(self);
}
}
impl CoordinatorIsCaptureSupportedResponder {
pub fn send(self, mut result: Result<bool, i32>) -> Result<(), fidl::Error> {
let _result = self.send_raw(result);
if _result.is_err() {
self.control_handle.shutdown();
}
self.drop_without_shutdown();
_result
}
pub fn send_no_shutdown_on_err(self, mut result: Result<bool, i32>) -> Result<(), fidl::Error> {
let _result = self.send_raw(result);
self.drop_without_shutdown();
_result
}
fn send_raw(&self, mut result: Result<bool, i32>) -> Result<(), fidl::Error> {
self.control_handle.inner.send::<fidl::encoding::ResultType<
CoordinatorIsCaptureSupportedResponse,
i32,
>>(
result.map(|supported| (supported,)),
self.tx_id,
0x4ca407277277971b,
fidl::encoding::DynamicFlags::empty(),
)
}
}
#[must_use = "FIDL methods require a response to be sent"]
#[derive(Debug)]
pub struct CoordinatorStartCaptureResponder {
control_handle: std::mem::ManuallyDrop<CoordinatorControlHandle>,
tx_id: u32,
}
impl std::ops::Drop for CoordinatorStartCaptureResponder {
fn drop(&mut self) {
self.control_handle.shutdown();
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
}
}
impl fidl::endpoints::Responder for CoordinatorStartCaptureResponder {
type ControlHandle = CoordinatorControlHandle;
fn control_handle(&self) -> &CoordinatorControlHandle {
&self.control_handle
}
fn drop_without_shutdown(mut self) {
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
std::mem::forget(self);
}
}
impl CoordinatorStartCaptureResponder {
pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
let _result = self.send_raw(result);
if _result.is_err() {
self.control_handle.shutdown();
}
self.drop_without_shutdown();
_result
}
pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
let _result = self.send_raw(result);
self.drop_without_shutdown();
_result
}
fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
self.control_handle
.inner
.send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>>(
result,
self.tx_id,
0x35cb38f19d96a8db,
fidl::encoding::DynamicFlags::empty(),
)
}
}
#[must_use = "FIDL methods require a response to be sent"]
#[derive(Debug)]
pub struct CoordinatorSetMinimumRgbResponder {
control_handle: std::mem::ManuallyDrop<CoordinatorControlHandle>,
tx_id: u32,
}
impl std::ops::Drop for CoordinatorSetMinimumRgbResponder {
fn drop(&mut self) {
self.control_handle.shutdown();
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
}
}
impl fidl::endpoints::Responder for CoordinatorSetMinimumRgbResponder {
type ControlHandle = CoordinatorControlHandle;
fn control_handle(&self) -> &CoordinatorControlHandle {
&self.control_handle
}
fn drop_without_shutdown(mut self) {
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
std::mem::forget(self);
}
}
impl CoordinatorSetMinimumRgbResponder {
pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
let _result = self.send_raw(result);
if _result.is_err() {
self.control_handle.shutdown();
}
self.drop_without_shutdown();
_result
}
pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
let _result = self.send_raw(result);
self.drop_without_shutdown();
_result
}
fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
self.control_handle
.inner
.send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>>(
result,
self.tx_id,
0x1b49251437038b0b,
fidl::encoding::DynamicFlags::empty(),
)
}
}
#[must_use = "FIDL methods require a response to be sent"]
#[derive(Debug)]
pub struct CoordinatorSetDisplayPowerResponder {
control_handle: std::mem::ManuallyDrop<CoordinatorControlHandle>,
tx_id: u32,
}
impl std::ops::Drop for CoordinatorSetDisplayPowerResponder {
fn drop(&mut self) {
self.control_handle.shutdown();
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
}
}
impl fidl::endpoints::Responder for CoordinatorSetDisplayPowerResponder {
type ControlHandle = CoordinatorControlHandle;
fn control_handle(&self) -> &CoordinatorControlHandle {
&self.control_handle
}
fn drop_without_shutdown(mut self) {
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
std::mem::forget(self);
}
}
impl CoordinatorSetDisplayPowerResponder {
pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
let _result = self.send_raw(result);
if _result.is_err() {
self.control_handle.shutdown();
}
self.drop_without_shutdown();
_result
}
pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
let _result = self.send_raw(result);
self.drop_without_shutdown();
_result
}
fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
self.control_handle
.inner
.send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>>(
result,
self.tx_id,
0x10feb62d11d9e92b,
fidl::encoding::DynamicFlags::empty(),
)
}
}
#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
pub struct CoordinatorListenerMarker;
impl fidl::endpoints::ProtocolMarker for CoordinatorListenerMarker {
type Proxy = CoordinatorListenerProxy;
type RequestStream = CoordinatorListenerRequestStream;
#[cfg(target_os = "fuchsia")]
type SynchronousProxy = CoordinatorListenerSynchronousProxy;
const DEBUG_NAME: &'static str = "(anonymous) CoordinatorListener";
}
pub trait CoordinatorListenerProxyInterface: Send + Sync {
fn r#on_displays_changed(
&self,
added: &[Info],
removed: &[fidl_fuchsia_hardware_display_types::DisplayId],
) -> Result<(), fidl::Error>;
fn r#on_vsync(
&self,
display_id: &fidl_fuchsia_hardware_display_types::DisplayId,
timestamp: i64,
applied_config_stamp: &fidl_fuchsia_hardware_display_types::ConfigStamp,
cookie: &VsyncAckCookie,
) -> Result<(), fidl::Error>;
fn r#on_client_ownership_change(&self, has_ownership: bool) -> Result<(), fidl::Error>;
}
#[derive(Debug)]
#[cfg(target_os = "fuchsia")]
pub struct CoordinatorListenerSynchronousProxy {
client: fidl::client::sync::Client,
}
#[cfg(target_os = "fuchsia")]
impl fidl::endpoints::SynchronousProxy for CoordinatorListenerSynchronousProxy {
type Proxy = CoordinatorListenerProxy;
type Protocol = CoordinatorListenerMarker;
fn from_channel(inner: fidl::Channel) -> Self {
Self::new(inner)
}
fn into_channel(self) -> fidl::Channel {
self.client.into_channel()
}
fn as_channel(&self) -> &fidl::Channel {
self.client.as_channel()
}
}
#[cfg(target_os = "fuchsia")]
impl CoordinatorListenerSynchronousProxy {
pub fn new(channel: fidl::Channel) -> Self {
let protocol_name =
<CoordinatorListenerMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
Self { client: fidl::client::sync::Client::new(channel, protocol_name) }
}
pub fn into_channel(self) -> fidl::Channel {
self.client.into_channel()
}
pub fn wait_for_event(
&self,
deadline: zx::MonotonicInstant,
) -> Result<CoordinatorListenerEvent, fidl::Error> {
CoordinatorListenerEvent::decode(self.client.wait_for_event(deadline)?)
}
pub fn r#on_displays_changed(
&self,
mut added: &[Info],
mut removed: &[fidl_fuchsia_hardware_display_types::DisplayId],
) -> Result<(), fidl::Error> {
self.client.send::<CoordinatorListenerOnDisplaysChangedRequest>(
(added, removed),
0x248fbe90c338a94f,
fidl::encoding::DynamicFlags::empty(),
)
}
pub fn r#on_vsync(
&self,
mut display_id: &fidl_fuchsia_hardware_display_types::DisplayId,
mut timestamp: i64,
mut applied_config_stamp: &fidl_fuchsia_hardware_display_types::ConfigStamp,
mut cookie: &VsyncAckCookie,
) -> Result<(), fidl::Error> {
self.client.send::<CoordinatorListenerOnVsyncRequest>(
(display_id, timestamp, applied_config_stamp, cookie),
0x249e9b8da7a7ac47,
fidl::encoding::DynamicFlags::empty(),
)
}
pub fn r#on_client_ownership_change(&self, mut has_ownership: bool) -> Result<(), fidl::Error> {
self.client.send::<CoordinatorListenerOnClientOwnershipChangeRequest>(
(has_ownership,),
0x1acd2ae683153d5e,
fidl::encoding::DynamicFlags::empty(),
)
}
}
#[derive(Debug, Clone)]
pub struct CoordinatorListenerProxy {
client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
}
impl fidl::endpoints::Proxy for CoordinatorListenerProxy {
type Protocol = CoordinatorListenerMarker;
fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
Self::new(inner)
}
fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
self.client.into_channel().map_err(|client| Self { client })
}
fn as_channel(&self) -> &::fidl::AsyncChannel {
self.client.as_channel()
}
}
impl CoordinatorListenerProxy {
pub fn new(channel: ::fidl::AsyncChannel) -> Self {
let protocol_name =
<CoordinatorListenerMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
Self { client: fidl::client::Client::new(channel, protocol_name) }
}
pub fn take_event_stream(&self) -> CoordinatorListenerEventStream {
CoordinatorListenerEventStream { event_receiver: self.client.take_event_receiver() }
}
pub fn r#on_displays_changed(
&self,
mut added: &[Info],
mut removed: &[fidl_fuchsia_hardware_display_types::DisplayId],
) -> Result<(), fidl::Error> {
CoordinatorListenerProxyInterface::r#on_displays_changed(self, added, removed)
}
pub fn r#on_vsync(
&self,
mut display_id: &fidl_fuchsia_hardware_display_types::DisplayId,
mut timestamp: i64,
mut applied_config_stamp: &fidl_fuchsia_hardware_display_types::ConfigStamp,
mut cookie: &VsyncAckCookie,
) -> Result<(), fidl::Error> {
CoordinatorListenerProxyInterface::r#on_vsync(
self,
display_id,
timestamp,
applied_config_stamp,
cookie,
)
}
pub fn r#on_client_ownership_change(&self, mut has_ownership: bool) -> Result<(), fidl::Error> {
CoordinatorListenerProxyInterface::r#on_client_ownership_change(self, has_ownership)
}
}
impl CoordinatorListenerProxyInterface for CoordinatorListenerProxy {
fn r#on_displays_changed(
&self,
mut added: &[Info],
mut removed: &[fidl_fuchsia_hardware_display_types::DisplayId],
) -> Result<(), fidl::Error> {
self.client.send::<CoordinatorListenerOnDisplaysChangedRequest>(
(added, removed),
0x248fbe90c338a94f,
fidl::encoding::DynamicFlags::empty(),
)
}
fn r#on_vsync(
&self,
mut display_id: &fidl_fuchsia_hardware_display_types::DisplayId,
mut timestamp: i64,
mut applied_config_stamp: &fidl_fuchsia_hardware_display_types::ConfigStamp,
mut cookie: &VsyncAckCookie,
) -> Result<(), fidl::Error> {
self.client.send::<CoordinatorListenerOnVsyncRequest>(
(display_id, timestamp, applied_config_stamp, cookie),
0x249e9b8da7a7ac47,
fidl::encoding::DynamicFlags::empty(),
)
}
fn r#on_client_ownership_change(&self, mut has_ownership: bool) -> Result<(), fidl::Error> {
self.client.send::<CoordinatorListenerOnClientOwnershipChangeRequest>(
(has_ownership,),
0x1acd2ae683153d5e,
fidl::encoding::DynamicFlags::empty(),
)
}
}
pub struct CoordinatorListenerEventStream {
event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
}
impl std::marker::Unpin for CoordinatorListenerEventStream {}
impl futures::stream::FusedStream for CoordinatorListenerEventStream {
fn is_terminated(&self) -> bool {
self.event_receiver.is_terminated()
}
}
impl futures::Stream for CoordinatorListenerEventStream {
type Item = Result<CoordinatorListenerEvent, fidl::Error>;
fn poll_next(
mut self: std::pin::Pin<&mut Self>,
cx: &mut std::task::Context<'_>,
) -> std::task::Poll<Option<Self::Item>> {
match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
&mut self.event_receiver,
cx
)?) {
Some(buf) => std::task::Poll::Ready(Some(CoordinatorListenerEvent::decode(buf))),
None => std::task::Poll::Ready(None),
}
}
}
#[derive(Debug)]
pub enum CoordinatorListenerEvent {
#[non_exhaustive]
_UnknownEvent {
ordinal: u64,
},
}
impl CoordinatorListenerEvent {
fn decode(
mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
) -> Result<CoordinatorListenerEvent, fidl::Error> {
let (bytes, _handles) = buf.split_mut();
let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
debug_assert_eq!(tx_header.tx_id, 0);
match tx_header.ordinal {
_ if tx_header.dynamic_flags().contains(fidl::encoding::DynamicFlags::FLEXIBLE) => {
Ok(CoordinatorListenerEvent::_UnknownEvent { ordinal: tx_header.ordinal })
}
_ => Err(fidl::Error::UnknownOrdinal {
ordinal: tx_header.ordinal,
protocol_name:
<CoordinatorListenerMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
}),
}
}
}
pub struct CoordinatorListenerRequestStream {
inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
is_terminated: bool,
}
impl std::marker::Unpin for CoordinatorListenerRequestStream {}
impl futures::stream::FusedStream for CoordinatorListenerRequestStream {
fn is_terminated(&self) -> bool {
self.is_terminated
}
}
impl fidl::endpoints::RequestStream for CoordinatorListenerRequestStream {
type Protocol = CoordinatorListenerMarker;
type ControlHandle = CoordinatorListenerControlHandle;
fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
}
fn control_handle(&self) -> Self::ControlHandle {
CoordinatorListenerControlHandle { inner: self.inner.clone() }
}
fn into_inner(
self,
) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
{
(self.inner, self.is_terminated)
}
fn from_inner(
inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
is_terminated: bool,
) -> Self {
Self { inner, is_terminated }
}
}
impl futures::Stream for CoordinatorListenerRequestStream {
type Item = Result<CoordinatorListenerRequest, fidl::Error>;
fn poll_next(
mut self: std::pin::Pin<&mut Self>,
cx: &mut std::task::Context<'_>,
) -> std::task::Poll<Option<Self::Item>> {
let this = &mut *self;
if this.inner.check_shutdown(cx) {
this.is_terminated = true;
return std::task::Poll::Ready(None);
}
if this.is_terminated {
panic!("polled CoordinatorListenerRequestStream after completion");
}
fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
|bytes, handles| {
match this.inner.channel().read_etc(cx, bytes, handles) {
std::task::Poll::Ready(Ok(())) => {}
std::task::Poll::Pending => return std::task::Poll::Pending,
std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
this.is_terminated = true;
return std::task::Poll::Ready(None);
}
std::task::Poll::Ready(Err(e)) => {
return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
e.into(),
))))
}
}
let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
std::task::Poll::Ready(Some(match header.ordinal {
0x248fbe90c338a94f => {
header.validate_request_tx_id(fidl::MethodType::OneWay)?;
let mut req = fidl::new_empty!(CoordinatorListenerOnDisplaysChangedRequest, fidl::encoding::DefaultFuchsiaResourceDialect);
fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<CoordinatorListenerOnDisplaysChangedRequest>(&header, _body_bytes, handles, &mut req)?;
let control_handle = CoordinatorListenerControlHandle {
inner: this.inner.clone(),
};
Ok(CoordinatorListenerRequest::OnDisplaysChanged {added: req.added,
removed: req.removed,
control_handle,
})
}
0x249e9b8da7a7ac47 => {
header.validate_request_tx_id(fidl::MethodType::OneWay)?;
let mut req = fidl::new_empty!(CoordinatorListenerOnVsyncRequest, fidl::encoding::DefaultFuchsiaResourceDialect);
fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<CoordinatorListenerOnVsyncRequest>(&header, _body_bytes, handles, &mut req)?;
let control_handle = CoordinatorListenerControlHandle {
inner: this.inner.clone(),
};
Ok(CoordinatorListenerRequest::OnVsync {display_id: req.display_id,
timestamp: req.timestamp,
applied_config_stamp: req.applied_config_stamp,
cookie: req.cookie,
control_handle,
})
}
0x1acd2ae683153d5e => {
header.validate_request_tx_id(fidl::MethodType::OneWay)?;
let mut req = fidl::new_empty!(CoordinatorListenerOnClientOwnershipChangeRequest, fidl::encoding::DefaultFuchsiaResourceDialect);
fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<CoordinatorListenerOnClientOwnershipChangeRequest>(&header, _body_bytes, handles, &mut req)?;
let control_handle = CoordinatorListenerControlHandle {
inner: this.inner.clone(),
};
Ok(CoordinatorListenerRequest::OnClientOwnershipChange {has_ownership: req.has_ownership,
control_handle,
})
}
_ if header.tx_id == 0 && header.dynamic_flags().contains(fidl::encoding::DynamicFlags::FLEXIBLE) => {
Ok(CoordinatorListenerRequest::_UnknownMethod {
ordinal: header.ordinal,
control_handle: CoordinatorListenerControlHandle { inner: this.inner.clone() },
method_type: fidl::MethodType::OneWay,
})
}
_ if header.dynamic_flags().contains(fidl::encoding::DynamicFlags::FLEXIBLE) => {
this.inner.send_framework_err(
fidl::encoding::FrameworkErr::UnknownMethod,
header.tx_id,
header.ordinal,
header.dynamic_flags(),
(bytes, handles),
)?;
Ok(CoordinatorListenerRequest::_UnknownMethod {
ordinal: header.ordinal,
control_handle: CoordinatorListenerControlHandle { inner: this.inner.clone() },
method_type: fidl::MethodType::TwoWay,
})
}
_ => Err(fidl::Error::UnknownOrdinal {
ordinal: header.ordinal,
protocol_name: <CoordinatorListenerMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
}),
}))
},
)
}
}
#[derive(Debug)]
pub enum CoordinatorListenerRequest {
OnDisplaysChanged {
added: Vec<Info>,
removed: Vec<fidl_fuchsia_hardware_display_types::DisplayId>,
control_handle: CoordinatorListenerControlHandle,
},
OnVsync {
display_id: fidl_fuchsia_hardware_display_types::DisplayId,
timestamp: i64,
applied_config_stamp: fidl_fuchsia_hardware_display_types::ConfigStamp,
cookie: VsyncAckCookie,
control_handle: CoordinatorListenerControlHandle,
},
OnClientOwnershipChange {
has_ownership: bool,
control_handle: CoordinatorListenerControlHandle,
},
#[non_exhaustive]
_UnknownMethod {
ordinal: u64,
control_handle: CoordinatorListenerControlHandle,
method_type: fidl::MethodType,
},
}
impl CoordinatorListenerRequest {
#[allow(irrefutable_let_patterns)]
pub fn into_on_displays_changed(
self,
) -> Option<(
Vec<Info>,
Vec<fidl_fuchsia_hardware_display_types::DisplayId>,
CoordinatorListenerControlHandle,
)> {
if let CoordinatorListenerRequest::OnDisplaysChanged { added, removed, control_handle } =
self
{
Some((added, removed, control_handle))
} else {
None
}
}
#[allow(irrefutable_let_patterns)]
pub fn into_on_vsync(
self,
) -> Option<(
fidl_fuchsia_hardware_display_types::DisplayId,
i64,
fidl_fuchsia_hardware_display_types::ConfigStamp,
VsyncAckCookie,
CoordinatorListenerControlHandle,
)> {
if let CoordinatorListenerRequest::OnVsync {
display_id,
timestamp,
applied_config_stamp,
cookie,
control_handle,
} = self
{
Some((display_id, timestamp, applied_config_stamp, cookie, control_handle))
} else {
None
}
}
#[allow(irrefutable_let_patterns)]
pub fn into_on_client_ownership_change(
self,
) -> Option<(bool, CoordinatorListenerControlHandle)> {
if let CoordinatorListenerRequest::OnClientOwnershipChange {
has_ownership,
control_handle,
} = self
{
Some((has_ownership, control_handle))
} else {
None
}
}
pub fn method_name(&self) -> &'static str {
match *self {
CoordinatorListenerRequest::OnDisplaysChanged { .. } => "on_displays_changed",
CoordinatorListenerRequest::OnVsync { .. } => "on_vsync",
CoordinatorListenerRequest::OnClientOwnershipChange { .. } => {
"on_client_ownership_change"
}
CoordinatorListenerRequest::_UnknownMethod {
method_type: fidl::MethodType::OneWay,
..
} => "unknown one-way method",
CoordinatorListenerRequest::_UnknownMethod {
method_type: fidl::MethodType::TwoWay,
..
} => "unknown two-way method",
}
}
}
#[derive(Debug, Clone)]
pub struct CoordinatorListenerControlHandle {
inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
}
impl fidl::endpoints::ControlHandle for CoordinatorListenerControlHandle {
fn shutdown(&self) {
self.inner.shutdown()
}
fn shutdown_with_epitaph(&self, status: zx_status::Status) {
self.inner.shutdown_with_epitaph(status)
}
fn is_closed(&self) -> bool {
self.inner.channel().is_closed()
}
fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
self.inner.channel().on_closed()
}
#[cfg(target_os = "fuchsia")]
fn signal_peer(
&self,
clear_mask: zx::Signals,
set_mask: zx::Signals,
) -> Result<(), zx_status::Status> {
use fidl::Peered;
self.inner.channel().signal_peer(clear_mask, set_mask)
}
}
impl CoordinatorListenerControlHandle {}
#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
pub struct ProviderMarker;
impl fidl::endpoints::ProtocolMarker for ProviderMarker {
type Proxy = ProviderProxy;
type RequestStream = ProviderRequestStream;
#[cfg(target_os = "fuchsia")]
type SynchronousProxy = ProviderSynchronousProxy;
const DEBUG_NAME: &'static str = "fuchsia.hardware.display.Provider";
}
impl fidl::endpoints::DiscoverableProtocolMarker for ProviderMarker {}
pub type ProviderOpenCoordinatorWithListenerForVirtconResult = Result<(), i32>;
pub type ProviderOpenCoordinatorWithListenerForPrimaryResult = Result<(), i32>;
pub trait ProviderProxyInterface: Send + Sync {
type OpenCoordinatorWithListenerForVirtconResponseFut: std::future::Future<
Output = Result<ProviderOpenCoordinatorWithListenerForVirtconResult, fidl::Error>,
> + Send;
fn r#open_coordinator_with_listener_for_virtcon(
&self,
payload: ProviderOpenCoordinatorWithListenerForVirtconRequest,
) -> Self::OpenCoordinatorWithListenerForVirtconResponseFut;
type OpenCoordinatorWithListenerForPrimaryResponseFut: std::future::Future<
Output = Result<ProviderOpenCoordinatorWithListenerForPrimaryResult, fidl::Error>,
> + Send;
fn r#open_coordinator_with_listener_for_primary(
&self,
payload: ProviderOpenCoordinatorWithListenerForPrimaryRequest,
) -> Self::OpenCoordinatorWithListenerForPrimaryResponseFut;
}
#[derive(Debug)]
#[cfg(target_os = "fuchsia")]
pub struct ProviderSynchronousProxy {
client: fidl::client::sync::Client,
}
#[cfg(target_os = "fuchsia")]
impl fidl::endpoints::SynchronousProxy for ProviderSynchronousProxy {
type Proxy = ProviderProxy;
type Protocol = ProviderMarker;
fn from_channel(inner: fidl::Channel) -> Self {
Self::new(inner)
}
fn into_channel(self) -> fidl::Channel {
self.client.into_channel()
}
fn as_channel(&self) -> &fidl::Channel {
self.client.as_channel()
}
}
#[cfg(target_os = "fuchsia")]
impl ProviderSynchronousProxy {
pub fn new(channel: fidl::Channel) -> Self {
let protocol_name = <ProviderMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
Self { client: fidl::client::sync::Client::new(channel, protocol_name) }
}
pub fn into_channel(self) -> fidl::Channel {
self.client.into_channel()
}
pub fn wait_for_event(
&self,
deadline: zx::MonotonicInstant,
) -> Result<ProviderEvent, fidl::Error> {
ProviderEvent::decode(self.client.wait_for_event(deadline)?)
}
pub fn r#open_coordinator_with_listener_for_virtcon(
&self,
mut payload: ProviderOpenCoordinatorWithListenerForVirtconRequest,
___deadline: zx::MonotonicInstant,
) -> Result<ProviderOpenCoordinatorWithListenerForVirtconResult, fidl::Error> {
let _response = self.client.send_query::<
ProviderOpenCoordinatorWithListenerForVirtconRequest,
fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
>(
&mut payload,
0x154ac672633d9ec7,
fidl::encoding::DynamicFlags::empty(),
___deadline,
)?;
Ok(_response.map(|x| x))
}
pub fn r#open_coordinator_with_listener_for_primary(
&self,
mut payload: ProviderOpenCoordinatorWithListenerForPrimaryRequest,
___deadline: zx::MonotonicInstant,
) -> Result<ProviderOpenCoordinatorWithListenerForPrimaryResult, fidl::Error> {
let _response = self.client.send_query::<
ProviderOpenCoordinatorWithListenerForPrimaryRequest,
fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
>(
&mut payload,
0x635b6087ce4f6bfa,
fidl::encoding::DynamicFlags::empty(),
___deadline,
)?;
Ok(_response.map(|x| x))
}
}
#[derive(Debug, Clone)]
pub struct ProviderProxy {
client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
}
impl fidl::endpoints::Proxy for ProviderProxy {
type Protocol = ProviderMarker;
fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
Self::new(inner)
}
fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
self.client.into_channel().map_err(|client| Self { client })
}
fn as_channel(&self) -> &::fidl::AsyncChannel {
self.client.as_channel()
}
}
impl ProviderProxy {
pub fn new(channel: ::fidl::AsyncChannel) -> Self {
let protocol_name = <ProviderMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
Self { client: fidl::client::Client::new(channel, protocol_name) }
}
pub fn take_event_stream(&self) -> ProviderEventStream {
ProviderEventStream { event_receiver: self.client.take_event_receiver() }
}
pub fn r#open_coordinator_with_listener_for_virtcon(
&self,
mut payload: ProviderOpenCoordinatorWithListenerForVirtconRequest,
) -> fidl::client::QueryResponseFut<
ProviderOpenCoordinatorWithListenerForVirtconResult,
fidl::encoding::DefaultFuchsiaResourceDialect,
> {
ProviderProxyInterface::r#open_coordinator_with_listener_for_virtcon(self, payload)
}
pub fn r#open_coordinator_with_listener_for_primary(
&self,
mut payload: ProviderOpenCoordinatorWithListenerForPrimaryRequest,
) -> fidl::client::QueryResponseFut<
ProviderOpenCoordinatorWithListenerForPrimaryResult,
fidl::encoding::DefaultFuchsiaResourceDialect,
> {
ProviderProxyInterface::r#open_coordinator_with_listener_for_primary(self, payload)
}
}
impl ProviderProxyInterface for ProviderProxy {
type OpenCoordinatorWithListenerForVirtconResponseFut = fidl::client::QueryResponseFut<
ProviderOpenCoordinatorWithListenerForVirtconResult,
fidl::encoding::DefaultFuchsiaResourceDialect,
>;
fn r#open_coordinator_with_listener_for_virtcon(
&self,
mut payload: ProviderOpenCoordinatorWithListenerForVirtconRequest,
) -> Self::OpenCoordinatorWithListenerForVirtconResponseFut {
fn _decode(
mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
) -> Result<ProviderOpenCoordinatorWithListenerForVirtconResult, fidl::Error> {
let _response = fidl::client::decode_transaction_body::<
fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
fidl::encoding::DefaultFuchsiaResourceDialect,
0x154ac672633d9ec7,
>(_buf?)?;
Ok(_response.map(|x| x))
}
self.client.send_query_and_decode::<
ProviderOpenCoordinatorWithListenerForVirtconRequest,
ProviderOpenCoordinatorWithListenerForVirtconResult,
>(
&mut payload,
0x154ac672633d9ec7,
fidl::encoding::DynamicFlags::empty(),
_decode,
)
}
type OpenCoordinatorWithListenerForPrimaryResponseFut = fidl::client::QueryResponseFut<
ProviderOpenCoordinatorWithListenerForPrimaryResult,
fidl::encoding::DefaultFuchsiaResourceDialect,
>;
fn r#open_coordinator_with_listener_for_primary(
&self,
mut payload: ProviderOpenCoordinatorWithListenerForPrimaryRequest,
) -> Self::OpenCoordinatorWithListenerForPrimaryResponseFut {
fn _decode(
mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
) -> Result<ProviderOpenCoordinatorWithListenerForPrimaryResult, fidl::Error> {
let _response = fidl::client::decode_transaction_body::<
fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
fidl::encoding::DefaultFuchsiaResourceDialect,
0x635b6087ce4f6bfa,
>(_buf?)?;
Ok(_response.map(|x| x))
}
self.client.send_query_and_decode::<
ProviderOpenCoordinatorWithListenerForPrimaryRequest,
ProviderOpenCoordinatorWithListenerForPrimaryResult,
>(
&mut payload,
0x635b6087ce4f6bfa,
fidl::encoding::DynamicFlags::empty(),
_decode,
)
}
}
pub struct ProviderEventStream {
event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
}
impl std::marker::Unpin for ProviderEventStream {}
impl futures::stream::FusedStream for ProviderEventStream {
fn is_terminated(&self) -> bool {
self.event_receiver.is_terminated()
}
}
impl futures::Stream for ProviderEventStream {
type Item = Result<ProviderEvent, fidl::Error>;
fn poll_next(
mut self: std::pin::Pin<&mut Self>,
cx: &mut std::task::Context<'_>,
) -> std::task::Poll<Option<Self::Item>> {
match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
&mut self.event_receiver,
cx
)?) {
Some(buf) => std::task::Poll::Ready(Some(ProviderEvent::decode(buf))),
None => std::task::Poll::Ready(None),
}
}
}
#[derive(Debug)]
pub enum ProviderEvent {}
impl ProviderEvent {
fn decode(
mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
) -> Result<ProviderEvent, fidl::Error> {
let (bytes, _handles) = buf.split_mut();
let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
debug_assert_eq!(tx_header.tx_id, 0);
match tx_header.ordinal {
_ => Err(fidl::Error::UnknownOrdinal {
ordinal: tx_header.ordinal,
protocol_name: <ProviderMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
}),
}
}
}
pub struct ProviderRequestStream {
inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
is_terminated: bool,
}
impl std::marker::Unpin for ProviderRequestStream {}
impl futures::stream::FusedStream for ProviderRequestStream {
fn is_terminated(&self) -> bool {
self.is_terminated
}
}
impl fidl::endpoints::RequestStream for ProviderRequestStream {
type Protocol = ProviderMarker;
type ControlHandle = ProviderControlHandle;
fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
}
fn control_handle(&self) -> Self::ControlHandle {
ProviderControlHandle { inner: self.inner.clone() }
}
fn into_inner(
self,
) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
{
(self.inner, self.is_terminated)
}
fn from_inner(
inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
is_terminated: bool,
) -> Self {
Self { inner, is_terminated }
}
}
impl futures::Stream for ProviderRequestStream {
type Item = Result<ProviderRequest, fidl::Error>;
fn poll_next(
mut self: std::pin::Pin<&mut Self>,
cx: &mut std::task::Context<'_>,
) -> std::task::Poll<Option<Self::Item>> {
let this = &mut *self;
if this.inner.check_shutdown(cx) {
this.is_terminated = true;
return std::task::Poll::Ready(None);
}
if this.is_terminated {
panic!("polled ProviderRequestStream after completion");
}
fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
|bytes, handles| {
match this.inner.channel().read_etc(cx, bytes, handles) {
std::task::Poll::Ready(Ok(())) => {}
std::task::Poll::Pending => return std::task::Poll::Pending,
std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
this.is_terminated = true;
return std::task::Poll::Ready(None);
}
std::task::Poll::Ready(Err(e)) => {
return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
e.into(),
))))
}
}
let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
std::task::Poll::Ready(Some(match header.ordinal {
0x154ac672633d9ec7 => {
header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
let mut req = fidl::new_empty!(
ProviderOpenCoordinatorWithListenerForVirtconRequest,
fidl::encoding::DefaultFuchsiaResourceDialect
);
fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<ProviderOpenCoordinatorWithListenerForVirtconRequest>(&header, _body_bytes, handles, &mut req)?;
let control_handle = ProviderControlHandle { inner: this.inner.clone() };
Ok(ProviderRequest::OpenCoordinatorWithListenerForVirtcon {
payload: req,
responder: ProviderOpenCoordinatorWithListenerForVirtconResponder {
control_handle: std::mem::ManuallyDrop::new(control_handle),
tx_id: header.tx_id,
},
})
}
0x635b6087ce4f6bfa => {
header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
let mut req = fidl::new_empty!(
ProviderOpenCoordinatorWithListenerForPrimaryRequest,
fidl::encoding::DefaultFuchsiaResourceDialect
);
fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<ProviderOpenCoordinatorWithListenerForPrimaryRequest>(&header, _body_bytes, handles, &mut req)?;
let control_handle = ProviderControlHandle { inner: this.inner.clone() };
Ok(ProviderRequest::OpenCoordinatorWithListenerForPrimary {
payload: req,
responder: ProviderOpenCoordinatorWithListenerForPrimaryResponder {
control_handle: std::mem::ManuallyDrop::new(control_handle),
tx_id: header.tx_id,
},
})
}
_ => Err(fidl::Error::UnknownOrdinal {
ordinal: header.ordinal,
protocol_name:
<ProviderMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
}),
}))
},
)
}
}
#[derive(Debug)]
pub enum ProviderRequest {
OpenCoordinatorWithListenerForVirtcon {
payload: ProviderOpenCoordinatorWithListenerForVirtconRequest,
responder: ProviderOpenCoordinatorWithListenerForVirtconResponder,
},
OpenCoordinatorWithListenerForPrimary {
payload: ProviderOpenCoordinatorWithListenerForPrimaryRequest,
responder: ProviderOpenCoordinatorWithListenerForPrimaryResponder,
},
}
impl ProviderRequest {
#[allow(irrefutable_let_patterns)]
pub fn into_open_coordinator_with_listener_for_virtcon(
self,
) -> Option<(
ProviderOpenCoordinatorWithListenerForVirtconRequest,
ProviderOpenCoordinatorWithListenerForVirtconResponder,
)> {
if let ProviderRequest::OpenCoordinatorWithListenerForVirtcon { payload, responder } = self
{
Some((payload, responder))
} else {
None
}
}
#[allow(irrefutable_let_patterns)]
pub fn into_open_coordinator_with_listener_for_primary(
self,
) -> Option<(
ProviderOpenCoordinatorWithListenerForPrimaryRequest,
ProviderOpenCoordinatorWithListenerForPrimaryResponder,
)> {
if let ProviderRequest::OpenCoordinatorWithListenerForPrimary { payload, responder } = self
{
Some((payload, responder))
} else {
None
}
}
pub fn method_name(&self) -> &'static str {
match *self {
ProviderRequest::OpenCoordinatorWithListenerForVirtcon { .. } => {
"open_coordinator_with_listener_for_virtcon"
}
ProviderRequest::OpenCoordinatorWithListenerForPrimary { .. } => {
"open_coordinator_with_listener_for_primary"
}
}
}
}
#[derive(Debug, Clone)]
pub struct ProviderControlHandle {
inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
}
impl fidl::endpoints::ControlHandle for ProviderControlHandle {
fn shutdown(&self) {
self.inner.shutdown()
}
fn shutdown_with_epitaph(&self, status: zx_status::Status) {
self.inner.shutdown_with_epitaph(status)
}
fn is_closed(&self) -> bool {
self.inner.channel().is_closed()
}
fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
self.inner.channel().on_closed()
}
#[cfg(target_os = "fuchsia")]
fn signal_peer(
&self,
clear_mask: zx::Signals,
set_mask: zx::Signals,
) -> Result<(), zx_status::Status> {
use fidl::Peered;
self.inner.channel().signal_peer(clear_mask, set_mask)
}
}
impl ProviderControlHandle {}
#[must_use = "FIDL methods require a response to be sent"]
#[derive(Debug)]
pub struct ProviderOpenCoordinatorWithListenerForVirtconResponder {
control_handle: std::mem::ManuallyDrop<ProviderControlHandle>,
tx_id: u32,
}
impl std::ops::Drop for ProviderOpenCoordinatorWithListenerForVirtconResponder {
fn drop(&mut self) {
self.control_handle.shutdown();
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
}
}
impl fidl::endpoints::Responder for ProviderOpenCoordinatorWithListenerForVirtconResponder {
type ControlHandle = ProviderControlHandle;
fn control_handle(&self) -> &ProviderControlHandle {
&self.control_handle
}
fn drop_without_shutdown(mut self) {
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
std::mem::forget(self);
}
}
impl ProviderOpenCoordinatorWithListenerForVirtconResponder {
pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
let _result = self.send_raw(result);
if _result.is_err() {
self.control_handle.shutdown();
}
self.drop_without_shutdown();
_result
}
pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
let _result = self.send_raw(result);
self.drop_without_shutdown();
_result
}
fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
self.control_handle
.inner
.send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>>(
result,
self.tx_id,
0x154ac672633d9ec7,
fidl::encoding::DynamicFlags::empty(),
)
}
}
#[must_use = "FIDL methods require a response to be sent"]
#[derive(Debug)]
pub struct ProviderOpenCoordinatorWithListenerForPrimaryResponder {
control_handle: std::mem::ManuallyDrop<ProviderControlHandle>,
tx_id: u32,
}
impl std::ops::Drop for ProviderOpenCoordinatorWithListenerForPrimaryResponder {
fn drop(&mut self) {
self.control_handle.shutdown();
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
}
}
impl fidl::endpoints::Responder for ProviderOpenCoordinatorWithListenerForPrimaryResponder {
type ControlHandle = ProviderControlHandle;
fn control_handle(&self) -> &ProviderControlHandle {
&self.control_handle
}
fn drop_without_shutdown(mut self) {
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
std::mem::forget(self);
}
}
impl ProviderOpenCoordinatorWithListenerForPrimaryResponder {
pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
let _result = self.send_raw(result);
if _result.is_err() {
self.control_handle.shutdown();
}
self.drop_without_shutdown();
_result
}
pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
let _result = self.send_raw(result);
self.drop_without_shutdown();
_result
}
fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
self.control_handle
.inner
.send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>>(
result,
self.tx_id,
0x635b6087ce4f6bfa,
fidl::encoding::DynamicFlags::empty(),
)
}
}
mod internal {
use super::*;
unsafe impl fidl::encoding::TypeMarker for VirtconMode {
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
std::mem::align_of::<u8>()
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
std::mem::size_of::<u8>()
}
#[inline(always)]
fn encode_is_copy() -> bool {
true
}
#[inline(always)]
fn decode_is_copy() -> bool {
false
}
}
impl fidl::encoding::ValueTypeMarker for VirtconMode {
type Borrowed<'a> = Self;
#[inline(always)]
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
*value
}
}
unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Self, D> for VirtconMode {
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<Self>(offset);
encoder.write_num(self.into_primitive(), offset);
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for VirtconMode {
#[inline(always)]
fn new_empty() -> Self {
Self::Inactive
}
#[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);
let prim = decoder.read_num::<u8>(offset);
*self = Self::from_primitive(prim).ok_or(fidl::Error::InvalidEnumValue)?;
Ok(())
}
}
impl fidl::encoding::ValueTypeMarker for BufferCollectionId {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for BufferCollectionId {
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
8
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
8
}
#[inline(always)]
fn encode_is_copy() -> bool {
true
}
#[inline(always)]
fn decode_is_copy() -> bool {
true
}
}
unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<BufferCollectionId, D>
for &BufferCollectionId
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<BufferCollectionId>(offset);
unsafe {
let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
(buf_ptr as *mut BufferCollectionId)
.write_unaligned((self as *const BufferCollectionId).read());
}
Ok(())
}
}
unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<u64, D>>
fidl::encoding::Encode<BufferCollectionId, 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::<BufferCollectionId>(offset);
self.0.encode(encoder, offset + 0, depth)?;
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for BufferCollectionId {
#[inline(always)]
fn new_empty() -> Self {
Self { value: fidl::new_empty!(u64, 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);
let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
unsafe {
std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 8);
}
Ok(())
}
}
impl fidl::encoding::ValueTypeMarker for BufferId {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for BufferId {
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
8
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
16
}
}
unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<BufferId, D> for &BufferId {
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<BufferId>(offset);
unsafe {
let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
(buf_ptr as *mut BufferId).write_unaligned((self as *const BufferId).read());
let padding_ptr = buf_ptr.offset(8) as *mut u64;
let padding_mask = 0xffffffff00000000u64;
padding_ptr.write_unaligned(padding_ptr.read_unaligned() & !padding_mask);
}
Ok(())
}
}
unsafe impl<
D: fidl::encoding::ResourceDialect,
T0: fidl::encoding::Encode<BufferCollectionId, D>,
T1: fidl::encoding::Encode<u32, D>,
> fidl::encoding::Encode<BufferId, D> for (T0, T1)
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<BufferId>(offset);
unsafe {
let ptr = encoder.buf.as_mut_ptr().add(offset).offset(8);
(ptr as *mut u64).write_unaligned(0);
}
self.0.encode(encoder, offset + 0, depth)?;
self.1.encode(encoder, offset + 8, depth)?;
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for BufferId {
#[inline(always)]
fn new_empty() -> Self {
Self {
buffer_collection_id: fidl::new_empty!(BufferCollectionId, D),
buffer_index: fidl::new_empty!(u32, 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);
let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
let ptr = unsafe { buf_ptr.offset(8) };
let padval = unsafe { (ptr as *const u64).read_unaligned() };
let mask = 0xffffffff00000000u64;
let maskedval = padval & mask;
if maskedval != 0 {
return Err(fidl::Error::NonZeroPadding {
padding_start: offset + 8 + ((mask as u64).trailing_zeros() / 8) as usize,
});
}
unsafe {
std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 16);
}
Ok(())
}
}
impl fidl::encoding::ValueTypeMarker for ClientCompositionOp {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for ClientCompositionOp {
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
8
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
24
}
}
unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<ClientCompositionOp, D>
for &ClientCompositionOp
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<ClientCompositionOp>(offset);
fidl::encoding::Encode::<ClientCompositionOp, D>::encode(
(
<fidl_fuchsia_hardware_display_types::DisplayId as fidl::encoding::ValueTypeMarker>::borrow(&self.display_id),
<LayerId as fidl::encoding::ValueTypeMarker>::borrow(&self.layer_id),
<fidl_fuchsia_hardware_display_types::ClientCompositionOpcode as fidl::encoding::ValueTypeMarker>::borrow(&self.opcode),
),
encoder, offset, _depth
)
}
}
unsafe impl<
D: fidl::encoding::ResourceDialect,
T0: fidl::encoding::Encode<fidl_fuchsia_hardware_display_types::DisplayId, D>,
T1: fidl::encoding::Encode<LayerId, D>,
T2: fidl::encoding::Encode<fidl_fuchsia_hardware_display_types::ClientCompositionOpcode, D>,
> fidl::encoding::Encode<ClientCompositionOp, D> for (T0, T1, T2)
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<ClientCompositionOp>(offset);
unsafe {
let ptr = encoder.buf.as_mut_ptr().add(offset).offset(16);
(ptr as *mut u64).write_unaligned(0);
}
self.0.encode(encoder, offset + 0, depth)?;
self.1.encode(encoder, offset + 8, depth)?;
self.2.encode(encoder, offset + 16, depth)?;
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for ClientCompositionOp {
#[inline(always)]
fn new_empty() -> Self {
Self {
display_id: fidl::new_empty!(fidl_fuchsia_hardware_display_types::DisplayId, D),
layer_id: fidl::new_empty!(LayerId, D),
opcode: fidl::new_empty!(
fidl_fuchsia_hardware_display_types::ClientCompositionOpcode,
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);
let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(16) };
let padval = unsafe { (ptr as *const u64).read_unaligned() };
let mask = 0xffffffffffffff00u64;
let maskedval = padval & mask;
if maskedval != 0 {
return Err(fidl::Error::NonZeroPadding {
padding_start: offset + 16 + ((mask as u64).trailing_zeros() / 8) as usize,
});
}
fidl::decode!(
fidl_fuchsia_hardware_display_types::DisplayId,
D,
&mut self.display_id,
decoder,
offset + 0,
_depth
)?;
fidl::decode!(LayerId, D, &mut self.layer_id, decoder, offset + 8, _depth)?;
fidl::decode!(
fidl_fuchsia_hardware_display_types::ClientCompositionOpcode,
D,
&mut self.opcode,
decoder,
offset + 16,
_depth
)?;
Ok(())
}
}
impl fidl::encoding::ValueTypeMarker for CoordinatorAcknowledgeVsyncRequest {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for CoordinatorAcknowledgeVsyncRequest {
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
8
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
8
}
#[inline(always)]
fn encode_is_copy() -> bool {
true
}
#[inline(always)]
fn decode_is_copy() -> bool {
true
}
}
unsafe impl<D: fidl::encoding::ResourceDialect>
fidl::encoding::Encode<CoordinatorAcknowledgeVsyncRequest, D>
for &CoordinatorAcknowledgeVsyncRequest
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<CoordinatorAcknowledgeVsyncRequest>(offset);
unsafe {
let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
(buf_ptr as *mut CoordinatorAcknowledgeVsyncRequest)
.write_unaligned((self as *const CoordinatorAcknowledgeVsyncRequest).read());
}
Ok(())
}
}
unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<u64, D>>
fidl::encoding::Encode<CoordinatorAcknowledgeVsyncRequest, 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::<CoordinatorAcknowledgeVsyncRequest>(offset);
self.0.encode(encoder, offset + 0, depth)?;
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
for CoordinatorAcknowledgeVsyncRequest
{
#[inline(always)]
fn new_empty() -> Self {
Self { cookie: fidl::new_empty!(u64, 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);
let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
unsafe {
std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 8);
}
Ok(())
}
}
impl fidl::encoding::ValueTypeMarker for CoordinatorCheckConfigRequest {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for CoordinatorCheckConfigRequest {
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<CoordinatorCheckConfigRequest, D>
for &CoordinatorCheckConfigRequest
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<CoordinatorCheckConfigRequest>(offset);
fidl::encoding::Encode::<CoordinatorCheckConfigRequest, D>::encode(
(<bool as fidl::encoding::ValueTypeMarker>::borrow(&self.discard),),
encoder,
offset,
_depth,
)
}
}
unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<bool, D>>
fidl::encoding::Encode<CoordinatorCheckConfigRequest, 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::<CoordinatorCheckConfigRequest>(offset);
self.0.encode(encoder, offset + 0, depth)?;
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
for CoordinatorCheckConfigRequest
{
#[inline(always)]
fn new_empty() -> Self {
Self { discard: fidl::new_empty!(bool, 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);
fidl::decode!(bool, D, &mut self.discard, decoder, offset + 0, _depth)?;
Ok(())
}
}
impl fidl::encoding::ValueTypeMarker for CoordinatorCheckConfigResponse {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for CoordinatorCheckConfigResponse {
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
8
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
24
}
}
unsafe impl<D: fidl::encoding::ResourceDialect>
fidl::encoding::Encode<CoordinatorCheckConfigResponse, D>
for &CoordinatorCheckConfigResponse
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<CoordinatorCheckConfigResponse>(offset);
fidl::encoding::Encode::<CoordinatorCheckConfigResponse, D>::encode(
(
<fidl_fuchsia_hardware_display_types::ConfigResult as fidl::encoding::ValueTypeMarker>::borrow(&self.res),
<fidl::encoding::UnboundedVector<ClientCompositionOp> as fidl::encoding::ValueTypeMarker>::borrow(&self.ops),
),
encoder, offset, _depth
)
}
}
unsafe impl<
D: fidl::encoding::ResourceDialect,
T0: fidl::encoding::Encode<fidl_fuchsia_hardware_display_types::ConfigResult, D>,
T1: fidl::encoding::Encode<fidl::encoding::UnboundedVector<ClientCompositionOp>, D>,
> fidl::encoding::Encode<CoordinatorCheckConfigResponse, D> for (T0, T1)
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<CoordinatorCheckConfigResponse>(offset);
unsafe {
let ptr = encoder.buf.as_mut_ptr().add(offset).offset(0);
(ptr as *mut u64).write_unaligned(0);
}
self.0.encode(encoder, offset + 0, depth)?;
self.1.encode(encoder, offset + 8, depth)?;
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
for CoordinatorCheckConfigResponse
{
#[inline(always)]
fn new_empty() -> Self {
Self {
res: fidl::new_empty!(fidl_fuchsia_hardware_display_types::ConfigResult, D),
ops: fidl::new_empty!(fidl::encoding::UnboundedVector<ClientCompositionOp>, 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);
let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(0) };
let padval = unsafe { (ptr as *const u64).read_unaligned() };
let mask = 0xffffffff00000000u64;
let maskedval = padval & mask;
if maskedval != 0 {
return Err(fidl::Error::NonZeroPadding {
padding_start: offset + 0 + ((mask as u64).trailing_zeros() / 8) as usize,
});
}
fidl::decode!(
fidl_fuchsia_hardware_display_types::ConfigResult,
D,
&mut self.res,
decoder,
offset + 0,
_depth
)?;
fidl::decode!(
fidl::encoding::UnboundedVector<ClientCompositionOp>,
D,
&mut self.ops,
decoder,
offset + 8,
_depth
)?;
Ok(())
}
}
impl fidl::encoding::ValueTypeMarker for CoordinatorDestroyLayerRequest {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for CoordinatorDestroyLayerRequest {
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
8
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
8
}
#[inline(always)]
fn encode_is_copy() -> bool {
true
}
#[inline(always)]
fn decode_is_copy() -> bool {
true
}
}
unsafe impl<D: fidl::encoding::ResourceDialect>
fidl::encoding::Encode<CoordinatorDestroyLayerRequest, D>
for &CoordinatorDestroyLayerRequest
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<CoordinatorDestroyLayerRequest>(offset);
unsafe {
let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
(buf_ptr as *mut CoordinatorDestroyLayerRequest)
.write_unaligned((self as *const CoordinatorDestroyLayerRequest).read());
}
Ok(())
}
}
unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<LayerId, D>>
fidl::encoding::Encode<CoordinatorDestroyLayerRequest, 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::<CoordinatorDestroyLayerRequest>(offset);
self.0.encode(encoder, offset + 0, depth)?;
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
for CoordinatorDestroyLayerRequest
{
#[inline(always)]
fn new_empty() -> Self {
Self { layer_id: fidl::new_empty!(LayerId, 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);
let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
unsafe {
std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 8);
}
Ok(())
}
}
impl fidl::encoding::ValueTypeMarker for CoordinatorEnableVsyncRequest {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for CoordinatorEnableVsyncRequest {
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<CoordinatorEnableVsyncRequest, D>
for &CoordinatorEnableVsyncRequest
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<CoordinatorEnableVsyncRequest>(offset);
fidl::encoding::Encode::<CoordinatorEnableVsyncRequest, D>::encode(
(<bool as fidl::encoding::ValueTypeMarker>::borrow(&self.enable),),
encoder,
offset,
_depth,
)
}
}
unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<bool, D>>
fidl::encoding::Encode<CoordinatorEnableVsyncRequest, 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::<CoordinatorEnableVsyncRequest>(offset);
self.0.encode(encoder, offset + 0, depth)?;
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
for CoordinatorEnableVsyncRequest
{
#[inline(always)]
fn new_empty() -> Self {
Self { enable: fidl::new_empty!(bool, 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);
fidl::decode!(bool, D, &mut self.enable, decoder, offset + 0, _depth)?;
Ok(())
}
}
impl fidl::encoding::ValueTypeMarker for CoordinatorGetLatestAppliedConfigStampResponse {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for CoordinatorGetLatestAppliedConfigStampResponse {
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
8
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
8
}
}
unsafe impl<D: fidl::encoding::ResourceDialect>
fidl::encoding::Encode<CoordinatorGetLatestAppliedConfigStampResponse, D>
for &CoordinatorGetLatestAppliedConfigStampResponse
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<CoordinatorGetLatestAppliedConfigStampResponse>(offset);
fidl::encoding::Encode::<CoordinatorGetLatestAppliedConfigStampResponse, D>::encode(
(
<fidl_fuchsia_hardware_display_types::ConfigStamp as fidl::encoding::ValueTypeMarker>::borrow(&self.stamp),
),
encoder, offset, _depth
)
}
}
unsafe impl<
D: fidl::encoding::ResourceDialect,
T0: fidl::encoding::Encode<fidl_fuchsia_hardware_display_types::ConfigStamp, D>,
> fidl::encoding::Encode<CoordinatorGetLatestAppliedConfigStampResponse, 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::<CoordinatorGetLatestAppliedConfigStampResponse>(offset);
self.0.encode(encoder, offset + 0, depth)?;
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
for CoordinatorGetLatestAppliedConfigStampResponse
{
#[inline(always)]
fn new_empty() -> Self {
Self { stamp: fidl::new_empty!(fidl_fuchsia_hardware_display_types::ConfigStamp, 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);
fidl::decode!(
fidl_fuchsia_hardware_display_types::ConfigStamp,
D,
&mut self.stamp,
decoder,
offset + 0,
_depth
)?;
Ok(())
}
}
impl fidl::encoding::ResourceTypeMarker for CoordinatorImportBufferCollectionRequest {
type Borrowed<'a> = &'a mut Self;
fn take_or_borrow<'a>(
value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
) -> Self::Borrowed<'a> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for CoordinatorImportBufferCollectionRequest {
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
8
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
16
}
}
unsafe impl
fidl::encoding::Encode<
CoordinatorImportBufferCollectionRequest,
fidl::encoding::DefaultFuchsiaResourceDialect,
> for &mut CoordinatorImportBufferCollectionRequest
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<
'_,
fidl::encoding::DefaultFuchsiaResourceDialect,
>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<CoordinatorImportBufferCollectionRequest>(offset);
fidl::encoding::Encode::<
CoordinatorImportBufferCollectionRequest,
fidl::encoding::DefaultFuchsiaResourceDialect,
>::encode(
(
<BufferCollectionId as fidl::encoding::ValueTypeMarker>::borrow(
&self.buffer_collection_id,
),
<fidl::encoding::Endpoint<
fidl::endpoints::ClientEnd<
fidl_fuchsia_sysmem2::BufferCollectionTokenMarker,
>,
> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
&mut self.buffer_collection_token,
),
),
encoder,
offset,
_depth,
)
}
}
unsafe impl<
T0: fidl::encoding::Encode<
BufferCollectionId,
fidl::encoding::DefaultFuchsiaResourceDialect,
>,
T1: fidl::encoding::Encode<
fidl::encoding::Endpoint<
fidl::endpoints::ClientEnd<fidl_fuchsia_sysmem2::BufferCollectionTokenMarker>,
>,
fidl::encoding::DefaultFuchsiaResourceDialect,
>,
>
fidl::encoding::Encode<
CoordinatorImportBufferCollectionRequest,
fidl::encoding::DefaultFuchsiaResourceDialect,
> for (T0, T1)
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<
'_,
fidl::encoding::DefaultFuchsiaResourceDialect,
>,
offset: usize,
depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<CoordinatorImportBufferCollectionRequest>(offset);
unsafe {
let ptr = encoder.buf.as_mut_ptr().add(offset).offset(8);
(ptr as *mut u64).write_unaligned(0);
}
self.0.encode(encoder, offset + 0, depth)?;
self.1.encode(encoder, offset + 8, depth)?;
Ok(())
}
}
impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
for CoordinatorImportBufferCollectionRequest
{
#[inline(always)]
fn new_empty() -> Self {
Self {
buffer_collection_id: fidl::new_empty!(
BufferCollectionId,
fidl::encoding::DefaultFuchsiaResourceDialect
),
buffer_collection_token: fidl::new_empty!(
fidl::encoding::Endpoint<
fidl::endpoints::ClientEnd<
fidl_fuchsia_sysmem2::BufferCollectionTokenMarker,
>,
>,
fidl::encoding::DefaultFuchsiaResourceDialect
),
}
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<
'_,
fidl::encoding::DefaultFuchsiaResourceDialect,
>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(8) };
let padval = unsafe { (ptr as *const u64).read_unaligned() };
let mask = 0xffffffff00000000u64;
let maskedval = padval & mask;
if maskedval != 0 {
return Err(fidl::Error::NonZeroPadding {
padding_start: offset + 8 + ((mask as u64).trailing_zeros() / 8) as usize,
});
}
fidl::decode!(
BufferCollectionId,
fidl::encoding::DefaultFuchsiaResourceDialect,
&mut self.buffer_collection_id,
decoder,
offset + 0,
_depth
)?;
fidl::decode!(
fidl::encoding::Endpoint<
fidl::endpoints::ClientEnd<fidl_fuchsia_sysmem2::BufferCollectionTokenMarker>,
>,
fidl::encoding::DefaultFuchsiaResourceDialect,
&mut self.buffer_collection_token,
decoder,
offset + 8,
_depth
)?;
Ok(())
}
}
impl fidl::encoding::ResourceTypeMarker for CoordinatorImportEventRequest {
type Borrowed<'a> = &'a mut Self;
fn take_or_borrow<'a>(
value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
) -> Self::Borrowed<'a> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for CoordinatorImportEventRequest {
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
8
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
16
}
}
unsafe impl
fidl::encoding::Encode<
CoordinatorImportEventRequest,
fidl::encoding::DefaultFuchsiaResourceDialect,
> for &mut CoordinatorImportEventRequest
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<
'_,
fidl::encoding::DefaultFuchsiaResourceDialect,
>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<CoordinatorImportEventRequest>(offset);
fidl::encoding::Encode::<
CoordinatorImportEventRequest,
fidl::encoding::DefaultFuchsiaResourceDialect,
>::encode(
(
<fidl::encoding::HandleType<
fidl::Event,
{ fidl::ObjectType::EVENT.into_raw() },
2147483648,
> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
&mut self.event
),
<EventId as fidl::encoding::ValueTypeMarker>::borrow(&self.id),
),
encoder,
offset,
_depth,
)
}
}
unsafe impl<
T0: fidl::encoding::Encode<
fidl::encoding::HandleType<
fidl::Event,
{ fidl::ObjectType::EVENT.into_raw() },
2147483648,
>,
fidl::encoding::DefaultFuchsiaResourceDialect,
>,
T1: fidl::encoding::Encode<EventId, fidl::encoding::DefaultFuchsiaResourceDialect>,
>
fidl::encoding::Encode<
CoordinatorImportEventRequest,
fidl::encoding::DefaultFuchsiaResourceDialect,
> for (T0, T1)
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<
'_,
fidl::encoding::DefaultFuchsiaResourceDialect,
>,
offset: usize,
depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<CoordinatorImportEventRequest>(offset);
unsafe {
let ptr = encoder.buf.as_mut_ptr().add(offset).offset(0);
(ptr as *mut u64).write_unaligned(0);
}
self.0.encode(encoder, offset + 0, depth)?;
self.1.encode(encoder, offset + 8, depth)?;
Ok(())
}
}
impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
for CoordinatorImportEventRequest
{
#[inline(always)]
fn new_empty() -> Self {
Self {
event: fidl::new_empty!(fidl::encoding::HandleType<fidl::Event, { fidl::ObjectType::EVENT.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect),
id: fidl::new_empty!(EventId, fidl::encoding::DefaultFuchsiaResourceDialect),
}
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<
'_,
fidl::encoding::DefaultFuchsiaResourceDialect,
>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(0) };
let padval = unsafe { (ptr as *const u64).read_unaligned() };
let mask = 0xffffffff00000000u64;
let maskedval = padval & mask;
if maskedval != 0 {
return Err(fidl::Error::NonZeroPadding {
padding_start: offset + 0 + ((mask as u64).trailing_zeros() / 8) as usize,
});
}
fidl::decode!(fidl::encoding::HandleType<fidl::Event, { fidl::ObjectType::EVENT.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect, &mut self.event, decoder, offset + 0, _depth)?;
fidl::decode!(
EventId,
fidl::encoding::DefaultFuchsiaResourceDialect,
&mut self.id,
decoder,
offset + 8,
_depth
)?;
Ok(())
}
}
impl fidl::encoding::ValueTypeMarker for CoordinatorImportImageRequest {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for CoordinatorImportImageRequest {
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
8
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
40
}
}
unsafe impl<D: fidl::encoding::ResourceDialect>
fidl::encoding::Encode<CoordinatorImportImageRequest, D>
for &CoordinatorImportImageRequest
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<CoordinatorImportImageRequest>(offset);
fidl::encoding::Encode::<CoordinatorImportImageRequest, D>::encode(
(
<fidl_fuchsia_hardware_display_types::ImageMetadata as fidl::encoding::ValueTypeMarker>::borrow(&self.image_metadata),
<BufferId as fidl::encoding::ValueTypeMarker>::borrow(&self.buffer_id),
<ImageId as fidl::encoding::ValueTypeMarker>::borrow(&self.image_id),
),
encoder, offset, _depth
)
}
}
unsafe impl<
D: fidl::encoding::ResourceDialect,
T0: fidl::encoding::Encode<fidl_fuchsia_hardware_display_types::ImageMetadata, D>,
T1: fidl::encoding::Encode<BufferId, D>,
T2: fidl::encoding::Encode<ImageId, D>,
> fidl::encoding::Encode<CoordinatorImportImageRequest, D> for (T0, T1, T2)
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<CoordinatorImportImageRequest>(offset);
unsafe {
let ptr = encoder.buf.as_mut_ptr().add(offset).offset(8);
(ptr as *mut u64).write_unaligned(0);
}
self.0.encode(encoder, offset + 0, depth)?;
self.1.encode(encoder, offset + 16, depth)?;
self.2.encode(encoder, offset + 32, depth)?;
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
for CoordinatorImportImageRequest
{
#[inline(always)]
fn new_empty() -> Self {
Self {
image_metadata: fidl::new_empty!(
fidl_fuchsia_hardware_display_types::ImageMetadata,
D
),
buffer_id: fidl::new_empty!(BufferId, D),
image_id: fidl::new_empty!(ImageId, 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);
let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(8) };
let padval = unsafe { (ptr as *const u64).read_unaligned() };
let mask = 0xffffffff00000000u64;
let maskedval = padval & mask;
if maskedval != 0 {
return Err(fidl::Error::NonZeroPadding {
padding_start: offset + 8 + ((mask as u64).trailing_zeros() / 8) as usize,
});
}
fidl::decode!(
fidl_fuchsia_hardware_display_types::ImageMetadata,
D,
&mut self.image_metadata,
decoder,
offset + 0,
_depth
)?;
fidl::decode!(BufferId, D, &mut self.buffer_id, decoder, offset + 16, _depth)?;
fidl::decode!(ImageId, D, &mut self.image_id, decoder, offset + 32, _depth)?;
Ok(())
}
}
impl fidl::encoding::ValueTypeMarker for CoordinatorListenerOnClientOwnershipChangeRequest {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for CoordinatorListenerOnClientOwnershipChangeRequest {
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<CoordinatorListenerOnClientOwnershipChangeRequest, D>
for &CoordinatorListenerOnClientOwnershipChangeRequest
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<CoordinatorListenerOnClientOwnershipChangeRequest>(offset);
fidl::encoding::Encode::<CoordinatorListenerOnClientOwnershipChangeRequest, D>::encode(
(<bool as fidl::encoding::ValueTypeMarker>::borrow(&self.has_ownership),),
encoder,
offset,
_depth,
)
}
}
unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<bool, D>>
fidl::encoding::Encode<CoordinatorListenerOnClientOwnershipChangeRequest, 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::<CoordinatorListenerOnClientOwnershipChangeRequest>(offset);
self.0.encode(encoder, offset + 0, depth)?;
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
for CoordinatorListenerOnClientOwnershipChangeRequest
{
#[inline(always)]
fn new_empty() -> Self {
Self { has_ownership: fidl::new_empty!(bool, 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);
fidl::decode!(bool, D, &mut self.has_ownership, decoder, offset + 0, _depth)?;
Ok(())
}
}
impl fidl::encoding::ValueTypeMarker for CoordinatorListenerOnDisplaysChangedRequest {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for CoordinatorListenerOnDisplaysChangedRequest {
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
8
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
32
}
}
unsafe impl<D: fidl::encoding::ResourceDialect>
fidl::encoding::Encode<CoordinatorListenerOnDisplaysChangedRequest, D>
for &CoordinatorListenerOnDisplaysChangedRequest
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<CoordinatorListenerOnDisplaysChangedRequest>(offset);
fidl::encoding::Encode::<CoordinatorListenerOnDisplaysChangedRequest, D>::encode(
(
<fidl::encoding::UnboundedVector<Info> as fidl::encoding::ValueTypeMarker>::borrow(&self.added),
<fidl::encoding::UnboundedVector<fidl_fuchsia_hardware_display_types::DisplayId> as fidl::encoding::ValueTypeMarker>::borrow(&self.removed),
),
encoder, offset, _depth
)
}
}
unsafe impl<
D: fidl::encoding::ResourceDialect,
T0: fidl::encoding::Encode<fidl::encoding::UnboundedVector<Info>, D>,
T1: fidl::encoding::Encode<
fidl::encoding::UnboundedVector<fidl_fuchsia_hardware_display_types::DisplayId>,
D,
>,
> fidl::encoding::Encode<CoordinatorListenerOnDisplaysChangedRequest, D> for (T0, T1)
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<CoordinatorListenerOnDisplaysChangedRequest>(offset);
self.0.encode(encoder, offset + 0, depth)?;
self.1.encode(encoder, offset + 16, depth)?;
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
for CoordinatorListenerOnDisplaysChangedRequest
{
#[inline(always)]
fn new_empty() -> Self {
Self {
added: fidl::new_empty!(fidl::encoding::UnboundedVector<Info>, D),
removed: fidl::new_empty!(
fidl::encoding::UnboundedVector<fidl_fuchsia_hardware_display_types::DisplayId>,
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);
fidl::decode!(
fidl::encoding::UnboundedVector<Info>,
D,
&mut self.added,
decoder,
offset + 0,
_depth
)?;
fidl::decode!(
fidl::encoding::UnboundedVector<fidl_fuchsia_hardware_display_types::DisplayId>,
D,
&mut self.removed,
decoder,
offset + 16,
_depth
)?;
Ok(())
}
}
impl fidl::encoding::ValueTypeMarker for CoordinatorListenerOnVsyncRequest {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for CoordinatorListenerOnVsyncRequest {
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
8
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
32
}
}
unsafe impl<D: fidl::encoding::ResourceDialect>
fidl::encoding::Encode<CoordinatorListenerOnVsyncRequest, D>
for &CoordinatorListenerOnVsyncRequest
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<CoordinatorListenerOnVsyncRequest>(offset);
fidl::encoding::Encode::<CoordinatorListenerOnVsyncRequest, D>::encode(
(
<fidl_fuchsia_hardware_display_types::DisplayId as fidl::encoding::ValueTypeMarker>::borrow(&self.display_id),
<i64 as fidl::encoding::ValueTypeMarker>::borrow(&self.timestamp),
<fidl_fuchsia_hardware_display_types::ConfigStamp as fidl::encoding::ValueTypeMarker>::borrow(&self.applied_config_stamp),
<VsyncAckCookie as fidl::encoding::ValueTypeMarker>::borrow(&self.cookie),
),
encoder, offset, _depth
)
}
}
unsafe impl<
D: fidl::encoding::ResourceDialect,
T0: fidl::encoding::Encode<fidl_fuchsia_hardware_display_types::DisplayId, D>,
T1: fidl::encoding::Encode<i64, D>,
T2: fidl::encoding::Encode<fidl_fuchsia_hardware_display_types::ConfigStamp, D>,
T3: fidl::encoding::Encode<VsyncAckCookie, D>,
> fidl::encoding::Encode<CoordinatorListenerOnVsyncRequest, D> for (T0, T1, T2, T3)
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<CoordinatorListenerOnVsyncRequest>(offset);
self.0.encode(encoder, offset + 0, depth)?;
self.1.encode(encoder, offset + 8, depth)?;
self.2.encode(encoder, offset + 16, depth)?;
self.3.encode(encoder, offset + 24, depth)?;
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
for CoordinatorListenerOnVsyncRequest
{
#[inline(always)]
fn new_empty() -> Self {
Self {
display_id: fidl::new_empty!(fidl_fuchsia_hardware_display_types::DisplayId, D),
timestamp: fidl::new_empty!(i64, D),
applied_config_stamp: fidl::new_empty!(
fidl_fuchsia_hardware_display_types::ConfigStamp,
D
),
cookie: fidl::new_empty!(VsyncAckCookie, 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);
fidl::decode!(
fidl_fuchsia_hardware_display_types::DisplayId,
D,
&mut self.display_id,
decoder,
offset + 0,
_depth
)?;
fidl::decode!(i64, D, &mut self.timestamp, decoder, offset + 8, _depth)?;
fidl::decode!(
fidl_fuchsia_hardware_display_types::ConfigStamp,
D,
&mut self.applied_config_stamp,
decoder,
offset + 16,
_depth
)?;
fidl::decode!(VsyncAckCookie, D, &mut self.cookie, decoder, offset + 24, _depth)?;
Ok(())
}
}
impl fidl::encoding::ValueTypeMarker for CoordinatorOnClientOwnershipChangeRequest {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for CoordinatorOnClientOwnershipChangeRequest {
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<CoordinatorOnClientOwnershipChangeRequest, D>
for &CoordinatorOnClientOwnershipChangeRequest
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<CoordinatorOnClientOwnershipChangeRequest>(offset);
fidl::encoding::Encode::<CoordinatorOnClientOwnershipChangeRequest, D>::encode(
(<bool as fidl::encoding::ValueTypeMarker>::borrow(&self.has_ownership),),
encoder,
offset,
_depth,
)
}
}
unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<bool, D>>
fidl::encoding::Encode<CoordinatorOnClientOwnershipChangeRequest, 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::<CoordinatorOnClientOwnershipChangeRequest>(offset);
self.0.encode(encoder, offset + 0, depth)?;
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
for CoordinatorOnClientOwnershipChangeRequest
{
#[inline(always)]
fn new_empty() -> Self {
Self { has_ownership: fidl::new_empty!(bool, 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);
fidl::decode!(bool, D, &mut self.has_ownership, decoder, offset + 0, _depth)?;
Ok(())
}
}
impl fidl::encoding::ValueTypeMarker for CoordinatorOnDisplaysChangedRequest {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for CoordinatorOnDisplaysChangedRequest {
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
8
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
32
}
}
unsafe impl<D: fidl::encoding::ResourceDialect>
fidl::encoding::Encode<CoordinatorOnDisplaysChangedRequest, D>
for &CoordinatorOnDisplaysChangedRequest
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<CoordinatorOnDisplaysChangedRequest>(offset);
fidl::encoding::Encode::<CoordinatorOnDisplaysChangedRequest, D>::encode(
(
<fidl::encoding::UnboundedVector<Info> as fidl::encoding::ValueTypeMarker>::borrow(&self.added),
<fidl::encoding::UnboundedVector<fidl_fuchsia_hardware_display_types::DisplayId> as fidl::encoding::ValueTypeMarker>::borrow(&self.removed),
),
encoder, offset, _depth
)
}
}
unsafe impl<
D: fidl::encoding::ResourceDialect,
T0: fidl::encoding::Encode<fidl::encoding::UnboundedVector<Info>, D>,
T1: fidl::encoding::Encode<
fidl::encoding::UnboundedVector<fidl_fuchsia_hardware_display_types::DisplayId>,
D,
>,
> fidl::encoding::Encode<CoordinatorOnDisplaysChangedRequest, D> for (T0, T1)
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<CoordinatorOnDisplaysChangedRequest>(offset);
self.0.encode(encoder, offset + 0, depth)?;
self.1.encode(encoder, offset + 16, depth)?;
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
for CoordinatorOnDisplaysChangedRequest
{
#[inline(always)]
fn new_empty() -> Self {
Self {
added: fidl::new_empty!(fidl::encoding::UnboundedVector<Info>, D),
removed: fidl::new_empty!(
fidl::encoding::UnboundedVector<fidl_fuchsia_hardware_display_types::DisplayId>,
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);
fidl::decode!(
fidl::encoding::UnboundedVector<Info>,
D,
&mut self.added,
decoder,
offset + 0,
_depth
)?;
fidl::decode!(
fidl::encoding::UnboundedVector<fidl_fuchsia_hardware_display_types::DisplayId>,
D,
&mut self.removed,
decoder,
offset + 16,
_depth
)?;
Ok(())
}
}
impl fidl::encoding::ResourceTypeMarker for CoordinatorOnVsyncRequest {
type Borrowed<'a> = &'a mut Self;
fn take_or_borrow<'a>(
value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
) -> Self::Borrowed<'a> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for CoordinatorOnVsyncRequest {
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
8
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
32
}
}
unsafe impl
fidl::encoding::Encode<
CoordinatorOnVsyncRequest,
fidl::encoding::DefaultFuchsiaResourceDialect,
> for &mut CoordinatorOnVsyncRequest
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<
'_,
fidl::encoding::DefaultFuchsiaResourceDialect,
>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<CoordinatorOnVsyncRequest>(offset);
fidl::encoding::Encode::<CoordinatorOnVsyncRequest, fidl::encoding::DefaultFuchsiaResourceDialect>::encode(
(
<fidl_fuchsia_hardware_display_types::DisplayId as fidl::encoding::ValueTypeMarker>::borrow(&self.display_id),
<u64 as fidl::encoding::ValueTypeMarker>::borrow(&self.timestamp),
<fidl_fuchsia_hardware_display_types::ConfigStamp as fidl::encoding::ValueTypeMarker>::borrow(&self.applied_config_stamp),
<u64 as fidl::encoding::ValueTypeMarker>::borrow(&self.cookie),
),
encoder, offset, _depth
)
}
}
unsafe impl<
T0: fidl::encoding::Encode<
fidl_fuchsia_hardware_display_types::DisplayId,
fidl::encoding::DefaultFuchsiaResourceDialect,
>,
T1: fidl::encoding::Encode<u64, fidl::encoding::DefaultFuchsiaResourceDialect>,
T2: fidl::encoding::Encode<
fidl_fuchsia_hardware_display_types::ConfigStamp,
fidl::encoding::DefaultFuchsiaResourceDialect,
>,
T3: fidl::encoding::Encode<u64, fidl::encoding::DefaultFuchsiaResourceDialect>,
>
fidl::encoding::Encode<
CoordinatorOnVsyncRequest,
fidl::encoding::DefaultFuchsiaResourceDialect,
> for (T0, T1, T2, T3)
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<
'_,
fidl::encoding::DefaultFuchsiaResourceDialect,
>,
offset: usize,
depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<CoordinatorOnVsyncRequest>(offset);
self.0.encode(encoder, offset + 0, depth)?;
self.1.encode(encoder, offset + 8, depth)?;
self.2.encode(encoder, offset + 16, depth)?;
self.3.encode(encoder, offset + 24, depth)?;
Ok(())
}
}
impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
for CoordinatorOnVsyncRequest
{
#[inline(always)]
fn new_empty() -> Self {
Self {
display_id: fidl::new_empty!(
fidl_fuchsia_hardware_display_types::DisplayId,
fidl::encoding::DefaultFuchsiaResourceDialect
),
timestamp: fidl::new_empty!(u64, fidl::encoding::DefaultFuchsiaResourceDialect),
applied_config_stamp: fidl::new_empty!(
fidl_fuchsia_hardware_display_types::ConfigStamp,
fidl::encoding::DefaultFuchsiaResourceDialect
),
cookie: fidl::new_empty!(u64, fidl::encoding::DefaultFuchsiaResourceDialect),
}
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<
'_,
fidl::encoding::DefaultFuchsiaResourceDialect,
>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
fidl::decode!(
fidl_fuchsia_hardware_display_types::DisplayId,
fidl::encoding::DefaultFuchsiaResourceDialect,
&mut self.display_id,
decoder,
offset + 0,
_depth
)?;
fidl::decode!(
u64,
fidl::encoding::DefaultFuchsiaResourceDialect,
&mut self.timestamp,
decoder,
offset + 8,
_depth
)?;
fidl::decode!(
fidl_fuchsia_hardware_display_types::ConfigStamp,
fidl::encoding::DefaultFuchsiaResourceDialect,
&mut self.applied_config_stamp,
decoder,
offset + 16,
_depth
)?;
fidl::decode!(
u64,
fidl::encoding::DefaultFuchsiaResourceDialect,
&mut self.cookie,
decoder,
offset + 24,
_depth
)?;
Ok(())
}
}
impl fidl::encoding::ValueTypeMarker for CoordinatorReleaseBufferCollectionRequest {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for CoordinatorReleaseBufferCollectionRequest {
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
8
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
8
}
#[inline(always)]
fn encode_is_copy() -> bool {
true
}
#[inline(always)]
fn decode_is_copy() -> bool {
true
}
}
unsafe impl<D: fidl::encoding::ResourceDialect>
fidl::encoding::Encode<CoordinatorReleaseBufferCollectionRequest, D>
for &CoordinatorReleaseBufferCollectionRequest
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<CoordinatorReleaseBufferCollectionRequest>(offset);
unsafe {
let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
(buf_ptr as *mut CoordinatorReleaseBufferCollectionRequest).write_unaligned(
(self as *const CoordinatorReleaseBufferCollectionRequest).read(),
);
}
Ok(())
}
}
unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<BufferCollectionId, D>>
fidl::encoding::Encode<CoordinatorReleaseBufferCollectionRequest, 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::<CoordinatorReleaseBufferCollectionRequest>(offset);
self.0.encode(encoder, offset + 0, depth)?;
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
for CoordinatorReleaseBufferCollectionRequest
{
#[inline(always)]
fn new_empty() -> Self {
Self { buffer_collection_id: fidl::new_empty!(BufferCollectionId, 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);
let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
unsafe {
std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 8);
}
Ok(())
}
}
impl fidl::encoding::ValueTypeMarker for CoordinatorReleaseEventRequest {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for CoordinatorReleaseEventRequest {
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
8
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
8
}
#[inline(always)]
fn encode_is_copy() -> bool {
true
}
#[inline(always)]
fn decode_is_copy() -> bool {
true
}
}
unsafe impl<D: fidl::encoding::ResourceDialect>
fidl::encoding::Encode<CoordinatorReleaseEventRequest, D>
for &CoordinatorReleaseEventRequest
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<CoordinatorReleaseEventRequest>(offset);
unsafe {
let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
(buf_ptr as *mut CoordinatorReleaseEventRequest)
.write_unaligned((self as *const CoordinatorReleaseEventRequest).read());
}
Ok(())
}
}
unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<EventId, D>>
fidl::encoding::Encode<CoordinatorReleaseEventRequest, 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::<CoordinatorReleaseEventRequest>(offset);
self.0.encode(encoder, offset + 0, depth)?;
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
for CoordinatorReleaseEventRequest
{
#[inline(always)]
fn new_empty() -> Self {
Self { id: fidl::new_empty!(EventId, 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);
let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
unsafe {
std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 8);
}
Ok(())
}
}
impl fidl::encoding::ValueTypeMarker for CoordinatorReleaseImageRequest {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for CoordinatorReleaseImageRequest {
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
8
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
8
}
#[inline(always)]
fn encode_is_copy() -> bool {
true
}
#[inline(always)]
fn decode_is_copy() -> bool {
true
}
}
unsafe impl<D: fidl::encoding::ResourceDialect>
fidl::encoding::Encode<CoordinatorReleaseImageRequest, D>
for &CoordinatorReleaseImageRequest
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<CoordinatorReleaseImageRequest>(offset);
unsafe {
let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
(buf_ptr as *mut CoordinatorReleaseImageRequest)
.write_unaligned((self as *const CoordinatorReleaseImageRequest).read());
}
Ok(())
}
}
unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<ImageId, D>>
fidl::encoding::Encode<CoordinatorReleaseImageRequest, 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::<CoordinatorReleaseImageRequest>(offset);
self.0.encode(encoder, offset + 0, depth)?;
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
for CoordinatorReleaseImageRequest
{
#[inline(always)]
fn new_empty() -> Self {
Self { image_id: fidl::new_empty!(ImageId, 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);
let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
unsafe {
std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 8);
}
Ok(())
}
}
impl fidl::encoding::ValueTypeMarker for CoordinatorSetBufferCollectionConstraintsRequest {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for CoordinatorSetBufferCollectionConstraintsRequest {
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
8
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
16
}
}
unsafe impl<D: fidl::encoding::ResourceDialect>
fidl::encoding::Encode<CoordinatorSetBufferCollectionConstraintsRequest, D>
for &CoordinatorSetBufferCollectionConstraintsRequest
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<CoordinatorSetBufferCollectionConstraintsRequest>(offset);
fidl::encoding::Encode::<CoordinatorSetBufferCollectionConstraintsRequest, D>::encode(
(
<BufferCollectionId as fidl::encoding::ValueTypeMarker>::borrow(&self.buffer_collection_id),
<fidl_fuchsia_hardware_display_types::ImageBufferUsage as fidl::encoding::ValueTypeMarker>::borrow(&self.buffer_usage),
),
encoder, offset, _depth
)
}
}
unsafe impl<
D: fidl::encoding::ResourceDialect,
T0: fidl::encoding::Encode<BufferCollectionId, D>,
T1: fidl::encoding::Encode<fidl_fuchsia_hardware_display_types::ImageBufferUsage, D>,
> fidl::encoding::Encode<CoordinatorSetBufferCollectionConstraintsRequest, D> for (T0, T1)
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<CoordinatorSetBufferCollectionConstraintsRequest>(offset);
unsafe {
let ptr = encoder.buf.as_mut_ptr().add(offset).offset(8);
(ptr as *mut u64).write_unaligned(0);
}
self.0.encode(encoder, offset + 0, depth)?;
self.1.encode(encoder, offset + 8, depth)?;
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
for CoordinatorSetBufferCollectionConstraintsRequest
{
#[inline(always)]
fn new_empty() -> Self {
Self {
buffer_collection_id: fidl::new_empty!(BufferCollectionId, D),
buffer_usage: fidl::new_empty!(
fidl_fuchsia_hardware_display_types::ImageBufferUsage,
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);
let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(8) };
let padval = unsafe { (ptr as *const u64).read_unaligned() };
let mask = 0xffffffff00000000u64;
let maskedval = padval & mask;
if maskedval != 0 {
return Err(fidl::Error::NonZeroPadding {
padding_start: offset + 8 + ((mask as u64).trailing_zeros() / 8) as usize,
});
}
fidl::decode!(
BufferCollectionId,
D,
&mut self.buffer_collection_id,
decoder,
offset + 0,
_depth
)?;
fidl::decode!(
fidl_fuchsia_hardware_display_types::ImageBufferUsage,
D,
&mut self.buffer_usage,
decoder,
offset + 8,
_depth
)?;
Ok(())
}
}
impl fidl::encoding::ValueTypeMarker for CoordinatorSetDisplayColorConversionRequest {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for CoordinatorSetDisplayColorConversionRequest {
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
8
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
72
}
}
unsafe impl<D: fidl::encoding::ResourceDialect>
fidl::encoding::Encode<CoordinatorSetDisplayColorConversionRequest, D>
for &CoordinatorSetDisplayColorConversionRequest
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<CoordinatorSetDisplayColorConversionRequest>(offset);
fidl::encoding::Encode::<CoordinatorSetDisplayColorConversionRequest, D>::encode(
(
<fidl_fuchsia_hardware_display_types::DisplayId as fidl::encoding::ValueTypeMarker>::borrow(&self.display_id),
<fidl::encoding::Array<f32, 3> as fidl::encoding::ValueTypeMarker>::borrow(&self.preoffsets),
<fidl::encoding::Array<f32, 9> as fidl::encoding::ValueTypeMarker>::borrow(&self.coefficients),
<fidl::encoding::Array<f32, 3> as fidl::encoding::ValueTypeMarker>::borrow(&self.postoffsets),
),
encoder, offset, _depth
)
}
}
unsafe impl<
D: fidl::encoding::ResourceDialect,
T0: fidl::encoding::Encode<fidl_fuchsia_hardware_display_types::DisplayId, D>,
T1: fidl::encoding::Encode<fidl::encoding::Array<f32, 3>, D>,
T2: fidl::encoding::Encode<fidl::encoding::Array<f32, 9>, D>,
T3: fidl::encoding::Encode<fidl::encoding::Array<f32, 3>, D>,
> fidl::encoding::Encode<CoordinatorSetDisplayColorConversionRequest, D>
for (T0, T1, T2, T3)
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<CoordinatorSetDisplayColorConversionRequest>(offset);
unsafe {
let ptr = encoder.buf.as_mut_ptr().add(offset).offset(64);
(ptr as *mut u64).write_unaligned(0);
}
self.0.encode(encoder, offset + 0, depth)?;
self.1.encode(encoder, offset + 8, depth)?;
self.2.encode(encoder, offset + 20, depth)?;
self.3.encode(encoder, offset + 56, depth)?;
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
for CoordinatorSetDisplayColorConversionRequest
{
#[inline(always)]
fn new_empty() -> Self {
Self {
display_id: fidl::new_empty!(fidl_fuchsia_hardware_display_types::DisplayId, D),
preoffsets: fidl::new_empty!(fidl::encoding::Array<f32, 3>, D),
coefficients: fidl::new_empty!(fidl::encoding::Array<f32, 9>, D),
postoffsets: fidl::new_empty!(fidl::encoding::Array<f32, 3>, 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);
let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(64) };
let padval = unsafe { (ptr as *const u64).read_unaligned() };
let mask = 0xffffffff00000000u64;
let maskedval = padval & mask;
if maskedval != 0 {
return Err(fidl::Error::NonZeroPadding {
padding_start: offset + 64 + ((mask as u64).trailing_zeros() / 8) as usize,
});
}
fidl::decode!(
fidl_fuchsia_hardware_display_types::DisplayId,
D,
&mut self.display_id,
decoder,
offset + 0,
_depth
)?;
fidl::decode!(fidl::encoding::Array<f32, 3>, D, &mut self.preoffsets, decoder, offset + 8, _depth)?;
fidl::decode!(fidl::encoding::Array<f32, 9>, D, &mut self.coefficients, decoder, offset + 20, _depth)?;
fidl::decode!(fidl::encoding::Array<f32, 3>, D, &mut self.postoffsets, decoder, offset + 56, _depth)?;
Ok(())
}
}
impl fidl::encoding::ValueTypeMarker for CoordinatorSetDisplayLayersRequest {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for CoordinatorSetDisplayLayersRequest {
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
8
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
24
}
}
unsafe impl<D: fidl::encoding::ResourceDialect>
fidl::encoding::Encode<CoordinatorSetDisplayLayersRequest, D>
for &CoordinatorSetDisplayLayersRequest
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<CoordinatorSetDisplayLayersRequest>(offset);
fidl::encoding::Encode::<CoordinatorSetDisplayLayersRequest, D>::encode(
(
<fidl_fuchsia_hardware_display_types::DisplayId as fidl::encoding::ValueTypeMarker>::borrow(&self.display_id),
<fidl::encoding::UnboundedVector<LayerId> as fidl::encoding::ValueTypeMarker>::borrow(&self.layer_ids),
),
encoder, offset, _depth
)
}
}
unsafe impl<
D: fidl::encoding::ResourceDialect,
T0: fidl::encoding::Encode<fidl_fuchsia_hardware_display_types::DisplayId, D>,
T1: fidl::encoding::Encode<fidl::encoding::UnboundedVector<LayerId>, D>,
> fidl::encoding::Encode<CoordinatorSetDisplayLayersRequest, D> for (T0, T1)
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<CoordinatorSetDisplayLayersRequest>(offset);
self.0.encode(encoder, offset + 0, depth)?;
self.1.encode(encoder, offset + 8, depth)?;
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
for CoordinatorSetDisplayLayersRequest
{
#[inline(always)]
fn new_empty() -> Self {
Self {
display_id: fidl::new_empty!(fidl_fuchsia_hardware_display_types::DisplayId, D),
layer_ids: fidl::new_empty!(fidl::encoding::UnboundedVector<LayerId>, 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);
fidl::decode!(
fidl_fuchsia_hardware_display_types::DisplayId,
D,
&mut self.display_id,
decoder,
offset + 0,
_depth
)?;
fidl::decode!(
fidl::encoding::UnboundedVector<LayerId>,
D,
&mut self.layer_ids,
decoder,
offset + 8,
_depth
)?;
Ok(())
}
}
impl fidl::encoding::ValueTypeMarker for CoordinatorSetDisplayModeRequest {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for CoordinatorSetDisplayModeRequest {
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
8
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
24
}
}
unsafe impl<D: fidl::encoding::ResourceDialect>
fidl::encoding::Encode<CoordinatorSetDisplayModeRequest, D>
for &CoordinatorSetDisplayModeRequest
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<CoordinatorSetDisplayModeRequest>(offset);
fidl::encoding::Encode::<CoordinatorSetDisplayModeRequest, D>::encode(
(
<fidl_fuchsia_hardware_display_types::DisplayId as fidl::encoding::ValueTypeMarker>::borrow(&self.display_id),
<fidl_fuchsia_hardware_display_types::Mode as fidl::encoding::ValueTypeMarker>::borrow(&self.mode),
),
encoder, offset, _depth
)
}
}
unsafe impl<
D: fidl::encoding::ResourceDialect,
T0: fidl::encoding::Encode<fidl_fuchsia_hardware_display_types::DisplayId, D>,
T1: fidl::encoding::Encode<fidl_fuchsia_hardware_display_types::Mode, D>,
> fidl::encoding::Encode<CoordinatorSetDisplayModeRequest, D> for (T0, T1)
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<CoordinatorSetDisplayModeRequest>(offset);
self.0.encode(encoder, offset + 0, depth)?;
self.1.encode(encoder, offset + 8, depth)?;
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
for CoordinatorSetDisplayModeRequest
{
#[inline(always)]
fn new_empty() -> Self {
Self {
display_id: fidl::new_empty!(fidl_fuchsia_hardware_display_types::DisplayId, D),
mode: fidl::new_empty!(fidl_fuchsia_hardware_display_types::Mode, 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);
fidl::decode!(
fidl_fuchsia_hardware_display_types::DisplayId,
D,
&mut self.display_id,
decoder,
offset + 0,
_depth
)?;
fidl::decode!(
fidl_fuchsia_hardware_display_types::Mode,
D,
&mut self.mode,
decoder,
offset + 8,
_depth
)?;
Ok(())
}
}
impl fidl::encoding::ValueTypeMarker for CoordinatorSetDisplayPowerRequest {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for CoordinatorSetDisplayPowerRequest {
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
8
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
16
}
}
unsafe impl<D: fidl::encoding::ResourceDialect>
fidl::encoding::Encode<CoordinatorSetDisplayPowerRequest, D>
for &CoordinatorSetDisplayPowerRequest
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<CoordinatorSetDisplayPowerRequest>(offset);
fidl::encoding::Encode::<CoordinatorSetDisplayPowerRequest, D>::encode(
(
<fidl_fuchsia_hardware_display_types::DisplayId as fidl::encoding::ValueTypeMarker>::borrow(&self.display_id),
<bool as fidl::encoding::ValueTypeMarker>::borrow(&self.power_on),
),
encoder, offset, _depth
)
}
}
unsafe impl<
D: fidl::encoding::ResourceDialect,
T0: fidl::encoding::Encode<fidl_fuchsia_hardware_display_types::DisplayId, D>,
T1: fidl::encoding::Encode<bool, D>,
> fidl::encoding::Encode<CoordinatorSetDisplayPowerRequest, D> for (T0, T1)
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<CoordinatorSetDisplayPowerRequest>(offset);
unsafe {
let ptr = encoder.buf.as_mut_ptr().add(offset).offset(8);
(ptr as *mut u64).write_unaligned(0);
}
self.0.encode(encoder, offset + 0, depth)?;
self.1.encode(encoder, offset + 8, depth)?;
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
for CoordinatorSetDisplayPowerRequest
{
#[inline(always)]
fn new_empty() -> Self {
Self {
display_id: fidl::new_empty!(fidl_fuchsia_hardware_display_types::DisplayId, D),
power_on: fidl::new_empty!(bool, 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);
let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(8) };
let padval = unsafe { (ptr as *const u64).read_unaligned() };
let mask = 0xffffffffffffff00u64;
let maskedval = padval & mask;
if maskedval != 0 {
return Err(fidl::Error::NonZeroPadding {
padding_start: offset + 8 + ((mask as u64).trailing_zeros() / 8) as usize,
});
}
fidl::decode!(
fidl_fuchsia_hardware_display_types::DisplayId,
D,
&mut self.display_id,
decoder,
offset + 0,
_depth
)?;
fidl::decode!(bool, D, &mut self.power_on, decoder, offset + 8, _depth)?;
Ok(())
}
}
impl fidl::encoding::ValueTypeMarker for CoordinatorSetLayerColorConfigRequest {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for CoordinatorSetLayerColorConfigRequest {
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
8
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
24
}
}
unsafe impl<D: fidl::encoding::ResourceDialect>
fidl::encoding::Encode<CoordinatorSetLayerColorConfigRequest, D>
for &CoordinatorSetLayerColorConfigRequest
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<CoordinatorSetLayerColorConfigRequest>(offset);
fidl::encoding::Encode::<CoordinatorSetLayerColorConfigRequest, D>::encode(
(
<LayerId as fidl::encoding::ValueTypeMarker>::borrow(&self.layer_id),
<fidl_fuchsia_hardware_display_types::Color as fidl::encoding::ValueTypeMarker>::borrow(&self.color),
),
encoder, offset, _depth
)
}
}
unsafe impl<
D: fidl::encoding::ResourceDialect,
T0: fidl::encoding::Encode<LayerId, D>,
T1: fidl::encoding::Encode<fidl_fuchsia_hardware_display_types::Color, D>,
> fidl::encoding::Encode<CoordinatorSetLayerColorConfigRequest, D> for (T0, T1)
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<CoordinatorSetLayerColorConfigRequest>(offset);
unsafe {
let ptr = encoder.buf.as_mut_ptr().add(offset).offset(16);
(ptr as *mut u64).write_unaligned(0);
}
self.0.encode(encoder, offset + 0, depth)?;
self.1.encode(encoder, offset + 8, depth)?;
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
for CoordinatorSetLayerColorConfigRequest
{
#[inline(always)]
fn new_empty() -> Self {
Self {
layer_id: fidl::new_empty!(LayerId, D),
color: fidl::new_empty!(fidl_fuchsia_hardware_display_types::Color, 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);
let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(16) };
let padval = unsafe { (ptr as *const u64).read_unaligned() };
let mask = 0xffffffff00000000u64;
let maskedval = padval & mask;
if maskedval != 0 {
return Err(fidl::Error::NonZeroPadding {
padding_start: offset + 16 + ((mask as u64).trailing_zeros() / 8) as usize,
});
}
fidl::decode!(LayerId, D, &mut self.layer_id, decoder, offset + 0, _depth)?;
fidl::decode!(
fidl_fuchsia_hardware_display_types::Color,
D,
&mut self.color,
decoder,
offset + 8,
_depth
)?;
Ok(())
}
}
impl fidl::encoding::ValueTypeMarker for CoordinatorSetLayerImage2Request {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for CoordinatorSetLayerImage2Request {
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
8
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
24
}
#[inline(always)]
fn encode_is_copy() -> bool {
true
}
#[inline(always)]
fn decode_is_copy() -> bool {
true
}
}
unsafe impl<D: fidl::encoding::ResourceDialect>
fidl::encoding::Encode<CoordinatorSetLayerImage2Request, D>
for &CoordinatorSetLayerImage2Request
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<CoordinatorSetLayerImage2Request>(offset);
unsafe {
let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
(buf_ptr as *mut CoordinatorSetLayerImage2Request)
.write_unaligned((self as *const CoordinatorSetLayerImage2Request).read());
}
Ok(())
}
}
unsafe impl<
D: fidl::encoding::ResourceDialect,
T0: fidl::encoding::Encode<LayerId, D>,
T1: fidl::encoding::Encode<ImageId, D>,
T2: fidl::encoding::Encode<EventId, D>,
> fidl::encoding::Encode<CoordinatorSetLayerImage2Request, D> for (T0, T1, T2)
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<CoordinatorSetLayerImage2Request>(offset);
self.0.encode(encoder, offset + 0, depth)?;
self.1.encode(encoder, offset + 8, depth)?;
self.2.encode(encoder, offset + 16, depth)?;
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
for CoordinatorSetLayerImage2Request
{
#[inline(always)]
fn new_empty() -> Self {
Self {
layer_id: fidl::new_empty!(LayerId, D),
image_id: fidl::new_empty!(ImageId, D),
wait_event_id: fidl::new_empty!(EventId, 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);
let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
unsafe {
std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 24);
}
Ok(())
}
}
impl fidl::encoding::ValueTypeMarker for CoordinatorSetLayerPrimaryAlphaRequest {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for CoordinatorSetLayerPrimaryAlphaRequest {
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
8
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
16
}
}
unsafe impl<D: fidl::encoding::ResourceDialect>
fidl::encoding::Encode<CoordinatorSetLayerPrimaryAlphaRequest, D>
for &CoordinatorSetLayerPrimaryAlphaRequest
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<CoordinatorSetLayerPrimaryAlphaRequest>(offset);
fidl::encoding::Encode::<CoordinatorSetLayerPrimaryAlphaRequest, D>::encode(
(
<LayerId as fidl::encoding::ValueTypeMarker>::borrow(&self.layer_id),
<fidl_fuchsia_hardware_display_types::AlphaMode as fidl::encoding::ValueTypeMarker>::borrow(&self.mode),
<f32 as fidl::encoding::ValueTypeMarker>::borrow(&self.val),
),
encoder, offset, _depth
)
}
}
unsafe impl<
D: fidl::encoding::ResourceDialect,
T0: fidl::encoding::Encode<LayerId, D>,
T1: fidl::encoding::Encode<fidl_fuchsia_hardware_display_types::AlphaMode, D>,
T2: fidl::encoding::Encode<f32, D>,
> fidl::encoding::Encode<CoordinatorSetLayerPrimaryAlphaRequest, D> for (T0, T1, T2)
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<CoordinatorSetLayerPrimaryAlphaRequest>(offset);
unsafe {
let ptr = encoder.buf.as_mut_ptr().add(offset).offset(8);
(ptr as *mut u64).write_unaligned(0);
}
self.0.encode(encoder, offset + 0, depth)?;
self.1.encode(encoder, offset + 8, depth)?;
self.2.encode(encoder, offset + 12, depth)?;
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
for CoordinatorSetLayerPrimaryAlphaRequest
{
#[inline(always)]
fn new_empty() -> Self {
Self {
layer_id: fidl::new_empty!(LayerId, D),
mode: fidl::new_empty!(fidl_fuchsia_hardware_display_types::AlphaMode, D),
val: fidl::new_empty!(f32, 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);
let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(8) };
let padval = unsafe { (ptr as *const u64).read_unaligned() };
let mask = 0xffffff00u64;
let maskedval = padval & mask;
if maskedval != 0 {
return Err(fidl::Error::NonZeroPadding {
padding_start: offset + 8 + ((mask as u64).trailing_zeros() / 8) as usize,
});
}
fidl::decode!(LayerId, D, &mut self.layer_id, decoder, offset + 0, _depth)?;
fidl::decode!(
fidl_fuchsia_hardware_display_types::AlphaMode,
D,
&mut self.mode,
decoder,
offset + 8,
_depth
)?;
fidl::decode!(f32, D, &mut self.val, decoder, offset + 12, _depth)?;
Ok(())
}
}
impl fidl::encoding::ValueTypeMarker for CoordinatorSetLayerPrimaryConfigRequest {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for CoordinatorSetLayerPrimaryConfigRequest {
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
8
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
24
}
}
unsafe impl<D: fidl::encoding::ResourceDialect>
fidl::encoding::Encode<CoordinatorSetLayerPrimaryConfigRequest, D>
for &CoordinatorSetLayerPrimaryConfigRequest
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<CoordinatorSetLayerPrimaryConfigRequest>(offset);
fidl::encoding::Encode::<CoordinatorSetLayerPrimaryConfigRequest, D>::encode(
(
<LayerId as fidl::encoding::ValueTypeMarker>::borrow(&self.layer_id),
<fidl_fuchsia_hardware_display_types::ImageMetadata as fidl::encoding::ValueTypeMarker>::borrow(&self.image_metadata),
),
encoder, offset, _depth
)
}
}
unsafe impl<
D: fidl::encoding::ResourceDialect,
T0: fidl::encoding::Encode<LayerId, D>,
T1: fidl::encoding::Encode<fidl_fuchsia_hardware_display_types::ImageMetadata, D>,
> fidl::encoding::Encode<CoordinatorSetLayerPrimaryConfigRequest, D> for (T0, T1)
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<CoordinatorSetLayerPrimaryConfigRequest>(offset);
unsafe {
let ptr = encoder.buf.as_mut_ptr().add(offset).offset(16);
(ptr as *mut u64).write_unaligned(0);
}
self.0.encode(encoder, offset + 0, depth)?;
self.1.encode(encoder, offset + 8, depth)?;
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
for CoordinatorSetLayerPrimaryConfigRequest
{
#[inline(always)]
fn new_empty() -> Self {
Self {
layer_id: fidl::new_empty!(LayerId, D),
image_metadata: fidl::new_empty!(
fidl_fuchsia_hardware_display_types::ImageMetadata,
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);
let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(16) };
let padval = unsafe { (ptr as *const u64).read_unaligned() };
let mask = 0xffffffff00000000u64;
let maskedval = padval & mask;
if maskedval != 0 {
return Err(fidl::Error::NonZeroPadding {
padding_start: offset + 16 + ((mask as u64).trailing_zeros() / 8) as usize,
});
}
fidl::decode!(LayerId, D, &mut self.layer_id, decoder, offset + 0, _depth)?;
fidl::decode!(
fidl_fuchsia_hardware_display_types::ImageMetadata,
D,
&mut self.image_metadata,
decoder,
offset + 8,
_depth
)?;
Ok(())
}
}
impl fidl::encoding::ValueTypeMarker for CoordinatorSetLayerPrimaryPositionRequest {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for CoordinatorSetLayerPrimaryPositionRequest {
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
8
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
48
}
}
unsafe impl<D: fidl::encoding::ResourceDialect>
fidl::encoding::Encode<CoordinatorSetLayerPrimaryPositionRequest, D>
for &CoordinatorSetLayerPrimaryPositionRequest
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<CoordinatorSetLayerPrimaryPositionRequest>(offset);
fidl::encoding::Encode::<CoordinatorSetLayerPrimaryPositionRequest, D>::encode(
(
<LayerId as fidl::encoding::ValueTypeMarker>::borrow(&self.layer_id),
<fidl_fuchsia_hardware_display_types::CoordinateTransformation as fidl::encoding::ValueTypeMarker>::borrow(&self.image_source_transformation),
<fidl_fuchsia_math::RectU as fidl::encoding::ValueTypeMarker>::borrow(&self.image_source),
<fidl_fuchsia_math::RectU as fidl::encoding::ValueTypeMarker>::borrow(&self.display_destination),
),
encoder, offset, _depth
)
}
}
unsafe impl<
D: fidl::encoding::ResourceDialect,
T0: fidl::encoding::Encode<LayerId, D>,
T1: fidl::encoding::Encode<
fidl_fuchsia_hardware_display_types::CoordinateTransformation,
D,
>,
T2: fidl::encoding::Encode<fidl_fuchsia_math::RectU, D>,
T3: fidl::encoding::Encode<fidl_fuchsia_math::RectU, D>,
> fidl::encoding::Encode<CoordinatorSetLayerPrimaryPositionRequest, D>
for (T0, T1, T2, T3)
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<CoordinatorSetLayerPrimaryPositionRequest>(offset);
unsafe {
let ptr = encoder.buf.as_mut_ptr().add(offset).offset(8);
(ptr as *mut u64).write_unaligned(0);
}
unsafe {
let ptr = encoder.buf.as_mut_ptr().add(offset).offset(40);
(ptr as *mut u64).write_unaligned(0);
}
self.0.encode(encoder, offset + 0, depth)?;
self.1.encode(encoder, offset + 8, depth)?;
self.2.encode(encoder, offset + 12, depth)?;
self.3.encode(encoder, offset + 28, depth)?;
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
for CoordinatorSetLayerPrimaryPositionRequest
{
#[inline(always)]
fn new_empty() -> Self {
Self {
layer_id: fidl::new_empty!(LayerId, D),
image_source_transformation: fidl::new_empty!(
fidl_fuchsia_hardware_display_types::CoordinateTransformation,
D
),
image_source: fidl::new_empty!(fidl_fuchsia_math::RectU, D),
display_destination: fidl::new_empty!(fidl_fuchsia_math::RectU, 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);
let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(8) };
let padval = unsafe { (ptr as *const u64).read_unaligned() };
let mask = 0xffffff00u64;
let maskedval = padval & mask;
if maskedval != 0 {
return Err(fidl::Error::NonZeroPadding {
padding_start: offset + 8 + ((mask as u64).trailing_zeros() / 8) as usize,
});
}
let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(40) };
let padval = unsafe { (ptr as *const u64).read_unaligned() };
let mask = 0xffffffff00000000u64;
let maskedval = padval & mask;
if maskedval != 0 {
return Err(fidl::Error::NonZeroPadding {
padding_start: offset + 40 + ((mask as u64).trailing_zeros() / 8) as usize,
});
}
fidl::decode!(LayerId, D, &mut self.layer_id, decoder, offset + 0, _depth)?;
fidl::decode!(
fidl_fuchsia_hardware_display_types::CoordinateTransformation,
D,
&mut self.image_source_transformation,
decoder,
offset + 8,
_depth
)?;
fidl::decode!(
fidl_fuchsia_math::RectU,
D,
&mut self.image_source,
decoder,
offset + 12,
_depth
)?;
fidl::decode!(
fidl_fuchsia_math::RectU,
D,
&mut self.display_destination,
decoder,
offset + 28,
_depth
)?;
Ok(())
}
}
impl fidl::encoding::ValueTypeMarker for CoordinatorSetMinimumRgbRequest {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for CoordinatorSetMinimumRgbRequest {
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
}
#[inline(always)]
fn encode_is_copy() -> bool {
true
}
#[inline(always)]
fn decode_is_copy() -> bool {
true
}
}
unsafe impl<D: fidl::encoding::ResourceDialect>
fidl::encoding::Encode<CoordinatorSetMinimumRgbRequest, D>
for &CoordinatorSetMinimumRgbRequest
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<CoordinatorSetMinimumRgbRequest>(offset);
unsafe {
let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
(buf_ptr as *mut CoordinatorSetMinimumRgbRequest)
.write_unaligned((self as *const CoordinatorSetMinimumRgbRequest).read());
}
Ok(())
}
}
unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<u8, D>>
fidl::encoding::Encode<CoordinatorSetMinimumRgbRequest, 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::<CoordinatorSetMinimumRgbRequest>(offset);
self.0.encode(encoder, offset + 0, depth)?;
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
for CoordinatorSetMinimumRgbRequest
{
#[inline(always)]
fn new_empty() -> Self {
Self { minimum_rgb: fidl::new_empty!(u8, 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);
let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
unsafe {
std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 1);
}
Ok(())
}
}
impl fidl::encoding::ValueTypeMarker for CoordinatorSetVirtconModeRequest {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for CoordinatorSetVirtconModeRequest {
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<CoordinatorSetVirtconModeRequest, D>
for &CoordinatorSetVirtconModeRequest
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<CoordinatorSetVirtconModeRequest>(offset);
fidl::encoding::Encode::<CoordinatorSetVirtconModeRequest, D>::encode(
(<VirtconMode as fidl::encoding::ValueTypeMarker>::borrow(&self.mode),),
encoder,
offset,
_depth,
)
}
}
unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<VirtconMode, D>>
fidl::encoding::Encode<CoordinatorSetVirtconModeRequest, 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::<CoordinatorSetVirtconModeRequest>(offset);
self.0.encode(encoder, offset + 0, depth)?;
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
for CoordinatorSetVirtconModeRequest
{
#[inline(always)]
fn new_empty() -> Self {
Self { mode: fidl::new_empty!(VirtconMode, 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);
fidl::decode!(VirtconMode, D, &mut self.mode, decoder, offset + 0, _depth)?;
Ok(())
}
}
impl fidl::encoding::ValueTypeMarker for CoordinatorStartCaptureRequest {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for CoordinatorStartCaptureRequest {
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
8
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
16
}
#[inline(always)]
fn encode_is_copy() -> bool {
true
}
#[inline(always)]
fn decode_is_copy() -> bool {
true
}
}
unsafe impl<D: fidl::encoding::ResourceDialect>
fidl::encoding::Encode<CoordinatorStartCaptureRequest, D>
for &CoordinatorStartCaptureRequest
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<CoordinatorStartCaptureRequest>(offset);
unsafe {
let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
(buf_ptr as *mut CoordinatorStartCaptureRequest)
.write_unaligned((self as *const CoordinatorStartCaptureRequest).read());
}
Ok(())
}
}
unsafe impl<
D: fidl::encoding::ResourceDialect,
T0: fidl::encoding::Encode<EventId, D>,
T1: fidl::encoding::Encode<ImageId, D>,
> fidl::encoding::Encode<CoordinatorStartCaptureRequest, D> for (T0, T1)
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<CoordinatorStartCaptureRequest>(offset);
self.0.encode(encoder, offset + 0, depth)?;
self.1.encode(encoder, offset + 8, depth)?;
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
for CoordinatorStartCaptureRequest
{
#[inline(always)]
fn new_empty() -> Self {
Self {
signal_event_id: fidl::new_empty!(EventId, D),
image_id: fidl::new_empty!(ImageId, 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);
let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
unsafe {
std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 16);
}
Ok(())
}
}
impl fidl::encoding::ValueTypeMarker for CoordinatorCreateLayerResponse {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for CoordinatorCreateLayerResponse {
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
8
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
8
}
#[inline(always)]
fn encode_is_copy() -> bool {
true
}
#[inline(always)]
fn decode_is_copy() -> bool {
true
}
}
unsafe impl<D: fidl::encoding::ResourceDialect>
fidl::encoding::Encode<CoordinatorCreateLayerResponse, D>
for &CoordinatorCreateLayerResponse
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<CoordinatorCreateLayerResponse>(offset);
unsafe {
let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
(buf_ptr as *mut CoordinatorCreateLayerResponse)
.write_unaligned((self as *const CoordinatorCreateLayerResponse).read());
}
Ok(())
}
}
unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<LayerId, D>>
fidl::encoding::Encode<CoordinatorCreateLayerResponse, 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::<CoordinatorCreateLayerResponse>(offset);
self.0.encode(encoder, offset + 0, depth)?;
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
for CoordinatorCreateLayerResponse
{
#[inline(always)]
fn new_empty() -> Self {
Self { layer_id: fidl::new_empty!(LayerId, 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);
let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
unsafe {
std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 8);
}
Ok(())
}
}
impl fidl::encoding::ValueTypeMarker for CoordinatorIsCaptureSupportedResponse {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for CoordinatorIsCaptureSupportedResponse {
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<CoordinatorIsCaptureSupportedResponse, D>
for &CoordinatorIsCaptureSupportedResponse
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<CoordinatorIsCaptureSupportedResponse>(offset);
fidl::encoding::Encode::<CoordinatorIsCaptureSupportedResponse, D>::encode(
(<bool as fidl::encoding::ValueTypeMarker>::borrow(&self.supported),),
encoder,
offset,
_depth,
)
}
}
unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<bool, D>>
fidl::encoding::Encode<CoordinatorIsCaptureSupportedResponse, 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::<CoordinatorIsCaptureSupportedResponse>(offset);
self.0.encode(encoder, offset + 0, depth)?;
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
for CoordinatorIsCaptureSupportedResponse
{
#[inline(always)]
fn new_empty() -> Self {
Self { supported: fidl::new_empty!(bool, 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);
fidl::decode!(bool, D, &mut self.supported, decoder, offset + 0, _depth)?;
Ok(())
}
}
impl fidl::encoding::ValueTypeMarker for EventId {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for EventId {
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
8
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
8
}
#[inline(always)]
fn encode_is_copy() -> bool {
true
}
#[inline(always)]
fn decode_is_copy() -> bool {
true
}
}
unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<EventId, D> for &EventId {
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<EventId>(offset);
unsafe {
let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
(buf_ptr as *mut EventId).write_unaligned((self as *const EventId).read());
}
Ok(())
}
}
unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<u64, D>>
fidl::encoding::Encode<EventId, 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::<EventId>(offset);
self.0.encode(encoder, offset + 0, depth)?;
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for EventId {
#[inline(always)]
fn new_empty() -> Self {
Self { value: fidl::new_empty!(u64, 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);
let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
unsafe {
std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 8);
}
Ok(())
}
}
impl fidl::encoding::ValueTypeMarker for ImageId {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for ImageId {
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
8
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
8
}
#[inline(always)]
fn encode_is_copy() -> bool {
true
}
#[inline(always)]
fn decode_is_copy() -> bool {
true
}
}
unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<ImageId, D> for &ImageId {
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<ImageId>(offset);
unsafe {
let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
(buf_ptr as *mut ImageId).write_unaligned((self as *const ImageId).read());
}
Ok(())
}
}
unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<u64, D>>
fidl::encoding::Encode<ImageId, 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::<ImageId>(offset);
self.0.encode(encoder, offset + 0, depth)?;
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for ImageId {
#[inline(always)]
fn new_empty() -> Self {
Self { value: fidl::new_empty!(u64, 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);
let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
unsafe {
std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 8);
}
Ok(())
}
}
impl fidl::encoding::ValueTypeMarker for Info {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for Info {
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
8
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
104
}
}
unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Info, D> for &Info {
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<Info>(offset);
fidl::encoding::Encode::<Info, D>::encode(
(
<fidl_fuchsia_hardware_display_types::DisplayId as fidl::encoding::ValueTypeMarker>::borrow(&self.id),
<fidl::encoding::UnboundedVector<fidl_fuchsia_hardware_display_types::Mode> as fidl::encoding::ValueTypeMarker>::borrow(&self.modes),
<fidl::encoding::UnboundedVector<fidl_fuchsia_images2::PixelFormat> as fidl::encoding::ValueTypeMarker>::borrow(&self.pixel_format),
<fidl::encoding::BoundedString<128> as fidl::encoding::ValueTypeMarker>::borrow(&self.manufacturer_name),
<fidl::encoding::BoundedString<128> as fidl::encoding::ValueTypeMarker>::borrow(&self.monitor_name),
<fidl::encoding::BoundedString<128> as fidl::encoding::ValueTypeMarker>::borrow(&self.monitor_serial),
<u32 as fidl::encoding::ValueTypeMarker>::borrow(&self.horizontal_size_mm),
<u32 as fidl::encoding::ValueTypeMarker>::borrow(&self.vertical_size_mm),
<bool as fidl::encoding::ValueTypeMarker>::borrow(&self.using_fallback_size),
),
encoder, offset, _depth
)
}
}
unsafe impl<
D: fidl::encoding::ResourceDialect,
T0: fidl::encoding::Encode<fidl_fuchsia_hardware_display_types::DisplayId, D>,
T1: fidl::encoding::Encode<
fidl::encoding::UnboundedVector<fidl_fuchsia_hardware_display_types::Mode>,
D,
>,
T2: fidl::encoding::Encode<
fidl::encoding::UnboundedVector<fidl_fuchsia_images2::PixelFormat>,
D,
>,
T3: fidl::encoding::Encode<fidl::encoding::BoundedString<128>, D>,
T4: fidl::encoding::Encode<fidl::encoding::BoundedString<128>, D>,
T5: fidl::encoding::Encode<fidl::encoding::BoundedString<128>, D>,
T6: fidl::encoding::Encode<u32, D>,
T7: fidl::encoding::Encode<u32, D>,
T8: fidl::encoding::Encode<bool, D>,
> fidl::encoding::Encode<Info, D> for (T0, T1, T2, T3, T4, T5, T6, T7, T8)
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<Info>(offset);
unsafe {
let ptr = encoder.buf.as_mut_ptr().add(offset).offset(96);
(ptr as *mut u64).write_unaligned(0);
}
self.0.encode(encoder, offset + 0, depth)?;
self.1.encode(encoder, offset + 8, depth)?;
self.2.encode(encoder, offset + 24, depth)?;
self.3.encode(encoder, offset + 40, depth)?;
self.4.encode(encoder, offset + 56, depth)?;
self.5.encode(encoder, offset + 72, depth)?;
self.6.encode(encoder, offset + 88, depth)?;
self.7.encode(encoder, offset + 92, depth)?;
self.8.encode(encoder, offset + 96, depth)?;
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for Info {
#[inline(always)]
fn new_empty() -> Self {
Self {
id: fidl::new_empty!(fidl_fuchsia_hardware_display_types::DisplayId, D),
modes: fidl::new_empty!(
fidl::encoding::UnboundedVector<fidl_fuchsia_hardware_display_types::Mode>,
D
),
pixel_format: fidl::new_empty!(
fidl::encoding::UnboundedVector<fidl_fuchsia_images2::PixelFormat>,
D
),
manufacturer_name: fidl::new_empty!(fidl::encoding::BoundedString<128>, D),
monitor_name: fidl::new_empty!(fidl::encoding::BoundedString<128>, D),
monitor_serial: fidl::new_empty!(fidl::encoding::BoundedString<128>, D),
horizontal_size_mm: fidl::new_empty!(u32, D),
vertical_size_mm: fidl::new_empty!(u32, D),
using_fallback_size: fidl::new_empty!(bool, 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);
let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(96) };
let padval = unsafe { (ptr as *const u64).read_unaligned() };
let mask = 0xffffffffffffff00u64;
let maskedval = padval & mask;
if maskedval != 0 {
return Err(fidl::Error::NonZeroPadding {
padding_start: offset + 96 + ((mask as u64).trailing_zeros() / 8) as usize,
});
}
fidl::decode!(
fidl_fuchsia_hardware_display_types::DisplayId,
D,
&mut self.id,
decoder,
offset + 0,
_depth
)?;
fidl::decode!(
fidl::encoding::UnboundedVector<fidl_fuchsia_hardware_display_types::Mode>,
D,
&mut self.modes,
decoder,
offset + 8,
_depth
)?;
fidl::decode!(
fidl::encoding::UnboundedVector<fidl_fuchsia_images2::PixelFormat>,
D,
&mut self.pixel_format,
decoder,
offset + 24,
_depth
)?;
fidl::decode!(
fidl::encoding::BoundedString<128>,
D,
&mut self.manufacturer_name,
decoder,
offset + 40,
_depth
)?;
fidl::decode!(
fidl::encoding::BoundedString<128>,
D,
&mut self.monitor_name,
decoder,
offset + 56,
_depth
)?;
fidl::decode!(
fidl::encoding::BoundedString<128>,
D,
&mut self.monitor_serial,
decoder,
offset + 72,
_depth
)?;
fidl::decode!(u32, D, &mut self.horizontal_size_mm, decoder, offset + 88, _depth)?;
fidl::decode!(u32, D, &mut self.vertical_size_mm, decoder, offset + 92, _depth)?;
fidl::decode!(bool, D, &mut self.using_fallback_size, decoder, offset + 96, _depth)?;
Ok(())
}
}
impl fidl::encoding::ValueTypeMarker for LayerId {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for LayerId {
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
8
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
8
}
#[inline(always)]
fn encode_is_copy() -> bool {
true
}
#[inline(always)]
fn decode_is_copy() -> bool {
true
}
}
unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<LayerId, D> for &LayerId {
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<LayerId>(offset);
unsafe {
let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
(buf_ptr as *mut LayerId).write_unaligned((self as *const LayerId).read());
}
Ok(())
}
}
unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<u64, D>>
fidl::encoding::Encode<LayerId, 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::<LayerId>(offset);
self.0.encode(encoder, offset + 0, depth)?;
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for LayerId {
#[inline(always)]
fn new_empty() -> Self {
Self { value: fidl::new_empty!(u64, 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);
let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
unsafe {
std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 8);
}
Ok(())
}
}
impl fidl::encoding::ValueTypeMarker for VsyncAckCookie {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for VsyncAckCookie {
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
8
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
8
}
#[inline(always)]
fn encode_is_copy() -> bool {
true
}
#[inline(always)]
fn decode_is_copy() -> bool {
true
}
}
unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<VsyncAckCookie, D>
for &VsyncAckCookie
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<VsyncAckCookie>(offset);
unsafe {
let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
(buf_ptr as *mut VsyncAckCookie)
.write_unaligned((self as *const VsyncAckCookie).read());
}
Ok(())
}
}
unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<u64, D>>
fidl::encoding::Encode<VsyncAckCookie, 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::<VsyncAckCookie>(offset);
self.0.encode(encoder, offset + 0, depth)?;
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for VsyncAckCookie {
#[inline(always)]
fn new_empty() -> Self {
Self { value: fidl::new_empty!(u64, 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);
let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
unsafe {
std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 8);
}
Ok(())
}
}
impl CoordinatorApplyConfig3Request {
#[inline(always)]
fn max_ordinal_present(&self) -> u64 {
if let Some(_) = self.stamp {
return 1;
}
0
}
}
impl fidl::encoding::ResourceTypeMarker for CoordinatorApplyConfig3Request {
type Borrowed<'a> = &'a mut Self;
fn take_or_borrow<'a>(
value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
) -> Self::Borrowed<'a> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for CoordinatorApplyConfig3Request {
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
8
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
16
}
}
unsafe impl
fidl::encoding::Encode<
CoordinatorApplyConfig3Request,
fidl::encoding::DefaultFuchsiaResourceDialect,
> for &mut CoordinatorApplyConfig3Request
{
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<
'_,
fidl::encoding::DefaultFuchsiaResourceDialect,
>,
offset: usize,
mut depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<CoordinatorApplyConfig3Request>(offset);
let max_ordinal: u64 = self.max_ordinal_present();
encoder.write_num(max_ordinal, offset);
encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
if max_ordinal == 0 {
return Ok(());
}
depth.increment()?;
let envelope_size = 8;
let bytes_len = max_ordinal as usize * envelope_size;
#[allow(unused_variables)]
let offset = encoder.out_of_line_offset(bytes_len);
let mut _prev_end_offset: usize = 0;
if 1 > max_ordinal {
return Ok(());
}
let cur_offset: usize = (1 - 1) * envelope_size;
encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
fidl::encoding::encode_in_envelope_optional::<fidl_fuchsia_hardware_display_types::ConfigStamp, fidl::encoding::DefaultFuchsiaResourceDialect>(
self.stamp.as_ref().map(<fidl_fuchsia_hardware_display_types::ConfigStamp as fidl::encoding::ValueTypeMarker>::borrow),
encoder, offset + cur_offset, depth
)?;
_prev_end_offset = cur_offset + envelope_size;
Ok(())
}
}
impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
for CoordinatorApplyConfig3Request
{
#[inline(always)]
fn new_empty() -> Self {
Self::default()
}
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<
'_,
fidl::encoding::DefaultFuchsiaResourceDialect,
>,
offset: usize,
mut depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
None => return Err(fidl::Error::NotNullable),
Some(len) => len,
};
if len == 0 {
return Ok(());
};
depth.increment()?;
let envelope_size = 8;
let bytes_len = len * envelope_size;
let offset = decoder.out_of_line_offset(bytes_len)?;
let mut _next_ordinal_to_read = 0;
let mut next_offset = offset;
let end_offset = offset + bytes_len;
_next_ordinal_to_read += 1;
if next_offset >= end_offset {
return Ok(());
}
while _next_ordinal_to_read < 1 {
fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
_next_ordinal_to_read += 1;
next_offset += envelope_size;
}
let next_out_of_line = decoder.next_out_of_line();
let handles_before = decoder.remaining_handles();
if let Some((inlined, num_bytes, num_handles)) =
fidl::encoding::decode_envelope_header(decoder, next_offset)?
{
let member_inline_size = <fidl_fuchsia_hardware_display_types::ConfigStamp as fidl::encoding::TypeMarker>::inline_size(decoder.context);
if inlined != (member_inline_size <= 4) {
return Err(fidl::Error::InvalidInlineBitInEnvelope);
}
let inner_offset;
let mut inner_depth = depth.clone();
if inlined {
decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
inner_offset = next_offset;
} else {
inner_offset = decoder.out_of_line_offset(member_inline_size)?;
inner_depth.increment()?;
}
let val_ref = self.stamp.get_or_insert_with(|| {
fidl::new_empty!(
fidl_fuchsia_hardware_display_types::ConfigStamp,
fidl::encoding::DefaultFuchsiaResourceDialect
)
});
fidl::decode!(
fidl_fuchsia_hardware_display_types::ConfigStamp,
fidl::encoding::DefaultFuchsiaResourceDialect,
val_ref,
decoder,
inner_offset,
inner_depth
)?;
if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
{
return Err(fidl::Error::InvalidNumBytesInEnvelope);
}
if handles_before != decoder.remaining_handles() + (num_handles as usize) {
return Err(fidl::Error::InvalidNumHandlesInEnvelope);
}
}
next_offset += envelope_size;
while next_offset < end_offset {
_next_ordinal_to_read += 1;
fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
next_offset += envelope_size;
}
Ok(())
}
}
impl ProviderOpenCoordinatorWithListenerForPrimaryRequest {
#[inline(always)]
fn max_ordinal_present(&self) -> u64 {
if let Some(_) = self.coordinator_listener {
return 2;
}
if let Some(_) = self.coordinator {
return 1;
}
0
}
}
impl fidl::encoding::ResourceTypeMarker for ProviderOpenCoordinatorWithListenerForPrimaryRequest {
type Borrowed<'a> = &'a mut Self;
fn take_or_borrow<'a>(
value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
) -> Self::Borrowed<'a> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for ProviderOpenCoordinatorWithListenerForPrimaryRequest {
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
8
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
16
}
}
unsafe impl
fidl::encoding::Encode<
ProviderOpenCoordinatorWithListenerForPrimaryRequest,
fidl::encoding::DefaultFuchsiaResourceDialect,
> for &mut ProviderOpenCoordinatorWithListenerForPrimaryRequest
{
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<
'_,
fidl::encoding::DefaultFuchsiaResourceDialect,
>,
offset: usize,
mut depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder
.debug_check_bounds::<ProviderOpenCoordinatorWithListenerForPrimaryRequest>(offset);
let max_ordinal: u64 = self.max_ordinal_present();
encoder.write_num(max_ordinal, offset);
encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
if max_ordinal == 0 {
return Ok(());
}
depth.increment()?;
let envelope_size = 8;
let bytes_len = max_ordinal as usize * envelope_size;
#[allow(unused_variables)]
let offset = encoder.out_of_line_offset(bytes_len);
let mut _prev_end_offset: usize = 0;
if 1 > max_ordinal {
return Ok(());
}
let cur_offset: usize = (1 - 1) * envelope_size;
encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
fidl::encoding::encode_in_envelope_optional::<fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<CoordinatorMarker>>, fidl::encoding::DefaultFuchsiaResourceDialect>(
self.coordinator.as_mut().map(<fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<CoordinatorMarker>> as fidl::encoding::ResourceTypeMarker>::take_or_borrow),
encoder, offset + cur_offset, depth
)?;
_prev_end_offset = cur_offset + envelope_size;
if 2 > max_ordinal {
return Ok(());
}
let cur_offset: usize = (2 - 1) * envelope_size;
encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
fidl::encoding::encode_in_envelope_optional::<fidl::encoding::Endpoint<fidl::endpoints::ClientEnd<CoordinatorListenerMarker>>, fidl::encoding::DefaultFuchsiaResourceDialect>(
self.coordinator_listener.as_mut().map(<fidl::encoding::Endpoint<fidl::endpoints::ClientEnd<CoordinatorListenerMarker>> as fidl::encoding::ResourceTypeMarker>::take_or_borrow),
encoder, offset + cur_offset, depth
)?;
_prev_end_offset = cur_offset + envelope_size;
Ok(())
}
}
impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
for ProviderOpenCoordinatorWithListenerForPrimaryRequest
{
#[inline(always)]
fn new_empty() -> Self {
Self::default()
}
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<
'_,
fidl::encoding::DefaultFuchsiaResourceDialect,
>,
offset: usize,
mut depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
None => return Err(fidl::Error::NotNullable),
Some(len) => len,
};
if len == 0 {
return Ok(());
};
depth.increment()?;
let envelope_size = 8;
let bytes_len = len * envelope_size;
let offset = decoder.out_of_line_offset(bytes_len)?;
let mut _next_ordinal_to_read = 0;
let mut next_offset = offset;
let end_offset = offset + bytes_len;
_next_ordinal_to_read += 1;
if next_offset >= end_offset {
return Ok(());
}
while _next_ordinal_to_read < 1 {
fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
_next_ordinal_to_read += 1;
next_offset += envelope_size;
}
let next_out_of_line = decoder.next_out_of_line();
let handles_before = decoder.remaining_handles();
if let Some((inlined, num_bytes, num_handles)) =
fidl::encoding::decode_envelope_header(decoder, next_offset)?
{
let member_inline_size = <fidl::encoding::Endpoint<
fidl::endpoints::ServerEnd<CoordinatorMarker>,
> as fidl::encoding::TypeMarker>::inline_size(
decoder.context
);
if inlined != (member_inline_size <= 4) {
return Err(fidl::Error::InvalidInlineBitInEnvelope);
}
let inner_offset;
let mut inner_depth = depth.clone();
if inlined {
decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
inner_offset = next_offset;
} else {
inner_offset = decoder.out_of_line_offset(member_inline_size)?;
inner_depth.increment()?;
}
let val_ref = self.coordinator.get_or_insert_with(|| {
fidl::new_empty!(
fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<CoordinatorMarker>>,
fidl::encoding::DefaultFuchsiaResourceDialect
)
});
fidl::decode!(
fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<CoordinatorMarker>>,
fidl::encoding::DefaultFuchsiaResourceDialect,
val_ref,
decoder,
inner_offset,
inner_depth
)?;
if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
{
return Err(fidl::Error::InvalidNumBytesInEnvelope);
}
if handles_before != decoder.remaining_handles() + (num_handles as usize) {
return Err(fidl::Error::InvalidNumHandlesInEnvelope);
}
}
next_offset += envelope_size;
_next_ordinal_to_read += 1;
if next_offset >= end_offset {
return Ok(());
}
while _next_ordinal_to_read < 2 {
fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
_next_ordinal_to_read += 1;
next_offset += envelope_size;
}
let next_out_of_line = decoder.next_out_of_line();
let handles_before = decoder.remaining_handles();
if let Some((inlined, num_bytes, num_handles)) =
fidl::encoding::decode_envelope_header(decoder, next_offset)?
{
let member_inline_size = <fidl::encoding::Endpoint<
fidl::endpoints::ClientEnd<CoordinatorListenerMarker>,
> as fidl::encoding::TypeMarker>::inline_size(
decoder.context
);
if inlined != (member_inline_size <= 4) {
return Err(fidl::Error::InvalidInlineBitInEnvelope);
}
let inner_offset;
let mut inner_depth = depth.clone();
if inlined {
decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
inner_offset = next_offset;
} else {
inner_offset = decoder.out_of_line_offset(member_inline_size)?;
inner_depth.increment()?;
}
let val_ref = self.coordinator_listener.get_or_insert_with(|| {
fidl::new_empty!(
fidl::encoding::Endpoint<
fidl::endpoints::ClientEnd<CoordinatorListenerMarker>,
>,
fidl::encoding::DefaultFuchsiaResourceDialect
)
});
fidl::decode!(
fidl::encoding::Endpoint<fidl::endpoints::ClientEnd<CoordinatorListenerMarker>>,
fidl::encoding::DefaultFuchsiaResourceDialect,
val_ref,
decoder,
inner_offset,
inner_depth
)?;
if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
{
return Err(fidl::Error::InvalidNumBytesInEnvelope);
}
if handles_before != decoder.remaining_handles() + (num_handles as usize) {
return Err(fidl::Error::InvalidNumHandlesInEnvelope);
}
}
next_offset += envelope_size;
while next_offset < end_offset {
_next_ordinal_to_read += 1;
fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
next_offset += envelope_size;
}
Ok(())
}
}
impl ProviderOpenCoordinatorWithListenerForVirtconRequest {
#[inline(always)]
fn max_ordinal_present(&self) -> u64 {
if let Some(_) = self.coordinator_listener {
return 2;
}
if let Some(_) = self.coordinator {
return 1;
}
0
}
}
impl fidl::encoding::ResourceTypeMarker for ProviderOpenCoordinatorWithListenerForVirtconRequest {
type Borrowed<'a> = &'a mut Self;
fn take_or_borrow<'a>(
value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
) -> Self::Borrowed<'a> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for ProviderOpenCoordinatorWithListenerForVirtconRequest {
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
8
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
16
}
}
unsafe impl
fidl::encoding::Encode<
ProviderOpenCoordinatorWithListenerForVirtconRequest,
fidl::encoding::DefaultFuchsiaResourceDialect,
> for &mut ProviderOpenCoordinatorWithListenerForVirtconRequest
{
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<
'_,
fidl::encoding::DefaultFuchsiaResourceDialect,
>,
offset: usize,
mut depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder
.debug_check_bounds::<ProviderOpenCoordinatorWithListenerForVirtconRequest>(offset);
let max_ordinal: u64 = self.max_ordinal_present();
encoder.write_num(max_ordinal, offset);
encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
if max_ordinal == 0 {
return Ok(());
}
depth.increment()?;
let envelope_size = 8;
let bytes_len = max_ordinal as usize * envelope_size;
#[allow(unused_variables)]
let offset = encoder.out_of_line_offset(bytes_len);
let mut _prev_end_offset: usize = 0;
if 1 > max_ordinal {
return Ok(());
}
let cur_offset: usize = (1 - 1) * envelope_size;
encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
fidl::encoding::encode_in_envelope_optional::<fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<CoordinatorMarker>>, fidl::encoding::DefaultFuchsiaResourceDialect>(
self.coordinator.as_mut().map(<fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<CoordinatorMarker>> as fidl::encoding::ResourceTypeMarker>::take_or_borrow),
encoder, offset + cur_offset, depth
)?;
_prev_end_offset = cur_offset + envelope_size;
if 2 > max_ordinal {
return Ok(());
}
let cur_offset: usize = (2 - 1) * envelope_size;
encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
fidl::encoding::encode_in_envelope_optional::<fidl::encoding::Endpoint<fidl::endpoints::ClientEnd<CoordinatorListenerMarker>>, fidl::encoding::DefaultFuchsiaResourceDialect>(
self.coordinator_listener.as_mut().map(<fidl::encoding::Endpoint<fidl::endpoints::ClientEnd<CoordinatorListenerMarker>> as fidl::encoding::ResourceTypeMarker>::take_or_borrow),
encoder, offset + cur_offset, depth
)?;
_prev_end_offset = cur_offset + envelope_size;
Ok(())
}
}
impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
for ProviderOpenCoordinatorWithListenerForVirtconRequest
{
#[inline(always)]
fn new_empty() -> Self {
Self::default()
}
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<
'_,
fidl::encoding::DefaultFuchsiaResourceDialect,
>,
offset: usize,
mut depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
None => return Err(fidl::Error::NotNullable),
Some(len) => len,
};
if len == 0 {
return Ok(());
};
depth.increment()?;
let envelope_size = 8;
let bytes_len = len * envelope_size;
let offset = decoder.out_of_line_offset(bytes_len)?;
let mut _next_ordinal_to_read = 0;
let mut next_offset = offset;
let end_offset = offset + bytes_len;
_next_ordinal_to_read += 1;
if next_offset >= end_offset {
return Ok(());
}
while _next_ordinal_to_read < 1 {
fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
_next_ordinal_to_read += 1;
next_offset += envelope_size;
}
let next_out_of_line = decoder.next_out_of_line();
let handles_before = decoder.remaining_handles();
if let Some((inlined, num_bytes, num_handles)) =
fidl::encoding::decode_envelope_header(decoder, next_offset)?
{
let member_inline_size = <fidl::encoding::Endpoint<
fidl::endpoints::ServerEnd<CoordinatorMarker>,
> as fidl::encoding::TypeMarker>::inline_size(
decoder.context
);
if inlined != (member_inline_size <= 4) {
return Err(fidl::Error::InvalidInlineBitInEnvelope);
}
let inner_offset;
let mut inner_depth = depth.clone();
if inlined {
decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
inner_offset = next_offset;
} else {
inner_offset = decoder.out_of_line_offset(member_inline_size)?;
inner_depth.increment()?;
}
let val_ref = self.coordinator.get_or_insert_with(|| {
fidl::new_empty!(
fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<CoordinatorMarker>>,
fidl::encoding::DefaultFuchsiaResourceDialect
)
});
fidl::decode!(
fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<CoordinatorMarker>>,
fidl::encoding::DefaultFuchsiaResourceDialect,
val_ref,
decoder,
inner_offset,
inner_depth
)?;
if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
{
return Err(fidl::Error::InvalidNumBytesInEnvelope);
}
if handles_before != decoder.remaining_handles() + (num_handles as usize) {
return Err(fidl::Error::InvalidNumHandlesInEnvelope);
}
}
next_offset += envelope_size;
_next_ordinal_to_read += 1;
if next_offset >= end_offset {
return Ok(());
}
while _next_ordinal_to_read < 2 {
fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
_next_ordinal_to_read += 1;
next_offset += envelope_size;
}
let next_out_of_line = decoder.next_out_of_line();
let handles_before = decoder.remaining_handles();
if let Some((inlined, num_bytes, num_handles)) =
fidl::encoding::decode_envelope_header(decoder, next_offset)?
{
let member_inline_size = <fidl::encoding::Endpoint<
fidl::endpoints::ClientEnd<CoordinatorListenerMarker>,
> as fidl::encoding::TypeMarker>::inline_size(
decoder.context
);
if inlined != (member_inline_size <= 4) {
return Err(fidl::Error::InvalidInlineBitInEnvelope);
}
let inner_offset;
let mut inner_depth = depth.clone();
if inlined {
decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
inner_offset = next_offset;
} else {
inner_offset = decoder.out_of_line_offset(member_inline_size)?;
inner_depth.increment()?;
}
let val_ref = self.coordinator_listener.get_or_insert_with(|| {
fidl::new_empty!(
fidl::encoding::Endpoint<
fidl::endpoints::ClientEnd<CoordinatorListenerMarker>,
>,
fidl::encoding::DefaultFuchsiaResourceDialect
)
});
fidl::decode!(
fidl::encoding::Endpoint<fidl::endpoints::ClientEnd<CoordinatorListenerMarker>>,
fidl::encoding::DefaultFuchsiaResourceDialect,
val_ref,
decoder,
inner_offset,
inner_depth
)?;
if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
{
return Err(fidl::Error::InvalidNumBytesInEnvelope);
}
if handles_before != decoder.remaining_handles() + (num_handles as usize) {
return Err(fidl::Error::InvalidNumHandlesInEnvelope);
}
}
next_offset += envelope_size;
while next_offset < end_offset {
_next_ordinal_to_read += 1;
fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
next_offset += envelope_size;
}
Ok(())
}
}
}