#![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 const SERVER_SUITE_VERSION: u64 = 1;
bitflags! {
#[derive(Clone, Copy, Debug, Default, PartialEq, Eq, PartialOrd, Ord, Hash)]
pub struct TeardownReason: u32 {
const PEER_CLOSED = 1;
const VOLUNTARY_SHUTDOWN = 2;
const INCOMPATIBLE_FORMAT = 4;
const UNEXPECTED_MESSAGE = 8;
const ENCODE_FAILURE = 16;
const DECODE_FAILURE = 32;
const WRITE_FAILURE = 64;
}
}
impl TeardownReason {
#[deprecated = "Strict bits should not use `has_unknown_bits`"]
#[inline(always)]
pub fn has_unknown_bits(&self) -> bool {
false
}
#[deprecated = "Strict bits should not use `get_unknown_bits`"]
#[inline(always)]
pub fn get_unknown_bits(&self) -> u32 {
0
}
}
#[derive(Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd, Hash)]
#[repr(u32)]
pub enum StartError {
TestDisabled = 1,
}
impl StartError {
#[inline]
pub fn from_primitive(prim: u32) -> Option<Self> {
match prim {
1 => Some(Self::TestDisabled),
_ => None,
}
}
#[inline]
pub const fn into_primitive(self) -> u32 {
self as u32
}
#[deprecated = "Strict enums should not use `is_unknown`"]
#[inline]
pub fn is_unknown(&self) -> bool {
false
}
}
#[derive(Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd, Hash)]
pub enum Test {
Setup,
IgnoreDisabled,
OneWayNoPayload,
TwoWayNoPayload,
TwoWayResultWithPayload,
TwoWayResultWithError,
TwoWayStructPayload,
TwoWayTablePayload,
TwoWayUnionPayload,
OneWayWithNonZeroTxid,
TwoWayNoPayloadWithZeroTxid,
UnknownOrdinalCausesClose,
BadMagicNumberCausesClose,
IgnoresUnrecognizedAtRestFlags,
IgnoresUnrecognizedDynamicFlags,
BadPayloadEncoding,
V1TwoWayNoPayload,
V1TwoWayStructPayload,
EventSendingDoNotReportPeerClosed,
ReplySendingDoNotReportPeerClosed,
ReceiveOneWayNoPayloadFromPeerClosedChannel,
ServerTearsDownWhenPeerClosed,
ClientSendsTooFewHandles,
ClientSendsWrongHandleType,
ClientSendsTooManyRights,
ClientSendsTooFewRights,
ClientSendsObjectOverPlainHandle,
ServerSendsWrongHandleType,
ServerSendsTooManyRights,
ServerSendsTooFewRights,
ServerSendsEpitaph,
ServerReceivesEpitaphInvalid,
RequestMatchesByteLimit,
RequestMatchesHandleLimit,
ResponseMatchesByteLimit,
ResponseMatchesHandleLimit,
ResponseExceedsByteLimit,
ResponseExceedsHandleLimit,
SendStrictEvent,
SendFlexibleEvent,
ReceiveStrictOneWay,
ReceiveStrictOneWayMismatchedStrictness,
ReceiveFlexibleOneWay,
ReceiveFlexibleOneWayMismatchedStrictness,
StrictTwoWayResponse,
StrictTwoWayResponseMismatchedStrictness,
StrictTwoWayNonEmptyResponse,
StrictTwoWayErrorSyntaxResponse,
StrictTwoWayErrorSyntaxResponseMismatchedStrictness,
StrictTwoWayErrorSyntaxNonEmptyResponse,
FlexibleTwoWayResponse,
FlexibleTwoWayResponseMismatchedStrictness,
FlexibleTwoWayNonEmptyResponse,
FlexibleTwoWayErrorSyntaxResponseSuccessResult,
FlexibleTwoWayErrorSyntaxResponseErrorResult,
FlexibleTwoWayErrorSyntaxNonEmptyResponseSuccessResult,
FlexibleTwoWayErrorSyntaxNonEmptyResponseErrorResult,
UnknownStrictOneWayOpenProtocol,
UnknownFlexibleOneWayOpenProtocol,
UnknownFlexibleOneWayHandleOpenProtocol,
UnknownStrictTwoWayOpenProtocol,
UnknownFlexibleTwoWayOpenProtocol,
UnknownFlexibleTwoWayHandleOpenProtocol,
UnknownStrictOneWayAjarProtocol,
UnknownFlexibleOneWayAjarProtocol,
UnknownStrictTwoWayAjarProtocol,
UnknownFlexibleTwoWayAjarProtocol,
UnknownStrictOneWayClosedProtocol,
UnknownFlexibleOneWayClosedProtocol,
UnknownStrictTwoWayClosedProtocol,
UnknownFlexibleTwoWayClosedProtocol,
#[doc(hidden)]
__SourceBreaking {
unknown_ordinal: u32,
},
}
#[macro_export]
macro_rules! TestUnknown {
() => {
_
};
}
impl Test {
#[inline]
pub fn from_primitive(prim: u32) -> Option<Self> {
match prim {
1 => Some(Self::Setup),
107 => Some(Self::IgnoreDisabled),
2 => Some(Self::OneWayNoPayload),
3 => Some(Self::TwoWayNoPayload),
4 => Some(Self::TwoWayResultWithPayload),
5 => Some(Self::TwoWayResultWithError),
6 => Some(Self::TwoWayStructPayload),
7 => Some(Self::TwoWayTablePayload),
8 => Some(Self::TwoWayUnionPayload),
9 => Some(Self::OneWayWithNonZeroTxid),
10 => Some(Self::TwoWayNoPayloadWithZeroTxid),
11 => Some(Self::UnknownOrdinalCausesClose),
12 => Some(Self::BadMagicNumberCausesClose),
13 => Some(Self::IgnoresUnrecognizedAtRestFlags),
14 => Some(Self::IgnoresUnrecognizedDynamicFlags),
15 => Some(Self::BadPayloadEncoding),
105 => Some(Self::V1TwoWayNoPayload),
106 => Some(Self::V1TwoWayStructPayload),
109 => Some(Self::EventSendingDoNotReportPeerClosed),
110 => Some(Self::ReplySendingDoNotReportPeerClosed),
111 => Some(Self::ReceiveOneWayNoPayloadFromPeerClosedChannel),
113 => Some(Self::ServerTearsDownWhenPeerClosed),
16 => Some(Self::ClientSendsTooFewHandles),
17 => Some(Self::ClientSendsWrongHandleType),
18 => Some(Self::ClientSendsTooManyRights),
19 => Some(Self::ClientSendsTooFewRights),
20 => Some(Self::ClientSendsObjectOverPlainHandle),
21 => Some(Self::ServerSendsWrongHandleType),
22 => Some(Self::ServerSendsTooManyRights),
23 => Some(Self::ServerSendsTooFewRights),
24 => Some(Self::ServerSendsEpitaph),
25 => Some(Self::ServerReceivesEpitaphInvalid),
26 => Some(Self::RequestMatchesByteLimit),
27 => Some(Self::RequestMatchesHandleLimit),
28 => Some(Self::ResponseMatchesByteLimit),
29 => Some(Self::ResponseMatchesHandleLimit),
30 => Some(Self::ResponseExceedsByteLimit),
31 => Some(Self::ResponseExceedsHandleLimit),
32 => Some(Self::SendStrictEvent),
33 => Some(Self::SendFlexibleEvent),
34 => Some(Self::ReceiveStrictOneWay),
35 => Some(Self::ReceiveStrictOneWayMismatchedStrictness),
36 => Some(Self::ReceiveFlexibleOneWay),
37 => Some(Self::ReceiveFlexibleOneWayMismatchedStrictness),
38 => Some(Self::StrictTwoWayResponse),
39 => Some(Self::StrictTwoWayResponseMismatchedStrictness),
63 => Some(Self::StrictTwoWayNonEmptyResponse),
40 => Some(Self::StrictTwoWayErrorSyntaxResponse),
41 => Some(Self::StrictTwoWayErrorSyntaxResponseMismatchedStrictness),
64 => Some(Self::StrictTwoWayErrorSyntaxNonEmptyResponse),
42 => Some(Self::FlexibleTwoWayResponse),
43 => Some(Self::FlexibleTwoWayResponseMismatchedStrictness),
44 => Some(Self::FlexibleTwoWayNonEmptyResponse),
45 => Some(Self::FlexibleTwoWayErrorSyntaxResponseSuccessResult),
46 => Some(Self::FlexibleTwoWayErrorSyntaxResponseErrorResult),
47 => Some(Self::FlexibleTwoWayErrorSyntaxNonEmptyResponseSuccessResult),
48 => Some(Self::FlexibleTwoWayErrorSyntaxNonEmptyResponseErrorResult),
49 => Some(Self::UnknownStrictOneWayOpenProtocol),
50 => Some(Self::UnknownFlexibleOneWayOpenProtocol),
51 => Some(Self::UnknownFlexibleOneWayHandleOpenProtocol),
52 => Some(Self::UnknownStrictTwoWayOpenProtocol),
53 => Some(Self::UnknownFlexibleTwoWayOpenProtocol),
54 => Some(Self::UnknownFlexibleTwoWayHandleOpenProtocol),
55 => Some(Self::UnknownStrictOneWayAjarProtocol),
56 => Some(Self::UnknownFlexibleOneWayAjarProtocol),
57 => Some(Self::UnknownStrictTwoWayAjarProtocol),
58 => Some(Self::UnknownFlexibleTwoWayAjarProtocol),
59 => Some(Self::UnknownStrictOneWayClosedProtocol),
60 => Some(Self::UnknownFlexibleOneWayClosedProtocol),
61 => Some(Self::UnknownStrictTwoWayClosedProtocol),
62 => Some(Self::UnknownFlexibleTwoWayClosedProtocol),
_ => None,
}
}
#[inline]
pub fn from_primitive_allow_unknown(prim: u32) -> Self {
match prim {
1 => Self::Setup,
107 => Self::IgnoreDisabled,
2 => Self::OneWayNoPayload,
3 => Self::TwoWayNoPayload,
4 => Self::TwoWayResultWithPayload,
5 => Self::TwoWayResultWithError,
6 => Self::TwoWayStructPayload,
7 => Self::TwoWayTablePayload,
8 => Self::TwoWayUnionPayload,
9 => Self::OneWayWithNonZeroTxid,
10 => Self::TwoWayNoPayloadWithZeroTxid,
11 => Self::UnknownOrdinalCausesClose,
12 => Self::BadMagicNumberCausesClose,
13 => Self::IgnoresUnrecognizedAtRestFlags,
14 => Self::IgnoresUnrecognizedDynamicFlags,
15 => Self::BadPayloadEncoding,
105 => Self::V1TwoWayNoPayload,
106 => Self::V1TwoWayStructPayload,
109 => Self::EventSendingDoNotReportPeerClosed,
110 => Self::ReplySendingDoNotReportPeerClosed,
111 => Self::ReceiveOneWayNoPayloadFromPeerClosedChannel,
113 => Self::ServerTearsDownWhenPeerClosed,
16 => Self::ClientSendsTooFewHandles,
17 => Self::ClientSendsWrongHandleType,
18 => Self::ClientSendsTooManyRights,
19 => Self::ClientSendsTooFewRights,
20 => Self::ClientSendsObjectOverPlainHandle,
21 => Self::ServerSendsWrongHandleType,
22 => Self::ServerSendsTooManyRights,
23 => Self::ServerSendsTooFewRights,
24 => Self::ServerSendsEpitaph,
25 => Self::ServerReceivesEpitaphInvalid,
26 => Self::RequestMatchesByteLimit,
27 => Self::RequestMatchesHandleLimit,
28 => Self::ResponseMatchesByteLimit,
29 => Self::ResponseMatchesHandleLimit,
30 => Self::ResponseExceedsByteLimit,
31 => Self::ResponseExceedsHandleLimit,
32 => Self::SendStrictEvent,
33 => Self::SendFlexibleEvent,
34 => Self::ReceiveStrictOneWay,
35 => Self::ReceiveStrictOneWayMismatchedStrictness,
36 => Self::ReceiveFlexibleOneWay,
37 => Self::ReceiveFlexibleOneWayMismatchedStrictness,
38 => Self::StrictTwoWayResponse,
39 => Self::StrictTwoWayResponseMismatchedStrictness,
63 => Self::StrictTwoWayNonEmptyResponse,
40 => Self::StrictTwoWayErrorSyntaxResponse,
41 => Self::StrictTwoWayErrorSyntaxResponseMismatchedStrictness,
64 => Self::StrictTwoWayErrorSyntaxNonEmptyResponse,
42 => Self::FlexibleTwoWayResponse,
43 => Self::FlexibleTwoWayResponseMismatchedStrictness,
44 => Self::FlexibleTwoWayNonEmptyResponse,
45 => Self::FlexibleTwoWayErrorSyntaxResponseSuccessResult,
46 => Self::FlexibleTwoWayErrorSyntaxResponseErrorResult,
47 => Self::FlexibleTwoWayErrorSyntaxNonEmptyResponseSuccessResult,
48 => Self::FlexibleTwoWayErrorSyntaxNonEmptyResponseErrorResult,
49 => Self::UnknownStrictOneWayOpenProtocol,
50 => Self::UnknownFlexibleOneWayOpenProtocol,
51 => Self::UnknownFlexibleOneWayHandleOpenProtocol,
52 => Self::UnknownStrictTwoWayOpenProtocol,
53 => Self::UnknownFlexibleTwoWayOpenProtocol,
54 => Self::UnknownFlexibleTwoWayHandleOpenProtocol,
55 => Self::UnknownStrictOneWayAjarProtocol,
56 => Self::UnknownFlexibleOneWayAjarProtocol,
57 => Self::UnknownStrictTwoWayAjarProtocol,
58 => Self::UnknownFlexibleTwoWayAjarProtocol,
59 => Self::UnknownStrictOneWayClosedProtocol,
60 => Self::UnknownFlexibleOneWayClosedProtocol,
61 => Self::UnknownStrictTwoWayClosedProtocol,
62 => Self::UnknownFlexibleTwoWayClosedProtocol,
unknown_ordinal => Self::__SourceBreaking { unknown_ordinal },
}
}
#[inline]
pub fn unknown() -> Self {
Self::__SourceBreaking { unknown_ordinal: 0xffffffff }
}
#[inline]
pub const fn into_primitive(self) -> u32 {
match self {
Self::Setup => 1,
Self::IgnoreDisabled => 107,
Self::OneWayNoPayload => 2,
Self::TwoWayNoPayload => 3,
Self::TwoWayResultWithPayload => 4,
Self::TwoWayResultWithError => 5,
Self::TwoWayStructPayload => 6,
Self::TwoWayTablePayload => 7,
Self::TwoWayUnionPayload => 8,
Self::OneWayWithNonZeroTxid => 9,
Self::TwoWayNoPayloadWithZeroTxid => 10,
Self::UnknownOrdinalCausesClose => 11,
Self::BadMagicNumberCausesClose => 12,
Self::IgnoresUnrecognizedAtRestFlags => 13,
Self::IgnoresUnrecognizedDynamicFlags => 14,
Self::BadPayloadEncoding => 15,
Self::V1TwoWayNoPayload => 105,
Self::V1TwoWayStructPayload => 106,
Self::EventSendingDoNotReportPeerClosed => 109,
Self::ReplySendingDoNotReportPeerClosed => 110,
Self::ReceiveOneWayNoPayloadFromPeerClosedChannel => 111,
Self::ServerTearsDownWhenPeerClosed => 113,
Self::ClientSendsTooFewHandles => 16,
Self::ClientSendsWrongHandleType => 17,
Self::ClientSendsTooManyRights => 18,
Self::ClientSendsTooFewRights => 19,
Self::ClientSendsObjectOverPlainHandle => 20,
Self::ServerSendsWrongHandleType => 21,
Self::ServerSendsTooManyRights => 22,
Self::ServerSendsTooFewRights => 23,
Self::ServerSendsEpitaph => 24,
Self::ServerReceivesEpitaphInvalid => 25,
Self::RequestMatchesByteLimit => 26,
Self::RequestMatchesHandleLimit => 27,
Self::ResponseMatchesByteLimit => 28,
Self::ResponseMatchesHandleLimit => 29,
Self::ResponseExceedsByteLimit => 30,
Self::ResponseExceedsHandleLimit => 31,
Self::SendStrictEvent => 32,
Self::SendFlexibleEvent => 33,
Self::ReceiveStrictOneWay => 34,
Self::ReceiveStrictOneWayMismatchedStrictness => 35,
Self::ReceiveFlexibleOneWay => 36,
Self::ReceiveFlexibleOneWayMismatchedStrictness => 37,
Self::StrictTwoWayResponse => 38,
Self::StrictTwoWayResponseMismatchedStrictness => 39,
Self::StrictTwoWayNonEmptyResponse => 63,
Self::StrictTwoWayErrorSyntaxResponse => 40,
Self::StrictTwoWayErrorSyntaxResponseMismatchedStrictness => 41,
Self::StrictTwoWayErrorSyntaxNonEmptyResponse => 64,
Self::FlexibleTwoWayResponse => 42,
Self::FlexibleTwoWayResponseMismatchedStrictness => 43,
Self::FlexibleTwoWayNonEmptyResponse => 44,
Self::FlexibleTwoWayErrorSyntaxResponseSuccessResult => 45,
Self::FlexibleTwoWayErrorSyntaxResponseErrorResult => 46,
Self::FlexibleTwoWayErrorSyntaxNonEmptyResponseSuccessResult => 47,
Self::FlexibleTwoWayErrorSyntaxNonEmptyResponseErrorResult => 48,
Self::UnknownStrictOneWayOpenProtocol => 49,
Self::UnknownFlexibleOneWayOpenProtocol => 50,
Self::UnknownFlexibleOneWayHandleOpenProtocol => 51,
Self::UnknownStrictTwoWayOpenProtocol => 52,
Self::UnknownFlexibleTwoWayOpenProtocol => 53,
Self::UnknownFlexibleTwoWayHandleOpenProtocol => 54,
Self::UnknownStrictOneWayAjarProtocol => 55,
Self::UnknownFlexibleOneWayAjarProtocol => 56,
Self::UnknownStrictTwoWayAjarProtocol => 57,
Self::UnknownFlexibleTwoWayAjarProtocol => 58,
Self::UnknownStrictOneWayClosedProtocol => 59,
Self::UnknownFlexibleOneWayClosedProtocol => 60,
Self::UnknownStrictTwoWayClosedProtocol => 61,
Self::UnknownFlexibleTwoWayClosedProtocol => 62,
Self::__SourceBreaking { unknown_ordinal } => unknown_ordinal,
}
}
#[inline]
pub fn is_unknown(&self) -> bool {
match self {
Self::__SourceBreaking { unknown_ordinal: _ } => true,
_ => false,
}
}
}
#[derive(Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd, Hash)]
#[repr(u32)]
pub enum UnknownMethodType {
OneWay = 1,
TwoWay = 2,
}
impl UnknownMethodType {
#[inline]
pub fn from_primitive(prim: u32) -> Option<Self> {
match prim {
1 => Some(Self::OneWay),
2 => Some(Self::TwoWay),
_ => None,
}
}
#[inline]
pub const fn into_primitive(self) -> u32 {
self as u32
}
#[deprecated = "Strict enums should not use `is_unknown`"]
#[inline]
pub fn is_unknown(&self) -> bool {
false
}
}
#[derive(Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
pub struct ClosedTargetByteVectorSizeRequest {
pub vec: Vec<u8>,
}
impl fidl::Persistable for ClosedTargetByteVectorSizeRequest {}
#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
#[repr(C)]
pub struct ClosedTargetByteVectorSizeResponse {
pub n: u32,
}
impl fidl::Persistable for ClosedTargetByteVectorSizeResponse {}
#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
#[repr(C)]
pub struct ClosedTargetCreateNByteVectorRequest {
pub n: u32,
}
impl fidl::Persistable for ClosedTargetCreateNByteVectorRequest {}
#[derive(Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
pub struct ClosedTargetCreateNByteVectorResponse {
pub vec: Vec<u8>,
}
impl fidl::Persistable for ClosedTargetCreateNByteVectorResponse {}
#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
#[repr(C)]
pub struct ClosedTargetCreateNHandleVectorRequest {
pub n: u32,
}
impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
for ClosedTargetCreateNHandleVectorRequest
{
}
#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
pub struct ClosedTargetCreateNHandleVectorResponse {
pub vec: Vec<fidl::Event>,
}
impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
for ClosedTargetCreateNHandleVectorResponse
{
}
#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
pub struct ClosedTargetEchoAsTransferableSignalableEventRequest {
pub handle: fidl::Handle,
}
impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
for ClosedTargetEchoAsTransferableSignalableEventRequest
{
}
#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
pub struct ClosedTargetEchoAsTransferableSignalableEventResponse {
pub handle: fidl::Event,
}
impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
for ClosedTargetEchoAsTransferableSignalableEventResponse
{
}
#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
pub struct ClosedTargetGetHandleRightsRequest {
pub handle: fidl::Handle,
}
impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
for ClosedTargetGetHandleRightsRequest
{
}
#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
pub struct ClosedTargetGetHandleRightsResponse {
pub rights: fidl::Rights,
}
impl fidl::Persistable for ClosedTargetGetHandleRightsResponse {}
#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
pub struct ClosedTargetGetSignalableEventRightsRequest {
pub handle: fidl::Event,
}
impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
for ClosedTargetGetSignalableEventRightsRequest
{
}
#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
pub struct ClosedTargetGetSignalableEventRightsResponse {
pub rights: fidl::Rights,
}
impl fidl::Persistable for ClosedTargetGetSignalableEventRightsResponse {}
#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
pub struct ClosedTargetHandleVectorSizeRequest {
pub vec: Vec<fidl::Event>,
}
impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
for ClosedTargetHandleVectorSizeRequest
{
}
#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
#[repr(C)]
pub struct ClosedTargetHandleVectorSizeResponse {
pub n: u32,
}
impl fidl::Persistable for ClosedTargetHandleVectorSizeResponse {}
#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
#[repr(C)]
pub struct ClosedTargetTwoWayStructPayloadRequest {
pub v: i8,
}
impl fidl::Persistable for ClosedTargetTwoWayStructPayloadRequest {}
#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
#[repr(C)]
pub struct ClosedTargetTwoWayStructPayloadResponse {
pub v: i8,
}
impl fidl::Persistable for ClosedTargetTwoWayStructPayloadResponse {}
#[derive(Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
pub struct ClosedTargetTwoWayResultResponse {
pub payload: String,
}
impl fidl::Persistable for ClosedTargetTwoWayResultResponse {}
#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
pub struct Empty;
impl fidl::Persistable for Empty {}
#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
#[repr(C)]
pub struct OpenTargetFlexibleTwoWayFieldsRequest {
pub reply_with: i32,
}
impl fidl::Persistable for OpenTargetFlexibleTwoWayFieldsRequest {}
#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
#[repr(C)]
pub struct OpenTargetStrictTwoWayFieldsRequest {
pub reply_with: i32,
}
impl fidl::Persistable for OpenTargetStrictTwoWayFieldsRequest {}
#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
#[repr(C)]
pub struct OpenTargetStrictTwoWayFieldsResponse {
pub some_field: i32,
}
impl fidl::Persistable for OpenTargetStrictTwoWayFieldsResponse {}
#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
#[repr(C)]
pub struct OpenTargetFlexibleTwoWayFieldsErrResponse {
pub some_field: i32,
}
impl fidl::Persistable for OpenTargetFlexibleTwoWayFieldsErrResponse {}
#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
#[repr(C)]
pub struct OpenTargetFlexibleTwoWayFieldsResponse {
pub some_field: i32,
}
impl fidl::Persistable for OpenTargetFlexibleTwoWayFieldsResponse {}
#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
#[repr(C)]
pub struct OpenTargetStrictTwoWayFieldsErrResponse {
pub some_field: i32,
}
impl fidl::Persistable for OpenTargetStrictTwoWayFieldsErrResponse {}
#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
#[repr(C)]
pub struct RunnerGetVersionResponse {
pub version: u64,
}
impl fidl::Persistable for RunnerGetVersionResponse {}
#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
pub struct RunnerOnTeardownRequest {
pub reason: TeardownReason,
}
impl fidl::Persistable for RunnerOnTeardownRequest {}
#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
#[repr(C)]
pub struct RunnerShutdownWithEpitaphRequest {
pub epitaph_status: i32,
}
impl fidl::Persistable for RunnerShutdownWithEpitaphRequest {}
#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
pub struct RunnerStartRequest {
pub test: Test,
pub any_target: AnyTarget,
}
impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect> for RunnerStartRequest {}
#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
pub struct UnknownMethodInfo {
pub ordinal: u64,
pub unknown_method_type: UnknownMethodType,
}
impl fidl::Persistable for UnknownMethodInfo {}
#[derive(Clone, Debug, Default, PartialEq)]
pub struct ClosedTargetTwoWayTablePayloadRequest {
pub v: Option<i8>,
#[doc(hidden)]
pub __source_breaking: fidl::marker::SourceBreaking,
}
impl fidl::Persistable for ClosedTargetTwoWayTablePayloadRequest {}
#[derive(Clone, Debug, Default, PartialEq)]
pub struct ClosedTargetTwoWayTablePayloadResponse {
pub v: Option<i8>,
#[doc(hidden)]
pub __source_breaking: fidl::marker::SourceBreaking,
}
impl fidl::Persistable for ClosedTargetTwoWayTablePayloadResponse {}
#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
pub enum AnyTarget {
Closed(fidl::endpoints::ServerEnd<ClosedTargetMarker>),
Ajar(fidl::endpoints::ServerEnd<AjarTargetMarker>),
Open(fidl::endpoints::ServerEnd<OpenTargetMarker>),
}
impl AnyTarget {
#[inline]
pub fn ordinal(&self) -> u64 {
match *self {
Self::Closed(_) => 1,
Self::Ajar(_) => 2,
Self::Open(_) => 3,
}
}
#[deprecated = "Strict unions should not use `is_unknown`"]
#[inline]
pub fn is_unknown(&self) -> bool {
false
}
}
impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect> for AnyTarget {}
#[derive(Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
pub enum ClosedTargetTwoWayResultRequest {
Payload(String),
Error(u32),
}
impl ClosedTargetTwoWayResultRequest {
#[inline]
pub fn ordinal(&self) -> u64 {
match *self {
Self::Payload(_) => 1,
Self::Error(_) => 2,
}
}
#[deprecated = "Strict unions should not use `is_unknown`"]
#[inline]
pub fn is_unknown(&self) -> bool {
false
}
}
impl fidl::Persistable for ClosedTargetTwoWayResultRequest {}
#[derive(Clone, Debug)]
pub enum ClosedTargetTwoWayUnionPayloadRequest {
V(i8),
#[doc(hidden)]
__SourceBreaking {
unknown_ordinal: u64,
},
}
#[macro_export]
macro_rules! ClosedTargetTwoWayUnionPayloadRequestUnknown {
() => {
_
};
}
impl PartialEq for ClosedTargetTwoWayUnionPayloadRequest {
fn eq(&self, other: &Self) -> bool {
match (self, other) {
(Self::V(x), Self::V(y)) => *x == *y,
_ => false,
}
}
}
impl ClosedTargetTwoWayUnionPayloadRequest {
#[inline]
pub fn ordinal(&self) -> u64 {
match *self {
Self::V(_) => 1,
Self::__SourceBreaking { unknown_ordinal } => unknown_ordinal,
}
}
#[inline]
pub fn unknown_variant_for_testing() -> Self {
Self::__SourceBreaking { unknown_ordinal: 0 }
}
#[inline]
pub fn is_unknown(&self) -> bool {
match self {
Self::__SourceBreaking { .. } => true,
_ => false,
}
}
}
impl fidl::Persistable for ClosedTargetTwoWayUnionPayloadRequest {}
#[derive(Clone, Debug)]
pub enum ClosedTargetTwoWayUnionPayloadResponse {
V(i8),
#[doc(hidden)]
__SourceBreaking {
unknown_ordinal: u64,
},
}
#[macro_export]
macro_rules! ClosedTargetTwoWayUnionPayloadResponseUnknown {
() => {
_
};
}
impl PartialEq for ClosedTargetTwoWayUnionPayloadResponse {
fn eq(&self, other: &Self) -> bool {
match (self, other) {
(Self::V(x), Self::V(y)) => *x == *y,
_ => false,
}
}
}
impl ClosedTargetTwoWayUnionPayloadResponse {
#[inline]
pub fn ordinal(&self) -> u64 {
match *self {
Self::V(_) => 1,
Self::__SourceBreaking { unknown_ordinal } => unknown_ordinal,
}
}
#[inline]
pub fn unknown_variant_for_testing() -> Self {
Self::__SourceBreaking { unknown_ordinal: 0 }
}
#[inline]
pub fn is_unknown(&self) -> bool {
match self {
Self::__SourceBreaking { .. } => true,
_ => false,
}
}
}
impl fidl::Persistable for ClosedTargetTwoWayUnionPayloadResponse {}
#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
pub enum OpenTargetFlexibleTwoWayErrRequest {
ReplySuccess(Empty),
ReplyError(i32),
}
impl OpenTargetFlexibleTwoWayErrRequest {
#[inline]
pub fn ordinal(&self) -> u64 {
match *self {
Self::ReplySuccess(_) => 1,
Self::ReplyError(_) => 2,
}
}
#[deprecated = "Strict unions should not use `is_unknown`"]
#[inline]
pub fn is_unknown(&self) -> bool {
false
}
}
impl fidl::Persistable for OpenTargetFlexibleTwoWayErrRequest {}
#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
pub enum OpenTargetFlexibleTwoWayFieldsErrRequest {
ReplySuccess(i32),
ReplyError(i32),
}
impl OpenTargetFlexibleTwoWayFieldsErrRequest {
#[inline]
pub fn ordinal(&self) -> u64 {
match *self {
Self::ReplySuccess(_) => 1,
Self::ReplyError(_) => 2,
}
}
#[deprecated = "Strict unions should not use `is_unknown`"]
#[inline]
pub fn is_unknown(&self) -> bool {
false
}
}
impl fidl::Persistable for OpenTargetFlexibleTwoWayFieldsErrRequest {}
#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
pub enum OpenTargetStrictTwoWayErrRequest {
ReplySuccess(Empty),
ReplyError(i32),
}
impl OpenTargetStrictTwoWayErrRequest {
#[inline]
pub fn ordinal(&self) -> u64 {
match *self {
Self::ReplySuccess(_) => 1,
Self::ReplyError(_) => 2,
}
}
#[deprecated = "Strict unions should not use `is_unknown`"]
#[inline]
pub fn is_unknown(&self) -> bool {
false
}
}
impl fidl::Persistable for OpenTargetStrictTwoWayErrRequest {}
#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
pub enum OpenTargetStrictTwoWayFieldsErrRequest {
ReplySuccess(i32),
ReplyError(i32),
}
impl OpenTargetStrictTwoWayFieldsErrRequest {
#[inline]
pub fn ordinal(&self) -> u64 {
match *self {
Self::ReplySuccess(_) => 1,
Self::ReplyError(_) => 2,
}
}
#[deprecated = "Strict unions should not use `is_unknown`"]
#[inline]
pub fn is_unknown(&self) -> bool {
false
}
}
impl fidl::Persistable for OpenTargetStrictTwoWayFieldsErrRequest {}
#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
pub struct AjarTargetMarker;
impl fidl::endpoints::ProtocolMarker for AjarTargetMarker {
type Proxy = AjarTargetProxy;
type RequestStream = AjarTargetRequestStream;
#[cfg(target_os = "fuchsia")]
type SynchronousProxy = AjarTargetSynchronousProxy;
const DEBUG_NAME: &'static str = "(anonymous) AjarTarget";
}
pub trait AjarTargetProxyInterface: Send + Sync {}
#[derive(Debug)]
#[cfg(target_os = "fuchsia")]
pub struct AjarTargetSynchronousProxy {
client: fidl::client::sync::Client,
}
#[cfg(target_os = "fuchsia")]
impl fidl::endpoints::SynchronousProxy for AjarTargetSynchronousProxy {
type Proxy = AjarTargetProxy;
type Protocol = AjarTargetMarker;
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 AjarTargetSynchronousProxy {
pub fn new(channel: fidl::Channel) -> Self {
let protocol_name = <AjarTargetMarker 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<AjarTargetEvent, fidl::Error> {
AjarTargetEvent::decode(self.client.wait_for_event(deadline)?)
}
}
#[derive(Debug, Clone)]
pub struct AjarTargetProxy {
client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
}
impl fidl::endpoints::Proxy for AjarTargetProxy {
type Protocol = AjarTargetMarker;
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 AjarTargetProxy {
pub fn new(channel: ::fidl::AsyncChannel) -> Self {
let protocol_name = <AjarTargetMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
Self { client: fidl::client::Client::new(channel, protocol_name) }
}
pub fn take_event_stream(&self) -> AjarTargetEventStream {
AjarTargetEventStream { event_receiver: self.client.take_event_receiver() }
}
}
impl AjarTargetProxyInterface for AjarTargetProxy {}
pub struct AjarTargetEventStream {
event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
}
impl std::marker::Unpin for AjarTargetEventStream {}
impl futures::stream::FusedStream for AjarTargetEventStream {
fn is_terminated(&self) -> bool {
self.event_receiver.is_terminated()
}
}
impl futures::Stream for AjarTargetEventStream {
type Item = Result<AjarTargetEvent, 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(AjarTargetEvent::decode(buf))),
None => std::task::Poll::Ready(None),
}
}
}
#[derive(Debug)]
pub enum AjarTargetEvent {
#[non_exhaustive]
_UnknownEvent {
ordinal: u64,
},
}
impl AjarTargetEvent {
fn decode(
mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
) -> Result<AjarTargetEvent, 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(AjarTargetEvent::_UnknownEvent { ordinal: tx_header.ordinal })
}
_ => Err(fidl::Error::UnknownOrdinal {
ordinal: tx_header.ordinal,
protocol_name: <AjarTargetMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
}),
}
}
}
pub struct AjarTargetRequestStream {
inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
is_terminated: bool,
}
impl std::marker::Unpin for AjarTargetRequestStream {}
impl futures::stream::FusedStream for AjarTargetRequestStream {
fn is_terminated(&self) -> bool {
self.is_terminated
}
}
impl fidl::endpoints::RequestStream for AjarTargetRequestStream {
type Protocol = AjarTargetMarker;
type ControlHandle = AjarTargetControlHandle;
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 {
AjarTargetControlHandle { 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 AjarTargetRequestStream {
type Item = Result<AjarTargetRequest, 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 AjarTargetRequestStream 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 {
_ if header.tx_id == 0
&& header
.dynamic_flags()
.contains(fidl::encoding::DynamicFlags::FLEXIBLE) =>
{
Ok(AjarTargetRequest::_UnknownMethod {
ordinal: header.ordinal,
control_handle: AjarTargetControlHandle { inner: this.inner.clone() },
})
}
_ => Err(fidl::Error::UnknownOrdinal {
ordinal: header.ordinal,
protocol_name:
<AjarTargetMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
}),
}))
},
)
}
}
#[derive(Debug)]
pub enum AjarTargetRequest {
#[non_exhaustive]
_UnknownMethod {
ordinal: u64,
control_handle: AjarTargetControlHandle,
},
}
impl AjarTargetRequest {
pub fn method_name(&self) -> &'static str {
match *self {
AjarTargetRequest::_UnknownMethod { .. } => "unknown one-way method",
}
}
}
#[derive(Debug, Clone)]
pub struct AjarTargetControlHandle {
inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
}
impl fidl::endpoints::ControlHandle for AjarTargetControlHandle {
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 AjarTargetControlHandle {}
#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
pub struct ClosedTargetMarker;
impl fidl::endpoints::ProtocolMarker for ClosedTargetMarker {
type Proxy = ClosedTargetProxy;
type RequestStream = ClosedTargetRequestStream;
#[cfg(target_os = "fuchsia")]
type SynchronousProxy = ClosedTargetSynchronousProxy;
const DEBUG_NAME: &'static str = "(anonymous) ClosedTarget";
}
pub type ClosedTargetTwoWayResultResult = Result<String, u32>;
pub trait ClosedTargetProxyInterface: Send + Sync {
fn r#one_way_no_payload(&self) -> Result<(), fidl::Error>;
type TwoWayNoPayloadResponseFut: std::future::Future<Output = Result<(), fidl::Error>> + Send;
fn r#two_way_no_payload(&self) -> Self::TwoWayNoPayloadResponseFut;
type TwoWayStructPayloadResponseFut: std::future::Future<Output = Result<i8, fidl::Error>>
+ Send;
fn r#two_way_struct_payload(&self, v: i8) -> Self::TwoWayStructPayloadResponseFut;
type TwoWayTablePayloadResponseFut: std::future::Future<Output = Result<ClosedTargetTwoWayTablePayloadResponse, fidl::Error>>
+ Send;
fn r#two_way_table_payload(
&self,
payload: &ClosedTargetTwoWayTablePayloadRequest,
) -> Self::TwoWayTablePayloadResponseFut;
type TwoWayUnionPayloadResponseFut: std::future::Future<Output = Result<ClosedTargetTwoWayUnionPayloadResponse, fidl::Error>>
+ Send;
fn r#two_way_union_payload(
&self,
payload: &ClosedTargetTwoWayUnionPayloadRequest,
) -> Self::TwoWayUnionPayloadResponseFut;
type TwoWayResultResponseFut: std::future::Future<Output = Result<ClosedTargetTwoWayResultResult, fidl::Error>>
+ Send;
fn r#two_way_result(
&self,
payload: &ClosedTargetTwoWayResultRequest,
) -> Self::TwoWayResultResponseFut;
type GetHandleRightsResponseFut: std::future::Future<Output = Result<fidl::Rights, fidl::Error>>
+ Send;
fn r#get_handle_rights(&self, handle: fidl::Handle) -> Self::GetHandleRightsResponseFut;
type GetSignalableEventRightsResponseFut: std::future::Future<Output = Result<fidl::Rights, fidl::Error>>
+ Send;
fn r#get_signalable_event_rights(
&self,
handle: fidl::Event,
) -> Self::GetSignalableEventRightsResponseFut;
type EchoAsTransferableSignalableEventResponseFut: std::future::Future<Output = Result<fidl::Event, fidl::Error>>
+ Send;
fn r#echo_as_transferable_signalable_event(
&self,
handle: fidl::Handle,
) -> Self::EchoAsTransferableSignalableEventResponseFut;
type ByteVectorSizeResponseFut: std::future::Future<Output = Result<u32, fidl::Error>> + Send;
fn r#byte_vector_size(&self, vec: &[u8]) -> Self::ByteVectorSizeResponseFut;
type HandleVectorSizeResponseFut: std::future::Future<Output = Result<u32, fidl::Error>> + Send;
fn r#handle_vector_size(&self, vec: Vec<fidl::Event>) -> Self::HandleVectorSizeResponseFut;
type CreateNByteVectorResponseFut: std::future::Future<Output = Result<Vec<u8>, fidl::Error>>
+ Send;
fn r#create_n_byte_vector(&self, n: u32) -> Self::CreateNByteVectorResponseFut;
type CreateNHandleVectorResponseFut: std::future::Future<Output = Result<Vec<fidl::Event>, fidl::Error>>
+ Send;
fn r#create_n_handle_vector(&self, n: u32) -> Self::CreateNHandleVectorResponseFut;
}
#[derive(Debug)]
#[cfg(target_os = "fuchsia")]
pub struct ClosedTargetSynchronousProxy {
client: fidl::client::sync::Client,
}
#[cfg(target_os = "fuchsia")]
impl fidl::endpoints::SynchronousProxy for ClosedTargetSynchronousProxy {
type Proxy = ClosedTargetProxy;
type Protocol = ClosedTargetMarker;
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 ClosedTargetSynchronousProxy {
pub fn new(channel: fidl::Channel) -> Self {
let protocol_name = <ClosedTargetMarker 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<ClosedTargetEvent, fidl::Error> {
ClosedTargetEvent::decode(self.client.wait_for_event(deadline)?)
}
pub fn r#one_way_no_payload(&self) -> Result<(), fidl::Error> {
self.client.send::<fidl::encoding::EmptyPayload>(
(),
0x66bd5fe1d4c019e,
fidl::encoding::DynamicFlags::empty(),
)
}
pub fn r#two_way_no_payload(
&self,
___deadline: zx::MonotonicInstant,
) -> Result<(), fidl::Error> {
let _response =
self.client.send_query::<fidl::encoding::EmptyPayload, fidl::encoding::EmptyPayload>(
(),
0x5bda1d1c46a5ae5f,
fidl::encoding::DynamicFlags::empty(),
___deadline,
)?;
Ok(_response)
}
pub fn r#two_way_struct_payload(
&self,
mut v: i8,
___deadline: zx::MonotonicInstant,
) -> Result<i8, fidl::Error> {
let _response = self.client.send_query::<
ClosedTargetTwoWayStructPayloadRequest,
ClosedTargetTwoWayStructPayloadResponse,
>(
(v,),
0x313769ab1b770c90,
fidl::encoding::DynamicFlags::empty(),
___deadline,
)?;
Ok(_response.v)
}
pub fn r#two_way_table_payload(
&self,
mut payload: &ClosedTargetTwoWayTablePayloadRequest,
___deadline: zx::MonotonicInstant,
) -> Result<ClosedTargetTwoWayTablePayloadResponse, fidl::Error> {
let _response = self.client.send_query::<
ClosedTargetTwoWayTablePayloadRequest,
ClosedTargetTwoWayTablePayloadResponse,
>(
payload,
0x631f7f27b6872baa,
fidl::encoding::DynamicFlags::empty(),
___deadline,
)?;
Ok(_response)
}
pub fn r#two_way_union_payload(
&self,
mut payload: &ClosedTargetTwoWayUnionPayloadRequest,
___deadline: zx::MonotonicInstant,
) -> Result<ClosedTargetTwoWayUnionPayloadResponse, fidl::Error> {
let _response = self.client.send_query::<
ClosedTargetTwoWayUnionPayloadRequest,
ClosedTargetTwoWayUnionPayloadResponse,
>(
payload,
0x77d0365370536dba,
fidl::encoding::DynamicFlags::empty(),
___deadline,
)?;
Ok(_response)
}
pub fn r#two_way_result(
&self,
mut payload: &ClosedTargetTwoWayResultRequest,
___deadline: zx::MonotonicInstant,
) -> Result<ClosedTargetTwoWayResultResult, fidl::Error> {
let _response = self.client.send_query::<
ClosedTargetTwoWayResultRequest,
fidl::encoding::ResultType<ClosedTargetTwoWayResultResponse, u32>,
>(
payload,
0xb32549e6f50894c,
fidl::encoding::DynamicFlags::empty(),
___deadline,
)?;
Ok(_response.map(|x| x.payload))
}
pub fn r#get_handle_rights(
&self,
mut handle: fidl::Handle,
___deadline: zx::MonotonicInstant,
) -> Result<fidl::Rights, fidl::Error> {
let _response = self
.client
.send_query::<ClosedTargetGetHandleRightsRequest, ClosedTargetGetHandleRightsResponse>(
(handle,),
0x1098d82f79effbe8,
fidl::encoding::DynamicFlags::empty(),
___deadline,
)?;
Ok(_response.rights)
}
pub fn r#get_signalable_event_rights(
&self,
mut handle: fidl::Event,
___deadline: zx::MonotonicInstant,
) -> Result<fidl::Rights, fidl::Error> {
let _response = self.client.send_query::<
ClosedTargetGetSignalableEventRightsRequest,
ClosedTargetGetSignalableEventRightsResponse,
>(
(handle,),
0x698c31448fd5daf,
fidl::encoding::DynamicFlags::empty(),
___deadline,
)?;
Ok(_response.rights)
}
pub fn r#echo_as_transferable_signalable_event(
&self,
mut handle: fidl::Handle,
___deadline: zx::MonotonicInstant,
) -> Result<fidl::Event, fidl::Error> {
let _response = self.client.send_query::<
ClosedTargetEchoAsTransferableSignalableEventRequest,
ClosedTargetEchoAsTransferableSignalableEventResponse,
>(
(handle,),
0x5ec627bdc2e02ca0,
fidl::encoding::DynamicFlags::empty(),
___deadline,
)?;
Ok(_response.handle)
}
pub fn r#byte_vector_size(
&self,
mut vec: &[u8],
___deadline: zx::MonotonicInstant,
) -> Result<u32, fidl::Error> {
let _response = self
.client
.send_query::<ClosedTargetByteVectorSizeRequest, ClosedTargetByteVectorSizeResponse>(
(vec,),
0x104b2f9aa8b7fe25,
fidl::encoding::DynamicFlags::empty(),
___deadline,
)?;
Ok(_response.n)
}
pub fn r#handle_vector_size(
&self,
mut vec: Vec<fidl::Event>,
___deadline: zx::MonotonicInstant,
) -> Result<u32, fidl::Error> {
let _response = self.client.send_query::<
ClosedTargetHandleVectorSizeRequest,
ClosedTargetHandleVectorSizeResponse,
>(
(vec.as_mut(),),
0x4c1ac83570a98537,
fidl::encoding::DynamicFlags::empty(),
___deadline,
)?;
Ok(_response.n)
}
pub fn r#create_n_byte_vector(
&self,
mut n: u32,
___deadline: zx::MonotonicInstant,
) -> Result<Vec<u8>, fidl::Error> {
let _response = self.client.send_query::<
ClosedTargetCreateNByteVectorRequest,
ClosedTargetCreateNByteVectorResponse,
>(
(n,),
0x1ecd88ef664e9c61,
fidl::encoding::DynamicFlags::empty(),
___deadline,
)?;
Ok(_response.vec)
}
pub fn r#create_n_handle_vector(
&self,
mut n: u32,
___deadline: zx::MonotonicInstant,
) -> Result<Vec<fidl::Event>, fidl::Error> {
let _response = self.client.send_query::<
ClosedTargetCreateNHandleVectorRequest,
ClosedTargetCreateNHandleVectorResponse,
>(
(n,),
0x26341ba1fa66813d,
fidl::encoding::DynamicFlags::empty(),
___deadline,
)?;
Ok(_response.vec)
}
}
#[derive(Debug, Clone)]
pub struct ClosedTargetProxy {
client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
}
impl fidl::endpoints::Proxy for ClosedTargetProxy {
type Protocol = ClosedTargetMarker;
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 ClosedTargetProxy {
pub fn new(channel: ::fidl::AsyncChannel) -> Self {
let protocol_name = <ClosedTargetMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
Self { client: fidl::client::Client::new(channel, protocol_name) }
}
pub fn take_event_stream(&self) -> ClosedTargetEventStream {
ClosedTargetEventStream { event_receiver: self.client.take_event_receiver() }
}
pub fn r#one_way_no_payload(&self) -> Result<(), fidl::Error> {
ClosedTargetProxyInterface::r#one_way_no_payload(self)
}
pub fn r#two_way_no_payload(
&self,
) -> fidl::client::QueryResponseFut<(), fidl::encoding::DefaultFuchsiaResourceDialect> {
ClosedTargetProxyInterface::r#two_way_no_payload(self)
}
pub fn r#two_way_struct_payload(
&self,
mut v: i8,
) -> fidl::client::QueryResponseFut<i8, fidl::encoding::DefaultFuchsiaResourceDialect> {
ClosedTargetProxyInterface::r#two_way_struct_payload(self, v)
}
pub fn r#two_way_table_payload(
&self,
mut payload: &ClosedTargetTwoWayTablePayloadRequest,
) -> fidl::client::QueryResponseFut<
ClosedTargetTwoWayTablePayloadResponse,
fidl::encoding::DefaultFuchsiaResourceDialect,
> {
ClosedTargetProxyInterface::r#two_way_table_payload(self, payload)
}
pub fn r#two_way_union_payload(
&self,
mut payload: &ClosedTargetTwoWayUnionPayloadRequest,
) -> fidl::client::QueryResponseFut<
ClosedTargetTwoWayUnionPayloadResponse,
fidl::encoding::DefaultFuchsiaResourceDialect,
> {
ClosedTargetProxyInterface::r#two_way_union_payload(self, payload)
}
pub fn r#two_way_result(
&self,
mut payload: &ClosedTargetTwoWayResultRequest,
) -> fidl::client::QueryResponseFut<
ClosedTargetTwoWayResultResult,
fidl::encoding::DefaultFuchsiaResourceDialect,
> {
ClosedTargetProxyInterface::r#two_way_result(self, payload)
}
pub fn r#get_handle_rights(
&self,
mut handle: fidl::Handle,
) -> fidl::client::QueryResponseFut<fidl::Rights, fidl::encoding::DefaultFuchsiaResourceDialect>
{
ClosedTargetProxyInterface::r#get_handle_rights(self, handle)
}
pub fn r#get_signalable_event_rights(
&self,
mut handle: fidl::Event,
) -> fidl::client::QueryResponseFut<fidl::Rights, fidl::encoding::DefaultFuchsiaResourceDialect>
{
ClosedTargetProxyInterface::r#get_signalable_event_rights(self, handle)
}
pub fn r#echo_as_transferable_signalable_event(
&self,
mut handle: fidl::Handle,
) -> fidl::client::QueryResponseFut<fidl::Event, fidl::encoding::DefaultFuchsiaResourceDialect>
{
ClosedTargetProxyInterface::r#echo_as_transferable_signalable_event(self, handle)
}
pub fn r#byte_vector_size(
&self,
mut vec: &[u8],
) -> fidl::client::QueryResponseFut<u32, fidl::encoding::DefaultFuchsiaResourceDialect> {
ClosedTargetProxyInterface::r#byte_vector_size(self, vec)
}
pub fn r#handle_vector_size(
&self,
mut vec: Vec<fidl::Event>,
) -> fidl::client::QueryResponseFut<u32, fidl::encoding::DefaultFuchsiaResourceDialect> {
ClosedTargetProxyInterface::r#handle_vector_size(self, vec)
}
pub fn r#create_n_byte_vector(
&self,
mut n: u32,
) -> fidl::client::QueryResponseFut<Vec<u8>, fidl::encoding::DefaultFuchsiaResourceDialect>
{
ClosedTargetProxyInterface::r#create_n_byte_vector(self, n)
}
pub fn r#create_n_handle_vector(
&self,
mut n: u32,
) -> fidl::client::QueryResponseFut<
Vec<fidl::Event>,
fidl::encoding::DefaultFuchsiaResourceDialect,
> {
ClosedTargetProxyInterface::r#create_n_handle_vector(self, n)
}
}
impl ClosedTargetProxyInterface for ClosedTargetProxy {
fn r#one_way_no_payload(&self) -> Result<(), fidl::Error> {
self.client.send::<fidl::encoding::EmptyPayload>(
(),
0x66bd5fe1d4c019e,
fidl::encoding::DynamicFlags::empty(),
)
}
type TwoWayNoPayloadResponseFut =
fidl::client::QueryResponseFut<(), fidl::encoding::DefaultFuchsiaResourceDialect>;
fn r#two_way_no_payload(&self) -> Self::TwoWayNoPayloadResponseFut {
fn _decode(
mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
) -> Result<(), fidl::Error> {
let _response = fidl::client::decode_transaction_body::<
fidl::encoding::EmptyPayload,
fidl::encoding::DefaultFuchsiaResourceDialect,
0x5bda1d1c46a5ae5f,
>(_buf?)?;
Ok(_response)
}
self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, ()>(
(),
0x5bda1d1c46a5ae5f,
fidl::encoding::DynamicFlags::empty(),
_decode,
)
}
type TwoWayStructPayloadResponseFut =
fidl::client::QueryResponseFut<i8, fidl::encoding::DefaultFuchsiaResourceDialect>;
fn r#two_way_struct_payload(&self, mut v: i8) -> Self::TwoWayStructPayloadResponseFut {
fn _decode(
mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
) -> Result<i8, fidl::Error> {
let _response = fidl::client::decode_transaction_body::<
ClosedTargetTwoWayStructPayloadResponse,
fidl::encoding::DefaultFuchsiaResourceDialect,
0x313769ab1b770c90,
>(_buf?)?;
Ok(_response.v)
}
self.client.send_query_and_decode::<ClosedTargetTwoWayStructPayloadRequest, i8>(
(v,),
0x313769ab1b770c90,
fidl::encoding::DynamicFlags::empty(),
_decode,
)
}
type TwoWayTablePayloadResponseFut = fidl::client::QueryResponseFut<
ClosedTargetTwoWayTablePayloadResponse,
fidl::encoding::DefaultFuchsiaResourceDialect,
>;
fn r#two_way_table_payload(
&self,
mut payload: &ClosedTargetTwoWayTablePayloadRequest,
) -> Self::TwoWayTablePayloadResponseFut {
fn _decode(
mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
) -> Result<ClosedTargetTwoWayTablePayloadResponse, fidl::Error> {
let _response = fidl::client::decode_transaction_body::<
ClosedTargetTwoWayTablePayloadResponse,
fidl::encoding::DefaultFuchsiaResourceDialect,
0x631f7f27b6872baa,
>(_buf?)?;
Ok(_response)
}
self.client.send_query_and_decode::<
ClosedTargetTwoWayTablePayloadRequest,
ClosedTargetTwoWayTablePayloadResponse,
>(
payload,
0x631f7f27b6872baa,
fidl::encoding::DynamicFlags::empty(),
_decode,
)
}
type TwoWayUnionPayloadResponseFut = fidl::client::QueryResponseFut<
ClosedTargetTwoWayUnionPayloadResponse,
fidl::encoding::DefaultFuchsiaResourceDialect,
>;
fn r#two_way_union_payload(
&self,
mut payload: &ClosedTargetTwoWayUnionPayloadRequest,
) -> Self::TwoWayUnionPayloadResponseFut {
fn _decode(
mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
) -> Result<ClosedTargetTwoWayUnionPayloadResponse, fidl::Error> {
let _response = fidl::client::decode_transaction_body::<
ClosedTargetTwoWayUnionPayloadResponse,
fidl::encoding::DefaultFuchsiaResourceDialect,
0x77d0365370536dba,
>(_buf?)?;
Ok(_response)
}
self.client.send_query_and_decode::<
ClosedTargetTwoWayUnionPayloadRequest,
ClosedTargetTwoWayUnionPayloadResponse,
>(
payload,
0x77d0365370536dba,
fidl::encoding::DynamicFlags::empty(),
_decode,
)
}
type TwoWayResultResponseFut = fidl::client::QueryResponseFut<
ClosedTargetTwoWayResultResult,
fidl::encoding::DefaultFuchsiaResourceDialect,
>;
fn r#two_way_result(
&self,
mut payload: &ClosedTargetTwoWayResultRequest,
) -> Self::TwoWayResultResponseFut {
fn _decode(
mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
) -> Result<ClosedTargetTwoWayResultResult, fidl::Error> {
let _response = fidl::client::decode_transaction_body::<
fidl::encoding::ResultType<ClosedTargetTwoWayResultResponse, u32>,
fidl::encoding::DefaultFuchsiaResourceDialect,
0xb32549e6f50894c,
>(_buf?)?;
Ok(_response.map(|x| x.payload))
}
self.client.send_query_and_decode::<
ClosedTargetTwoWayResultRequest,
ClosedTargetTwoWayResultResult,
>(
payload,
0xb32549e6f50894c,
fidl::encoding::DynamicFlags::empty(),
_decode,
)
}
type GetHandleRightsResponseFut =
fidl::client::QueryResponseFut<fidl::Rights, fidl::encoding::DefaultFuchsiaResourceDialect>;
fn r#get_handle_rights(&self, mut handle: fidl::Handle) -> Self::GetHandleRightsResponseFut {
fn _decode(
mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
) -> Result<fidl::Rights, fidl::Error> {
let _response = fidl::client::decode_transaction_body::<
ClosedTargetGetHandleRightsResponse,
fidl::encoding::DefaultFuchsiaResourceDialect,
0x1098d82f79effbe8,
>(_buf?)?;
Ok(_response.rights)
}
self.client.send_query_and_decode::<ClosedTargetGetHandleRightsRequest, fidl::Rights>(
(handle,),
0x1098d82f79effbe8,
fidl::encoding::DynamicFlags::empty(),
_decode,
)
}
type GetSignalableEventRightsResponseFut =
fidl::client::QueryResponseFut<fidl::Rights, fidl::encoding::DefaultFuchsiaResourceDialect>;
fn r#get_signalable_event_rights(
&self,
mut handle: fidl::Event,
) -> Self::GetSignalableEventRightsResponseFut {
fn _decode(
mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
) -> Result<fidl::Rights, fidl::Error> {
let _response = fidl::client::decode_transaction_body::<
ClosedTargetGetSignalableEventRightsResponse,
fidl::encoding::DefaultFuchsiaResourceDialect,
0x698c31448fd5daf,
>(_buf?)?;
Ok(_response.rights)
}
self.client
.send_query_and_decode::<ClosedTargetGetSignalableEventRightsRequest, fidl::Rights>(
(handle,),
0x698c31448fd5daf,
fidl::encoding::DynamicFlags::empty(),
_decode,
)
}
type EchoAsTransferableSignalableEventResponseFut =
fidl::client::QueryResponseFut<fidl::Event, fidl::encoding::DefaultFuchsiaResourceDialect>;
fn r#echo_as_transferable_signalable_event(
&self,
mut handle: fidl::Handle,
) -> Self::EchoAsTransferableSignalableEventResponseFut {
fn _decode(
mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
) -> Result<fidl::Event, fidl::Error> {
let _response = fidl::client::decode_transaction_body::<
ClosedTargetEchoAsTransferableSignalableEventResponse,
fidl::encoding::DefaultFuchsiaResourceDialect,
0x5ec627bdc2e02ca0,
>(_buf?)?;
Ok(_response.handle)
}
self.client.send_query_and_decode::<
ClosedTargetEchoAsTransferableSignalableEventRequest,
fidl::Event,
>(
(handle,),
0x5ec627bdc2e02ca0,
fidl::encoding::DynamicFlags::empty(),
_decode,
)
}
type ByteVectorSizeResponseFut =
fidl::client::QueryResponseFut<u32, fidl::encoding::DefaultFuchsiaResourceDialect>;
fn r#byte_vector_size(&self, mut vec: &[u8]) -> Self::ByteVectorSizeResponseFut {
fn _decode(
mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
) -> Result<u32, fidl::Error> {
let _response = fidl::client::decode_transaction_body::<
ClosedTargetByteVectorSizeResponse,
fidl::encoding::DefaultFuchsiaResourceDialect,
0x104b2f9aa8b7fe25,
>(_buf?)?;
Ok(_response.n)
}
self.client.send_query_and_decode::<ClosedTargetByteVectorSizeRequest, u32>(
(vec,),
0x104b2f9aa8b7fe25,
fidl::encoding::DynamicFlags::empty(),
_decode,
)
}
type HandleVectorSizeResponseFut =
fidl::client::QueryResponseFut<u32, fidl::encoding::DefaultFuchsiaResourceDialect>;
fn r#handle_vector_size(&self, mut vec: Vec<fidl::Event>) -> Self::HandleVectorSizeResponseFut {
fn _decode(
mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
) -> Result<u32, fidl::Error> {
let _response = fidl::client::decode_transaction_body::<
ClosedTargetHandleVectorSizeResponse,
fidl::encoding::DefaultFuchsiaResourceDialect,
0x4c1ac83570a98537,
>(_buf?)?;
Ok(_response.n)
}
self.client.send_query_and_decode::<ClosedTargetHandleVectorSizeRequest, u32>(
(vec.as_mut(),),
0x4c1ac83570a98537,
fidl::encoding::DynamicFlags::empty(),
_decode,
)
}
type CreateNByteVectorResponseFut =
fidl::client::QueryResponseFut<Vec<u8>, fidl::encoding::DefaultFuchsiaResourceDialect>;
fn r#create_n_byte_vector(&self, mut n: u32) -> Self::CreateNByteVectorResponseFut {
fn _decode(
mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
) -> Result<Vec<u8>, fidl::Error> {
let _response = fidl::client::decode_transaction_body::<
ClosedTargetCreateNByteVectorResponse,
fidl::encoding::DefaultFuchsiaResourceDialect,
0x1ecd88ef664e9c61,
>(_buf?)?;
Ok(_response.vec)
}
self.client.send_query_and_decode::<ClosedTargetCreateNByteVectorRequest, Vec<u8>>(
(n,),
0x1ecd88ef664e9c61,
fidl::encoding::DynamicFlags::empty(),
_decode,
)
}
type CreateNHandleVectorResponseFut = fidl::client::QueryResponseFut<
Vec<fidl::Event>,
fidl::encoding::DefaultFuchsiaResourceDialect,
>;
fn r#create_n_handle_vector(&self, mut n: u32) -> Self::CreateNHandleVectorResponseFut {
fn _decode(
mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
) -> Result<Vec<fidl::Event>, fidl::Error> {
let _response = fidl::client::decode_transaction_body::<
ClosedTargetCreateNHandleVectorResponse,
fidl::encoding::DefaultFuchsiaResourceDialect,
0x26341ba1fa66813d,
>(_buf?)?;
Ok(_response.vec)
}
self.client
.send_query_and_decode::<ClosedTargetCreateNHandleVectorRequest, Vec<fidl::Event>>(
(n,),
0x26341ba1fa66813d,
fidl::encoding::DynamicFlags::empty(),
_decode,
)
}
}
pub struct ClosedTargetEventStream {
event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
}
impl std::marker::Unpin for ClosedTargetEventStream {}
impl futures::stream::FusedStream for ClosedTargetEventStream {
fn is_terminated(&self) -> bool {
self.event_receiver.is_terminated()
}
}
impl futures::Stream for ClosedTargetEventStream {
type Item = Result<ClosedTargetEvent, 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(ClosedTargetEvent::decode(buf))),
None => std::task::Poll::Ready(None),
}
}
}
#[derive(Debug)]
pub enum ClosedTargetEvent {}
impl ClosedTargetEvent {
fn decode(
mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
) -> Result<ClosedTargetEvent, 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: <ClosedTargetMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
}),
}
}
}
pub struct ClosedTargetRequestStream {
inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
is_terminated: bool,
}
impl std::marker::Unpin for ClosedTargetRequestStream {}
impl futures::stream::FusedStream for ClosedTargetRequestStream {
fn is_terminated(&self) -> bool {
self.is_terminated
}
}
impl fidl::endpoints::RequestStream for ClosedTargetRequestStream {
type Protocol = ClosedTargetMarker;
type ControlHandle = ClosedTargetControlHandle;
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 {
ClosedTargetControlHandle { 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 ClosedTargetRequestStream {
type Item = Result<ClosedTargetRequest, 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 ClosedTargetRequestStream 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 {
0x66bd5fe1d4c019e => {
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 =
ClosedTargetControlHandle { inner: this.inner.clone() };
Ok(ClosedTargetRequest::OneWayNoPayload { control_handle })
}
0x5bda1d1c46a5ae5f => {
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 =
ClosedTargetControlHandle { inner: this.inner.clone() };
Ok(ClosedTargetRequest::TwoWayNoPayload {
responder: ClosedTargetTwoWayNoPayloadResponder {
control_handle: std::mem::ManuallyDrop::new(control_handle),
tx_id: header.tx_id,
},
})
}
0x313769ab1b770c90 => {
header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
let mut req = fidl::new_empty!(
ClosedTargetTwoWayStructPayloadRequest,
fidl::encoding::DefaultFuchsiaResourceDialect
);
fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<ClosedTargetTwoWayStructPayloadRequest>(&header, _body_bytes, handles, &mut req)?;
let control_handle =
ClosedTargetControlHandle { inner: this.inner.clone() };
Ok(ClosedTargetRequest::TwoWayStructPayload {
v: req.v,
responder: ClosedTargetTwoWayStructPayloadResponder {
control_handle: std::mem::ManuallyDrop::new(control_handle),
tx_id: header.tx_id,
},
})
}
0x631f7f27b6872baa => {
header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
let mut req = fidl::new_empty!(
ClosedTargetTwoWayTablePayloadRequest,
fidl::encoding::DefaultFuchsiaResourceDialect
);
fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<ClosedTargetTwoWayTablePayloadRequest>(&header, _body_bytes, handles, &mut req)?;
let control_handle =
ClosedTargetControlHandle { inner: this.inner.clone() };
Ok(ClosedTargetRequest::TwoWayTablePayload {
payload: req,
responder: ClosedTargetTwoWayTablePayloadResponder {
control_handle: std::mem::ManuallyDrop::new(control_handle),
tx_id: header.tx_id,
},
})
}
0x77d0365370536dba => {
header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
let mut req = fidl::new_empty!(
ClosedTargetTwoWayUnionPayloadRequest,
fidl::encoding::DefaultFuchsiaResourceDialect
);
fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<ClosedTargetTwoWayUnionPayloadRequest>(&header, _body_bytes, handles, &mut req)?;
let control_handle =
ClosedTargetControlHandle { inner: this.inner.clone() };
Ok(ClosedTargetRequest::TwoWayUnionPayload {
payload: req,
responder: ClosedTargetTwoWayUnionPayloadResponder {
control_handle: std::mem::ManuallyDrop::new(control_handle),
tx_id: header.tx_id,
},
})
}
0xb32549e6f50894c => {
header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
let mut req = fidl::new_empty!(
ClosedTargetTwoWayResultRequest,
fidl::encoding::DefaultFuchsiaResourceDialect
);
fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<ClosedTargetTwoWayResultRequest>(&header, _body_bytes, handles, &mut req)?;
let control_handle =
ClosedTargetControlHandle { inner: this.inner.clone() };
Ok(ClosedTargetRequest::TwoWayResult {
payload: req,
responder: ClosedTargetTwoWayResultResponder {
control_handle: std::mem::ManuallyDrop::new(control_handle),
tx_id: header.tx_id,
},
})
}
0x1098d82f79effbe8 => {
header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
let mut req = fidl::new_empty!(
ClosedTargetGetHandleRightsRequest,
fidl::encoding::DefaultFuchsiaResourceDialect
);
fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<ClosedTargetGetHandleRightsRequest>(&header, _body_bytes, handles, &mut req)?;
let control_handle =
ClosedTargetControlHandle { inner: this.inner.clone() };
Ok(ClosedTargetRequest::GetHandleRights {
handle: req.handle,
responder: ClosedTargetGetHandleRightsResponder {
control_handle: std::mem::ManuallyDrop::new(control_handle),
tx_id: header.tx_id,
},
})
}
0x698c31448fd5daf => {
header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
let mut req = fidl::new_empty!(
ClosedTargetGetSignalableEventRightsRequest,
fidl::encoding::DefaultFuchsiaResourceDialect
);
fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<ClosedTargetGetSignalableEventRightsRequest>(&header, _body_bytes, handles, &mut req)?;
let control_handle =
ClosedTargetControlHandle { inner: this.inner.clone() };
Ok(ClosedTargetRequest::GetSignalableEventRights {
handle: req.handle,
responder: ClosedTargetGetSignalableEventRightsResponder {
control_handle: std::mem::ManuallyDrop::new(control_handle),
tx_id: header.tx_id,
},
})
}
0x5ec627bdc2e02ca0 => {
header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
let mut req = fidl::new_empty!(
ClosedTargetEchoAsTransferableSignalableEventRequest,
fidl::encoding::DefaultFuchsiaResourceDialect
);
fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<ClosedTargetEchoAsTransferableSignalableEventRequest>(&header, _body_bytes, handles, &mut req)?;
let control_handle =
ClosedTargetControlHandle { inner: this.inner.clone() };
Ok(ClosedTargetRequest::EchoAsTransferableSignalableEvent {
handle: req.handle,
responder: ClosedTargetEchoAsTransferableSignalableEventResponder {
control_handle: std::mem::ManuallyDrop::new(control_handle),
tx_id: header.tx_id,
},
})
}
0x104b2f9aa8b7fe25 => {
header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
let mut req = fidl::new_empty!(
ClosedTargetByteVectorSizeRequest,
fidl::encoding::DefaultFuchsiaResourceDialect
);
fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<ClosedTargetByteVectorSizeRequest>(&header, _body_bytes, handles, &mut req)?;
let control_handle =
ClosedTargetControlHandle { inner: this.inner.clone() };
Ok(ClosedTargetRequest::ByteVectorSize {
vec: req.vec,
responder: ClosedTargetByteVectorSizeResponder {
control_handle: std::mem::ManuallyDrop::new(control_handle),
tx_id: header.tx_id,
},
})
}
0x4c1ac83570a98537 => {
header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
let mut req = fidl::new_empty!(
ClosedTargetHandleVectorSizeRequest,
fidl::encoding::DefaultFuchsiaResourceDialect
);
fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<ClosedTargetHandleVectorSizeRequest>(&header, _body_bytes, handles, &mut req)?;
let control_handle =
ClosedTargetControlHandle { inner: this.inner.clone() };
Ok(ClosedTargetRequest::HandleVectorSize {
vec: req.vec,
responder: ClosedTargetHandleVectorSizeResponder {
control_handle: std::mem::ManuallyDrop::new(control_handle),
tx_id: header.tx_id,
},
})
}
0x1ecd88ef664e9c61 => {
header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
let mut req = fidl::new_empty!(
ClosedTargetCreateNByteVectorRequest,
fidl::encoding::DefaultFuchsiaResourceDialect
);
fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<ClosedTargetCreateNByteVectorRequest>(&header, _body_bytes, handles, &mut req)?;
let control_handle =
ClosedTargetControlHandle { inner: this.inner.clone() };
Ok(ClosedTargetRequest::CreateNByteVector {
n: req.n,
responder: ClosedTargetCreateNByteVectorResponder {
control_handle: std::mem::ManuallyDrop::new(control_handle),
tx_id: header.tx_id,
},
})
}
0x26341ba1fa66813d => {
header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
let mut req = fidl::new_empty!(
ClosedTargetCreateNHandleVectorRequest,
fidl::encoding::DefaultFuchsiaResourceDialect
);
fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<ClosedTargetCreateNHandleVectorRequest>(&header, _body_bytes, handles, &mut req)?;
let control_handle =
ClosedTargetControlHandle { inner: this.inner.clone() };
Ok(ClosedTargetRequest::CreateNHandleVector {
n: req.n,
responder: ClosedTargetCreateNHandleVectorResponder {
control_handle: std::mem::ManuallyDrop::new(control_handle),
tx_id: header.tx_id,
},
})
}
_ => Err(fidl::Error::UnknownOrdinal {
ordinal: header.ordinal,
protocol_name:
<ClosedTargetMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
}),
}))
},
)
}
}
#[derive(Debug)]
pub enum ClosedTargetRequest {
OneWayNoPayload {
control_handle: ClosedTargetControlHandle,
},
TwoWayNoPayload {
responder: ClosedTargetTwoWayNoPayloadResponder,
},
TwoWayStructPayload {
v: i8,
responder: ClosedTargetTwoWayStructPayloadResponder,
},
TwoWayTablePayload {
payload: ClosedTargetTwoWayTablePayloadRequest,
responder: ClosedTargetTwoWayTablePayloadResponder,
},
TwoWayUnionPayload {
payload: ClosedTargetTwoWayUnionPayloadRequest,
responder: ClosedTargetTwoWayUnionPayloadResponder,
},
TwoWayResult {
payload: ClosedTargetTwoWayResultRequest,
responder: ClosedTargetTwoWayResultResponder,
},
GetHandleRights {
handle: fidl::Handle,
responder: ClosedTargetGetHandleRightsResponder,
},
GetSignalableEventRights {
handle: fidl::Event,
responder: ClosedTargetGetSignalableEventRightsResponder,
},
EchoAsTransferableSignalableEvent {
handle: fidl::Handle,
responder: ClosedTargetEchoAsTransferableSignalableEventResponder,
},
ByteVectorSize {
vec: Vec<u8>,
responder: ClosedTargetByteVectorSizeResponder,
},
HandleVectorSize {
vec: Vec<fidl::Event>,
responder: ClosedTargetHandleVectorSizeResponder,
},
CreateNByteVector {
n: u32,
responder: ClosedTargetCreateNByteVectorResponder,
},
CreateNHandleVector {
n: u32,
responder: ClosedTargetCreateNHandleVectorResponder,
},
}
impl ClosedTargetRequest {
#[allow(irrefutable_let_patterns)]
pub fn into_one_way_no_payload(self) -> Option<(ClosedTargetControlHandle)> {
if let ClosedTargetRequest::OneWayNoPayload { control_handle } = self {
Some((control_handle))
} else {
None
}
}
#[allow(irrefutable_let_patterns)]
pub fn into_two_way_no_payload(self) -> Option<(ClosedTargetTwoWayNoPayloadResponder)> {
if let ClosedTargetRequest::TwoWayNoPayload { responder } = self {
Some((responder))
} else {
None
}
}
#[allow(irrefutable_let_patterns)]
pub fn into_two_way_struct_payload(
self,
) -> Option<(i8, ClosedTargetTwoWayStructPayloadResponder)> {
if let ClosedTargetRequest::TwoWayStructPayload { v, responder } = self {
Some((v, responder))
} else {
None
}
}
#[allow(irrefutable_let_patterns)]
pub fn into_two_way_table_payload(
self,
) -> Option<(ClosedTargetTwoWayTablePayloadRequest, ClosedTargetTwoWayTablePayloadResponder)>
{
if let ClosedTargetRequest::TwoWayTablePayload { payload, responder } = self {
Some((payload, responder))
} else {
None
}
}
#[allow(irrefutable_let_patterns)]
pub fn into_two_way_union_payload(
self,
) -> Option<(ClosedTargetTwoWayUnionPayloadRequest, ClosedTargetTwoWayUnionPayloadResponder)>
{
if let ClosedTargetRequest::TwoWayUnionPayload { payload, responder } = self {
Some((payload, responder))
} else {
None
}
}
#[allow(irrefutable_let_patterns)]
pub fn into_two_way_result(
self,
) -> Option<(ClosedTargetTwoWayResultRequest, ClosedTargetTwoWayResultResponder)> {
if let ClosedTargetRequest::TwoWayResult { payload, responder } = self {
Some((payload, responder))
} else {
None
}
}
#[allow(irrefutable_let_patterns)]
pub fn into_get_handle_rights(
self,
) -> Option<(fidl::Handle, ClosedTargetGetHandleRightsResponder)> {
if let ClosedTargetRequest::GetHandleRights { handle, responder } = self {
Some((handle, responder))
} else {
None
}
}
#[allow(irrefutable_let_patterns)]
pub fn into_get_signalable_event_rights(
self,
) -> Option<(fidl::Event, ClosedTargetGetSignalableEventRightsResponder)> {
if let ClosedTargetRequest::GetSignalableEventRights { handle, responder } = self {
Some((handle, responder))
} else {
None
}
}
#[allow(irrefutable_let_patterns)]
pub fn into_echo_as_transferable_signalable_event(
self,
) -> Option<(fidl::Handle, ClosedTargetEchoAsTransferableSignalableEventResponder)> {
if let ClosedTargetRequest::EchoAsTransferableSignalableEvent { handle, responder } = self {
Some((handle, responder))
} else {
None
}
}
#[allow(irrefutable_let_patterns)]
pub fn into_byte_vector_size(self) -> Option<(Vec<u8>, ClosedTargetByteVectorSizeResponder)> {
if let ClosedTargetRequest::ByteVectorSize { vec, responder } = self {
Some((vec, responder))
} else {
None
}
}
#[allow(irrefutable_let_patterns)]
pub fn into_handle_vector_size(
self,
) -> Option<(Vec<fidl::Event>, ClosedTargetHandleVectorSizeResponder)> {
if let ClosedTargetRequest::HandleVectorSize { vec, responder } = self {
Some((vec, responder))
} else {
None
}
}
#[allow(irrefutable_let_patterns)]
pub fn into_create_n_byte_vector(
self,
) -> Option<(u32, ClosedTargetCreateNByteVectorResponder)> {
if let ClosedTargetRequest::CreateNByteVector { n, responder } = self {
Some((n, responder))
} else {
None
}
}
#[allow(irrefutable_let_patterns)]
pub fn into_create_n_handle_vector(
self,
) -> Option<(u32, ClosedTargetCreateNHandleVectorResponder)> {
if let ClosedTargetRequest::CreateNHandleVector { n, responder } = self {
Some((n, responder))
} else {
None
}
}
pub fn method_name(&self) -> &'static str {
match *self {
ClosedTargetRequest::OneWayNoPayload { .. } => "one_way_no_payload",
ClosedTargetRequest::TwoWayNoPayload { .. } => "two_way_no_payload",
ClosedTargetRequest::TwoWayStructPayload { .. } => "two_way_struct_payload",
ClosedTargetRequest::TwoWayTablePayload { .. } => "two_way_table_payload",
ClosedTargetRequest::TwoWayUnionPayload { .. } => "two_way_union_payload",
ClosedTargetRequest::TwoWayResult { .. } => "two_way_result",
ClosedTargetRequest::GetHandleRights { .. } => "get_handle_rights",
ClosedTargetRequest::GetSignalableEventRights { .. } => "get_signalable_event_rights",
ClosedTargetRequest::EchoAsTransferableSignalableEvent { .. } => {
"echo_as_transferable_signalable_event"
}
ClosedTargetRequest::ByteVectorSize { .. } => "byte_vector_size",
ClosedTargetRequest::HandleVectorSize { .. } => "handle_vector_size",
ClosedTargetRequest::CreateNByteVector { .. } => "create_n_byte_vector",
ClosedTargetRequest::CreateNHandleVector { .. } => "create_n_handle_vector",
}
}
}
#[derive(Debug, Clone)]
pub struct ClosedTargetControlHandle {
inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
}
impl fidl::endpoints::ControlHandle for ClosedTargetControlHandle {
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 ClosedTargetControlHandle {}
#[must_use = "FIDL methods require a response to be sent"]
#[derive(Debug)]
pub struct ClosedTargetTwoWayNoPayloadResponder {
control_handle: std::mem::ManuallyDrop<ClosedTargetControlHandle>,
tx_id: u32,
}
impl std::ops::Drop for ClosedTargetTwoWayNoPayloadResponder {
fn drop(&mut self) {
self.control_handle.shutdown();
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
}
}
impl fidl::endpoints::Responder for ClosedTargetTwoWayNoPayloadResponder {
type ControlHandle = ClosedTargetControlHandle;
fn control_handle(&self) -> &ClosedTargetControlHandle {
&self.control_handle
}
fn drop_without_shutdown(mut self) {
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
std::mem::forget(self);
}
}
impl ClosedTargetTwoWayNoPayloadResponder {
pub fn send(self) -> Result<(), fidl::Error> {
let _result = self.send_raw();
if _result.is_err() {
self.control_handle.shutdown();
}
self.drop_without_shutdown();
_result
}
pub fn send_no_shutdown_on_err(self) -> Result<(), fidl::Error> {
let _result = self.send_raw();
self.drop_without_shutdown();
_result
}
fn send_raw(&self) -> Result<(), fidl::Error> {
self.control_handle.inner.send::<fidl::encoding::EmptyPayload>(
(),
self.tx_id,
0x5bda1d1c46a5ae5f,
fidl::encoding::DynamicFlags::empty(),
)
}
}
#[must_use = "FIDL methods require a response to be sent"]
#[derive(Debug)]
pub struct ClosedTargetTwoWayStructPayloadResponder {
control_handle: std::mem::ManuallyDrop<ClosedTargetControlHandle>,
tx_id: u32,
}
impl std::ops::Drop for ClosedTargetTwoWayStructPayloadResponder {
fn drop(&mut self) {
self.control_handle.shutdown();
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
}
}
impl fidl::endpoints::Responder for ClosedTargetTwoWayStructPayloadResponder {
type ControlHandle = ClosedTargetControlHandle;
fn control_handle(&self) -> &ClosedTargetControlHandle {
&self.control_handle
}
fn drop_without_shutdown(mut self) {
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
std::mem::forget(self);
}
}
impl ClosedTargetTwoWayStructPayloadResponder {
pub fn send(self, mut v: i8) -> Result<(), fidl::Error> {
let _result = self.send_raw(v);
if _result.is_err() {
self.control_handle.shutdown();
}
self.drop_without_shutdown();
_result
}
pub fn send_no_shutdown_on_err(self, mut v: i8) -> Result<(), fidl::Error> {
let _result = self.send_raw(v);
self.drop_without_shutdown();
_result
}
fn send_raw(&self, mut v: i8) -> Result<(), fidl::Error> {
self.control_handle.inner.send::<ClosedTargetTwoWayStructPayloadResponse>(
(v,),
self.tx_id,
0x313769ab1b770c90,
fidl::encoding::DynamicFlags::empty(),
)
}
}
#[must_use = "FIDL methods require a response to be sent"]
#[derive(Debug)]
pub struct ClosedTargetTwoWayTablePayloadResponder {
control_handle: std::mem::ManuallyDrop<ClosedTargetControlHandle>,
tx_id: u32,
}
impl std::ops::Drop for ClosedTargetTwoWayTablePayloadResponder {
fn drop(&mut self) {
self.control_handle.shutdown();
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
}
}
impl fidl::endpoints::Responder for ClosedTargetTwoWayTablePayloadResponder {
type ControlHandle = ClosedTargetControlHandle;
fn control_handle(&self) -> &ClosedTargetControlHandle {
&self.control_handle
}
fn drop_without_shutdown(mut self) {
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
std::mem::forget(self);
}
}
impl ClosedTargetTwoWayTablePayloadResponder {
pub fn send(
self,
mut payload: &ClosedTargetTwoWayTablePayloadResponse,
) -> Result<(), fidl::Error> {
let _result = self.send_raw(payload);
if _result.is_err() {
self.control_handle.shutdown();
}
self.drop_without_shutdown();
_result
}
pub fn send_no_shutdown_on_err(
self,
mut payload: &ClosedTargetTwoWayTablePayloadResponse,
) -> Result<(), fidl::Error> {
let _result = self.send_raw(payload);
self.drop_without_shutdown();
_result
}
fn send_raw(
&self,
mut payload: &ClosedTargetTwoWayTablePayloadResponse,
) -> Result<(), fidl::Error> {
self.control_handle.inner.send::<ClosedTargetTwoWayTablePayloadResponse>(
payload,
self.tx_id,
0x631f7f27b6872baa,
fidl::encoding::DynamicFlags::empty(),
)
}
}
#[must_use = "FIDL methods require a response to be sent"]
#[derive(Debug)]
pub struct ClosedTargetTwoWayUnionPayloadResponder {
control_handle: std::mem::ManuallyDrop<ClosedTargetControlHandle>,
tx_id: u32,
}
impl std::ops::Drop for ClosedTargetTwoWayUnionPayloadResponder {
fn drop(&mut self) {
self.control_handle.shutdown();
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
}
}
impl fidl::endpoints::Responder for ClosedTargetTwoWayUnionPayloadResponder {
type ControlHandle = ClosedTargetControlHandle;
fn control_handle(&self) -> &ClosedTargetControlHandle {
&self.control_handle
}
fn drop_without_shutdown(mut self) {
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
std::mem::forget(self);
}
}
impl ClosedTargetTwoWayUnionPayloadResponder {
pub fn send(
self,
mut payload: &ClosedTargetTwoWayUnionPayloadResponse,
) -> Result<(), fidl::Error> {
let _result = self.send_raw(payload);
if _result.is_err() {
self.control_handle.shutdown();
}
self.drop_without_shutdown();
_result
}
pub fn send_no_shutdown_on_err(
self,
mut payload: &ClosedTargetTwoWayUnionPayloadResponse,
) -> Result<(), fidl::Error> {
let _result = self.send_raw(payload);
self.drop_without_shutdown();
_result
}
fn send_raw(
&self,
mut payload: &ClosedTargetTwoWayUnionPayloadResponse,
) -> Result<(), fidl::Error> {
self.control_handle.inner.send::<ClosedTargetTwoWayUnionPayloadResponse>(
payload,
self.tx_id,
0x77d0365370536dba,
fidl::encoding::DynamicFlags::empty(),
)
}
}
#[must_use = "FIDL methods require a response to be sent"]
#[derive(Debug)]
pub struct ClosedTargetTwoWayResultResponder {
control_handle: std::mem::ManuallyDrop<ClosedTargetControlHandle>,
tx_id: u32,
}
impl std::ops::Drop for ClosedTargetTwoWayResultResponder {
fn drop(&mut self) {
self.control_handle.shutdown();
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
}
}
impl fidl::endpoints::Responder for ClosedTargetTwoWayResultResponder {
type ControlHandle = ClosedTargetControlHandle;
fn control_handle(&self) -> &ClosedTargetControlHandle {
&self.control_handle
}
fn drop_without_shutdown(mut self) {
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
std::mem::forget(self);
}
}
impl ClosedTargetTwoWayResultResponder {
pub fn send(self, mut result: Result<&str, u32>) -> 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<&str, u32>) -> Result<(), fidl::Error> {
let _result = self.send_raw(result);
self.drop_without_shutdown();
_result
}
fn send_raw(&self, mut result: Result<&str, u32>) -> Result<(), fidl::Error> {
self.control_handle
.inner
.send::<fidl::encoding::ResultType<ClosedTargetTwoWayResultResponse, u32>>(
result.map(|payload| (payload,)),
self.tx_id,
0xb32549e6f50894c,
fidl::encoding::DynamicFlags::empty(),
)
}
}
#[must_use = "FIDL methods require a response to be sent"]
#[derive(Debug)]
pub struct ClosedTargetGetHandleRightsResponder {
control_handle: std::mem::ManuallyDrop<ClosedTargetControlHandle>,
tx_id: u32,
}
impl std::ops::Drop for ClosedTargetGetHandleRightsResponder {
fn drop(&mut self) {
self.control_handle.shutdown();
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
}
}
impl fidl::endpoints::Responder for ClosedTargetGetHandleRightsResponder {
type ControlHandle = ClosedTargetControlHandle;
fn control_handle(&self) -> &ClosedTargetControlHandle {
&self.control_handle
}
fn drop_without_shutdown(mut self) {
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
std::mem::forget(self);
}
}
impl ClosedTargetGetHandleRightsResponder {
pub fn send(self, mut rights: fidl::Rights) -> Result<(), fidl::Error> {
let _result = self.send_raw(rights);
if _result.is_err() {
self.control_handle.shutdown();
}
self.drop_without_shutdown();
_result
}
pub fn send_no_shutdown_on_err(self, mut rights: fidl::Rights) -> Result<(), fidl::Error> {
let _result = self.send_raw(rights);
self.drop_without_shutdown();
_result
}
fn send_raw(&self, mut rights: fidl::Rights) -> Result<(), fidl::Error> {
self.control_handle.inner.send::<ClosedTargetGetHandleRightsResponse>(
(rights,),
self.tx_id,
0x1098d82f79effbe8,
fidl::encoding::DynamicFlags::empty(),
)
}
}
#[must_use = "FIDL methods require a response to be sent"]
#[derive(Debug)]
pub struct ClosedTargetGetSignalableEventRightsResponder {
control_handle: std::mem::ManuallyDrop<ClosedTargetControlHandle>,
tx_id: u32,
}
impl std::ops::Drop for ClosedTargetGetSignalableEventRightsResponder {
fn drop(&mut self) {
self.control_handle.shutdown();
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
}
}
impl fidl::endpoints::Responder for ClosedTargetGetSignalableEventRightsResponder {
type ControlHandle = ClosedTargetControlHandle;
fn control_handle(&self) -> &ClosedTargetControlHandle {
&self.control_handle
}
fn drop_without_shutdown(mut self) {
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
std::mem::forget(self);
}
}
impl ClosedTargetGetSignalableEventRightsResponder {
pub fn send(self, mut rights: fidl::Rights) -> Result<(), fidl::Error> {
let _result = self.send_raw(rights);
if _result.is_err() {
self.control_handle.shutdown();
}
self.drop_without_shutdown();
_result
}
pub fn send_no_shutdown_on_err(self, mut rights: fidl::Rights) -> Result<(), fidl::Error> {
let _result = self.send_raw(rights);
self.drop_without_shutdown();
_result
}
fn send_raw(&self, mut rights: fidl::Rights) -> Result<(), fidl::Error> {
self.control_handle.inner.send::<ClosedTargetGetSignalableEventRightsResponse>(
(rights,),
self.tx_id,
0x698c31448fd5daf,
fidl::encoding::DynamicFlags::empty(),
)
}
}
#[must_use = "FIDL methods require a response to be sent"]
#[derive(Debug)]
pub struct ClosedTargetEchoAsTransferableSignalableEventResponder {
control_handle: std::mem::ManuallyDrop<ClosedTargetControlHandle>,
tx_id: u32,
}
impl std::ops::Drop for ClosedTargetEchoAsTransferableSignalableEventResponder {
fn drop(&mut self) {
self.control_handle.shutdown();
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
}
}
impl fidl::endpoints::Responder for ClosedTargetEchoAsTransferableSignalableEventResponder {
type ControlHandle = ClosedTargetControlHandle;
fn control_handle(&self) -> &ClosedTargetControlHandle {
&self.control_handle
}
fn drop_without_shutdown(mut self) {
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
std::mem::forget(self);
}
}
impl ClosedTargetEchoAsTransferableSignalableEventResponder {
pub fn send(self, mut handle: fidl::Event) -> Result<(), fidl::Error> {
let _result = self.send_raw(handle);
if _result.is_err() {
self.control_handle.shutdown();
}
self.drop_without_shutdown();
_result
}
pub fn send_no_shutdown_on_err(self, mut handle: fidl::Event) -> Result<(), fidl::Error> {
let _result = self.send_raw(handle);
self.drop_without_shutdown();
_result
}
fn send_raw(&self, mut handle: fidl::Event) -> Result<(), fidl::Error> {
self.control_handle.inner.send::<ClosedTargetEchoAsTransferableSignalableEventResponse>(
(handle,),
self.tx_id,
0x5ec627bdc2e02ca0,
fidl::encoding::DynamicFlags::empty(),
)
}
}
#[must_use = "FIDL methods require a response to be sent"]
#[derive(Debug)]
pub struct ClosedTargetByteVectorSizeResponder {
control_handle: std::mem::ManuallyDrop<ClosedTargetControlHandle>,
tx_id: u32,
}
impl std::ops::Drop for ClosedTargetByteVectorSizeResponder {
fn drop(&mut self) {
self.control_handle.shutdown();
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
}
}
impl fidl::endpoints::Responder for ClosedTargetByteVectorSizeResponder {
type ControlHandle = ClosedTargetControlHandle;
fn control_handle(&self) -> &ClosedTargetControlHandle {
&self.control_handle
}
fn drop_without_shutdown(mut self) {
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
std::mem::forget(self);
}
}
impl ClosedTargetByteVectorSizeResponder {
pub fn send(self, mut n: u32) -> Result<(), fidl::Error> {
let _result = self.send_raw(n);
if _result.is_err() {
self.control_handle.shutdown();
}
self.drop_without_shutdown();
_result
}
pub fn send_no_shutdown_on_err(self, mut n: u32) -> Result<(), fidl::Error> {
let _result = self.send_raw(n);
self.drop_without_shutdown();
_result
}
fn send_raw(&self, mut n: u32) -> Result<(), fidl::Error> {
self.control_handle.inner.send::<ClosedTargetByteVectorSizeResponse>(
(n,),
self.tx_id,
0x104b2f9aa8b7fe25,
fidl::encoding::DynamicFlags::empty(),
)
}
}
#[must_use = "FIDL methods require a response to be sent"]
#[derive(Debug)]
pub struct ClosedTargetHandleVectorSizeResponder {
control_handle: std::mem::ManuallyDrop<ClosedTargetControlHandle>,
tx_id: u32,
}
impl std::ops::Drop for ClosedTargetHandleVectorSizeResponder {
fn drop(&mut self) {
self.control_handle.shutdown();
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
}
}
impl fidl::endpoints::Responder for ClosedTargetHandleVectorSizeResponder {
type ControlHandle = ClosedTargetControlHandle;
fn control_handle(&self) -> &ClosedTargetControlHandle {
&self.control_handle
}
fn drop_without_shutdown(mut self) {
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
std::mem::forget(self);
}
}
impl ClosedTargetHandleVectorSizeResponder {
pub fn send(self, mut n: u32) -> Result<(), fidl::Error> {
let _result = self.send_raw(n);
if _result.is_err() {
self.control_handle.shutdown();
}
self.drop_without_shutdown();
_result
}
pub fn send_no_shutdown_on_err(self, mut n: u32) -> Result<(), fidl::Error> {
let _result = self.send_raw(n);
self.drop_without_shutdown();
_result
}
fn send_raw(&self, mut n: u32) -> Result<(), fidl::Error> {
self.control_handle.inner.send::<ClosedTargetHandleVectorSizeResponse>(
(n,),
self.tx_id,
0x4c1ac83570a98537,
fidl::encoding::DynamicFlags::empty(),
)
}
}
#[must_use = "FIDL methods require a response to be sent"]
#[derive(Debug)]
pub struct ClosedTargetCreateNByteVectorResponder {
control_handle: std::mem::ManuallyDrop<ClosedTargetControlHandle>,
tx_id: u32,
}
impl std::ops::Drop for ClosedTargetCreateNByteVectorResponder {
fn drop(&mut self) {
self.control_handle.shutdown();
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
}
}
impl fidl::endpoints::Responder for ClosedTargetCreateNByteVectorResponder {
type ControlHandle = ClosedTargetControlHandle;
fn control_handle(&self) -> &ClosedTargetControlHandle {
&self.control_handle
}
fn drop_without_shutdown(mut self) {
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
std::mem::forget(self);
}
}
impl ClosedTargetCreateNByteVectorResponder {
pub fn send(self, mut vec: &[u8]) -> Result<(), fidl::Error> {
let _result = self.send_raw(vec);
if _result.is_err() {
self.control_handle.shutdown();
}
self.drop_without_shutdown();
_result
}
pub fn send_no_shutdown_on_err(self, mut vec: &[u8]) -> Result<(), fidl::Error> {
let _result = self.send_raw(vec);
self.drop_without_shutdown();
_result
}
fn send_raw(&self, mut vec: &[u8]) -> Result<(), fidl::Error> {
self.control_handle.inner.send::<ClosedTargetCreateNByteVectorResponse>(
(vec,),
self.tx_id,
0x1ecd88ef664e9c61,
fidl::encoding::DynamicFlags::empty(),
)
}
}
#[must_use = "FIDL methods require a response to be sent"]
#[derive(Debug)]
pub struct ClosedTargetCreateNHandleVectorResponder {
control_handle: std::mem::ManuallyDrop<ClosedTargetControlHandle>,
tx_id: u32,
}
impl std::ops::Drop for ClosedTargetCreateNHandleVectorResponder {
fn drop(&mut self) {
self.control_handle.shutdown();
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
}
}
impl fidl::endpoints::Responder for ClosedTargetCreateNHandleVectorResponder {
type ControlHandle = ClosedTargetControlHandle;
fn control_handle(&self) -> &ClosedTargetControlHandle {
&self.control_handle
}
fn drop_without_shutdown(mut self) {
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
std::mem::forget(self);
}
}
impl ClosedTargetCreateNHandleVectorResponder {
pub fn send(self, mut vec: Vec<fidl::Event>) -> Result<(), fidl::Error> {
let _result = self.send_raw(vec);
if _result.is_err() {
self.control_handle.shutdown();
}
self.drop_without_shutdown();
_result
}
pub fn send_no_shutdown_on_err(self, mut vec: Vec<fidl::Event>) -> Result<(), fidl::Error> {
let _result = self.send_raw(vec);
self.drop_without_shutdown();
_result
}
fn send_raw(&self, mut vec: Vec<fidl::Event>) -> Result<(), fidl::Error> {
self.control_handle.inner.send::<ClosedTargetCreateNHandleVectorResponse>(
(vec.as_mut(),),
self.tx_id,
0x26341ba1fa66813d,
fidl::encoding::DynamicFlags::empty(),
)
}
}
#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
pub struct OpenTargetMarker;
impl fidl::endpoints::ProtocolMarker for OpenTargetMarker {
type Proxy = OpenTargetProxy;
type RequestStream = OpenTargetRequestStream;
#[cfg(target_os = "fuchsia")]
type SynchronousProxy = OpenTargetSynchronousProxy;
const DEBUG_NAME: &'static str = "(anonymous) OpenTarget";
}
pub type OpenTargetStrictTwoWayErrResult = Result<(), i32>;
pub type OpenTargetStrictTwoWayFieldsErrResult = Result<i32, i32>;
pub type OpenTargetFlexibleTwoWayErrResult = Result<(), i32>;
pub type OpenTargetFlexibleTwoWayFieldsErrResult = Result<i32, i32>;
pub trait OpenTargetProxyInterface: Send + Sync {
fn r#strict_one_way(&self) -> Result<(), fidl::Error>;
fn r#flexible_one_way(&self) -> Result<(), fidl::Error>;
type StrictTwoWayResponseFut: std::future::Future<Output = Result<(), fidl::Error>> + Send;
fn r#strict_two_way(&self) -> Self::StrictTwoWayResponseFut;
type StrictTwoWayFieldsResponseFut: std::future::Future<Output = Result<i32, fidl::Error>>
+ Send;
fn r#strict_two_way_fields(&self, reply_with: i32) -> Self::StrictTwoWayFieldsResponseFut;
type StrictTwoWayErrResponseFut: std::future::Future<Output = Result<OpenTargetStrictTwoWayErrResult, fidl::Error>>
+ Send;
fn r#strict_two_way_err(
&self,
payload: &OpenTargetStrictTwoWayErrRequest,
) -> Self::StrictTwoWayErrResponseFut;
type StrictTwoWayFieldsErrResponseFut: std::future::Future<Output = Result<OpenTargetStrictTwoWayFieldsErrResult, fidl::Error>>
+ Send;
fn r#strict_two_way_fields_err(
&self,
payload: &OpenTargetStrictTwoWayFieldsErrRequest,
) -> Self::StrictTwoWayFieldsErrResponseFut;
type FlexibleTwoWayResponseFut: std::future::Future<Output = Result<(), fidl::Error>> + Send;
fn r#flexible_two_way(&self) -> Self::FlexibleTwoWayResponseFut;
type FlexibleTwoWayFieldsResponseFut: std::future::Future<Output = Result<i32, fidl::Error>>
+ Send;
fn r#flexible_two_way_fields(&self, reply_with: i32) -> Self::FlexibleTwoWayFieldsResponseFut;
type FlexibleTwoWayErrResponseFut: std::future::Future<Output = Result<OpenTargetFlexibleTwoWayErrResult, fidl::Error>>
+ Send;
fn r#flexible_two_way_err(
&self,
payload: &OpenTargetFlexibleTwoWayErrRequest,
) -> Self::FlexibleTwoWayErrResponseFut;
type FlexibleTwoWayFieldsErrResponseFut: std::future::Future<Output = Result<OpenTargetFlexibleTwoWayFieldsErrResult, fidl::Error>>
+ Send;
fn r#flexible_two_way_fields_err(
&self,
payload: &OpenTargetFlexibleTwoWayFieldsErrRequest,
) -> Self::FlexibleTwoWayFieldsErrResponseFut;
}
#[derive(Debug)]
#[cfg(target_os = "fuchsia")]
pub struct OpenTargetSynchronousProxy {
client: fidl::client::sync::Client,
}
#[cfg(target_os = "fuchsia")]
impl fidl::endpoints::SynchronousProxy for OpenTargetSynchronousProxy {
type Proxy = OpenTargetProxy;
type Protocol = OpenTargetMarker;
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 OpenTargetSynchronousProxy {
pub fn new(channel: fidl::Channel) -> Self {
let protocol_name = <OpenTargetMarker 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<OpenTargetEvent, fidl::Error> {
OpenTargetEvent::decode(self.client.wait_for_event(deadline)?)
}
pub fn r#strict_one_way(&self) -> Result<(), fidl::Error> {
self.client.send::<fidl::encoding::EmptyPayload>(
(),
0x24dd8be3750aba9b,
fidl::encoding::DynamicFlags::empty(),
)
}
pub fn r#flexible_one_way(&self) -> Result<(), fidl::Error> {
self.client.send::<fidl::encoding::EmptyPayload>(
(),
0x421bbeb2bbc84a58,
fidl::encoding::DynamicFlags::FLEXIBLE,
)
}
pub fn r#strict_two_way(&self, ___deadline: zx::MonotonicInstant) -> Result<(), fidl::Error> {
let _response =
self.client.send_query::<fidl::encoding::EmptyPayload, fidl::encoding::EmptyPayload>(
(),
0x70020c582a57ef03,
fidl::encoding::DynamicFlags::empty(),
___deadline,
)?;
Ok(_response)
}
pub fn r#strict_two_way_fields(
&self,
mut reply_with: i32,
___deadline: zx::MonotonicInstant,
) -> Result<i32, fidl::Error> {
let _response = self.client.send_query::<
OpenTargetStrictTwoWayFieldsRequest,
OpenTargetStrictTwoWayFieldsResponse,
>(
(reply_with,),
0x2be6e1cc40008010,
fidl::encoding::DynamicFlags::empty(),
___deadline,
)?;
Ok(_response.some_field)
}
pub fn r#strict_two_way_err(
&self,
mut payload: &OpenTargetStrictTwoWayErrRequest,
___deadline: zx::MonotonicInstant,
) -> Result<OpenTargetStrictTwoWayErrResult, fidl::Error> {
let _response = self.client.send_query::<
OpenTargetStrictTwoWayErrRequest,
fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
>(
payload,
0x6efc16069ebd0b2c,
fidl::encoding::DynamicFlags::empty(),
___deadline,
)?;
Ok(_response.map(|x| x))
}
pub fn r#strict_two_way_fields_err(
&self,
mut payload: &OpenTargetStrictTwoWayFieldsErrRequest,
___deadline: zx::MonotonicInstant,
) -> Result<OpenTargetStrictTwoWayFieldsErrResult, fidl::Error> {
let _response = self.client.send_query::<
OpenTargetStrictTwoWayFieldsErrRequest,
fidl::encoding::ResultType<OpenTargetStrictTwoWayFieldsErrResponse, i32>,
>(
payload,
0x309c8adda770fcf0,
fidl::encoding::DynamicFlags::empty(),
___deadline,
)?;
Ok(_response.map(|x| x.some_field))
}
pub fn r#flexible_two_way(&self, ___deadline: zx::MonotonicInstant) -> Result<(), fidl::Error> {
let _response = self.client.send_query::<
fidl::encoding::EmptyPayload,
fidl::encoding::FlexibleType<fidl::encoding::EmptyStruct>,
>(
(),
0x19f932dac7810c71,
fidl::encoding::DynamicFlags::FLEXIBLE,
___deadline,
)?
.into_result::<OpenTargetMarker>("flexible_two_way")?;
Ok(_response)
}
pub fn r#flexible_two_way_fields(
&self,
mut reply_with: i32,
___deadline: zx::MonotonicInstant,
) -> Result<i32, fidl::Error> {
let _response = self.client.send_query::<
OpenTargetFlexibleTwoWayFieldsRequest,
fidl::encoding::FlexibleType<OpenTargetFlexibleTwoWayFieldsResponse>,
>(
(reply_with,),
0x47cca5ddb4207774,
fidl::encoding::DynamicFlags::FLEXIBLE,
___deadline,
)?
.into_result::<OpenTargetMarker>("flexible_two_way_fields")?;
Ok(_response.some_field)
}
pub fn r#flexible_two_way_err(
&self,
mut payload: &OpenTargetFlexibleTwoWayErrRequest,
___deadline: zx::MonotonicInstant,
) -> Result<OpenTargetFlexibleTwoWayErrResult, fidl::Error> {
let _response = self.client.send_query::<
OpenTargetFlexibleTwoWayErrRequest,
fidl::encoding::FlexibleResultType<fidl::encoding::EmptyStruct, i32>,
>(
payload,
0x52aa19681fea3a0,
fidl::encoding::DynamicFlags::FLEXIBLE,
___deadline,
)?
.into_result::<OpenTargetMarker>("flexible_two_way_err")?;
Ok(_response.map(|x| x))
}
pub fn r#flexible_two_way_fields_err(
&self,
mut payload: &OpenTargetFlexibleTwoWayFieldsErrRequest,
___deadline: zx::MonotonicInstant,
) -> Result<OpenTargetFlexibleTwoWayFieldsErrResult, fidl::Error> {
let _response = self.client.send_query::<
OpenTargetFlexibleTwoWayFieldsErrRequest,
fidl::encoding::FlexibleResultType<OpenTargetFlexibleTwoWayFieldsErrResponse, i32>,
>(
payload,
0x1ab7dd4c6a3650b6,
fidl::encoding::DynamicFlags::FLEXIBLE,
___deadline,
)?
.into_result::<OpenTargetMarker>("flexible_two_way_fields_err")?;
Ok(_response.map(|x| x.some_field))
}
}
#[derive(Debug, Clone)]
pub struct OpenTargetProxy {
client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
}
impl fidl::endpoints::Proxy for OpenTargetProxy {
type Protocol = OpenTargetMarker;
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 OpenTargetProxy {
pub fn new(channel: ::fidl::AsyncChannel) -> Self {
let protocol_name = <OpenTargetMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
Self { client: fidl::client::Client::new(channel, protocol_name) }
}
pub fn take_event_stream(&self) -> OpenTargetEventStream {
OpenTargetEventStream { event_receiver: self.client.take_event_receiver() }
}
pub fn r#strict_one_way(&self) -> Result<(), fidl::Error> {
OpenTargetProxyInterface::r#strict_one_way(self)
}
pub fn r#flexible_one_way(&self) -> Result<(), fidl::Error> {
OpenTargetProxyInterface::r#flexible_one_way(self)
}
pub fn r#strict_two_way(
&self,
) -> fidl::client::QueryResponseFut<(), fidl::encoding::DefaultFuchsiaResourceDialect> {
OpenTargetProxyInterface::r#strict_two_way(self)
}
pub fn r#strict_two_way_fields(
&self,
mut reply_with: i32,
) -> fidl::client::QueryResponseFut<i32, fidl::encoding::DefaultFuchsiaResourceDialect> {
OpenTargetProxyInterface::r#strict_two_way_fields(self, reply_with)
}
pub fn r#strict_two_way_err(
&self,
mut payload: &OpenTargetStrictTwoWayErrRequest,
) -> fidl::client::QueryResponseFut<
OpenTargetStrictTwoWayErrResult,
fidl::encoding::DefaultFuchsiaResourceDialect,
> {
OpenTargetProxyInterface::r#strict_two_way_err(self, payload)
}
pub fn r#strict_two_way_fields_err(
&self,
mut payload: &OpenTargetStrictTwoWayFieldsErrRequest,
) -> fidl::client::QueryResponseFut<
OpenTargetStrictTwoWayFieldsErrResult,
fidl::encoding::DefaultFuchsiaResourceDialect,
> {
OpenTargetProxyInterface::r#strict_two_way_fields_err(self, payload)
}
pub fn r#flexible_two_way(
&self,
) -> fidl::client::QueryResponseFut<(), fidl::encoding::DefaultFuchsiaResourceDialect> {
OpenTargetProxyInterface::r#flexible_two_way(self)
}
pub fn r#flexible_two_way_fields(
&self,
mut reply_with: i32,
) -> fidl::client::QueryResponseFut<i32, fidl::encoding::DefaultFuchsiaResourceDialect> {
OpenTargetProxyInterface::r#flexible_two_way_fields(self, reply_with)
}
pub fn r#flexible_two_way_err(
&self,
mut payload: &OpenTargetFlexibleTwoWayErrRequest,
) -> fidl::client::QueryResponseFut<
OpenTargetFlexibleTwoWayErrResult,
fidl::encoding::DefaultFuchsiaResourceDialect,
> {
OpenTargetProxyInterface::r#flexible_two_way_err(self, payload)
}
pub fn r#flexible_two_way_fields_err(
&self,
mut payload: &OpenTargetFlexibleTwoWayFieldsErrRequest,
) -> fidl::client::QueryResponseFut<
OpenTargetFlexibleTwoWayFieldsErrResult,
fidl::encoding::DefaultFuchsiaResourceDialect,
> {
OpenTargetProxyInterface::r#flexible_two_way_fields_err(self, payload)
}
}
impl OpenTargetProxyInterface for OpenTargetProxy {
fn r#strict_one_way(&self) -> Result<(), fidl::Error> {
self.client.send::<fidl::encoding::EmptyPayload>(
(),
0x24dd8be3750aba9b,
fidl::encoding::DynamicFlags::empty(),
)
}
fn r#flexible_one_way(&self) -> Result<(), fidl::Error> {
self.client.send::<fidl::encoding::EmptyPayload>(
(),
0x421bbeb2bbc84a58,
fidl::encoding::DynamicFlags::FLEXIBLE,
)
}
type StrictTwoWayResponseFut =
fidl::client::QueryResponseFut<(), fidl::encoding::DefaultFuchsiaResourceDialect>;
fn r#strict_two_way(&self) -> Self::StrictTwoWayResponseFut {
fn _decode(
mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
) -> Result<(), fidl::Error> {
let _response = fidl::client::decode_transaction_body::<
fidl::encoding::EmptyPayload,
fidl::encoding::DefaultFuchsiaResourceDialect,
0x70020c582a57ef03,
>(_buf?)?;
Ok(_response)
}
self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, ()>(
(),
0x70020c582a57ef03,
fidl::encoding::DynamicFlags::empty(),
_decode,
)
}
type StrictTwoWayFieldsResponseFut =
fidl::client::QueryResponseFut<i32, fidl::encoding::DefaultFuchsiaResourceDialect>;
fn r#strict_two_way_fields(&self, mut reply_with: i32) -> Self::StrictTwoWayFieldsResponseFut {
fn _decode(
mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
) -> Result<i32, fidl::Error> {
let _response = fidl::client::decode_transaction_body::<
OpenTargetStrictTwoWayFieldsResponse,
fidl::encoding::DefaultFuchsiaResourceDialect,
0x2be6e1cc40008010,
>(_buf?)?;
Ok(_response.some_field)
}
self.client.send_query_and_decode::<OpenTargetStrictTwoWayFieldsRequest, i32>(
(reply_with,),
0x2be6e1cc40008010,
fidl::encoding::DynamicFlags::empty(),
_decode,
)
}
type StrictTwoWayErrResponseFut = fidl::client::QueryResponseFut<
OpenTargetStrictTwoWayErrResult,
fidl::encoding::DefaultFuchsiaResourceDialect,
>;
fn r#strict_two_way_err(
&self,
mut payload: &OpenTargetStrictTwoWayErrRequest,
) -> Self::StrictTwoWayErrResponseFut {
fn _decode(
mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
) -> Result<OpenTargetStrictTwoWayErrResult, fidl::Error> {
let _response = fidl::client::decode_transaction_body::<
fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
fidl::encoding::DefaultFuchsiaResourceDialect,
0x6efc16069ebd0b2c,
>(_buf?)?;
Ok(_response.map(|x| x))
}
self.client.send_query_and_decode::<
OpenTargetStrictTwoWayErrRequest,
OpenTargetStrictTwoWayErrResult,
>(
payload,
0x6efc16069ebd0b2c,
fidl::encoding::DynamicFlags::empty(),
_decode,
)
}
type StrictTwoWayFieldsErrResponseFut = fidl::client::QueryResponseFut<
OpenTargetStrictTwoWayFieldsErrResult,
fidl::encoding::DefaultFuchsiaResourceDialect,
>;
fn r#strict_two_way_fields_err(
&self,
mut payload: &OpenTargetStrictTwoWayFieldsErrRequest,
) -> Self::StrictTwoWayFieldsErrResponseFut {
fn _decode(
mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
) -> Result<OpenTargetStrictTwoWayFieldsErrResult, fidl::Error> {
let _response = fidl::client::decode_transaction_body::<
fidl::encoding::ResultType<OpenTargetStrictTwoWayFieldsErrResponse, i32>,
fidl::encoding::DefaultFuchsiaResourceDialect,
0x309c8adda770fcf0,
>(_buf?)?;
Ok(_response.map(|x| x.some_field))
}
self.client.send_query_and_decode::<
OpenTargetStrictTwoWayFieldsErrRequest,
OpenTargetStrictTwoWayFieldsErrResult,
>(
payload,
0x309c8adda770fcf0,
fidl::encoding::DynamicFlags::empty(),
_decode,
)
}
type FlexibleTwoWayResponseFut =
fidl::client::QueryResponseFut<(), fidl::encoding::DefaultFuchsiaResourceDialect>;
fn r#flexible_two_way(&self) -> Self::FlexibleTwoWayResponseFut {
fn _decode(
mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
) -> Result<(), fidl::Error> {
let _response = fidl::client::decode_transaction_body::<
fidl::encoding::FlexibleType<fidl::encoding::EmptyStruct>,
fidl::encoding::DefaultFuchsiaResourceDialect,
0x19f932dac7810c71,
>(_buf?)?
.into_result::<OpenTargetMarker>("flexible_two_way")?;
Ok(_response)
}
self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, ()>(
(),
0x19f932dac7810c71,
fidl::encoding::DynamicFlags::FLEXIBLE,
_decode,
)
}
type FlexibleTwoWayFieldsResponseFut =
fidl::client::QueryResponseFut<i32, fidl::encoding::DefaultFuchsiaResourceDialect>;
fn r#flexible_two_way_fields(
&self,
mut reply_with: i32,
) -> Self::FlexibleTwoWayFieldsResponseFut {
fn _decode(
mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
) -> Result<i32, fidl::Error> {
let _response = fidl::client::decode_transaction_body::<
fidl::encoding::FlexibleType<OpenTargetFlexibleTwoWayFieldsResponse>,
fidl::encoding::DefaultFuchsiaResourceDialect,
0x47cca5ddb4207774,
>(_buf?)?
.into_result::<OpenTargetMarker>("flexible_two_way_fields")?;
Ok(_response.some_field)
}
self.client.send_query_and_decode::<OpenTargetFlexibleTwoWayFieldsRequest, i32>(
(reply_with,),
0x47cca5ddb4207774,
fidl::encoding::DynamicFlags::FLEXIBLE,
_decode,
)
}
type FlexibleTwoWayErrResponseFut = fidl::client::QueryResponseFut<
OpenTargetFlexibleTwoWayErrResult,
fidl::encoding::DefaultFuchsiaResourceDialect,
>;
fn r#flexible_two_way_err(
&self,
mut payload: &OpenTargetFlexibleTwoWayErrRequest,
) -> Self::FlexibleTwoWayErrResponseFut {
fn _decode(
mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
) -> Result<OpenTargetFlexibleTwoWayErrResult, fidl::Error> {
let _response = fidl::client::decode_transaction_body::<
fidl::encoding::FlexibleResultType<fidl::encoding::EmptyStruct, i32>,
fidl::encoding::DefaultFuchsiaResourceDialect,
0x52aa19681fea3a0,
>(_buf?)?
.into_result::<OpenTargetMarker>("flexible_two_way_err")?;
Ok(_response.map(|x| x))
}
self.client.send_query_and_decode::<
OpenTargetFlexibleTwoWayErrRequest,
OpenTargetFlexibleTwoWayErrResult,
>(
payload,
0x52aa19681fea3a0,
fidl::encoding::DynamicFlags::FLEXIBLE,
_decode,
)
}
type FlexibleTwoWayFieldsErrResponseFut = fidl::client::QueryResponseFut<
OpenTargetFlexibleTwoWayFieldsErrResult,
fidl::encoding::DefaultFuchsiaResourceDialect,
>;
fn r#flexible_two_way_fields_err(
&self,
mut payload: &OpenTargetFlexibleTwoWayFieldsErrRequest,
) -> Self::FlexibleTwoWayFieldsErrResponseFut {
fn _decode(
mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
) -> Result<OpenTargetFlexibleTwoWayFieldsErrResult, fidl::Error> {
let _response = fidl::client::decode_transaction_body::<
fidl::encoding::FlexibleResultType<OpenTargetFlexibleTwoWayFieldsErrResponse, i32>,
fidl::encoding::DefaultFuchsiaResourceDialect,
0x1ab7dd4c6a3650b6,
>(_buf?)?
.into_result::<OpenTargetMarker>("flexible_two_way_fields_err")?;
Ok(_response.map(|x| x.some_field))
}
self.client.send_query_and_decode::<
OpenTargetFlexibleTwoWayFieldsErrRequest,
OpenTargetFlexibleTwoWayFieldsErrResult,
>(
payload,
0x1ab7dd4c6a3650b6,
fidl::encoding::DynamicFlags::FLEXIBLE,
_decode,
)
}
}
pub struct OpenTargetEventStream {
event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
}
impl std::marker::Unpin for OpenTargetEventStream {}
impl futures::stream::FusedStream for OpenTargetEventStream {
fn is_terminated(&self) -> bool {
self.event_receiver.is_terminated()
}
}
impl futures::Stream for OpenTargetEventStream {
type Item = Result<OpenTargetEvent, 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(OpenTargetEvent::decode(buf))),
None => std::task::Poll::Ready(None),
}
}
}
#[derive(Debug)]
pub enum OpenTargetEvent {
StrictEvent {},
FlexibleEvent {},
#[non_exhaustive]
_UnknownEvent {
ordinal: u64,
},
}
impl OpenTargetEvent {
#[allow(irrefutable_let_patterns)]
pub fn into_strict_event(self) -> Option<()> {
if let OpenTargetEvent::StrictEvent {} = self {
Some(())
} else {
None
}
}
#[allow(irrefutable_let_patterns)]
pub fn into_flexible_event(self) -> Option<()> {
if let OpenTargetEvent::FlexibleEvent {} = self {
Some(())
} else {
None
}
}
fn decode(
mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
) -> Result<OpenTargetEvent, 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 {
0x778f95d421c0685 => {
let mut out = fidl::new_empty!(
fidl::encoding::EmptyPayload,
fidl::encoding::DefaultFuchsiaResourceDialect
);
fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&tx_header, _body_bytes, _handles, &mut out)?;
Ok((OpenTargetEvent::StrictEvent {}))
}
0x43d9ee0dca2bb33e => {
let mut out = fidl::new_empty!(
fidl::encoding::EmptyPayload,
fidl::encoding::DefaultFuchsiaResourceDialect
);
fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&tx_header, _body_bytes, _handles, &mut out)?;
Ok((OpenTargetEvent::FlexibleEvent {}))
}
_ if tx_header.dynamic_flags().contains(fidl::encoding::DynamicFlags::FLEXIBLE) => {
Ok(OpenTargetEvent::_UnknownEvent { ordinal: tx_header.ordinal })
}
_ => Err(fidl::Error::UnknownOrdinal {
ordinal: tx_header.ordinal,
protocol_name: <OpenTargetMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
}),
}
}
}
pub struct OpenTargetRequestStream {
inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
is_terminated: bool,
}
impl std::marker::Unpin for OpenTargetRequestStream {}
impl futures::stream::FusedStream for OpenTargetRequestStream {
fn is_terminated(&self) -> bool {
self.is_terminated
}
}
impl fidl::endpoints::RequestStream for OpenTargetRequestStream {
type Protocol = OpenTargetMarker;
type ControlHandle = OpenTargetControlHandle;
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 {
OpenTargetControlHandle { 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 OpenTargetRequestStream {
type Item = Result<OpenTargetRequest, 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 OpenTargetRequestStream 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 {
0x24dd8be3750aba9b => {
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 = OpenTargetControlHandle { inner: this.inner.clone() };
Ok(OpenTargetRequest::StrictOneWay { control_handle })
}
0x421bbeb2bbc84a58 => {
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 = OpenTargetControlHandle { inner: this.inner.clone() };
Ok(OpenTargetRequest::FlexibleOneWay { control_handle })
}
0x70020c582a57ef03 => {
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 = OpenTargetControlHandle { inner: this.inner.clone() };
Ok(OpenTargetRequest::StrictTwoWay {
responder: OpenTargetStrictTwoWayResponder {
control_handle: std::mem::ManuallyDrop::new(control_handle),
tx_id: header.tx_id,
},
})
}
0x2be6e1cc40008010 => {
header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
let mut req = fidl::new_empty!(
OpenTargetStrictTwoWayFieldsRequest,
fidl::encoding::DefaultFuchsiaResourceDialect
);
fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<OpenTargetStrictTwoWayFieldsRequest>(&header, _body_bytes, handles, &mut req)?;
let control_handle = OpenTargetControlHandle { inner: this.inner.clone() };
Ok(OpenTargetRequest::StrictTwoWayFields {
reply_with: req.reply_with,
responder: OpenTargetStrictTwoWayFieldsResponder {
control_handle: std::mem::ManuallyDrop::new(control_handle),
tx_id: header.tx_id,
},
})
}
0x6efc16069ebd0b2c => {
header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
let mut req = fidl::new_empty!(
OpenTargetStrictTwoWayErrRequest,
fidl::encoding::DefaultFuchsiaResourceDialect
);
fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<OpenTargetStrictTwoWayErrRequest>(&header, _body_bytes, handles, &mut req)?;
let control_handle = OpenTargetControlHandle { inner: this.inner.clone() };
Ok(OpenTargetRequest::StrictTwoWayErr {
payload: req,
responder: OpenTargetStrictTwoWayErrResponder {
control_handle: std::mem::ManuallyDrop::new(control_handle),
tx_id: header.tx_id,
},
})
}
0x309c8adda770fcf0 => {
header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
let mut req = fidl::new_empty!(
OpenTargetStrictTwoWayFieldsErrRequest,
fidl::encoding::DefaultFuchsiaResourceDialect
);
fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<OpenTargetStrictTwoWayFieldsErrRequest>(&header, _body_bytes, handles, &mut req)?;
let control_handle = OpenTargetControlHandle { inner: this.inner.clone() };
Ok(OpenTargetRequest::StrictTwoWayFieldsErr {
payload: req,
responder: OpenTargetStrictTwoWayFieldsErrResponder {
control_handle: std::mem::ManuallyDrop::new(control_handle),
tx_id: header.tx_id,
},
})
}
0x19f932dac7810c71 => {
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 = OpenTargetControlHandle { inner: this.inner.clone() };
Ok(OpenTargetRequest::FlexibleTwoWay {
responder: OpenTargetFlexibleTwoWayResponder {
control_handle: std::mem::ManuallyDrop::new(control_handle),
tx_id: header.tx_id,
},
})
}
0x47cca5ddb4207774 => {
header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
let mut req = fidl::new_empty!(
OpenTargetFlexibleTwoWayFieldsRequest,
fidl::encoding::DefaultFuchsiaResourceDialect
);
fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<OpenTargetFlexibleTwoWayFieldsRequest>(&header, _body_bytes, handles, &mut req)?;
let control_handle = OpenTargetControlHandle { inner: this.inner.clone() };
Ok(OpenTargetRequest::FlexibleTwoWayFields {
reply_with: req.reply_with,
responder: OpenTargetFlexibleTwoWayFieldsResponder {
control_handle: std::mem::ManuallyDrop::new(control_handle),
tx_id: header.tx_id,
},
})
}
0x52aa19681fea3a0 => {
header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
let mut req = fidl::new_empty!(
OpenTargetFlexibleTwoWayErrRequest,
fidl::encoding::DefaultFuchsiaResourceDialect
);
fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<OpenTargetFlexibleTwoWayErrRequest>(&header, _body_bytes, handles, &mut req)?;
let control_handle = OpenTargetControlHandle { inner: this.inner.clone() };
Ok(OpenTargetRequest::FlexibleTwoWayErr {
payload: req,
responder: OpenTargetFlexibleTwoWayErrResponder {
control_handle: std::mem::ManuallyDrop::new(control_handle),
tx_id: header.tx_id,
},
})
}
0x1ab7dd4c6a3650b6 => {
header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
let mut req = fidl::new_empty!(
OpenTargetFlexibleTwoWayFieldsErrRequest,
fidl::encoding::DefaultFuchsiaResourceDialect
);
fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<OpenTargetFlexibleTwoWayFieldsErrRequest>(&header, _body_bytes, handles, &mut req)?;
let control_handle = OpenTargetControlHandle { inner: this.inner.clone() };
Ok(OpenTargetRequest::FlexibleTwoWayFieldsErr {
payload: req,
responder: OpenTargetFlexibleTwoWayFieldsErrResponder {
control_handle: std::mem::ManuallyDrop::new(control_handle),
tx_id: header.tx_id,
},
})
}
_ if header.tx_id == 0
&& header
.dynamic_flags()
.contains(fidl::encoding::DynamicFlags::FLEXIBLE) =>
{
Ok(OpenTargetRequest::_UnknownMethod {
ordinal: header.ordinal,
control_handle: OpenTargetControlHandle { 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(OpenTargetRequest::_UnknownMethod {
ordinal: header.ordinal,
control_handle: OpenTargetControlHandle { inner: this.inner.clone() },
method_type: fidl::MethodType::TwoWay,
})
}
_ => Err(fidl::Error::UnknownOrdinal {
ordinal: header.ordinal,
protocol_name:
<OpenTargetMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
}),
}))
},
)
}
}
#[derive(Debug)]
pub enum OpenTargetRequest {
StrictOneWay {
control_handle: OpenTargetControlHandle,
},
FlexibleOneWay {
control_handle: OpenTargetControlHandle,
},
StrictTwoWay {
responder: OpenTargetStrictTwoWayResponder,
},
StrictTwoWayFields {
reply_with: i32,
responder: OpenTargetStrictTwoWayFieldsResponder,
},
StrictTwoWayErr {
payload: OpenTargetStrictTwoWayErrRequest,
responder: OpenTargetStrictTwoWayErrResponder,
},
StrictTwoWayFieldsErr {
payload: OpenTargetStrictTwoWayFieldsErrRequest,
responder: OpenTargetStrictTwoWayFieldsErrResponder,
},
FlexibleTwoWay {
responder: OpenTargetFlexibleTwoWayResponder,
},
FlexibleTwoWayFields {
reply_with: i32,
responder: OpenTargetFlexibleTwoWayFieldsResponder,
},
FlexibleTwoWayErr {
payload: OpenTargetFlexibleTwoWayErrRequest,
responder: OpenTargetFlexibleTwoWayErrResponder,
},
FlexibleTwoWayFieldsErr {
payload: OpenTargetFlexibleTwoWayFieldsErrRequest,
responder: OpenTargetFlexibleTwoWayFieldsErrResponder,
},
#[non_exhaustive]
_UnknownMethod {
ordinal: u64,
control_handle: OpenTargetControlHandle,
method_type: fidl::MethodType,
},
}
impl OpenTargetRequest {
#[allow(irrefutable_let_patterns)]
pub fn into_strict_one_way(self) -> Option<(OpenTargetControlHandle)> {
if let OpenTargetRequest::StrictOneWay { control_handle } = self {
Some((control_handle))
} else {
None
}
}
#[allow(irrefutable_let_patterns)]
pub fn into_flexible_one_way(self) -> Option<(OpenTargetControlHandle)> {
if let OpenTargetRequest::FlexibleOneWay { control_handle } = self {
Some((control_handle))
} else {
None
}
}
#[allow(irrefutable_let_patterns)]
pub fn into_strict_two_way(self) -> Option<(OpenTargetStrictTwoWayResponder)> {
if let OpenTargetRequest::StrictTwoWay { responder } = self {
Some((responder))
} else {
None
}
}
#[allow(irrefutable_let_patterns)]
pub fn into_strict_two_way_fields(
self,
) -> Option<(i32, OpenTargetStrictTwoWayFieldsResponder)> {
if let OpenTargetRequest::StrictTwoWayFields { reply_with, responder } = self {
Some((reply_with, responder))
} else {
None
}
}
#[allow(irrefutable_let_patterns)]
pub fn into_strict_two_way_err(
self,
) -> Option<(OpenTargetStrictTwoWayErrRequest, OpenTargetStrictTwoWayErrResponder)> {
if let OpenTargetRequest::StrictTwoWayErr { payload, responder } = self {
Some((payload, responder))
} else {
None
}
}
#[allow(irrefutable_let_patterns)]
pub fn into_strict_two_way_fields_err(
self,
) -> Option<(OpenTargetStrictTwoWayFieldsErrRequest, OpenTargetStrictTwoWayFieldsErrResponder)>
{
if let OpenTargetRequest::StrictTwoWayFieldsErr { payload, responder } = self {
Some((payload, responder))
} else {
None
}
}
#[allow(irrefutable_let_patterns)]
pub fn into_flexible_two_way(self) -> Option<(OpenTargetFlexibleTwoWayResponder)> {
if let OpenTargetRequest::FlexibleTwoWay { responder } = self {
Some((responder))
} else {
None
}
}
#[allow(irrefutable_let_patterns)]
pub fn into_flexible_two_way_fields(
self,
) -> Option<(i32, OpenTargetFlexibleTwoWayFieldsResponder)> {
if let OpenTargetRequest::FlexibleTwoWayFields { reply_with, responder } = self {
Some((reply_with, responder))
} else {
None
}
}
#[allow(irrefutable_let_patterns)]
pub fn into_flexible_two_way_err(
self,
) -> Option<(OpenTargetFlexibleTwoWayErrRequest, OpenTargetFlexibleTwoWayErrResponder)> {
if let OpenTargetRequest::FlexibleTwoWayErr { payload, responder } = self {
Some((payload, responder))
} else {
None
}
}
#[allow(irrefutable_let_patterns)]
pub fn into_flexible_two_way_fields_err(
self,
) -> Option<(
OpenTargetFlexibleTwoWayFieldsErrRequest,
OpenTargetFlexibleTwoWayFieldsErrResponder,
)> {
if let OpenTargetRequest::FlexibleTwoWayFieldsErr { payload, responder } = self {
Some((payload, responder))
} else {
None
}
}
pub fn method_name(&self) -> &'static str {
match *self {
OpenTargetRequest::StrictOneWay { .. } => "strict_one_way",
OpenTargetRequest::FlexibleOneWay { .. } => "flexible_one_way",
OpenTargetRequest::StrictTwoWay { .. } => "strict_two_way",
OpenTargetRequest::StrictTwoWayFields { .. } => "strict_two_way_fields",
OpenTargetRequest::StrictTwoWayErr { .. } => "strict_two_way_err",
OpenTargetRequest::StrictTwoWayFieldsErr { .. } => "strict_two_way_fields_err",
OpenTargetRequest::FlexibleTwoWay { .. } => "flexible_two_way",
OpenTargetRequest::FlexibleTwoWayFields { .. } => "flexible_two_way_fields",
OpenTargetRequest::FlexibleTwoWayErr { .. } => "flexible_two_way_err",
OpenTargetRequest::FlexibleTwoWayFieldsErr { .. } => "flexible_two_way_fields_err",
OpenTargetRequest::_UnknownMethod { method_type: fidl::MethodType::OneWay, .. } => {
"unknown one-way method"
}
OpenTargetRequest::_UnknownMethod { method_type: fidl::MethodType::TwoWay, .. } => {
"unknown two-way method"
}
}
}
}
#[derive(Debug, Clone)]
pub struct OpenTargetControlHandle {
inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
}
impl fidl::endpoints::ControlHandle for OpenTargetControlHandle {
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 OpenTargetControlHandle {
pub fn send_strict_event(&self) -> Result<(), fidl::Error> {
self.inner.send::<fidl::encoding::EmptyPayload>(
(),
0,
0x778f95d421c0685,
fidl::encoding::DynamicFlags::empty(),
)
}
pub fn send_flexible_event(&self) -> Result<(), fidl::Error> {
self.inner.send::<fidl::encoding::EmptyPayload>(
(),
0,
0x43d9ee0dca2bb33e,
fidl::encoding::DynamicFlags::FLEXIBLE,
)
}
}
#[must_use = "FIDL methods require a response to be sent"]
#[derive(Debug)]
pub struct OpenTargetStrictTwoWayResponder {
control_handle: std::mem::ManuallyDrop<OpenTargetControlHandle>,
tx_id: u32,
}
impl std::ops::Drop for OpenTargetStrictTwoWayResponder {
fn drop(&mut self) {
self.control_handle.shutdown();
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
}
}
impl fidl::endpoints::Responder for OpenTargetStrictTwoWayResponder {
type ControlHandle = OpenTargetControlHandle;
fn control_handle(&self) -> &OpenTargetControlHandle {
&self.control_handle
}
fn drop_without_shutdown(mut self) {
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
std::mem::forget(self);
}
}
impl OpenTargetStrictTwoWayResponder {
pub fn send(self) -> Result<(), fidl::Error> {
let _result = self.send_raw();
if _result.is_err() {
self.control_handle.shutdown();
}
self.drop_without_shutdown();
_result
}
pub fn send_no_shutdown_on_err(self) -> Result<(), fidl::Error> {
let _result = self.send_raw();
self.drop_without_shutdown();
_result
}
fn send_raw(&self) -> Result<(), fidl::Error> {
self.control_handle.inner.send::<fidl::encoding::EmptyPayload>(
(),
self.tx_id,
0x70020c582a57ef03,
fidl::encoding::DynamicFlags::empty(),
)
}
}
#[must_use = "FIDL methods require a response to be sent"]
#[derive(Debug)]
pub struct OpenTargetStrictTwoWayFieldsResponder {
control_handle: std::mem::ManuallyDrop<OpenTargetControlHandle>,
tx_id: u32,
}
impl std::ops::Drop for OpenTargetStrictTwoWayFieldsResponder {
fn drop(&mut self) {
self.control_handle.shutdown();
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
}
}
impl fidl::endpoints::Responder for OpenTargetStrictTwoWayFieldsResponder {
type ControlHandle = OpenTargetControlHandle;
fn control_handle(&self) -> &OpenTargetControlHandle {
&self.control_handle
}
fn drop_without_shutdown(mut self) {
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
std::mem::forget(self);
}
}
impl OpenTargetStrictTwoWayFieldsResponder {
pub fn send(self, mut some_field: i32) -> Result<(), fidl::Error> {
let _result = self.send_raw(some_field);
if _result.is_err() {
self.control_handle.shutdown();
}
self.drop_without_shutdown();
_result
}
pub fn send_no_shutdown_on_err(self, mut some_field: i32) -> Result<(), fidl::Error> {
let _result = self.send_raw(some_field);
self.drop_without_shutdown();
_result
}
fn send_raw(&self, mut some_field: i32) -> Result<(), fidl::Error> {
self.control_handle.inner.send::<OpenTargetStrictTwoWayFieldsResponse>(
(some_field,),
self.tx_id,
0x2be6e1cc40008010,
fidl::encoding::DynamicFlags::empty(),
)
}
}
#[must_use = "FIDL methods require a response to be sent"]
#[derive(Debug)]
pub struct OpenTargetStrictTwoWayErrResponder {
control_handle: std::mem::ManuallyDrop<OpenTargetControlHandle>,
tx_id: u32,
}
impl std::ops::Drop for OpenTargetStrictTwoWayErrResponder {
fn drop(&mut self) {
self.control_handle.shutdown();
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
}
}
impl fidl::endpoints::Responder for OpenTargetStrictTwoWayErrResponder {
type ControlHandle = OpenTargetControlHandle;
fn control_handle(&self) -> &OpenTargetControlHandle {
&self.control_handle
}
fn drop_without_shutdown(mut self) {
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
std::mem::forget(self);
}
}
impl OpenTargetStrictTwoWayErrResponder {
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,
0x6efc16069ebd0b2c,
fidl::encoding::DynamicFlags::empty(),
)
}
}
#[must_use = "FIDL methods require a response to be sent"]
#[derive(Debug)]
pub struct OpenTargetStrictTwoWayFieldsErrResponder {
control_handle: std::mem::ManuallyDrop<OpenTargetControlHandle>,
tx_id: u32,
}
impl std::ops::Drop for OpenTargetStrictTwoWayFieldsErrResponder {
fn drop(&mut self) {
self.control_handle.shutdown();
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
}
}
impl fidl::endpoints::Responder for OpenTargetStrictTwoWayFieldsErrResponder {
type ControlHandle = OpenTargetControlHandle;
fn control_handle(&self) -> &OpenTargetControlHandle {
&self.control_handle
}
fn drop_without_shutdown(mut self) {
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
std::mem::forget(self);
}
}
impl OpenTargetStrictTwoWayFieldsErrResponder {
pub fn send(self, mut result: Result<i32, 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, i32>) -> Result<(), fidl::Error> {
let _result = self.send_raw(result);
self.drop_without_shutdown();
_result
}
fn send_raw(&self, mut result: Result<i32, i32>) -> Result<(), fidl::Error> {
self.control_handle.inner.send::<fidl::encoding::ResultType<
OpenTargetStrictTwoWayFieldsErrResponse,
i32,
>>(
result.map(|some_field| (some_field,)),
self.tx_id,
0x309c8adda770fcf0,
fidl::encoding::DynamicFlags::empty(),
)
}
}
#[must_use = "FIDL methods require a response to be sent"]
#[derive(Debug)]
pub struct OpenTargetFlexibleTwoWayResponder {
control_handle: std::mem::ManuallyDrop<OpenTargetControlHandle>,
tx_id: u32,
}
impl std::ops::Drop for OpenTargetFlexibleTwoWayResponder {
fn drop(&mut self) {
self.control_handle.shutdown();
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
}
}
impl fidl::endpoints::Responder for OpenTargetFlexibleTwoWayResponder {
type ControlHandle = OpenTargetControlHandle;
fn control_handle(&self) -> &OpenTargetControlHandle {
&self.control_handle
}
fn drop_without_shutdown(mut self) {
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
std::mem::forget(self);
}
}
impl OpenTargetFlexibleTwoWayResponder {
pub fn send(self) -> Result<(), fidl::Error> {
let _result = self.send_raw();
if _result.is_err() {
self.control_handle.shutdown();
}
self.drop_without_shutdown();
_result
}
pub fn send_no_shutdown_on_err(self) -> Result<(), fidl::Error> {
let _result = self.send_raw();
self.drop_without_shutdown();
_result
}
fn send_raw(&self) -> Result<(), fidl::Error> {
self.control_handle.inner.send::<fidl::encoding::FlexibleType<fidl::encoding::EmptyStruct>>(
fidl::encoding::Flexible::new(()),
self.tx_id,
0x19f932dac7810c71,
fidl::encoding::DynamicFlags::FLEXIBLE,
)
}
}
#[must_use = "FIDL methods require a response to be sent"]
#[derive(Debug)]
pub struct OpenTargetFlexibleTwoWayFieldsResponder {
control_handle: std::mem::ManuallyDrop<OpenTargetControlHandle>,
tx_id: u32,
}
impl std::ops::Drop for OpenTargetFlexibleTwoWayFieldsResponder {
fn drop(&mut self) {
self.control_handle.shutdown();
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
}
}
impl fidl::endpoints::Responder for OpenTargetFlexibleTwoWayFieldsResponder {
type ControlHandle = OpenTargetControlHandle;
fn control_handle(&self) -> &OpenTargetControlHandle {
&self.control_handle
}
fn drop_without_shutdown(mut self) {
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
std::mem::forget(self);
}
}
impl OpenTargetFlexibleTwoWayFieldsResponder {
pub fn send(self, mut some_field: i32) -> Result<(), fidl::Error> {
let _result = self.send_raw(some_field);
if _result.is_err() {
self.control_handle.shutdown();
}
self.drop_without_shutdown();
_result
}
pub fn send_no_shutdown_on_err(self, mut some_field: i32) -> Result<(), fidl::Error> {
let _result = self.send_raw(some_field);
self.drop_without_shutdown();
_result
}
fn send_raw(&self, mut some_field: i32) -> Result<(), fidl::Error> {
self.control_handle.inner.send::<fidl::encoding::FlexibleType<
OpenTargetFlexibleTwoWayFieldsResponse,
>>(
fidl::encoding::Flexible::new((some_field,)),
self.tx_id,
0x47cca5ddb4207774,
fidl::encoding::DynamicFlags::FLEXIBLE,
)
}
}
#[must_use = "FIDL methods require a response to be sent"]
#[derive(Debug)]
pub struct OpenTargetFlexibleTwoWayErrResponder {
control_handle: std::mem::ManuallyDrop<OpenTargetControlHandle>,
tx_id: u32,
}
impl std::ops::Drop for OpenTargetFlexibleTwoWayErrResponder {
fn drop(&mut self) {
self.control_handle.shutdown();
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
}
}
impl fidl::endpoints::Responder for OpenTargetFlexibleTwoWayErrResponder {
type ControlHandle = OpenTargetControlHandle;
fn control_handle(&self) -> &OpenTargetControlHandle {
&self.control_handle
}
fn drop_without_shutdown(mut self) {
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
std::mem::forget(self);
}
}
impl OpenTargetFlexibleTwoWayErrResponder {
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::FlexibleResultType<
fidl::encoding::EmptyStruct,
i32,
>>(
fidl::encoding::FlexibleResult::new(result),
self.tx_id,
0x52aa19681fea3a0,
fidl::encoding::DynamicFlags::FLEXIBLE,
)
}
}
#[must_use = "FIDL methods require a response to be sent"]
#[derive(Debug)]
pub struct OpenTargetFlexibleTwoWayFieldsErrResponder {
control_handle: std::mem::ManuallyDrop<OpenTargetControlHandle>,
tx_id: u32,
}
impl std::ops::Drop for OpenTargetFlexibleTwoWayFieldsErrResponder {
fn drop(&mut self) {
self.control_handle.shutdown();
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
}
}
impl fidl::endpoints::Responder for OpenTargetFlexibleTwoWayFieldsErrResponder {
type ControlHandle = OpenTargetControlHandle;
fn control_handle(&self) -> &OpenTargetControlHandle {
&self.control_handle
}
fn drop_without_shutdown(mut self) {
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
std::mem::forget(self);
}
}
impl OpenTargetFlexibleTwoWayFieldsErrResponder {
pub fn send(self, mut result: Result<i32, 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, i32>) -> Result<(), fidl::Error> {
let _result = self.send_raw(result);
self.drop_without_shutdown();
_result
}
fn send_raw(&self, mut result: Result<i32, i32>) -> Result<(), fidl::Error> {
self.control_handle.inner.send::<fidl::encoding::FlexibleResultType<
OpenTargetFlexibleTwoWayFieldsErrResponse,
i32,
>>(
fidl::encoding::FlexibleResult::new(result.map(|some_field| (some_field,))),
self.tx_id,
0x1ab7dd4c6a3650b6,
fidl::encoding::DynamicFlags::FLEXIBLE,
)
}
}
#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
pub struct RunnerMarker;
impl fidl::endpoints::ProtocolMarker for RunnerMarker {
type Proxy = RunnerProxy;
type RequestStream = RunnerRequestStream;
#[cfg(target_os = "fuchsia")]
type SynchronousProxy = RunnerSynchronousProxy;
const DEBUG_NAME: &'static str = "fidl.serversuite.Runner";
}
impl fidl::endpoints::DiscoverableProtocolMarker for RunnerMarker {}
pub type RunnerStartResult = Result<(), StartError>;
pub trait RunnerProxyInterface: Send + Sync {
type GetVersionResponseFut: std::future::Future<Output = Result<u64, fidl::Error>> + Send;
fn r#get_version(&self) -> Self::GetVersionResponseFut;
type CheckAliveResponseFut: std::future::Future<Output = Result<(), fidl::Error>> + Send;
fn r#check_alive(&self) -> Self::CheckAliveResponseFut;
type StartResponseFut: std::future::Future<Output = Result<RunnerStartResult, fidl::Error>>
+ Send;
fn r#start(&self, test: Test, any_target: AnyTarget) -> Self::StartResponseFut;
type ShutdownWithEpitaphResponseFut: std::future::Future<Output = Result<(), fidl::Error>>
+ Send;
fn r#shutdown_with_epitaph(&self, epitaph_status: i32) -> Self::ShutdownWithEpitaphResponseFut;
type SendOpenTargetStrictEventResponseFut: std::future::Future<Output = Result<(), fidl::Error>>
+ Send;
fn r#send_open_target_strict_event(&self) -> Self::SendOpenTargetStrictEventResponseFut;
type SendOpenTargetFlexibleEventResponseFut: std::future::Future<Output = Result<(), fidl::Error>>
+ Send;
fn r#send_open_target_flexible_event(&self) -> Self::SendOpenTargetFlexibleEventResponseFut;
}
#[derive(Debug)]
#[cfg(target_os = "fuchsia")]
pub struct RunnerSynchronousProxy {
client: fidl::client::sync::Client,
}
#[cfg(target_os = "fuchsia")]
impl fidl::endpoints::SynchronousProxy for RunnerSynchronousProxy {
type Proxy = RunnerProxy;
type Protocol = RunnerMarker;
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 RunnerSynchronousProxy {
pub fn new(channel: fidl::Channel) -> Self {
let protocol_name = <RunnerMarker 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<RunnerEvent, fidl::Error> {
RunnerEvent::decode(self.client.wait_for_event(deadline)?)
}
pub fn r#get_version(&self, ___deadline: zx::MonotonicInstant) -> Result<u64, fidl::Error> {
let _response =
self.client.send_query::<fidl::encoding::EmptyPayload, RunnerGetVersionResponse>(
(),
0x3c70bef2e59d06a7,
fidl::encoding::DynamicFlags::empty(),
___deadline,
)?;
Ok(_response.version)
}
pub fn r#check_alive(&self, ___deadline: zx::MonotonicInstant) -> Result<(), fidl::Error> {
let _response =
self.client.send_query::<fidl::encoding::EmptyPayload, fidl::encoding::EmptyPayload>(
(),
0x2449c31d30d6f5b7,
fidl::encoding::DynamicFlags::empty(),
___deadline,
)?;
Ok(_response)
}
pub fn r#start(
&self,
mut test: Test,
mut any_target: AnyTarget,
___deadline: zx::MonotonicInstant,
) -> Result<RunnerStartResult, fidl::Error> {
let _response = self.client.send_query::<RunnerStartRequest, fidl::encoding::ResultType<
fidl::encoding::EmptyStruct,
StartError,
>>(
(test, &mut any_target),
0x2d4735726d30a5b0,
fidl::encoding::DynamicFlags::empty(),
___deadline,
)?;
Ok(_response.map(|x| x))
}
pub fn r#shutdown_with_epitaph(
&self,
mut epitaph_status: i32,
___deadline: zx::MonotonicInstant,
) -> Result<(), fidl::Error> {
let _response = self
.client
.send_query::<RunnerShutdownWithEpitaphRequest, fidl::encoding::EmptyPayload>(
(epitaph_status,),
0x7a15369d88e1e8ec,
fidl::encoding::DynamicFlags::empty(),
___deadline,
)?;
Ok(_response)
}
pub fn r#send_open_target_strict_event(
&self,
___deadline: zx::MonotonicInstant,
) -> Result<(), fidl::Error> {
let _response =
self.client.send_query::<fidl::encoding::EmptyPayload, fidl::encoding::EmptyPayload>(
(),
0x1c3e4452a20c9590,
fidl::encoding::DynamicFlags::empty(),
___deadline,
)?;
Ok(_response)
}
pub fn r#send_open_target_flexible_event(
&self,
___deadline: zx::MonotonicInstant,
) -> Result<(), fidl::Error> {
let _response =
self.client.send_query::<fidl::encoding::EmptyPayload, fidl::encoding::EmptyPayload>(
(),
0x2d2c9446799baeb6,
fidl::encoding::DynamicFlags::empty(),
___deadline,
)?;
Ok(_response)
}
}
#[derive(Debug, Clone)]
pub struct RunnerProxy {
client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
}
impl fidl::endpoints::Proxy for RunnerProxy {
type Protocol = RunnerMarker;
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 RunnerProxy {
pub fn new(channel: ::fidl::AsyncChannel) -> Self {
let protocol_name = <RunnerMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
Self { client: fidl::client::Client::new(channel, protocol_name) }
}
pub fn take_event_stream(&self) -> RunnerEventStream {
RunnerEventStream { event_receiver: self.client.take_event_receiver() }
}
pub fn r#get_version(
&self,
) -> fidl::client::QueryResponseFut<u64, fidl::encoding::DefaultFuchsiaResourceDialect> {
RunnerProxyInterface::r#get_version(self)
}
pub fn r#check_alive(
&self,
) -> fidl::client::QueryResponseFut<(), fidl::encoding::DefaultFuchsiaResourceDialect> {
RunnerProxyInterface::r#check_alive(self)
}
pub fn r#start(
&self,
mut test: Test,
mut any_target: AnyTarget,
) -> fidl::client::QueryResponseFut<
RunnerStartResult,
fidl::encoding::DefaultFuchsiaResourceDialect,
> {
RunnerProxyInterface::r#start(self, test, any_target)
}
pub fn r#shutdown_with_epitaph(
&self,
mut epitaph_status: i32,
) -> fidl::client::QueryResponseFut<(), fidl::encoding::DefaultFuchsiaResourceDialect> {
RunnerProxyInterface::r#shutdown_with_epitaph(self, epitaph_status)
}
pub fn r#send_open_target_strict_event(
&self,
) -> fidl::client::QueryResponseFut<(), fidl::encoding::DefaultFuchsiaResourceDialect> {
RunnerProxyInterface::r#send_open_target_strict_event(self)
}
pub fn r#send_open_target_flexible_event(
&self,
) -> fidl::client::QueryResponseFut<(), fidl::encoding::DefaultFuchsiaResourceDialect> {
RunnerProxyInterface::r#send_open_target_flexible_event(self)
}
}
impl RunnerProxyInterface for RunnerProxy {
type GetVersionResponseFut =
fidl::client::QueryResponseFut<u64, fidl::encoding::DefaultFuchsiaResourceDialect>;
fn r#get_version(&self) -> Self::GetVersionResponseFut {
fn _decode(
mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
) -> Result<u64, fidl::Error> {
let _response = fidl::client::decode_transaction_body::<
RunnerGetVersionResponse,
fidl::encoding::DefaultFuchsiaResourceDialect,
0x3c70bef2e59d06a7,
>(_buf?)?;
Ok(_response.version)
}
self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, u64>(
(),
0x3c70bef2e59d06a7,
fidl::encoding::DynamicFlags::empty(),
_decode,
)
}
type CheckAliveResponseFut =
fidl::client::QueryResponseFut<(), fidl::encoding::DefaultFuchsiaResourceDialect>;
fn r#check_alive(&self) -> Self::CheckAliveResponseFut {
fn _decode(
mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
) -> Result<(), fidl::Error> {
let _response = fidl::client::decode_transaction_body::<
fidl::encoding::EmptyPayload,
fidl::encoding::DefaultFuchsiaResourceDialect,
0x2449c31d30d6f5b7,
>(_buf?)?;
Ok(_response)
}
self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, ()>(
(),
0x2449c31d30d6f5b7,
fidl::encoding::DynamicFlags::empty(),
_decode,
)
}
type StartResponseFut = fidl::client::QueryResponseFut<
RunnerStartResult,
fidl::encoding::DefaultFuchsiaResourceDialect,
>;
fn r#start(&self, mut test: Test, mut any_target: AnyTarget) -> Self::StartResponseFut {
fn _decode(
mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
) -> Result<RunnerStartResult, fidl::Error> {
let _response = fidl::client::decode_transaction_body::<
fidl::encoding::ResultType<fidl::encoding::EmptyStruct, StartError>,
fidl::encoding::DefaultFuchsiaResourceDialect,
0x2d4735726d30a5b0,
>(_buf?)?;
Ok(_response.map(|x| x))
}
self.client.send_query_and_decode::<RunnerStartRequest, RunnerStartResult>(
(test, &mut any_target),
0x2d4735726d30a5b0,
fidl::encoding::DynamicFlags::empty(),
_decode,
)
}
type ShutdownWithEpitaphResponseFut =
fidl::client::QueryResponseFut<(), fidl::encoding::DefaultFuchsiaResourceDialect>;
fn r#shutdown_with_epitaph(
&self,
mut epitaph_status: i32,
) -> Self::ShutdownWithEpitaphResponseFut {
fn _decode(
mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
) -> Result<(), fidl::Error> {
let _response = fidl::client::decode_transaction_body::<
fidl::encoding::EmptyPayload,
fidl::encoding::DefaultFuchsiaResourceDialect,
0x7a15369d88e1e8ec,
>(_buf?)?;
Ok(_response)
}
self.client.send_query_and_decode::<RunnerShutdownWithEpitaphRequest, ()>(
(epitaph_status,),
0x7a15369d88e1e8ec,
fidl::encoding::DynamicFlags::empty(),
_decode,
)
}
type SendOpenTargetStrictEventResponseFut =
fidl::client::QueryResponseFut<(), fidl::encoding::DefaultFuchsiaResourceDialect>;
fn r#send_open_target_strict_event(&self) -> Self::SendOpenTargetStrictEventResponseFut {
fn _decode(
mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
) -> Result<(), fidl::Error> {
let _response = fidl::client::decode_transaction_body::<
fidl::encoding::EmptyPayload,
fidl::encoding::DefaultFuchsiaResourceDialect,
0x1c3e4452a20c9590,
>(_buf?)?;
Ok(_response)
}
self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, ()>(
(),
0x1c3e4452a20c9590,
fidl::encoding::DynamicFlags::empty(),
_decode,
)
}
type SendOpenTargetFlexibleEventResponseFut =
fidl::client::QueryResponseFut<(), fidl::encoding::DefaultFuchsiaResourceDialect>;
fn r#send_open_target_flexible_event(&self) -> Self::SendOpenTargetFlexibleEventResponseFut {
fn _decode(
mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
) -> Result<(), fidl::Error> {
let _response = fidl::client::decode_transaction_body::<
fidl::encoding::EmptyPayload,
fidl::encoding::DefaultFuchsiaResourceDialect,
0x2d2c9446799baeb6,
>(_buf?)?;
Ok(_response)
}
self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, ()>(
(),
0x2d2c9446799baeb6,
fidl::encoding::DynamicFlags::empty(),
_decode,
)
}
}
pub struct RunnerEventStream {
event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
}
impl std::marker::Unpin for RunnerEventStream {}
impl futures::stream::FusedStream for RunnerEventStream {
fn is_terminated(&self) -> bool {
self.event_receiver.is_terminated()
}
}
impl futures::Stream for RunnerEventStream {
type Item = Result<RunnerEvent, 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(RunnerEvent::decode(buf))),
None => std::task::Poll::Ready(None),
}
}
}
#[derive(Debug)]
pub enum RunnerEvent {
OnTeardown { reason: TeardownReason },
OnReceivedUnknownMethod { ordinal: u64, unknown_method_type: UnknownMethodType },
OnReceivedClosedTargetOneWayNoPayload {},
OnReceivedOpenTargetStrictOneWay {},
OnReceivedOpenTargetFlexibleOneWay {},
}
impl RunnerEvent {
#[allow(irrefutable_let_patterns)]
pub fn into_on_teardown(self) -> Option<TeardownReason> {
if let RunnerEvent::OnTeardown { reason } = self {
Some((reason))
} else {
None
}
}
#[allow(irrefutable_let_patterns)]
pub fn into_on_received_unknown_method(self) -> Option<(u64, UnknownMethodType)> {
if let RunnerEvent::OnReceivedUnknownMethod { ordinal, unknown_method_type } = self {
Some((ordinal, unknown_method_type))
} else {
None
}
}
#[allow(irrefutable_let_patterns)]
pub fn into_on_received_closed_target_one_way_no_payload(self) -> Option<()> {
if let RunnerEvent::OnReceivedClosedTargetOneWayNoPayload {} = self {
Some(())
} else {
None
}
}
#[allow(irrefutable_let_patterns)]
pub fn into_on_received_open_target_strict_one_way(self) -> Option<()> {
if let RunnerEvent::OnReceivedOpenTargetStrictOneWay {} = self {
Some(())
} else {
None
}
}
#[allow(irrefutable_let_patterns)]
pub fn into_on_received_open_target_flexible_one_way(self) -> Option<()> {
if let RunnerEvent::OnReceivedOpenTargetFlexibleOneWay {} = self {
Some(())
} else {
None
}
}
fn decode(
mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
) -> Result<RunnerEvent, 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 {
0x4472273866753acf => {
let mut out = fidl::new_empty!(
RunnerOnTeardownRequest,
fidl::encoding::DefaultFuchsiaResourceDialect
);
fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<RunnerOnTeardownRequest>(&tx_header, _body_bytes, _handles, &mut out)?;
Ok((RunnerEvent::OnTeardown { reason: out.reason }))
}
0x3c7f8d66a4f4c0e4 => {
let mut out = fidl::new_empty!(
UnknownMethodInfo,
fidl::encoding::DefaultFuchsiaResourceDialect
);
fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<UnknownMethodInfo>(&tx_header, _body_bytes, _handles, &mut out)?;
Ok((RunnerEvent::OnReceivedUnknownMethod {
ordinal: out.ordinal,
unknown_method_type: out.unknown_method_type,
}))
}
0x56915f3fcde32b6f => {
let mut out = fidl::new_empty!(
fidl::encoding::EmptyPayload,
fidl::encoding::DefaultFuchsiaResourceDialect
);
fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&tx_header, _body_bytes, _handles, &mut out)?;
Ok((RunnerEvent::OnReceivedClosedTargetOneWayNoPayload {}))
}
0x5b82db8b0ffe97c5 => {
let mut out = fidl::new_empty!(
fidl::encoding::EmptyPayload,
fidl::encoding::DefaultFuchsiaResourceDialect
);
fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&tx_header, _body_bytes, _handles, &mut out)?;
Ok((RunnerEvent::OnReceivedOpenTargetStrictOneWay {}))
}
0x2428c34ecface889 => {
let mut out = fidl::new_empty!(
fidl::encoding::EmptyPayload,
fidl::encoding::DefaultFuchsiaResourceDialect
);
fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&tx_header, _body_bytes, _handles, &mut out)?;
Ok((RunnerEvent::OnReceivedOpenTargetFlexibleOneWay {}))
}
_ => Err(fidl::Error::UnknownOrdinal {
ordinal: tx_header.ordinal,
protocol_name: <RunnerMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
}),
}
}
}
pub struct RunnerRequestStream {
inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
is_terminated: bool,
}
impl std::marker::Unpin for RunnerRequestStream {}
impl futures::stream::FusedStream for RunnerRequestStream {
fn is_terminated(&self) -> bool {
self.is_terminated
}
}
impl fidl::endpoints::RequestStream for RunnerRequestStream {
type Protocol = RunnerMarker;
type ControlHandle = RunnerControlHandle;
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 {
RunnerControlHandle { 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 RunnerRequestStream {
type Item = Result<RunnerRequest, 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 RunnerRequestStream 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 {
0x3c70bef2e59d06a7 => {
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 = RunnerControlHandle { inner: this.inner.clone() };
Ok(RunnerRequest::GetVersion {
responder: RunnerGetVersionResponder {
control_handle: std::mem::ManuallyDrop::new(control_handle),
tx_id: header.tx_id,
},
})
}
0x2449c31d30d6f5b7 => {
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 = RunnerControlHandle { inner: this.inner.clone() };
Ok(RunnerRequest::CheckAlive {
responder: RunnerCheckAliveResponder {
control_handle: std::mem::ManuallyDrop::new(control_handle),
tx_id: header.tx_id,
},
})
}
0x2d4735726d30a5b0 => {
header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
let mut req = fidl::new_empty!(
RunnerStartRequest,
fidl::encoding::DefaultFuchsiaResourceDialect
);
fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<RunnerStartRequest>(&header, _body_bytes, handles, &mut req)?;
let control_handle = RunnerControlHandle { inner: this.inner.clone() };
Ok(RunnerRequest::Start {
test: req.test,
any_target: req.any_target,
responder: RunnerStartResponder {
control_handle: std::mem::ManuallyDrop::new(control_handle),
tx_id: header.tx_id,
},
})
}
0x7a15369d88e1e8ec => {
header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
let mut req = fidl::new_empty!(
RunnerShutdownWithEpitaphRequest,
fidl::encoding::DefaultFuchsiaResourceDialect
);
fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<RunnerShutdownWithEpitaphRequest>(&header, _body_bytes, handles, &mut req)?;
let control_handle = RunnerControlHandle { inner: this.inner.clone() };
Ok(RunnerRequest::ShutdownWithEpitaph {
epitaph_status: req.epitaph_status,
responder: RunnerShutdownWithEpitaphResponder {
control_handle: std::mem::ManuallyDrop::new(control_handle),
tx_id: header.tx_id,
},
})
}
0x1c3e4452a20c9590 => {
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 = RunnerControlHandle { inner: this.inner.clone() };
Ok(RunnerRequest::SendOpenTargetStrictEvent {
responder: RunnerSendOpenTargetStrictEventResponder {
control_handle: std::mem::ManuallyDrop::new(control_handle),
tx_id: header.tx_id,
},
})
}
0x2d2c9446799baeb6 => {
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 = RunnerControlHandle { inner: this.inner.clone() };
Ok(RunnerRequest::SendOpenTargetFlexibleEvent {
responder: RunnerSendOpenTargetFlexibleEventResponder {
control_handle: std::mem::ManuallyDrop::new(control_handle),
tx_id: header.tx_id,
},
})
}
_ => Err(fidl::Error::UnknownOrdinal {
ordinal: header.ordinal,
protocol_name:
<RunnerMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
}),
}))
},
)
}
}
#[derive(Debug)]
pub enum RunnerRequest {
GetVersion { responder: RunnerGetVersionResponder },
CheckAlive { responder: RunnerCheckAliveResponder },
Start { test: Test, any_target: AnyTarget, responder: RunnerStartResponder },
ShutdownWithEpitaph { epitaph_status: i32, responder: RunnerShutdownWithEpitaphResponder },
SendOpenTargetStrictEvent { responder: RunnerSendOpenTargetStrictEventResponder },
SendOpenTargetFlexibleEvent { responder: RunnerSendOpenTargetFlexibleEventResponder },
}
impl RunnerRequest {
#[allow(irrefutable_let_patterns)]
pub fn into_get_version(self) -> Option<(RunnerGetVersionResponder)> {
if let RunnerRequest::GetVersion { responder } = self {
Some((responder))
} else {
None
}
}
#[allow(irrefutable_let_patterns)]
pub fn into_check_alive(self) -> Option<(RunnerCheckAliveResponder)> {
if let RunnerRequest::CheckAlive { responder } = self {
Some((responder))
} else {
None
}
}
#[allow(irrefutable_let_patterns)]
pub fn into_start(self) -> Option<(Test, AnyTarget, RunnerStartResponder)> {
if let RunnerRequest::Start { test, any_target, responder } = self {
Some((test, any_target, responder))
} else {
None
}
}
#[allow(irrefutable_let_patterns)]
pub fn into_shutdown_with_epitaph(self) -> Option<(i32, RunnerShutdownWithEpitaphResponder)> {
if let RunnerRequest::ShutdownWithEpitaph { epitaph_status, responder } = self {
Some((epitaph_status, responder))
} else {
None
}
}
#[allow(irrefutable_let_patterns)]
pub fn into_send_open_target_strict_event(
self,
) -> Option<(RunnerSendOpenTargetStrictEventResponder)> {
if let RunnerRequest::SendOpenTargetStrictEvent { responder } = self {
Some((responder))
} else {
None
}
}
#[allow(irrefutable_let_patterns)]
pub fn into_send_open_target_flexible_event(
self,
) -> Option<(RunnerSendOpenTargetFlexibleEventResponder)> {
if let RunnerRequest::SendOpenTargetFlexibleEvent { responder } = self {
Some((responder))
} else {
None
}
}
pub fn method_name(&self) -> &'static str {
match *self {
RunnerRequest::GetVersion { .. } => "get_version",
RunnerRequest::CheckAlive { .. } => "check_alive",
RunnerRequest::Start { .. } => "start",
RunnerRequest::ShutdownWithEpitaph { .. } => "shutdown_with_epitaph",
RunnerRequest::SendOpenTargetStrictEvent { .. } => "send_open_target_strict_event",
RunnerRequest::SendOpenTargetFlexibleEvent { .. } => "send_open_target_flexible_event",
}
}
}
#[derive(Debug, Clone)]
pub struct RunnerControlHandle {
inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
}
impl fidl::endpoints::ControlHandle for RunnerControlHandle {
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 RunnerControlHandle {
pub fn send_on_teardown(&self, mut reason: TeardownReason) -> Result<(), fidl::Error> {
self.inner.send::<RunnerOnTeardownRequest>(
(reason,),
0,
0x4472273866753acf,
fidl::encoding::DynamicFlags::empty(),
)
}
pub fn send_on_received_unknown_method(
&self,
mut ordinal: u64,
mut unknown_method_type: UnknownMethodType,
) -> Result<(), fidl::Error> {
self.inner.send::<UnknownMethodInfo>(
(ordinal, unknown_method_type),
0,
0x3c7f8d66a4f4c0e4,
fidl::encoding::DynamicFlags::empty(),
)
}
pub fn send_on_received_closed_target_one_way_no_payload(&self) -> Result<(), fidl::Error> {
self.inner.send::<fidl::encoding::EmptyPayload>(
(),
0,
0x56915f3fcde32b6f,
fidl::encoding::DynamicFlags::empty(),
)
}
pub fn send_on_received_open_target_strict_one_way(&self) -> Result<(), fidl::Error> {
self.inner.send::<fidl::encoding::EmptyPayload>(
(),
0,
0x5b82db8b0ffe97c5,
fidl::encoding::DynamicFlags::empty(),
)
}
pub fn send_on_received_open_target_flexible_one_way(&self) -> Result<(), fidl::Error> {
self.inner.send::<fidl::encoding::EmptyPayload>(
(),
0,
0x2428c34ecface889,
fidl::encoding::DynamicFlags::empty(),
)
}
}
#[must_use = "FIDL methods require a response to be sent"]
#[derive(Debug)]
pub struct RunnerGetVersionResponder {
control_handle: std::mem::ManuallyDrop<RunnerControlHandle>,
tx_id: u32,
}
impl std::ops::Drop for RunnerGetVersionResponder {
fn drop(&mut self) {
self.control_handle.shutdown();
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
}
}
impl fidl::endpoints::Responder for RunnerGetVersionResponder {
type ControlHandle = RunnerControlHandle;
fn control_handle(&self) -> &RunnerControlHandle {
&self.control_handle
}
fn drop_without_shutdown(mut self) {
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
std::mem::forget(self);
}
}
impl RunnerGetVersionResponder {
pub fn send(self, mut version: u64) -> Result<(), fidl::Error> {
let _result = self.send_raw(version);
if _result.is_err() {
self.control_handle.shutdown();
}
self.drop_without_shutdown();
_result
}
pub fn send_no_shutdown_on_err(self, mut version: u64) -> Result<(), fidl::Error> {
let _result = self.send_raw(version);
self.drop_without_shutdown();
_result
}
fn send_raw(&self, mut version: u64) -> Result<(), fidl::Error> {
self.control_handle.inner.send::<RunnerGetVersionResponse>(
(version,),
self.tx_id,
0x3c70bef2e59d06a7,
fidl::encoding::DynamicFlags::empty(),
)
}
}
#[must_use = "FIDL methods require a response to be sent"]
#[derive(Debug)]
pub struct RunnerCheckAliveResponder {
control_handle: std::mem::ManuallyDrop<RunnerControlHandle>,
tx_id: u32,
}
impl std::ops::Drop for RunnerCheckAliveResponder {
fn drop(&mut self) {
self.control_handle.shutdown();
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
}
}
impl fidl::endpoints::Responder for RunnerCheckAliveResponder {
type ControlHandle = RunnerControlHandle;
fn control_handle(&self) -> &RunnerControlHandle {
&self.control_handle
}
fn drop_without_shutdown(mut self) {
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
std::mem::forget(self);
}
}
impl RunnerCheckAliveResponder {
pub fn send(self) -> Result<(), fidl::Error> {
let _result = self.send_raw();
if _result.is_err() {
self.control_handle.shutdown();
}
self.drop_without_shutdown();
_result
}
pub fn send_no_shutdown_on_err(self) -> Result<(), fidl::Error> {
let _result = self.send_raw();
self.drop_without_shutdown();
_result
}
fn send_raw(&self) -> Result<(), fidl::Error> {
self.control_handle.inner.send::<fidl::encoding::EmptyPayload>(
(),
self.tx_id,
0x2449c31d30d6f5b7,
fidl::encoding::DynamicFlags::empty(),
)
}
}
#[must_use = "FIDL methods require a response to be sent"]
#[derive(Debug)]
pub struct RunnerStartResponder {
control_handle: std::mem::ManuallyDrop<RunnerControlHandle>,
tx_id: u32,
}
impl std::ops::Drop for RunnerStartResponder {
fn drop(&mut self) {
self.control_handle.shutdown();
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
}
}
impl fidl::endpoints::Responder for RunnerStartResponder {
type ControlHandle = RunnerControlHandle;
fn control_handle(&self) -> &RunnerControlHandle {
&self.control_handle
}
fn drop_without_shutdown(mut self) {
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
std::mem::forget(self);
}
}
impl RunnerStartResponder {
pub fn send(self, mut result: Result<(), StartError>) -> 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<(), StartError>,
) -> Result<(), fidl::Error> {
let _result = self.send_raw(result);
self.drop_without_shutdown();
_result
}
fn send_raw(&self, mut result: Result<(), StartError>) -> Result<(), fidl::Error> {
self.control_handle
.inner
.send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, StartError>>(
result,
self.tx_id,
0x2d4735726d30a5b0,
fidl::encoding::DynamicFlags::empty(),
)
}
}
#[must_use = "FIDL methods require a response to be sent"]
#[derive(Debug)]
pub struct RunnerShutdownWithEpitaphResponder {
control_handle: std::mem::ManuallyDrop<RunnerControlHandle>,
tx_id: u32,
}
impl std::ops::Drop for RunnerShutdownWithEpitaphResponder {
fn drop(&mut self) {
self.control_handle.shutdown();
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
}
}
impl fidl::endpoints::Responder for RunnerShutdownWithEpitaphResponder {
type ControlHandle = RunnerControlHandle;
fn control_handle(&self) -> &RunnerControlHandle {
&self.control_handle
}
fn drop_without_shutdown(mut self) {
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
std::mem::forget(self);
}
}
impl RunnerShutdownWithEpitaphResponder {
pub fn send(self) -> Result<(), fidl::Error> {
let _result = self.send_raw();
if _result.is_err() {
self.control_handle.shutdown();
}
self.drop_without_shutdown();
_result
}
pub fn send_no_shutdown_on_err(self) -> Result<(), fidl::Error> {
let _result = self.send_raw();
self.drop_without_shutdown();
_result
}
fn send_raw(&self) -> Result<(), fidl::Error> {
self.control_handle.inner.send::<fidl::encoding::EmptyPayload>(
(),
self.tx_id,
0x7a15369d88e1e8ec,
fidl::encoding::DynamicFlags::empty(),
)
}
}
#[must_use = "FIDL methods require a response to be sent"]
#[derive(Debug)]
pub struct RunnerSendOpenTargetStrictEventResponder {
control_handle: std::mem::ManuallyDrop<RunnerControlHandle>,
tx_id: u32,
}
impl std::ops::Drop for RunnerSendOpenTargetStrictEventResponder {
fn drop(&mut self) {
self.control_handle.shutdown();
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
}
}
impl fidl::endpoints::Responder for RunnerSendOpenTargetStrictEventResponder {
type ControlHandle = RunnerControlHandle;
fn control_handle(&self) -> &RunnerControlHandle {
&self.control_handle
}
fn drop_without_shutdown(mut self) {
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
std::mem::forget(self);
}
}
impl RunnerSendOpenTargetStrictEventResponder {
pub fn send(self) -> Result<(), fidl::Error> {
let _result = self.send_raw();
if _result.is_err() {
self.control_handle.shutdown();
}
self.drop_without_shutdown();
_result
}
pub fn send_no_shutdown_on_err(self) -> Result<(), fidl::Error> {
let _result = self.send_raw();
self.drop_without_shutdown();
_result
}
fn send_raw(&self) -> Result<(), fidl::Error> {
self.control_handle.inner.send::<fidl::encoding::EmptyPayload>(
(),
self.tx_id,
0x1c3e4452a20c9590,
fidl::encoding::DynamicFlags::empty(),
)
}
}
#[must_use = "FIDL methods require a response to be sent"]
#[derive(Debug)]
pub struct RunnerSendOpenTargetFlexibleEventResponder {
control_handle: std::mem::ManuallyDrop<RunnerControlHandle>,
tx_id: u32,
}
impl std::ops::Drop for RunnerSendOpenTargetFlexibleEventResponder {
fn drop(&mut self) {
self.control_handle.shutdown();
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
}
}
impl fidl::endpoints::Responder for RunnerSendOpenTargetFlexibleEventResponder {
type ControlHandle = RunnerControlHandle;
fn control_handle(&self) -> &RunnerControlHandle {
&self.control_handle
}
fn drop_without_shutdown(mut self) {
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
std::mem::forget(self);
}
}
impl RunnerSendOpenTargetFlexibleEventResponder {
pub fn send(self) -> Result<(), fidl::Error> {
let _result = self.send_raw();
if _result.is_err() {
self.control_handle.shutdown();
}
self.drop_without_shutdown();
_result
}
pub fn send_no_shutdown_on_err(self) -> Result<(), fidl::Error> {
let _result = self.send_raw();
self.drop_without_shutdown();
_result
}
fn send_raw(&self) -> Result<(), fidl::Error> {
self.control_handle.inner.send::<fidl::encoding::EmptyPayload>(
(),
self.tx_id,
0x2d2c9446799baeb6,
fidl::encoding::DynamicFlags::empty(),
)
}
}
mod internal {
use super::*;
unsafe impl fidl::encoding::TypeMarker for TeardownReason {
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
4
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
4
}
}
impl fidl::encoding::ValueTypeMarker for TeardownReason {
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 TeardownReason {
#[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);
if self.bits() & Self::all().bits() != self.bits() {
return Err(fidl::Error::InvalidBitsValue);
}
encoder.write_num(self.bits(), offset);
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for TeardownReason {
#[inline(always)]
fn new_empty() -> Self {
Self::empty()
}
#[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::<u32>(offset);
*self = Self::from_bits(prim).ok_or(fidl::Error::InvalidBitsValue)?;
Ok(())
}
}
unsafe impl fidl::encoding::TypeMarker for StartError {
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
std::mem::align_of::<u32>()
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
std::mem::size_of::<u32>()
}
#[inline(always)]
fn encode_is_copy() -> bool {
true
}
#[inline(always)]
fn decode_is_copy() -> bool {
false
}
}
impl fidl::encoding::ValueTypeMarker for StartError {
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 StartError {
#[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 StartError {
#[inline(always)]
fn new_empty() -> Self {
Self::TestDisabled
}
#[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::<u32>(offset);
*self = Self::from_primitive(prim).ok_or(fidl::Error::InvalidEnumValue)?;
Ok(())
}
}
unsafe impl fidl::encoding::TypeMarker for Test {
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
std::mem::align_of::<u32>()
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
std::mem::size_of::<u32>()
}
#[inline(always)]
fn encode_is_copy() -> bool {
false
}
#[inline(always)]
fn decode_is_copy() -> bool {
false
}
}
impl fidl::encoding::ValueTypeMarker for Test {
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 Test {
#[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 Test {
#[inline(always)]
fn new_empty() -> Self {
Self::unknown()
}
#[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::<u32>(offset);
*self = Self::from_primitive_allow_unknown(prim);
Ok(())
}
}
unsafe impl fidl::encoding::TypeMarker for UnknownMethodType {
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
std::mem::align_of::<u32>()
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
std::mem::size_of::<u32>()
}
#[inline(always)]
fn encode_is_copy() -> bool {
true
}
#[inline(always)]
fn decode_is_copy() -> bool {
false
}
}
impl fidl::encoding::ValueTypeMarker for UnknownMethodType {
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 UnknownMethodType
{
#[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 UnknownMethodType {
#[inline(always)]
fn new_empty() -> Self {
Self::OneWay
}
#[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::<u32>(offset);
*self = Self::from_primitive(prim).ok_or(fidl::Error::InvalidEnumValue)?;
Ok(())
}
}
impl fidl::encoding::ValueTypeMarker for ClosedTargetByteVectorSizeRequest {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for ClosedTargetByteVectorSizeRequest {
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<ClosedTargetByteVectorSizeRequest, D>
for &ClosedTargetByteVectorSizeRequest
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<ClosedTargetByteVectorSizeRequest>(offset);
fidl::encoding::Encode::<ClosedTargetByteVectorSizeRequest, D>::encode(
(<fidl::encoding::UnboundedVector<u8> as fidl::encoding::ValueTypeMarker>::borrow(
&self.vec,
),),
encoder,
offset,
_depth,
)
}
}
unsafe impl<
D: fidl::encoding::ResourceDialect,
T0: fidl::encoding::Encode<fidl::encoding::UnboundedVector<u8>, D>,
> fidl::encoding::Encode<ClosedTargetByteVectorSizeRequest, 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::<ClosedTargetByteVectorSizeRequest>(offset);
self.0.encode(encoder, offset + 0, depth)?;
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
for ClosedTargetByteVectorSizeRequest
{
#[inline(always)]
fn new_empty() -> Self {
Self { vec: fidl::new_empty!(fidl::encoding::UnboundedVector<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);
fidl::decode!(
fidl::encoding::UnboundedVector<u8>,
D,
&mut self.vec,
decoder,
offset + 0,
_depth
)?;
Ok(())
}
}
impl fidl::encoding::ValueTypeMarker for ClosedTargetByteVectorSizeResponse {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for ClosedTargetByteVectorSizeResponse {
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
4
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
4
}
#[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<ClosedTargetByteVectorSizeResponse, D>
for &ClosedTargetByteVectorSizeResponse
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<ClosedTargetByteVectorSizeResponse>(offset);
unsafe {
let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
(buf_ptr as *mut ClosedTargetByteVectorSizeResponse)
.write_unaligned((self as *const ClosedTargetByteVectorSizeResponse).read());
}
Ok(())
}
}
unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<u32, D>>
fidl::encoding::Encode<ClosedTargetByteVectorSizeResponse, 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::<ClosedTargetByteVectorSizeResponse>(offset);
self.0.encode(encoder, offset + 0, depth)?;
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
for ClosedTargetByteVectorSizeResponse
{
#[inline(always)]
fn new_empty() -> Self {
Self { n: 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) };
unsafe {
std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 4);
}
Ok(())
}
}
impl fidl::encoding::ValueTypeMarker for ClosedTargetCreateNByteVectorRequest {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for ClosedTargetCreateNByteVectorRequest {
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
4
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
4
}
#[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<ClosedTargetCreateNByteVectorRequest, D>
for &ClosedTargetCreateNByteVectorRequest
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<ClosedTargetCreateNByteVectorRequest>(offset);
unsafe {
let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
(buf_ptr as *mut ClosedTargetCreateNByteVectorRequest)
.write_unaligned((self as *const ClosedTargetCreateNByteVectorRequest).read());
}
Ok(())
}
}
unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<u32, D>>
fidl::encoding::Encode<ClosedTargetCreateNByteVectorRequest, 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::<ClosedTargetCreateNByteVectorRequest>(offset);
self.0.encode(encoder, offset + 0, depth)?;
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
for ClosedTargetCreateNByteVectorRequest
{
#[inline(always)]
fn new_empty() -> Self {
Self { n: 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) };
unsafe {
std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 4);
}
Ok(())
}
}
impl fidl::encoding::ValueTypeMarker for ClosedTargetCreateNByteVectorResponse {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for ClosedTargetCreateNByteVectorResponse {
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<ClosedTargetCreateNByteVectorResponse, D>
for &ClosedTargetCreateNByteVectorResponse
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<ClosedTargetCreateNByteVectorResponse>(offset);
fidl::encoding::Encode::<ClosedTargetCreateNByteVectorResponse, D>::encode(
(<fidl::encoding::UnboundedVector<u8> as fidl::encoding::ValueTypeMarker>::borrow(
&self.vec,
),),
encoder,
offset,
_depth,
)
}
}
unsafe impl<
D: fidl::encoding::ResourceDialect,
T0: fidl::encoding::Encode<fidl::encoding::UnboundedVector<u8>, D>,
> fidl::encoding::Encode<ClosedTargetCreateNByteVectorResponse, 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::<ClosedTargetCreateNByteVectorResponse>(offset);
self.0.encode(encoder, offset + 0, depth)?;
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
for ClosedTargetCreateNByteVectorResponse
{
#[inline(always)]
fn new_empty() -> Self {
Self { vec: fidl::new_empty!(fidl::encoding::UnboundedVector<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);
fidl::decode!(
fidl::encoding::UnboundedVector<u8>,
D,
&mut self.vec,
decoder,
offset + 0,
_depth
)?;
Ok(())
}
}
impl fidl::encoding::ResourceTypeMarker for ClosedTargetCreateNHandleVectorRequest {
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 ClosedTargetCreateNHandleVectorRequest {
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
4
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
4
}
#[inline(always)]
fn encode_is_copy() -> bool {
true
}
#[inline(always)]
fn decode_is_copy() -> bool {
true
}
}
unsafe impl
fidl::encoding::Encode<
ClosedTargetCreateNHandleVectorRequest,
fidl::encoding::DefaultFuchsiaResourceDialect,
> for &mut ClosedTargetCreateNHandleVectorRequest
{
#[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::<ClosedTargetCreateNHandleVectorRequest>(offset);
unsafe {
let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
(buf_ptr as *mut ClosedTargetCreateNHandleVectorRequest).write_unaligned(
(self as *const ClosedTargetCreateNHandleVectorRequest).read(),
);
}
Ok(())
}
}
unsafe impl<T0: fidl::encoding::Encode<u32, fidl::encoding::DefaultFuchsiaResourceDialect>>
fidl::encoding::Encode<
ClosedTargetCreateNHandleVectorRequest,
fidl::encoding::DefaultFuchsiaResourceDialect,
> for (T0,)
{
#[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::<ClosedTargetCreateNHandleVectorRequest>(offset);
self.0.encode(encoder, offset + 0, depth)?;
Ok(())
}
}
impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
for ClosedTargetCreateNHandleVectorRequest
{
#[inline(always)]
fn new_empty() -> Self {
Self { n: fidl::new_empty!(u32, 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 buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
unsafe {
std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 4);
}
Ok(())
}
}
impl fidl::encoding::ResourceTypeMarker for ClosedTargetCreateNHandleVectorResponse {
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 ClosedTargetCreateNHandleVectorResponse {
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<
ClosedTargetCreateNHandleVectorResponse,
fidl::encoding::DefaultFuchsiaResourceDialect,
> for &mut ClosedTargetCreateNHandleVectorResponse
{
#[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::<ClosedTargetCreateNHandleVectorResponse>(offset);
fidl::encoding::Encode::<
ClosedTargetCreateNHandleVectorResponse,
fidl::encoding::DefaultFuchsiaResourceDialect,
>::encode(
(<fidl::encoding::UnboundedVector<
fidl::encoding::HandleType<
fidl::Event,
{ fidl::ObjectType::EVENT.into_raw() },
2147483648,
>,
> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
&mut self.vec
),),
encoder,
offset,
_depth,
)
}
}
unsafe impl<
T0: fidl::encoding::Encode<
fidl::encoding::UnboundedVector<
fidl::encoding::HandleType<
fidl::Event,
{ fidl::ObjectType::EVENT.into_raw() },
2147483648,
>,
>,
fidl::encoding::DefaultFuchsiaResourceDialect,
>,
>
fidl::encoding::Encode<
ClosedTargetCreateNHandleVectorResponse,
fidl::encoding::DefaultFuchsiaResourceDialect,
> for (T0,)
{
#[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::<ClosedTargetCreateNHandleVectorResponse>(offset);
self.0.encode(encoder, offset + 0, depth)?;
Ok(())
}
}
impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
for ClosedTargetCreateNHandleVectorResponse
{
#[inline(always)]
fn new_empty() -> Self {
Self {
vec: fidl::new_empty!(
fidl::encoding::UnboundedVector<
fidl::encoding::HandleType<
fidl::Event,
{ fidl::ObjectType::EVENT.into_raw() },
2147483648,
>,
>,
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::encoding::UnboundedVector<
fidl::encoding::HandleType<
fidl::Event,
{ fidl::ObjectType::EVENT.into_raw() },
2147483648,
>,
>,
fidl::encoding::DefaultFuchsiaResourceDialect,
&mut self.vec,
decoder,
offset + 0,
_depth
)?;
Ok(())
}
}
impl fidl::encoding::ResourceTypeMarker for ClosedTargetEchoAsTransferableSignalableEventRequest {
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 ClosedTargetEchoAsTransferableSignalableEventRequest {
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
4
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
4
}
}
unsafe impl
fidl::encoding::Encode<
ClosedTargetEchoAsTransferableSignalableEventRequest,
fidl::encoding::DefaultFuchsiaResourceDialect,
> for &mut ClosedTargetEchoAsTransferableSignalableEventRequest
{
#[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::<ClosedTargetEchoAsTransferableSignalableEventRequest>(offset);
fidl::encoding::Encode::<
ClosedTargetEchoAsTransferableSignalableEventRequest,
fidl::encoding::DefaultFuchsiaResourceDialect,
>::encode(
(<fidl::encoding::HandleType<
fidl::Handle,
{ fidl::ObjectType::NONE.into_raw() },
2147483648,
> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
&mut self.handle
),),
encoder,
offset,
_depth,
)
}
}
unsafe impl<
T0: fidl::encoding::Encode<
fidl::encoding::HandleType<
fidl::Handle,
{ fidl::ObjectType::NONE.into_raw() },
2147483648,
>,
fidl::encoding::DefaultFuchsiaResourceDialect,
>,
>
fidl::encoding::Encode<
ClosedTargetEchoAsTransferableSignalableEventRequest,
fidl::encoding::DefaultFuchsiaResourceDialect,
> for (T0,)
{
#[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::<ClosedTargetEchoAsTransferableSignalableEventRequest>(offset);
self.0.encode(encoder, offset + 0, depth)?;
Ok(())
}
}
impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
for ClosedTargetEchoAsTransferableSignalableEventRequest
{
#[inline(always)]
fn new_empty() -> Self {
Self {
handle: fidl::new_empty!(fidl::encoding::HandleType<fidl::Handle, { fidl::ObjectType::NONE.into_raw() }, 2147483648>, 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::encoding::HandleType<fidl::Handle, { fidl::ObjectType::NONE.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect, &mut self.handle, decoder, offset + 0, _depth)?;
Ok(())
}
}
impl fidl::encoding::ResourceTypeMarker for ClosedTargetEchoAsTransferableSignalableEventResponse {
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 ClosedTargetEchoAsTransferableSignalableEventResponse {
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
4
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
4
}
}
unsafe impl
fidl::encoding::Encode<
ClosedTargetEchoAsTransferableSignalableEventResponse,
fidl::encoding::DefaultFuchsiaResourceDialect,
> for &mut ClosedTargetEchoAsTransferableSignalableEventResponse
{
#[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::<ClosedTargetEchoAsTransferableSignalableEventResponse>(
offset,
);
fidl::encoding::Encode::<
ClosedTargetEchoAsTransferableSignalableEventResponse,
fidl::encoding::DefaultFuchsiaResourceDialect,
>::encode(
(<fidl::encoding::HandleType<
fidl::Event,
{ fidl::ObjectType::EVENT.into_raw() },
4098,
> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
&mut self.handle
),),
encoder,
offset,
_depth,
)
}
}
unsafe impl<
T0: fidl::encoding::Encode<
fidl::encoding::HandleType<
fidl::Event,
{ fidl::ObjectType::EVENT.into_raw() },
4098,
>,
fidl::encoding::DefaultFuchsiaResourceDialect,
>,
>
fidl::encoding::Encode<
ClosedTargetEchoAsTransferableSignalableEventResponse,
fidl::encoding::DefaultFuchsiaResourceDialect,
> for (T0,)
{
#[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::<ClosedTargetEchoAsTransferableSignalableEventResponse>(
offset,
);
self.0.encode(encoder, offset + 0, depth)?;
Ok(())
}
}
impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
for ClosedTargetEchoAsTransferableSignalableEventResponse
{
#[inline(always)]
fn new_empty() -> Self {
Self {
handle: fidl::new_empty!(fidl::encoding::HandleType<fidl::Event, { fidl::ObjectType::EVENT.into_raw() }, 4098>, 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::encoding::HandleType<fidl::Event, { fidl::ObjectType::EVENT.into_raw() }, 4098>, fidl::encoding::DefaultFuchsiaResourceDialect, &mut self.handle, decoder, offset + 0, _depth)?;
Ok(())
}
}
impl fidl::encoding::ResourceTypeMarker for ClosedTargetGetHandleRightsRequest {
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 ClosedTargetGetHandleRightsRequest {
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
4
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
4
}
}
unsafe impl
fidl::encoding::Encode<
ClosedTargetGetHandleRightsRequest,
fidl::encoding::DefaultFuchsiaResourceDialect,
> for &mut ClosedTargetGetHandleRightsRequest
{
#[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::<ClosedTargetGetHandleRightsRequest>(offset);
fidl::encoding::Encode::<
ClosedTargetGetHandleRightsRequest,
fidl::encoding::DefaultFuchsiaResourceDialect,
>::encode(
(<fidl::encoding::HandleType<
fidl::Handle,
{ fidl::ObjectType::NONE.into_raw() },
2147483648,
> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
&mut self.handle
),),
encoder,
offset,
_depth,
)
}
}
unsafe impl<
T0: fidl::encoding::Encode<
fidl::encoding::HandleType<
fidl::Handle,
{ fidl::ObjectType::NONE.into_raw() },
2147483648,
>,
fidl::encoding::DefaultFuchsiaResourceDialect,
>,
>
fidl::encoding::Encode<
ClosedTargetGetHandleRightsRequest,
fidl::encoding::DefaultFuchsiaResourceDialect,
> for (T0,)
{
#[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::<ClosedTargetGetHandleRightsRequest>(offset);
self.0.encode(encoder, offset + 0, depth)?;
Ok(())
}
}
impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
for ClosedTargetGetHandleRightsRequest
{
#[inline(always)]
fn new_empty() -> Self {
Self {
handle: fidl::new_empty!(fidl::encoding::HandleType<fidl::Handle, { fidl::ObjectType::NONE.into_raw() }, 2147483648>, 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::encoding::HandleType<fidl::Handle, { fidl::ObjectType::NONE.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect, &mut self.handle, decoder, offset + 0, _depth)?;
Ok(())
}
}
impl fidl::encoding::ValueTypeMarker for ClosedTargetGetHandleRightsResponse {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for ClosedTargetGetHandleRightsResponse {
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
4
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
4
}
}
unsafe impl<D: fidl::encoding::ResourceDialect>
fidl::encoding::Encode<ClosedTargetGetHandleRightsResponse, D>
for &ClosedTargetGetHandleRightsResponse
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<ClosedTargetGetHandleRightsResponse>(offset);
fidl::encoding::Encode::<ClosedTargetGetHandleRightsResponse, D>::encode(
(<fidl::Rights as fidl::encoding::ValueTypeMarker>::borrow(&self.rights),),
encoder,
offset,
_depth,
)
}
}
unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<fidl::Rights, D>>
fidl::encoding::Encode<ClosedTargetGetHandleRightsResponse, 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::<ClosedTargetGetHandleRightsResponse>(offset);
self.0.encode(encoder, offset + 0, depth)?;
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
for ClosedTargetGetHandleRightsResponse
{
#[inline(always)]
fn new_empty() -> Self {
Self { rights: fidl::new_empty!(fidl::Rights, 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::Rights, D, &mut self.rights, decoder, offset + 0, _depth)?;
Ok(())
}
}
impl fidl::encoding::ResourceTypeMarker for ClosedTargetGetSignalableEventRightsRequest {
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 ClosedTargetGetSignalableEventRightsRequest {
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
4
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
4
}
}
unsafe impl
fidl::encoding::Encode<
ClosedTargetGetSignalableEventRightsRequest,
fidl::encoding::DefaultFuchsiaResourceDialect,
> for &mut ClosedTargetGetSignalableEventRightsRequest
{
#[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::<ClosedTargetGetSignalableEventRightsRequest>(offset);
fidl::encoding::Encode::<
ClosedTargetGetSignalableEventRightsRequest,
fidl::encoding::DefaultFuchsiaResourceDialect,
>::encode(
(<fidl::encoding::HandleType<
fidl::Event,
{ fidl::ObjectType::EVENT.into_raw() },
4096,
> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
&mut self.handle
),),
encoder,
offset,
_depth,
)
}
}
unsafe impl<
T0: fidl::encoding::Encode<
fidl::encoding::HandleType<
fidl::Event,
{ fidl::ObjectType::EVENT.into_raw() },
4096,
>,
fidl::encoding::DefaultFuchsiaResourceDialect,
>,
>
fidl::encoding::Encode<
ClosedTargetGetSignalableEventRightsRequest,
fidl::encoding::DefaultFuchsiaResourceDialect,
> for (T0,)
{
#[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::<ClosedTargetGetSignalableEventRightsRequest>(offset);
self.0.encode(encoder, offset + 0, depth)?;
Ok(())
}
}
impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
for ClosedTargetGetSignalableEventRightsRequest
{
#[inline(always)]
fn new_empty() -> Self {
Self {
handle: fidl::new_empty!(fidl::encoding::HandleType<fidl::Event, { fidl::ObjectType::EVENT.into_raw() }, 4096>, 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::encoding::HandleType<fidl::Event, { fidl::ObjectType::EVENT.into_raw() }, 4096>, fidl::encoding::DefaultFuchsiaResourceDialect, &mut self.handle, decoder, offset + 0, _depth)?;
Ok(())
}
}
impl fidl::encoding::ValueTypeMarker for ClosedTargetGetSignalableEventRightsResponse {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for ClosedTargetGetSignalableEventRightsResponse {
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
4
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
4
}
}
unsafe impl<D: fidl::encoding::ResourceDialect>
fidl::encoding::Encode<ClosedTargetGetSignalableEventRightsResponse, D>
for &ClosedTargetGetSignalableEventRightsResponse
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<ClosedTargetGetSignalableEventRightsResponse>(offset);
fidl::encoding::Encode::<ClosedTargetGetSignalableEventRightsResponse, D>::encode(
(<fidl::Rights as fidl::encoding::ValueTypeMarker>::borrow(&self.rights),),
encoder,
offset,
_depth,
)
}
}
unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<fidl::Rights, D>>
fidl::encoding::Encode<ClosedTargetGetSignalableEventRightsResponse, 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::<ClosedTargetGetSignalableEventRightsResponse>(offset);
self.0.encode(encoder, offset + 0, depth)?;
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
for ClosedTargetGetSignalableEventRightsResponse
{
#[inline(always)]
fn new_empty() -> Self {
Self { rights: fidl::new_empty!(fidl::Rights, 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::Rights, D, &mut self.rights, decoder, offset + 0, _depth)?;
Ok(())
}
}
impl fidl::encoding::ResourceTypeMarker for ClosedTargetHandleVectorSizeRequest {
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 ClosedTargetHandleVectorSizeRequest {
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<
ClosedTargetHandleVectorSizeRequest,
fidl::encoding::DefaultFuchsiaResourceDialect,
> for &mut ClosedTargetHandleVectorSizeRequest
{
#[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::<ClosedTargetHandleVectorSizeRequest>(offset);
fidl::encoding::Encode::<
ClosedTargetHandleVectorSizeRequest,
fidl::encoding::DefaultFuchsiaResourceDialect,
>::encode(
(<fidl::encoding::UnboundedVector<
fidl::encoding::HandleType<
fidl::Event,
{ fidl::ObjectType::EVENT.into_raw() },
2147483648,
>,
> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
&mut self.vec
),),
encoder,
offset,
_depth,
)
}
}
unsafe impl<
T0: fidl::encoding::Encode<
fidl::encoding::UnboundedVector<
fidl::encoding::HandleType<
fidl::Event,
{ fidl::ObjectType::EVENT.into_raw() },
2147483648,
>,
>,
fidl::encoding::DefaultFuchsiaResourceDialect,
>,
>
fidl::encoding::Encode<
ClosedTargetHandleVectorSizeRequest,
fidl::encoding::DefaultFuchsiaResourceDialect,
> for (T0,)
{
#[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::<ClosedTargetHandleVectorSizeRequest>(offset);
self.0.encode(encoder, offset + 0, depth)?;
Ok(())
}
}
impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
for ClosedTargetHandleVectorSizeRequest
{
#[inline(always)]
fn new_empty() -> Self {
Self {
vec: fidl::new_empty!(
fidl::encoding::UnboundedVector<
fidl::encoding::HandleType<
fidl::Event,
{ fidl::ObjectType::EVENT.into_raw() },
2147483648,
>,
>,
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::encoding::UnboundedVector<
fidl::encoding::HandleType<
fidl::Event,
{ fidl::ObjectType::EVENT.into_raw() },
2147483648,
>,
>,
fidl::encoding::DefaultFuchsiaResourceDialect,
&mut self.vec,
decoder,
offset + 0,
_depth
)?;
Ok(())
}
}
impl fidl::encoding::ValueTypeMarker for ClosedTargetHandleVectorSizeResponse {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for ClosedTargetHandleVectorSizeResponse {
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
4
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
4
}
#[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<ClosedTargetHandleVectorSizeResponse, D>
for &ClosedTargetHandleVectorSizeResponse
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<ClosedTargetHandleVectorSizeResponse>(offset);
unsafe {
let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
(buf_ptr as *mut ClosedTargetHandleVectorSizeResponse)
.write_unaligned((self as *const ClosedTargetHandleVectorSizeResponse).read());
}
Ok(())
}
}
unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<u32, D>>
fidl::encoding::Encode<ClosedTargetHandleVectorSizeResponse, 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::<ClosedTargetHandleVectorSizeResponse>(offset);
self.0.encode(encoder, offset + 0, depth)?;
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
for ClosedTargetHandleVectorSizeResponse
{
#[inline(always)]
fn new_empty() -> Self {
Self { n: 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) };
unsafe {
std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 4);
}
Ok(())
}
}
impl fidl::encoding::ValueTypeMarker for ClosedTargetTwoWayStructPayloadRequest {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for ClosedTargetTwoWayStructPayloadRequest {
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<ClosedTargetTwoWayStructPayloadRequest, D>
for &ClosedTargetTwoWayStructPayloadRequest
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<ClosedTargetTwoWayStructPayloadRequest>(offset);
unsafe {
let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
(buf_ptr as *mut ClosedTargetTwoWayStructPayloadRequest).write_unaligned(
(self as *const ClosedTargetTwoWayStructPayloadRequest).read(),
);
}
Ok(())
}
}
unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<i8, D>>
fidl::encoding::Encode<ClosedTargetTwoWayStructPayloadRequest, 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::<ClosedTargetTwoWayStructPayloadRequest>(offset);
self.0.encode(encoder, offset + 0, depth)?;
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
for ClosedTargetTwoWayStructPayloadRequest
{
#[inline(always)]
fn new_empty() -> Self {
Self { v: fidl::new_empty!(i8, 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 ClosedTargetTwoWayStructPayloadResponse {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for ClosedTargetTwoWayStructPayloadResponse {
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<ClosedTargetTwoWayStructPayloadResponse, D>
for &ClosedTargetTwoWayStructPayloadResponse
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<ClosedTargetTwoWayStructPayloadResponse>(offset);
unsafe {
let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
(buf_ptr as *mut ClosedTargetTwoWayStructPayloadResponse).write_unaligned(
(self as *const ClosedTargetTwoWayStructPayloadResponse).read(),
);
}
Ok(())
}
}
unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<i8, D>>
fidl::encoding::Encode<ClosedTargetTwoWayStructPayloadResponse, 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::<ClosedTargetTwoWayStructPayloadResponse>(offset);
self.0.encode(encoder, offset + 0, depth)?;
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
for ClosedTargetTwoWayStructPayloadResponse
{
#[inline(always)]
fn new_empty() -> Self {
Self { v: fidl::new_empty!(i8, 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 ClosedTargetTwoWayResultResponse {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for ClosedTargetTwoWayResultResponse {
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<ClosedTargetTwoWayResultResponse, D>
for &ClosedTargetTwoWayResultResponse
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<ClosedTargetTwoWayResultResponse>(offset);
fidl::encoding::Encode::<ClosedTargetTwoWayResultResponse, D>::encode(
(<fidl::encoding::UnboundedString as fidl::encoding::ValueTypeMarker>::borrow(
&self.payload,
),),
encoder,
offset,
_depth,
)
}
}
unsafe impl<
D: fidl::encoding::ResourceDialect,
T0: fidl::encoding::Encode<fidl::encoding::UnboundedString, D>,
> fidl::encoding::Encode<ClosedTargetTwoWayResultResponse, 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::<ClosedTargetTwoWayResultResponse>(offset);
self.0.encode(encoder, offset + 0, depth)?;
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
for ClosedTargetTwoWayResultResponse
{
#[inline(always)]
fn new_empty() -> Self {
Self { payload: fidl::new_empty!(fidl::encoding::UnboundedString, 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::UnboundedString,
D,
&mut self.payload,
decoder,
offset + 0,
_depth
)?;
Ok(())
}
}
impl fidl::encoding::ValueTypeMarker for Empty {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for Empty {
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
1
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
1
}
}
unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Empty, D> for &Empty {
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<Empty>(offset);
encoder.write_num(0u8, offset);
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for Empty {
#[inline(always)]
fn new_empty() -> Self {
Self
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
match decoder.read_num::<u8>(offset) {
0 => Ok(()),
_ => Err(fidl::Error::Invalid),
}
}
}
impl fidl::encoding::ValueTypeMarker for OpenTargetFlexibleTwoWayFieldsRequest {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for OpenTargetFlexibleTwoWayFieldsRequest {
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
4
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
4
}
#[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<OpenTargetFlexibleTwoWayFieldsRequest, D>
for &OpenTargetFlexibleTwoWayFieldsRequest
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<OpenTargetFlexibleTwoWayFieldsRequest>(offset);
unsafe {
let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
(buf_ptr as *mut OpenTargetFlexibleTwoWayFieldsRequest)
.write_unaligned((self as *const OpenTargetFlexibleTwoWayFieldsRequest).read());
}
Ok(())
}
}
unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<i32, D>>
fidl::encoding::Encode<OpenTargetFlexibleTwoWayFieldsRequest, 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::<OpenTargetFlexibleTwoWayFieldsRequest>(offset);
self.0.encode(encoder, offset + 0, depth)?;
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
for OpenTargetFlexibleTwoWayFieldsRequest
{
#[inline(always)]
fn new_empty() -> Self {
Self { reply_with: fidl::new_empty!(i32, 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, 4);
}
Ok(())
}
}
impl fidl::encoding::ValueTypeMarker for OpenTargetStrictTwoWayFieldsRequest {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for OpenTargetStrictTwoWayFieldsRequest {
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
4
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
4
}
#[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<OpenTargetStrictTwoWayFieldsRequest, D>
for &OpenTargetStrictTwoWayFieldsRequest
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<OpenTargetStrictTwoWayFieldsRequest>(offset);
unsafe {
let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
(buf_ptr as *mut OpenTargetStrictTwoWayFieldsRequest)
.write_unaligned((self as *const OpenTargetStrictTwoWayFieldsRequest).read());
}
Ok(())
}
}
unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<i32, D>>
fidl::encoding::Encode<OpenTargetStrictTwoWayFieldsRequest, 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::<OpenTargetStrictTwoWayFieldsRequest>(offset);
self.0.encode(encoder, offset + 0, depth)?;
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
for OpenTargetStrictTwoWayFieldsRequest
{
#[inline(always)]
fn new_empty() -> Self {
Self { reply_with: fidl::new_empty!(i32, 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, 4);
}
Ok(())
}
}
impl fidl::encoding::ValueTypeMarker for OpenTargetStrictTwoWayFieldsResponse {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for OpenTargetStrictTwoWayFieldsResponse {
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
4
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
4
}
#[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<OpenTargetStrictTwoWayFieldsResponse, D>
for &OpenTargetStrictTwoWayFieldsResponse
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<OpenTargetStrictTwoWayFieldsResponse>(offset);
unsafe {
let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
(buf_ptr as *mut OpenTargetStrictTwoWayFieldsResponse)
.write_unaligned((self as *const OpenTargetStrictTwoWayFieldsResponse).read());
}
Ok(())
}
}
unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<i32, D>>
fidl::encoding::Encode<OpenTargetStrictTwoWayFieldsResponse, 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::<OpenTargetStrictTwoWayFieldsResponse>(offset);
self.0.encode(encoder, offset + 0, depth)?;
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
for OpenTargetStrictTwoWayFieldsResponse
{
#[inline(always)]
fn new_empty() -> Self {
Self { some_field: fidl::new_empty!(i32, 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, 4);
}
Ok(())
}
}
impl fidl::encoding::ValueTypeMarker for OpenTargetFlexibleTwoWayFieldsErrResponse {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for OpenTargetFlexibleTwoWayFieldsErrResponse {
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
4
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
4
}
#[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<OpenTargetFlexibleTwoWayFieldsErrResponse, D>
for &OpenTargetFlexibleTwoWayFieldsErrResponse
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<OpenTargetFlexibleTwoWayFieldsErrResponse>(offset);
unsafe {
let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
(buf_ptr as *mut OpenTargetFlexibleTwoWayFieldsErrResponse).write_unaligned(
(self as *const OpenTargetFlexibleTwoWayFieldsErrResponse).read(),
);
}
Ok(())
}
}
unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<i32, D>>
fidl::encoding::Encode<OpenTargetFlexibleTwoWayFieldsErrResponse, 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::<OpenTargetFlexibleTwoWayFieldsErrResponse>(offset);
self.0.encode(encoder, offset + 0, depth)?;
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
for OpenTargetFlexibleTwoWayFieldsErrResponse
{
#[inline(always)]
fn new_empty() -> Self {
Self { some_field: fidl::new_empty!(i32, 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, 4);
}
Ok(())
}
}
impl fidl::encoding::ValueTypeMarker for OpenTargetFlexibleTwoWayFieldsResponse {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for OpenTargetFlexibleTwoWayFieldsResponse {
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
4
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
4
}
#[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<OpenTargetFlexibleTwoWayFieldsResponse, D>
for &OpenTargetFlexibleTwoWayFieldsResponse
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<OpenTargetFlexibleTwoWayFieldsResponse>(offset);
unsafe {
let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
(buf_ptr as *mut OpenTargetFlexibleTwoWayFieldsResponse).write_unaligned(
(self as *const OpenTargetFlexibleTwoWayFieldsResponse).read(),
);
}
Ok(())
}
}
unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<i32, D>>
fidl::encoding::Encode<OpenTargetFlexibleTwoWayFieldsResponse, 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::<OpenTargetFlexibleTwoWayFieldsResponse>(offset);
self.0.encode(encoder, offset + 0, depth)?;
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
for OpenTargetFlexibleTwoWayFieldsResponse
{
#[inline(always)]
fn new_empty() -> Self {
Self { some_field: fidl::new_empty!(i32, 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, 4);
}
Ok(())
}
}
impl fidl::encoding::ValueTypeMarker for OpenTargetStrictTwoWayFieldsErrResponse {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for OpenTargetStrictTwoWayFieldsErrResponse {
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
4
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
4
}
#[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<OpenTargetStrictTwoWayFieldsErrResponse, D>
for &OpenTargetStrictTwoWayFieldsErrResponse
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<OpenTargetStrictTwoWayFieldsErrResponse>(offset);
unsafe {
let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
(buf_ptr as *mut OpenTargetStrictTwoWayFieldsErrResponse).write_unaligned(
(self as *const OpenTargetStrictTwoWayFieldsErrResponse).read(),
);
}
Ok(())
}
}
unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<i32, D>>
fidl::encoding::Encode<OpenTargetStrictTwoWayFieldsErrResponse, 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::<OpenTargetStrictTwoWayFieldsErrResponse>(offset);
self.0.encode(encoder, offset + 0, depth)?;
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
for OpenTargetStrictTwoWayFieldsErrResponse
{
#[inline(always)]
fn new_empty() -> Self {
Self { some_field: fidl::new_empty!(i32, 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, 4);
}
Ok(())
}
}
impl fidl::encoding::ValueTypeMarker for RunnerGetVersionResponse {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for RunnerGetVersionResponse {
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<RunnerGetVersionResponse, D> for &RunnerGetVersionResponse
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<RunnerGetVersionResponse>(offset);
unsafe {
let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
(buf_ptr as *mut RunnerGetVersionResponse)
.write_unaligned((self as *const RunnerGetVersionResponse).read());
}
Ok(())
}
}
unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<u64, D>>
fidl::encoding::Encode<RunnerGetVersionResponse, 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::<RunnerGetVersionResponse>(offset);
self.0.encode(encoder, offset + 0, depth)?;
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
for RunnerGetVersionResponse
{
#[inline(always)]
fn new_empty() -> Self {
Self { version: 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 RunnerOnTeardownRequest {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for RunnerOnTeardownRequest {
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
4
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
4
}
}
unsafe impl<D: fidl::encoding::ResourceDialect>
fidl::encoding::Encode<RunnerOnTeardownRequest, D> for &RunnerOnTeardownRequest
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<RunnerOnTeardownRequest>(offset);
fidl::encoding::Encode::<RunnerOnTeardownRequest, D>::encode(
(<TeardownReason as fidl::encoding::ValueTypeMarker>::borrow(&self.reason),),
encoder,
offset,
_depth,
)
}
}
unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<TeardownReason, D>>
fidl::encoding::Encode<RunnerOnTeardownRequest, 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::<RunnerOnTeardownRequest>(offset);
self.0.encode(encoder, offset + 0, depth)?;
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
for RunnerOnTeardownRequest
{
#[inline(always)]
fn new_empty() -> Self {
Self { reason: fidl::new_empty!(TeardownReason, 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!(TeardownReason, D, &mut self.reason, decoder, offset + 0, _depth)?;
Ok(())
}
}
impl fidl::encoding::ValueTypeMarker for RunnerShutdownWithEpitaphRequest {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for RunnerShutdownWithEpitaphRequest {
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
4
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
4
}
#[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<RunnerShutdownWithEpitaphRequest, D>
for &RunnerShutdownWithEpitaphRequest
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<RunnerShutdownWithEpitaphRequest>(offset);
unsafe {
let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
(buf_ptr as *mut RunnerShutdownWithEpitaphRequest)
.write_unaligned((self as *const RunnerShutdownWithEpitaphRequest).read());
}
Ok(())
}
}
unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<i32, D>>
fidl::encoding::Encode<RunnerShutdownWithEpitaphRequest, 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::<RunnerShutdownWithEpitaphRequest>(offset);
self.0.encode(encoder, offset + 0, depth)?;
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
for RunnerShutdownWithEpitaphRequest
{
#[inline(always)]
fn new_empty() -> Self {
Self { epitaph_status: fidl::new_empty!(i32, 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, 4);
}
Ok(())
}
}
impl fidl::encoding::ResourceTypeMarker for RunnerStartRequest {
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 RunnerStartRequest {
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
fidl::encoding::Encode<RunnerStartRequest, fidl::encoding::DefaultFuchsiaResourceDialect>
for &mut RunnerStartRequest
{
#[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::<RunnerStartRequest>(offset);
fidl::encoding::Encode::<
RunnerStartRequest,
fidl::encoding::DefaultFuchsiaResourceDialect,
>::encode(
(
<Test as fidl::encoding::ValueTypeMarker>::borrow(&self.test),
<AnyTarget as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
&mut self.any_target,
),
),
encoder,
offset,
_depth,
)
}
}
unsafe impl<
T0: fidl::encoding::Encode<Test, fidl::encoding::DefaultFuchsiaResourceDialect>,
T1: fidl::encoding::Encode<AnyTarget, fidl::encoding::DefaultFuchsiaResourceDialect>,
>
fidl::encoding::Encode<RunnerStartRequest, 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::<RunnerStartRequest>(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 RunnerStartRequest
{
#[inline(always)]
fn new_empty() -> Self {
Self {
test: fidl::new_empty!(Test, fidl::encoding::DefaultFuchsiaResourceDialect),
any_target: fidl::new_empty!(
AnyTarget,
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!(
Test,
fidl::encoding::DefaultFuchsiaResourceDialect,
&mut self.test,
decoder,
offset + 0,
_depth
)?;
fidl::decode!(
AnyTarget,
fidl::encoding::DefaultFuchsiaResourceDialect,
&mut self.any_target,
decoder,
offset + 8,
_depth
)?;
Ok(())
}
}
impl fidl::encoding::ValueTypeMarker for UnknownMethodInfo {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for UnknownMethodInfo {
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<UnknownMethodInfo, D>
for &UnknownMethodInfo
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<UnknownMethodInfo>(offset);
fidl::encoding::Encode::<UnknownMethodInfo, D>::encode(
(
<u64 as fidl::encoding::ValueTypeMarker>::borrow(&self.ordinal),
<UnknownMethodType as fidl::encoding::ValueTypeMarker>::borrow(
&self.unknown_method_type,
),
),
encoder,
offset,
_depth,
)
}
}
unsafe impl<
D: fidl::encoding::ResourceDialect,
T0: fidl::encoding::Encode<u64, D>,
T1: fidl::encoding::Encode<UnknownMethodType, D>,
> fidl::encoding::Encode<UnknownMethodInfo, 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::<UnknownMethodInfo>(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 UnknownMethodInfo {
#[inline(always)]
fn new_empty() -> Self {
Self {
ordinal: fidl::new_empty!(u64, D),
unknown_method_type: fidl::new_empty!(UnknownMethodType, 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!(u64, D, &mut self.ordinal, decoder, offset + 0, _depth)?;
fidl::decode!(
UnknownMethodType,
D,
&mut self.unknown_method_type,
decoder,
offset + 8,
_depth
)?;
Ok(())
}
}
impl ClosedTargetTwoWayTablePayloadRequest {
#[inline(always)]
fn max_ordinal_present(&self) -> u64 {
if let Some(_) = self.v {
return 1;
}
0
}
}
impl fidl::encoding::ValueTypeMarker for ClosedTargetTwoWayTablePayloadRequest {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for ClosedTargetTwoWayTablePayloadRequest {
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<ClosedTargetTwoWayTablePayloadRequest, D>
for &ClosedTargetTwoWayTablePayloadRequest
{
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
mut depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<ClosedTargetTwoWayTablePayloadRequest>(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::<i8, D>(
self.v.as_ref().map(<i8 as fidl::encoding::ValueTypeMarker>::borrow),
encoder,
offset + cur_offset,
depth,
)?;
_prev_end_offset = cur_offset + envelope_size;
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
for ClosedTargetTwoWayTablePayloadRequest
{
#[inline(always)]
fn new_empty() -> Self {
Self::default()
}
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_, D>,
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 =
<i8 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.v.get_or_insert_with(|| fidl::new_empty!(i8, D));
fidl::decode!(i8, D, 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 ClosedTargetTwoWayTablePayloadResponse {
#[inline(always)]
fn max_ordinal_present(&self) -> u64 {
if let Some(_) = self.v {
return 1;
}
0
}
}
impl fidl::encoding::ValueTypeMarker for ClosedTargetTwoWayTablePayloadResponse {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for ClosedTargetTwoWayTablePayloadResponse {
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<ClosedTargetTwoWayTablePayloadResponse, D>
for &ClosedTargetTwoWayTablePayloadResponse
{
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
mut depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<ClosedTargetTwoWayTablePayloadResponse>(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::<i8, D>(
self.v.as_ref().map(<i8 as fidl::encoding::ValueTypeMarker>::borrow),
encoder,
offset + cur_offset,
depth,
)?;
_prev_end_offset = cur_offset + envelope_size;
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
for ClosedTargetTwoWayTablePayloadResponse
{
#[inline(always)]
fn new_empty() -> Self {
Self::default()
}
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_, D>,
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 =
<i8 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.v.get_or_insert_with(|| fidl::new_empty!(i8, D));
fidl::decode!(i8, D, 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 fidl::encoding::ResourceTypeMarker for AnyTarget {
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 AnyTarget {
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<AnyTarget, fidl::encoding::DefaultFuchsiaResourceDialect>
for &mut AnyTarget
{
#[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::<AnyTarget>(offset);
encoder.write_num::<u64>(self.ordinal(), offset);
match self {
AnyTarget::Closed(ref mut val) => {
fidl::encoding::encode_in_envelope::<fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<ClosedTargetMarker>>, fidl::encoding::DefaultFuchsiaResourceDialect>(
<fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<ClosedTargetMarker>> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(val),
encoder, offset + 8, _depth
)
}
AnyTarget::Ajar(ref mut val) => {
fidl::encoding::encode_in_envelope::<fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<AjarTargetMarker>>, fidl::encoding::DefaultFuchsiaResourceDialect>(
<fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<AjarTargetMarker>> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(val),
encoder, offset + 8, _depth
)
}
AnyTarget::Open(ref mut val) => {
fidl::encoding::encode_in_envelope::<fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<OpenTargetMarker>>, fidl::encoding::DefaultFuchsiaResourceDialect>(
<fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<OpenTargetMarker>> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(val),
encoder, offset + 8, _depth
)
}
}
}
}
impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect> for AnyTarget {
#[inline(always)]
fn new_empty() -> Self {
Self::Closed(fidl::new_empty!(
fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<ClosedTargetMarker>>,
fidl::encoding::DefaultFuchsiaResourceDialect
))
}
#[inline]
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);
#[allow(unused_variables)]
let next_out_of_line = decoder.next_out_of_line();
let handles_before = decoder.remaining_handles();
let (ordinal, inlined, num_bytes, num_handles) =
fidl::encoding::decode_union_inline_portion(decoder, offset)?;
let member_inline_size = match ordinal {
1 => <fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<ClosedTargetMarker>> as fidl::encoding::TypeMarker>::inline_size(decoder.context),
2 => <fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<AjarTargetMarker>> as fidl::encoding::TypeMarker>::inline_size(decoder.context),
3 => <fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<OpenTargetMarker>> as fidl::encoding::TypeMarker>::inline_size(decoder.context),
_ => return Err(fidl::Error::UnknownUnionTag),
};
if inlined != (member_inline_size <= 4) {
return Err(fidl::Error::InvalidInlineBitInEnvelope);
}
let _inner_offset;
if inlined {
decoder.check_inline_envelope_padding(offset + 8, member_inline_size)?;
_inner_offset = offset + 8;
} else {
depth.increment()?;
_inner_offset = decoder.out_of_line_offset(member_inline_size)?;
}
match ordinal {
1 => {
#[allow(irrefutable_let_patterns)]
if let AnyTarget::Closed(_) = self {
} else {
*self = AnyTarget::Closed(fidl::new_empty!(
fidl::encoding::Endpoint<
fidl::endpoints::ServerEnd<ClosedTargetMarker>,
>,
fidl::encoding::DefaultFuchsiaResourceDialect
));
}
#[allow(irrefutable_let_patterns)]
if let AnyTarget::Closed(ref mut val) = self {
fidl::decode!(
fidl::encoding::Endpoint<
fidl::endpoints::ServerEnd<ClosedTargetMarker>,
>,
fidl::encoding::DefaultFuchsiaResourceDialect,
val,
decoder,
_inner_offset,
depth
)?;
} else {
unreachable!()
}
}
2 => {
#[allow(irrefutable_let_patterns)]
if let AnyTarget::Ajar(_) = self {
} else {
*self = AnyTarget::Ajar(fidl::new_empty!(
fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<AjarTargetMarker>>,
fidl::encoding::DefaultFuchsiaResourceDialect
));
}
#[allow(irrefutable_let_patterns)]
if let AnyTarget::Ajar(ref mut val) = self {
fidl::decode!(
fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<AjarTargetMarker>>,
fidl::encoding::DefaultFuchsiaResourceDialect,
val,
decoder,
_inner_offset,
depth
)?;
} else {
unreachable!()
}
}
3 => {
#[allow(irrefutable_let_patterns)]
if let AnyTarget::Open(_) = self {
} else {
*self = AnyTarget::Open(fidl::new_empty!(
fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<OpenTargetMarker>>,
fidl::encoding::DefaultFuchsiaResourceDialect
));
}
#[allow(irrefutable_let_patterns)]
if let AnyTarget::Open(ref mut val) = self {
fidl::decode!(
fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<OpenTargetMarker>>,
fidl::encoding::DefaultFuchsiaResourceDialect,
val,
decoder,
_inner_offset,
depth
)?;
} else {
unreachable!()
}
}
ordinal => panic!("unexpected ordinal {:?}", ordinal),
}
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);
}
Ok(())
}
}
impl fidl::encoding::ValueTypeMarker for ClosedTargetTwoWayResultRequest {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for ClosedTargetTwoWayResultRequest {
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<ClosedTargetTwoWayResultRequest, D>
for &ClosedTargetTwoWayResultRequest
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<ClosedTargetTwoWayResultRequest>(offset);
encoder.write_num::<u64>(self.ordinal(), offset);
match self {
ClosedTargetTwoWayResultRequest::Payload(ref val) => {
fidl::encoding::encode_in_envelope::<fidl::encoding::UnboundedString, D>(
<fidl::encoding::UnboundedString as fidl::encoding::ValueTypeMarker>::borrow(val),
encoder, offset + 8, _depth
)
}
ClosedTargetTwoWayResultRequest::Error(ref val) => {
fidl::encoding::encode_in_envelope::<u32, D>(
<u32 as fidl::encoding::ValueTypeMarker>::borrow(val),
encoder, offset + 8, _depth
)
}
}
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
for ClosedTargetTwoWayResultRequest
{
#[inline(always)]
fn new_empty() -> Self {
Self::Payload(fidl::new_empty!(fidl::encoding::UnboundedString, D))
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_, D>,
offset: usize,
mut depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
#[allow(unused_variables)]
let next_out_of_line = decoder.next_out_of_line();
let handles_before = decoder.remaining_handles();
let (ordinal, inlined, num_bytes, num_handles) =
fidl::encoding::decode_union_inline_portion(decoder, offset)?;
let member_inline_size = match ordinal {
1 => <fidl::encoding::UnboundedString as fidl::encoding::TypeMarker>::inline_size(
decoder.context,
),
2 => <u32 as fidl::encoding::TypeMarker>::inline_size(decoder.context),
_ => return Err(fidl::Error::UnknownUnionTag),
};
if inlined != (member_inline_size <= 4) {
return Err(fidl::Error::InvalidInlineBitInEnvelope);
}
let _inner_offset;
if inlined {
decoder.check_inline_envelope_padding(offset + 8, member_inline_size)?;
_inner_offset = offset + 8;
} else {
depth.increment()?;
_inner_offset = decoder.out_of_line_offset(member_inline_size)?;
}
match ordinal {
1 => {
#[allow(irrefutable_let_patterns)]
if let ClosedTargetTwoWayResultRequest::Payload(_) = self {
} else {
*self = ClosedTargetTwoWayResultRequest::Payload(fidl::new_empty!(
fidl::encoding::UnboundedString,
D
));
}
#[allow(irrefutable_let_patterns)]
if let ClosedTargetTwoWayResultRequest::Payload(ref mut val) = self {
fidl::decode!(
fidl::encoding::UnboundedString,
D,
val,
decoder,
_inner_offset,
depth
)?;
} else {
unreachable!()
}
}
2 => {
#[allow(irrefutable_let_patterns)]
if let ClosedTargetTwoWayResultRequest::Error(_) = self {
} else {
*self = ClosedTargetTwoWayResultRequest::Error(fidl::new_empty!(u32, D));
}
#[allow(irrefutable_let_patterns)]
if let ClosedTargetTwoWayResultRequest::Error(ref mut val) = self {
fidl::decode!(u32, D, val, decoder, _inner_offset, depth)?;
} else {
unreachable!()
}
}
ordinal => panic!("unexpected ordinal {:?}", ordinal),
}
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);
}
Ok(())
}
}
impl fidl::encoding::ValueTypeMarker for ClosedTargetTwoWayUnionPayloadRequest {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for ClosedTargetTwoWayUnionPayloadRequest {
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<ClosedTargetTwoWayUnionPayloadRequest, D>
for &ClosedTargetTwoWayUnionPayloadRequest
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<ClosedTargetTwoWayUnionPayloadRequest>(offset);
encoder.write_num::<u64>(self.ordinal(), offset);
match self {
ClosedTargetTwoWayUnionPayloadRequest::V(ref val) => {
fidl::encoding::encode_in_envelope::<i8, D>(
<i8 as fidl::encoding::ValueTypeMarker>::borrow(val),
encoder,
offset + 8,
_depth,
)
}
ClosedTargetTwoWayUnionPayloadRequest::__SourceBreaking { .. } => {
Err(fidl::Error::UnknownUnionTag)
}
}
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
for ClosedTargetTwoWayUnionPayloadRequest
{
#[inline(always)]
fn new_empty() -> Self {
Self::__SourceBreaking { unknown_ordinal: 0 }
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_, D>,
offset: usize,
mut depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
#[allow(unused_variables)]
let next_out_of_line = decoder.next_out_of_line();
let handles_before = decoder.remaining_handles();
let (ordinal, inlined, num_bytes, num_handles) =
fidl::encoding::decode_union_inline_portion(decoder, offset)?;
let member_inline_size = match ordinal {
1 => <i8 as fidl::encoding::TypeMarker>::inline_size(decoder.context),
0 => return Err(fidl::Error::UnknownUnionTag),
_ => num_bytes as usize,
};
if inlined != (member_inline_size <= 4) {
return Err(fidl::Error::InvalidInlineBitInEnvelope);
}
let _inner_offset;
if inlined {
decoder.check_inline_envelope_padding(offset + 8, member_inline_size)?;
_inner_offset = offset + 8;
} else {
depth.increment()?;
_inner_offset = decoder.out_of_line_offset(member_inline_size)?;
}
match ordinal {
1 => {
#[allow(irrefutable_let_patterns)]
if let ClosedTargetTwoWayUnionPayloadRequest::V(_) = self {
} else {
*self = ClosedTargetTwoWayUnionPayloadRequest::V(fidl::new_empty!(i8, D));
}
#[allow(irrefutable_let_patterns)]
if let ClosedTargetTwoWayUnionPayloadRequest::V(ref mut val) = self {
fidl::decode!(i8, D, val, decoder, _inner_offset, depth)?;
} else {
unreachable!()
}
}
#[allow(deprecated)]
ordinal => {
for _ in 0..num_handles {
decoder.drop_next_handle()?;
}
*self = ClosedTargetTwoWayUnionPayloadRequest::__SourceBreaking {
unknown_ordinal: ordinal,
};
}
}
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);
}
Ok(())
}
}
impl fidl::encoding::ValueTypeMarker for ClosedTargetTwoWayUnionPayloadResponse {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for ClosedTargetTwoWayUnionPayloadResponse {
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<ClosedTargetTwoWayUnionPayloadResponse, D>
for &ClosedTargetTwoWayUnionPayloadResponse
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<ClosedTargetTwoWayUnionPayloadResponse>(offset);
encoder.write_num::<u64>(self.ordinal(), offset);
match self {
ClosedTargetTwoWayUnionPayloadResponse::V(ref val) => {
fidl::encoding::encode_in_envelope::<i8, D>(
<i8 as fidl::encoding::ValueTypeMarker>::borrow(val),
encoder,
offset + 8,
_depth,
)
}
ClosedTargetTwoWayUnionPayloadResponse::__SourceBreaking { .. } => {
Err(fidl::Error::UnknownUnionTag)
}
}
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
for ClosedTargetTwoWayUnionPayloadResponse
{
#[inline(always)]
fn new_empty() -> Self {
Self::__SourceBreaking { unknown_ordinal: 0 }
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_, D>,
offset: usize,
mut depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
#[allow(unused_variables)]
let next_out_of_line = decoder.next_out_of_line();
let handles_before = decoder.remaining_handles();
let (ordinal, inlined, num_bytes, num_handles) =
fidl::encoding::decode_union_inline_portion(decoder, offset)?;
let member_inline_size = match ordinal {
1 => <i8 as fidl::encoding::TypeMarker>::inline_size(decoder.context),
0 => return Err(fidl::Error::UnknownUnionTag),
_ => num_bytes as usize,
};
if inlined != (member_inline_size <= 4) {
return Err(fidl::Error::InvalidInlineBitInEnvelope);
}
let _inner_offset;
if inlined {
decoder.check_inline_envelope_padding(offset + 8, member_inline_size)?;
_inner_offset = offset + 8;
} else {
depth.increment()?;
_inner_offset = decoder.out_of_line_offset(member_inline_size)?;
}
match ordinal {
1 => {
#[allow(irrefutable_let_patterns)]
if let ClosedTargetTwoWayUnionPayloadResponse::V(_) = self {
} else {
*self = ClosedTargetTwoWayUnionPayloadResponse::V(fidl::new_empty!(i8, D));
}
#[allow(irrefutable_let_patterns)]
if let ClosedTargetTwoWayUnionPayloadResponse::V(ref mut val) = self {
fidl::decode!(i8, D, val, decoder, _inner_offset, depth)?;
} else {
unreachable!()
}
}
#[allow(deprecated)]
ordinal => {
for _ in 0..num_handles {
decoder.drop_next_handle()?;
}
*self = ClosedTargetTwoWayUnionPayloadResponse::__SourceBreaking {
unknown_ordinal: ordinal,
};
}
}
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);
}
Ok(())
}
}
impl fidl::encoding::ValueTypeMarker for OpenTargetFlexibleTwoWayErrRequest {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for OpenTargetFlexibleTwoWayErrRequest {
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<OpenTargetFlexibleTwoWayErrRequest, D>
for &OpenTargetFlexibleTwoWayErrRequest
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<OpenTargetFlexibleTwoWayErrRequest>(offset);
encoder.write_num::<u64>(self.ordinal(), offset);
match self {
OpenTargetFlexibleTwoWayErrRequest::ReplySuccess(ref val) => {
fidl::encoding::encode_in_envelope::<Empty, D>(
<Empty as fidl::encoding::ValueTypeMarker>::borrow(val),
encoder,
offset + 8,
_depth,
)
}
OpenTargetFlexibleTwoWayErrRequest::ReplyError(ref val) => {
fidl::encoding::encode_in_envelope::<i32, D>(
<i32 as fidl::encoding::ValueTypeMarker>::borrow(val),
encoder,
offset + 8,
_depth,
)
}
}
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
for OpenTargetFlexibleTwoWayErrRequest
{
#[inline(always)]
fn new_empty() -> Self {
Self::ReplySuccess(fidl::new_empty!(Empty, D))
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_, D>,
offset: usize,
mut depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
#[allow(unused_variables)]
let next_out_of_line = decoder.next_out_of_line();
let handles_before = decoder.remaining_handles();
let (ordinal, inlined, num_bytes, num_handles) =
fidl::encoding::decode_union_inline_portion(decoder, offset)?;
let member_inline_size = match ordinal {
1 => <Empty as fidl::encoding::TypeMarker>::inline_size(decoder.context),
2 => <i32 as fidl::encoding::TypeMarker>::inline_size(decoder.context),
_ => return Err(fidl::Error::UnknownUnionTag),
};
if inlined != (member_inline_size <= 4) {
return Err(fidl::Error::InvalidInlineBitInEnvelope);
}
let _inner_offset;
if inlined {
decoder.check_inline_envelope_padding(offset + 8, member_inline_size)?;
_inner_offset = offset + 8;
} else {
depth.increment()?;
_inner_offset = decoder.out_of_line_offset(member_inline_size)?;
}
match ordinal {
1 => {
#[allow(irrefutable_let_patterns)]
if let OpenTargetFlexibleTwoWayErrRequest::ReplySuccess(_) = self {
} else {
*self = OpenTargetFlexibleTwoWayErrRequest::ReplySuccess(fidl::new_empty!(
Empty, D
));
}
#[allow(irrefutable_let_patterns)]
if let OpenTargetFlexibleTwoWayErrRequest::ReplySuccess(ref mut val) = self {
fidl::decode!(Empty, D, val, decoder, _inner_offset, depth)?;
} else {
unreachable!()
}
}
2 => {
#[allow(irrefutable_let_patterns)]
if let OpenTargetFlexibleTwoWayErrRequest::ReplyError(_) = self {
} else {
*self = OpenTargetFlexibleTwoWayErrRequest::ReplyError(fidl::new_empty!(
i32, D
));
}
#[allow(irrefutable_let_patterns)]
if let OpenTargetFlexibleTwoWayErrRequest::ReplyError(ref mut val) = self {
fidl::decode!(i32, D, val, decoder, _inner_offset, depth)?;
} else {
unreachable!()
}
}
ordinal => panic!("unexpected ordinal {:?}", ordinal),
}
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);
}
Ok(())
}
}
impl fidl::encoding::ValueTypeMarker for OpenTargetFlexibleTwoWayFieldsErrRequest {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for OpenTargetFlexibleTwoWayFieldsErrRequest {
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<OpenTargetFlexibleTwoWayFieldsErrRequest, D>
for &OpenTargetFlexibleTwoWayFieldsErrRequest
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<OpenTargetFlexibleTwoWayFieldsErrRequest>(offset);
encoder.write_num::<u64>(self.ordinal(), offset);
match self {
OpenTargetFlexibleTwoWayFieldsErrRequest::ReplySuccess(ref val) => {
fidl::encoding::encode_in_envelope::<i32, D>(
<i32 as fidl::encoding::ValueTypeMarker>::borrow(val),
encoder,
offset + 8,
_depth,
)
}
OpenTargetFlexibleTwoWayFieldsErrRequest::ReplyError(ref val) => {
fidl::encoding::encode_in_envelope::<i32, D>(
<i32 as fidl::encoding::ValueTypeMarker>::borrow(val),
encoder,
offset + 8,
_depth,
)
}
}
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
for OpenTargetFlexibleTwoWayFieldsErrRequest
{
#[inline(always)]
fn new_empty() -> Self {
Self::ReplySuccess(fidl::new_empty!(i32, D))
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_, D>,
offset: usize,
mut depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
#[allow(unused_variables)]
let next_out_of_line = decoder.next_out_of_line();
let handles_before = decoder.remaining_handles();
let (ordinal, inlined, num_bytes, num_handles) =
fidl::encoding::decode_union_inline_portion(decoder, offset)?;
let member_inline_size = match ordinal {
1 => <i32 as fidl::encoding::TypeMarker>::inline_size(decoder.context),
2 => <i32 as fidl::encoding::TypeMarker>::inline_size(decoder.context),
_ => return Err(fidl::Error::UnknownUnionTag),
};
if inlined != (member_inline_size <= 4) {
return Err(fidl::Error::InvalidInlineBitInEnvelope);
}
let _inner_offset;
if inlined {
decoder.check_inline_envelope_padding(offset + 8, member_inline_size)?;
_inner_offset = offset + 8;
} else {
depth.increment()?;
_inner_offset = decoder.out_of_line_offset(member_inline_size)?;
}
match ordinal {
1 => {
#[allow(irrefutable_let_patterns)]
if let OpenTargetFlexibleTwoWayFieldsErrRequest::ReplySuccess(_) = self {
} else {
*self = OpenTargetFlexibleTwoWayFieldsErrRequest::ReplySuccess(
fidl::new_empty!(i32, D),
);
}
#[allow(irrefutable_let_patterns)]
if let OpenTargetFlexibleTwoWayFieldsErrRequest::ReplySuccess(ref mut val) =
self
{
fidl::decode!(i32, D, val, decoder, _inner_offset, depth)?;
} else {
unreachable!()
}
}
2 => {
#[allow(irrefutable_let_patterns)]
if let OpenTargetFlexibleTwoWayFieldsErrRequest::ReplyError(_) = self {
} else {
*self = OpenTargetFlexibleTwoWayFieldsErrRequest::ReplyError(
fidl::new_empty!(i32, D),
);
}
#[allow(irrefutable_let_patterns)]
if let OpenTargetFlexibleTwoWayFieldsErrRequest::ReplyError(ref mut val) = self
{
fidl::decode!(i32, D, val, decoder, _inner_offset, depth)?;
} else {
unreachable!()
}
}
ordinal => panic!("unexpected ordinal {:?}", ordinal),
}
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);
}
Ok(())
}
}
impl fidl::encoding::ValueTypeMarker for OpenTargetStrictTwoWayErrRequest {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for OpenTargetStrictTwoWayErrRequest {
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<OpenTargetStrictTwoWayErrRequest, D>
for &OpenTargetStrictTwoWayErrRequest
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<OpenTargetStrictTwoWayErrRequest>(offset);
encoder.write_num::<u64>(self.ordinal(), offset);
match self {
OpenTargetStrictTwoWayErrRequest::ReplySuccess(ref val) => {
fidl::encoding::encode_in_envelope::<Empty, D>(
<Empty as fidl::encoding::ValueTypeMarker>::borrow(val),
encoder,
offset + 8,
_depth,
)
}
OpenTargetStrictTwoWayErrRequest::ReplyError(ref val) => {
fidl::encoding::encode_in_envelope::<i32, D>(
<i32 as fidl::encoding::ValueTypeMarker>::borrow(val),
encoder,
offset + 8,
_depth,
)
}
}
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
for OpenTargetStrictTwoWayErrRequest
{
#[inline(always)]
fn new_empty() -> Self {
Self::ReplySuccess(fidl::new_empty!(Empty, D))
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_, D>,
offset: usize,
mut depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
#[allow(unused_variables)]
let next_out_of_line = decoder.next_out_of_line();
let handles_before = decoder.remaining_handles();
let (ordinal, inlined, num_bytes, num_handles) =
fidl::encoding::decode_union_inline_portion(decoder, offset)?;
let member_inline_size = match ordinal {
1 => <Empty as fidl::encoding::TypeMarker>::inline_size(decoder.context),
2 => <i32 as fidl::encoding::TypeMarker>::inline_size(decoder.context),
_ => return Err(fidl::Error::UnknownUnionTag),
};
if inlined != (member_inline_size <= 4) {
return Err(fidl::Error::InvalidInlineBitInEnvelope);
}
let _inner_offset;
if inlined {
decoder.check_inline_envelope_padding(offset + 8, member_inline_size)?;
_inner_offset = offset + 8;
} else {
depth.increment()?;
_inner_offset = decoder.out_of_line_offset(member_inline_size)?;
}
match ordinal {
1 => {
#[allow(irrefutable_let_patterns)]
if let OpenTargetStrictTwoWayErrRequest::ReplySuccess(_) = self {
} else {
*self = OpenTargetStrictTwoWayErrRequest::ReplySuccess(fidl::new_empty!(
Empty, D
));
}
#[allow(irrefutable_let_patterns)]
if let OpenTargetStrictTwoWayErrRequest::ReplySuccess(ref mut val) = self {
fidl::decode!(Empty, D, val, decoder, _inner_offset, depth)?;
} else {
unreachable!()
}
}
2 => {
#[allow(irrefutable_let_patterns)]
if let OpenTargetStrictTwoWayErrRequest::ReplyError(_) = self {
} else {
*self =
OpenTargetStrictTwoWayErrRequest::ReplyError(fidl::new_empty!(i32, D));
}
#[allow(irrefutable_let_patterns)]
if let OpenTargetStrictTwoWayErrRequest::ReplyError(ref mut val) = self {
fidl::decode!(i32, D, val, decoder, _inner_offset, depth)?;
} else {
unreachable!()
}
}
ordinal => panic!("unexpected ordinal {:?}", ordinal),
}
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);
}
Ok(())
}
}
impl fidl::encoding::ValueTypeMarker for OpenTargetStrictTwoWayFieldsErrRequest {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for OpenTargetStrictTwoWayFieldsErrRequest {
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<OpenTargetStrictTwoWayFieldsErrRequest, D>
for &OpenTargetStrictTwoWayFieldsErrRequest
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<OpenTargetStrictTwoWayFieldsErrRequest>(offset);
encoder.write_num::<u64>(self.ordinal(), offset);
match self {
OpenTargetStrictTwoWayFieldsErrRequest::ReplySuccess(ref val) => {
fidl::encoding::encode_in_envelope::<i32, D>(
<i32 as fidl::encoding::ValueTypeMarker>::borrow(val),
encoder,
offset + 8,
_depth,
)
}
OpenTargetStrictTwoWayFieldsErrRequest::ReplyError(ref val) => {
fidl::encoding::encode_in_envelope::<i32, D>(
<i32 as fidl::encoding::ValueTypeMarker>::borrow(val),
encoder,
offset + 8,
_depth,
)
}
}
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
for OpenTargetStrictTwoWayFieldsErrRequest
{
#[inline(always)]
fn new_empty() -> Self {
Self::ReplySuccess(fidl::new_empty!(i32, D))
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_, D>,
offset: usize,
mut depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
#[allow(unused_variables)]
let next_out_of_line = decoder.next_out_of_line();
let handles_before = decoder.remaining_handles();
let (ordinal, inlined, num_bytes, num_handles) =
fidl::encoding::decode_union_inline_portion(decoder, offset)?;
let member_inline_size = match ordinal {
1 => <i32 as fidl::encoding::TypeMarker>::inline_size(decoder.context),
2 => <i32 as fidl::encoding::TypeMarker>::inline_size(decoder.context),
_ => return Err(fidl::Error::UnknownUnionTag),
};
if inlined != (member_inline_size <= 4) {
return Err(fidl::Error::InvalidInlineBitInEnvelope);
}
let _inner_offset;
if inlined {
decoder.check_inline_envelope_padding(offset + 8, member_inline_size)?;
_inner_offset = offset + 8;
} else {
depth.increment()?;
_inner_offset = decoder.out_of_line_offset(member_inline_size)?;
}
match ordinal {
1 => {
#[allow(irrefutable_let_patterns)]
if let OpenTargetStrictTwoWayFieldsErrRequest::ReplySuccess(_) = self {
} else {
*self = OpenTargetStrictTwoWayFieldsErrRequest::ReplySuccess(
fidl::new_empty!(i32, D),
);
}
#[allow(irrefutable_let_patterns)]
if let OpenTargetStrictTwoWayFieldsErrRequest::ReplySuccess(ref mut val) = self
{
fidl::decode!(i32, D, val, decoder, _inner_offset, depth)?;
} else {
unreachable!()
}
}
2 => {
#[allow(irrefutable_let_patterns)]
if let OpenTargetStrictTwoWayFieldsErrRequest::ReplyError(_) = self {
} else {
*self = OpenTargetStrictTwoWayFieldsErrRequest::ReplyError(
fidl::new_empty!(i32, D),
);
}
#[allow(irrefutable_let_patterns)]
if let OpenTargetStrictTwoWayFieldsErrRequest::ReplyError(ref mut val) = self {
fidl::decode!(i32, D, val, decoder, _inner_offset, depth)?;
} else {
unreachable!()
}
}
ordinal => panic!("unexpected ordinal {:?}", ordinal),
}
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);
}
Ok(())
}
}
}