#![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 ROOT_ID: u32 = 0;
#[derive(Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd, Hash)]
pub enum DiffType {
Full,
Diff,
Both,
#[doc(hidden)]
__SourceBreaking { unknown_ordinal: u32 },
}
#[macro_export]
macro_rules! DiffTypeUnknown {
() => {
_
};
}
impl DiffType {
#[inline]
pub fn from_primitive(prim: u32) -> Option<Self> {
match prim {
0 => Some(Self::Full),
1 => Some(Self::Diff),
2 => Some(Self::Both),
_ => None,
}
}
#[inline]
pub fn from_primitive_allow_unknown(prim: u32) -> Self {
match prim {
0 => Self::Full,
1 => Self::Diff,
2 => Self::Both,
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::Full => 0,
Self::Diff => 1,
Self::Both => 2,
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 LinkDisposition {
Child = 0,
Inline = 1,
}
impl LinkDisposition {
#[inline]
pub fn from_primitive(prim: u32) -> Option<Self> {
match prim {
0 => Some(Self::Child),
1 => Some(Self::Inline),
_ => 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 TestResult {
Ok,
Unimplemented,
Failed,
Illegal,
#[doc(hidden)]
__SourceBreaking { unknown_ordinal: u32 },
}
#[macro_export]
macro_rules! TestResultUnknown {
() => {
_
};
}
impl TestResult {
#[inline]
pub fn from_primitive(prim: u32) -> Option<Self> {
match prim {
0 => Some(Self::Ok),
1 => Some(Self::Unimplemented),
2 => Some(Self::Failed),
3 => Some(Self::Illegal),
_ => None,
}
}
#[inline]
pub fn from_primitive_allow_unknown(prim: u32) -> Self {
match prim {
0 => Self::Ok,
1 => Self::Unimplemented,
2 => Self::Failed,
3 => Self::Illegal,
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::Ok => 0,
Self::Unimplemented => 1,
Self::Failed => 2,
Self::Illegal => 3,
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)]
pub enum ValueType {
Int,
Uint,
Double,
String,
#[doc(hidden)]
__SourceBreaking {
unknown_ordinal: u8,
},
}
#[macro_export]
macro_rules! ValueTypeUnknown {
() => {
_
};
}
impl ValueType {
#[inline]
pub fn from_primitive(prim: u8) -> Option<Self> {
match prim {
1 => Some(Self::Int),
2 => Some(Self::Uint),
3 => Some(Self::Double),
4 => Some(Self::String),
_ => None,
}
}
#[inline]
pub fn from_primitive_allow_unknown(prim: u8) -> Self {
match prim {
1 => Self::Int,
2 => Self::Uint,
3 => Self::Double,
4 => Self::String,
unknown_ordinal => Self::__SourceBreaking { unknown_ordinal },
}
}
#[inline]
pub fn unknown() -> Self {
Self::__SourceBreaking { unknown_ordinal: 0xff }
}
#[inline]
pub const fn into_primitive(self) -> u8 {
match self {
Self::Int => 1,
Self::Uint => 2,
Self::Double => 3,
Self::String => 4,
Self::__SourceBreaking { unknown_ordinal } => unknown_ordinal,
}
}
#[inline]
pub fn is_unknown(&self) -> bool {
match self {
Self::__SourceBreaking { unknown_ordinal: _ } => true,
_ => false,
}
}
}
#[derive(Clone, Debug, PartialEq)]
pub struct AddNumber {
pub id: u32,
pub value: Value,
}
impl fidl::Persistable for AddNumber {}
#[derive(Clone, Debug, PartialEq)]
pub struct ArrayAdd {
pub id: u32,
pub index: u64,
pub value: Value,
}
impl fidl::Persistable for ArrayAdd {}
#[derive(Clone, Debug, PartialEq)]
pub struct ArraySet {
pub id: u32,
pub index: u64,
pub value: Value,
}
impl fidl::Persistable for ArraySet {}
#[derive(Clone, Debug, PartialEq)]
pub struct ArraySubtract {
pub id: u32,
pub index: u64,
pub value: Value,
}
impl fidl::Persistable for ArraySubtract {}
#[derive(Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
pub struct CreateArrayProperty {
pub parent: u32,
pub id: u32,
pub name: String,
pub slots: u64,
pub value_type: ValueType,
}
impl fidl::Persistable for CreateArrayProperty {}
#[derive(Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
pub struct CreateBoolProperty {
pub parent: u32,
pub id: u32,
pub name: String,
pub value: bool,
}
impl fidl::Persistable for CreateBoolProperty {}
#[derive(Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
pub struct CreateBytesProperty {
pub parent: u32,
pub id: u32,
pub name: String,
pub value: Vec<u8>,
}
impl fidl::Persistable for CreateBytesProperty {}
#[derive(Clone, Debug, PartialEq)]
pub struct CreateExponentialHistogram {
pub parent: u32,
pub id: u32,
pub name: String,
pub floor: Value,
pub initial_step: Value,
pub step_multiplier: Value,
pub buckets: u64,
}
impl fidl::Persistable for CreateExponentialHistogram {}
#[derive(Clone, Debug, PartialEq)]
pub struct CreateLazyNode {
pub parent: u32,
pub id: u32,
pub name: String,
pub disposition: LinkDisposition,
pub actions: Vec<Action>,
}
impl fidl::Persistable for CreateLazyNode {}
#[derive(Clone, Debug, PartialEq)]
pub struct CreateLinearHistogram {
pub parent: u32,
pub id: u32,
pub name: String,
pub floor: Value,
pub step_size: Value,
pub buckets: u64,
}
impl fidl::Persistable for CreateLinearHistogram {}
#[derive(Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
pub struct CreateNode {
pub parent: u32,
pub id: u32,
pub name: String,
}
impl fidl::Persistable for CreateNode {}
#[derive(Clone, Debug, PartialEq)]
pub struct CreateNumericProperty {
pub parent: u32,
pub id: u32,
pub name: String,
pub value: Value,
}
impl fidl::Persistable for CreateNumericProperty {}
#[derive(Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
pub struct CreateStringProperty {
pub parent: u32,
pub id: u32,
pub name: String,
pub value: String,
}
impl fidl::Persistable for CreateStringProperty {}
#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
#[repr(C)]
pub struct DeleteLazyNode {
pub id: u32,
}
impl fidl::Persistable for DeleteLazyNode {}
#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
#[repr(C)]
pub struct DeleteNode {
pub id: u32,
}
impl fidl::Persistable for DeleteNode {}
#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
#[repr(C)]
pub struct DeleteProperty {
pub id: u32,
}
impl fidl::Persistable for DeleteProperty {}
#[derive(Clone, Debug, PartialEq)]
pub struct Insert {
pub id: u32,
pub value: Value,
}
impl fidl::Persistable for Insert {}
#[derive(Clone, Debug, PartialEq)]
pub struct InsertMultiple {
pub id: u32,
pub value: Value,
pub count: u64,
}
impl fidl::Persistable for InsertMultiple {}
#[derive(Clone, Debug, PartialEq)]
pub struct InspectPuppetActLazyRequest {
pub lazy_action: LazyAction,
}
impl fidl::Persistable for InspectPuppetActLazyRequest {}
#[derive(Clone, Debug, PartialEq)]
pub struct InspectPuppetActRequest {
pub action: Action,
}
impl fidl::Persistable for InspectPuppetActRequest {}
#[derive(Clone, Debug, PartialEq)]
pub struct InspectPuppetInitializeRequest {
pub params: InitializationParams,
}
impl fidl::Persistable for InspectPuppetInitializeRequest {}
#[derive(Clone, Debug, PartialEq)]
pub struct InspectPuppetInitializeTreeRequest {
pub params: InitializationParams,
}
impl fidl::Persistable for InspectPuppetInitializeTreeRequest {}
#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
pub struct InspectPuppetActLazyResponse {
pub result: TestResult,
}
impl fidl::Persistable for InspectPuppetActLazyResponse {}
#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
pub struct InspectPuppetActResponse {
pub result: TestResult,
}
impl fidl::Persistable for InspectPuppetActResponse {}
#[derive(Debug, PartialEq)]
pub struct InspectPuppetGetConfigResponse {
pub printable_name: String,
pub options: Options,
}
impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
for InspectPuppetGetConfigResponse
{
}
#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
pub struct InspectPuppetInitializeTreeResponse {
pub tree: Option<fidl::endpoints::ClientEnd<fidl_fuchsia_inspect::TreeMarker>>,
pub result: TestResult,
}
impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
for InspectPuppetInitializeTreeResponse
{
}
#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
pub struct InspectPuppetInitializeResponse {
pub vmo: Option<fidl::Handle>,
pub result: TestResult,
}
impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
for InspectPuppetInitializeResponse
{
}
#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
pub struct InspectPuppetPublishResponse {
pub result: TestResult,
}
impl fidl::Persistable for InspectPuppetPublishResponse {}
#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
pub struct SetBool {
pub id: u32,
pub value: bool,
}
impl fidl::Persistable for SetBool {}
#[derive(Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
pub struct SetBytes {
pub id: u32,
pub value: Vec<u8>,
}
impl fidl::Persistable for SetBytes {}
#[derive(Clone, Debug, PartialEq)]
pub struct SetNumber {
pub id: u32,
pub value: Value,
}
impl fidl::Persistable for SetNumber {}
#[derive(Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
pub struct SetString {
pub id: u32,
pub value: String,
}
impl fidl::Persistable for SetString {}
#[derive(Clone, Debug, PartialEq)]
pub struct SubtractNumber {
pub id: u32,
pub value: Value,
}
impl fidl::Persistable for SubtractNumber {}
#[derive(Clone, Debug, Default, PartialEq)]
pub struct InitializationParams {
pub vmo_size: Option<u64>,
#[doc(hidden)]
pub __source_breaking: fidl::marker::SourceBreaking,
}
impl fidl::Persistable for InitializationParams {}
#[derive(Debug, Default, PartialEq)]
pub struct Options {
pub has_runner_node: Option<bool>,
pub diff_type: Option<DiffType>,
#[doc(hidden)]
pub __source_breaking: fidl::marker::SourceBreaking,
}
impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect> for Options {}
#[derive(Clone, Debug)]
pub enum Action {
CreateNode(CreateNode),
DeleteNode(DeleteNode),
CreateNumericProperty(CreateNumericProperty),
CreateBytesProperty(CreateBytesProperty),
CreateStringProperty(CreateStringProperty),
DeleteProperty(DeleteProperty),
SetNumber(SetNumber),
SetString(SetString),
SetBytes(SetBytes),
AddNumber(AddNumber),
SubtractNumber(SubtractNumber),
CreateArrayProperty(CreateArrayProperty),
ArraySet(ArraySet),
ArrayAdd(ArrayAdd),
ArraySubtract(ArraySubtract),
CreateLinearHistogram(CreateLinearHistogram),
CreateExponentialHistogram(CreateExponentialHistogram),
Insert(Insert),
InsertMultiple(InsertMultiple),
CreateBoolProperty(CreateBoolProperty),
SetBool(SetBool),
#[doc(hidden)]
__SourceBreaking {
unknown_ordinal: u64,
},
}
#[macro_export]
macro_rules! ActionUnknown {
() => {
_
};
}
impl PartialEq for Action {
fn eq(&self, other: &Self) -> bool {
match (self, other) {
(Self::CreateNode(x), Self::CreateNode(y)) => *x == *y,
(Self::DeleteNode(x), Self::DeleteNode(y)) => *x == *y,
(Self::CreateNumericProperty(x), Self::CreateNumericProperty(y)) => *x == *y,
(Self::CreateBytesProperty(x), Self::CreateBytesProperty(y)) => *x == *y,
(Self::CreateStringProperty(x), Self::CreateStringProperty(y)) => *x == *y,
(Self::DeleteProperty(x), Self::DeleteProperty(y)) => *x == *y,
(Self::SetNumber(x), Self::SetNumber(y)) => *x == *y,
(Self::SetString(x), Self::SetString(y)) => *x == *y,
(Self::SetBytes(x), Self::SetBytes(y)) => *x == *y,
(Self::AddNumber(x), Self::AddNumber(y)) => *x == *y,
(Self::SubtractNumber(x), Self::SubtractNumber(y)) => *x == *y,
(Self::CreateArrayProperty(x), Self::CreateArrayProperty(y)) => *x == *y,
(Self::ArraySet(x), Self::ArraySet(y)) => *x == *y,
(Self::ArrayAdd(x), Self::ArrayAdd(y)) => *x == *y,
(Self::ArraySubtract(x), Self::ArraySubtract(y)) => *x == *y,
(Self::CreateLinearHistogram(x), Self::CreateLinearHistogram(y)) => *x == *y,
(Self::CreateExponentialHistogram(x), Self::CreateExponentialHistogram(y)) => *x == *y,
(Self::Insert(x), Self::Insert(y)) => *x == *y,
(Self::InsertMultiple(x), Self::InsertMultiple(y)) => *x == *y,
(Self::CreateBoolProperty(x), Self::CreateBoolProperty(y)) => *x == *y,
(Self::SetBool(x), Self::SetBool(y)) => *x == *y,
_ => false,
}
}
}
impl Action {
#[inline]
pub fn ordinal(&self) -> u64 {
match *self {
Self::CreateNode(_) => 1,
Self::DeleteNode(_) => 2,
Self::CreateNumericProperty(_) => 3,
Self::CreateBytesProperty(_) => 4,
Self::CreateStringProperty(_) => 5,
Self::DeleteProperty(_) => 6,
Self::SetNumber(_) => 7,
Self::SetString(_) => 8,
Self::SetBytes(_) => 9,
Self::AddNumber(_) => 10,
Self::SubtractNumber(_) => 11,
Self::CreateArrayProperty(_) => 12,
Self::ArraySet(_) => 13,
Self::ArrayAdd(_) => 14,
Self::ArraySubtract(_) => 15,
Self::CreateLinearHistogram(_) => 16,
Self::CreateExponentialHistogram(_) => 17,
Self::Insert(_) => 18,
Self::InsertMultiple(_) => 19,
Self::CreateBoolProperty(_) => 20,
Self::SetBool(_) => 21,
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 Action {}
#[derive(Clone, Debug)]
pub enum LazyAction {
CreateLazyNode(CreateLazyNode),
DeleteLazyNode(DeleteLazyNode),
#[doc(hidden)]
__SourceBreaking {
unknown_ordinal: u64,
},
}
#[macro_export]
macro_rules! LazyActionUnknown {
() => {
_
};
}
impl PartialEq for LazyAction {
fn eq(&self, other: &Self) -> bool {
match (self, other) {
(Self::CreateLazyNode(x), Self::CreateLazyNode(y)) => *x == *y,
(Self::DeleteLazyNode(x), Self::DeleteLazyNode(y)) => *x == *y,
_ => false,
}
}
}
impl LazyAction {
#[inline]
pub fn ordinal(&self) -> u64 {
match *self {
Self::CreateLazyNode(_) => 1,
Self::DeleteLazyNode(_) => 2,
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 LazyAction {}
#[derive(Clone, Debug)]
pub enum Value {
IntT(i64),
UintT(u64),
DoubleT(f64),
StringT(String),
#[doc(hidden)]
__SourceBreaking {
unknown_ordinal: u64,
},
}
#[macro_export]
macro_rules! ValueUnknown {
() => {
_
};
}
impl PartialEq for Value {
fn eq(&self, other: &Self) -> bool {
match (self, other) {
(Self::IntT(x), Self::IntT(y)) => *x == *y,
(Self::UintT(x), Self::UintT(y)) => *x == *y,
(Self::DoubleT(x), Self::DoubleT(y)) => *x == *y,
(Self::StringT(x), Self::StringT(y)) => *x == *y,
_ => false,
}
}
}
impl Value {
#[inline]
pub fn ordinal(&self) -> u64 {
match *self {
Self::IntT(_) => 1,
Self::UintT(_) => 2,
Self::DoubleT(_) => 3,
Self::StringT(_) => 4,
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 Value {}
#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
pub struct InspectPuppetMarker;
impl fidl::endpoints::ProtocolMarker for InspectPuppetMarker {
type Proxy = InspectPuppetProxy;
type RequestStream = InspectPuppetRequestStream;
#[cfg(target_os = "fuchsia")]
type SynchronousProxy = InspectPuppetSynchronousProxy;
const DEBUG_NAME: &'static str = "diagnostics.validate.InspectPuppet";
}
impl fidl::endpoints::DiscoverableProtocolMarker for InspectPuppetMarker {}
pub trait InspectPuppetProxyInterface: Send + Sync {
type InitializeResponseFut: std::future::Future<Output = Result<(Option<fidl::Handle>, TestResult), fidl::Error>>
+ Send;
fn r#initialize(&self, params: &InitializationParams) -> Self::InitializeResponseFut;
type GetConfigResponseFut: std::future::Future<Output = Result<(String, Options), fidl::Error>>
+ Send;
fn r#get_config(&self) -> Self::GetConfigResponseFut;
type InitializeTreeResponseFut: std::future::Future<
Output = Result<
(Option<fidl::endpoints::ClientEnd<fidl_fuchsia_inspect::TreeMarker>>, TestResult),
fidl::Error,
>,
> + Send;
fn r#initialize_tree(&self, params: &InitializationParams) -> Self::InitializeTreeResponseFut;
type PublishResponseFut: std::future::Future<Output = Result<TestResult, fidl::Error>> + Send;
fn r#publish(&self) -> Self::PublishResponseFut;
type ActResponseFut: std::future::Future<Output = Result<TestResult, fidl::Error>> + Send;
fn r#act(&self, action: &Action) -> Self::ActResponseFut;
type ActLazyResponseFut: std::future::Future<Output = Result<TestResult, fidl::Error>> + Send;
fn r#act_lazy(&self, lazy_action: &LazyAction) -> Self::ActLazyResponseFut;
}
#[derive(Debug)]
#[cfg(target_os = "fuchsia")]
pub struct InspectPuppetSynchronousProxy {
client: fidl::client::sync::Client,
}
#[cfg(target_os = "fuchsia")]
impl fidl::endpoints::SynchronousProxy for InspectPuppetSynchronousProxy {
type Proxy = InspectPuppetProxy;
type Protocol = InspectPuppetMarker;
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 InspectPuppetSynchronousProxy {
pub fn new(channel: fidl::Channel) -> Self {
let protocol_name = <InspectPuppetMarker 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<InspectPuppetEvent, fidl::Error> {
InspectPuppetEvent::decode(self.client.wait_for_event(deadline)?)
}
pub fn r#initialize(
&self,
mut params: &InitializationParams,
___deadline: zx::MonotonicInstant,
) -> Result<(Option<fidl::Handle>, TestResult), fidl::Error> {
let _response = self.client.send_query::<
InspectPuppetInitializeRequest,
fidl::encoding::FlexibleType<InspectPuppetInitializeResponse>,
>(
(params,),
0x6f6c1f23e5665591,
fidl::encoding::DynamicFlags::FLEXIBLE,
___deadline,
)?
.into_result::<InspectPuppetMarker>("initialize")?;
Ok((_response.vmo, _response.result))
}
pub fn r#get_config(
&self,
___deadline: zx::MonotonicInstant,
) -> Result<(String, Options), fidl::Error> {
let _response = self.client.send_query::<
fidl::encoding::EmptyPayload,
fidl::encoding::FlexibleType<InspectPuppetGetConfigResponse>,
>(
(),
0x61588d76bae449fd,
fidl::encoding::DynamicFlags::FLEXIBLE,
___deadline,
)?
.into_result::<InspectPuppetMarker>("get_config")?;
Ok((_response.printable_name, _response.options))
}
pub fn r#initialize_tree(
&self,
mut params: &InitializationParams,
___deadline: zx::MonotonicInstant,
) -> Result<
(Option<fidl::endpoints::ClientEnd<fidl_fuchsia_inspect::TreeMarker>>, TestResult),
fidl::Error,
> {
let _response = self.client.send_query::<
InspectPuppetInitializeTreeRequest,
fidl::encoding::FlexibleType<InspectPuppetInitializeTreeResponse>,
>(
(params,),
0x1dba90332d970658,
fidl::encoding::DynamicFlags::FLEXIBLE,
___deadline,
)?
.into_result::<InspectPuppetMarker>("initialize_tree")?;
Ok((_response.tree, _response.result))
}
pub fn r#publish(&self, ___deadline: zx::MonotonicInstant) -> Result<TestResult, fidl::Error> {
let _response = self.client.send_query::<
fidl::encoding::EmptyPayload,
fidl::encoding::FlexibleType<InspectPuppetPublishResponse>,
>(
(),
0x2cb88b53aa897dd8,
fidl::encoding::DynamicFlags::FLEXIBLE,
___deadline,
)?
.into_result::<InspectPuppetMarker>("publish")?;
Ok(_response.result)
}
pub fn r#act(
&self,
mut action: &Action,
___deadline: zx::MonotonicInstant,
) -> Result<TestResult, fidl::Error> {
let _response = self.client.send_query::<
InspectPuppetActRequest,
fidl::encoding::FlexibleType<InspectPuppetActResponse>,
>(
(action,),
0x72760753739e292f,
fidl::encoding::DynamicFlags::FLEXIBLE,
___deadline,
)?
.into_result::<InspectPuppetMarker>("act")?;
Ok(_response.result)
}
pub fn r#act_lazy(
&self,
mut lazy_action: &LazyAction,
___deadline: zx::MonotonicInstant,
) -> Result<TestResult, fidl::Error> {
let _response = self.client.send_query::<
InspectPuppetActLazyRequest,
fidl::encoding::FlexibleType<InspectPuppetActLazyResponse>,
>(
(lazy_action,),
0x2d43263540a22a5f,
fidl::encoding::DynamicFlags::FLEXIBLE,
___deadline,
)?
.into_result::<InspectPuppetMarker>("act_lazy")?;
Ok(_response.result)
}
}
#[derive(Debug, Clone)]
pub struct InspectPuppetProxy {
client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
}
impl fidl::endpoints::Proxy for InspectPuppetProxy {
type Protocol = InspectPuppetMarker;
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 InspectPuppetProxy {
pub fn new(channel: ::fidl::AsyncChannel) -> Self {
let protocol_name = <InspectPuppetMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
Self { client: fidl::client::Client::new(channel, protocol_name) }
}
pub fn take_event_stream(&self) -> InspectPuppetEventStream {
InspectPuppetEventStream { event_receiver: self.client.take_event_receiver() }
}
pub fn r#initialize(
&self,
mut params: &InitializationParams,
) -> fidl::client::QueryResponseFut<
(Option<fidl::Handle>, TestResult),
fidl::encoding::DefaultFuchsiaResourceDialect,
> {
InspectPuppetProxyInterface::r#initialize(self, params)
}
pub fn r#get_config(
&self,
) -> fidl::client::QueryResponseFut<
(String, Options),
fidl::encoding::DefaultFuchsiaResourceDialect,
> {
InspectPuppetProxyInterface::r#get_config(self)
}
pub fn r#initialize_tree(
&self,
mut params: &InitializationParams,
) -> fidl::client::QueryResponseFut<
(Option<fidl::endpoints::ClientEnd<fidl_fuchsia_inspect::TreeMarker>>, TestResult),
fidl::encoding::DefaultFuchsiaResourceDialect,
> {
InspectPuppetProxyInterface::r#initialize_tree(self, params)
}
pub fn r#publish(
&self,
) -> fidl::client::QueryResponseFut<TestResult, fidl::encoding::DefaultFuchsiaResourceDialect>
{
InspectPuppetProxyInterface::r#publish(self)
}
pub fn r#act(
&self,
mut action: &Action,
) -> fidl::client::QueryResponseFut<TestResult, fidl::encoding::DefaultFuchsiaResourceDialect>
{
InspectPuppetProxyInterface::r#act(self, action)
}
pub fn r#act_lazy(
&self,
mut lazy_action: &LazyAction,
) -> fidl::client::QueryResponseFut<TestResult, fidl::encoding::DefaultFuchsiaResourceDialect>
{
InspectPuppetProxyInterface::r#act_lazy(self, lazy_action)
}
}
impl InspectPuppetProxyInterface for InspectPuppetProxy {
type InitializeResponseFut = fidl::client::QueryResponseFut<
(Option<fidl::Handle>, TestResult),
fidl::encoding::DefaultFuchsiaResourceDialect,
>;
fn r#initialize(&self, mut params: &InitializationParams) -> Self::InitializeResponseFut {
fn _decode(
mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
) -> Result<(Option<fidl::Handle>, TestResult), fidl::Error> {
let _response = fidl::client::decode_transaction_body::<
fidl::encoding::FlexibleType<InspectPuppetInitializeResponse>,
fidl::encoding::DefaultFuchsiaResourceDialect,
0x6f6c1f23e5665591,
>(_buf?)?
.into_result::<InspectPuppetMarker>("initialize")?;
Ok((_response.vmo, _response.result))
}
self.client.send_query_and_decode::<
InspectPuppetInitializeRequest,
(Option<fidl::Handle>, TestResult),
>(
(params,),
0x6f6c1f23e5665591,
fidl::encoding::DynamicFlags::FLEXIBLE,
_decode,
)
}
type GetConfigResponseFut = fidl::client::QueryResponseFut<
(String, Options),
fidl::encoding::DefaultFuchsiaResourceDialect,
>;
fn r#get_config(&self) -> Self::GetConfigResponseFut {
fn _decode(
mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
) -> Result<(String, Options), fidl::Error> {
let _response = fidl::client::decode_transaction_body::<
fidl::encoding::FlexibleType<InspectPuppetGetConfigResponse>,
fidl::encoding::DefaultFuchsiaResourceDialect,
0x61588d76bae449fd,
>(_buf?)?
.into_result::<InspectPuppetMarker>("get_config")?;
Ok((_response.printable_name, _response.options))
}
self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, (String, Options)>(
(),
0x61588d76bae449fd,
fidl::encoding::DynamicFlags::FLEXIBLE,
_decode,
)
}
type InitializeTreeResponseFut = fidl::client::QueryResponseFut<
(Option<fidl::endpoints::ClientEnd<fidl_fuchsia_inspect::TreeMarker>>, TestResult),
fidl::encoding::DefaultFuchsiaResourceDialect,
>;
fn r#initialize_tree(
&self,
mut params: &InitializationParams,
) -> Self::InitializeTreeResponseFut {
fn _decode(
mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
) -> Result<
(Option<fidl::endpoints::ClientEnd<fidl_fuchsia_inspect::TreeMarker>>, TestResult),
fidl::Error,
> {
let _response = fidl::client::decode_transaction_body::<
fidl::encoding::FlexibleType<InspectPuppetInitializeTreeResponse>,
fidl::encoding::DefaultFuchsiaResourceDialect,
0x1dba90332d970658,
>(_buf?)?
.into_result::<InspectPuppetMarker>("initialize_tree")?;
Ok((_response.tree, _response.result))
}
self.client.send_query_and_decode::<InspectPuppetInitializeTreeRequest, (
Option<fidl::endpoints::ClientEnd<fidl_fuchsia_inspect::TreeMarker>>,
TestResult,
)>(
(params,), 0x1dba90332d970658, fidl::encoding::DynamicFlags::FLEXIBLE, _decode
)
}
type PublishResponseFut =
fidl::client::QueryResponseFut<TestResult, fidl::encoding::DefaultFuchsiaResourceDialect>;
fn r#publish(&self) -> Self::PublishResponseFut {
fn _decode(
mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
) -> Result<TestResult, fidl::Error> {
let _response = fidl::client::decode_transaction_body::<
fidl::encoding::FlexibleType<InspectPuppetPublishResponse>,
fidl::encoding::DefaultFuchsiaResourceDialect,
0x2cb88b53aa897dd8,
>(_buf?)?
.into_result::<InspectPuppetMarker>("publish")?;
Ok(_response.result)
}
self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, TestResult>(
(),
0x2cb88b53aa897dd8,
fidl::encoding::DynamicFlags::FLEXIBLE,
_decode,
)
}
type ActResponseFut =
fidl::client::QueryResponseFut<TestResult, fidl::encoding::DefaultFuchsiaResourceDialect>;
fn r#act(&self, mut action: &Action) -> Self::ActResponseFut {
fn _decode(
mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
) -> Result<TestResult, fidl::Error> {
let _response = fidl::client::decode_transaction_body::<
fidl::encoding::FlexibleType<InspectPuppetActResponse>,
fidl::encoding::DefaultFuchsiaResourceDialect,
0x72760753739e292f,
>(_buf?)?
.into_result::<InspectPuppetMarker>("act")?;
Ok(_response.result)
}
self.client.send_query_and_decode::<InspectPuppetActRequest, TestResult>(
(action,),
0x72760753739e292f,
fidl::encoding::DynamicFlags::FLEXIBLE,
_decode,
)
}
type ActLazyResponseFut =
fidl::client::QueryResponseFut<TestResult, fidl::encoding::DefaultFuchsiaResourceDialect>;
fn r#act_lazy(&self, mut lazy_action: &LazyAction) -> Self::ActLazyResponseFut {
fn _decode(
mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
) -> Result<TestResult, fidl::Error> {
let _response = fidl::client::decode_transaction_body::<
fidl::encoding::FlexibleType<InspectPuppetActLazyResponse>,
fidl::encoding::DefaultFuchsiaResourceDialect,
0x2d43263540a22a5f,
>(_buf?)?
.into_result::<InspectPuppetMarker>("act_lazy")?;
Ok(_response.result)
}
self.client.send_query_and_decode::<InspectPuppetActLazyRequest, TestResult>(
(lazy_action,),
0x2d43263540a22a5f,
fidl::encoding::DynamicFlags::FLEXIBLE,
_decode,
)
}
}
pub struct InspectPuppetEventStream {
event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
}
impl std::marker::Unpin for InspectPuppetEventStream {}
impl futures::stream::FusedStream for InspectPuppetEventStream {
fn is_terminated(&self) -> bool {
self.event_receiver.is_terminated()
}
}
impl futures::Stream for InspectPuppetEventStream {
type Item = Result<InspectPuppetEvent, 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(InspectPuppetEvent::decode(buf))),
None => std::task::Poll::Ready(None),
}
}
}
#[derive(Debug)]
pub enum InspectPuppetEvent {
#[non_exhaustive]
_UnknownEvent {
ordinal: u64,
},
}
impl InspectPuppetEvent {
fn decode(
mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
) -> Result<InspectPuppetEvent, 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(InspectPuppetEvent::_UnknownEvent { ordinal: tx_header.ordinal })
}
_ => Err(fidl::Error::UnknownOrdinal {
ordinal: tx_header.ordinal,
protocol_name: <InspectPuppetMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
}),
}
}
}
pub struct InspectPuppetRequestStream {
inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
is_terminated: bool,
}
impl std::marker::Unpin for InspectPuppetRequestStream {}
impl futures::stream::FusedStream for InspectPuppetRequestStream {
fn is_terminated(&self) -> bool {
self.is_terminated
}
}
impl fidl::endpoints::RequestStream for InspectPuppetRequestStream {
type Protocol = InspectPuppetMarker;
type ControlHandle = InspectPuppetControlHandle;
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 {
InspectPuppetControlHandle { 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 InspectPuppetRequestStream {
type Item = Result<InspectPuppetRequest, 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 InspectPuppetRequestStream 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 {
0x6f6c1f23e5665591 => {
header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
let mut req = fidl::new_empty!(
InspectPuppetInitializeRequest,
fidl::encoding::DefaultFuchsiaResourceDialect
);
fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<InspectPuppetInitializeRequest>(&header, _body_bytes, handles, &mut req)?;
let control_handle =
InspectPuppetControlHandle { inner: this.inner.clone() };
Ok(InspectPuppetRequest::Initialize {
params: req.params,
responder: InspectPuppetInitializeResponder {
control_handle: std::mem::ManuallyDrop::new(control_handle),
tx_id: header.tx_id,
},
})
}
0x61588d76bae449fd => {
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 =
InspectPuppetControlHandle { inner: this.inner.clone() };
Ok(InspectPuppetRequest::GetConfig {
responder: InspectPuppetGetConfigResponder {
control_handle: std::mem::ManuallyDrop::new(control_handle),
tx_id: header.tx_id,
},
})
}
0x1dba90332d970658 => {
header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
let mut req = fidl::new_empty!(
InspectPuppetInitializeTreeRequest,
fidl::encoding::DefaultFuchsiaResourceDialect
);
fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<InspectPuppetInitializeTreeRequest>(&header, _body_bytes, handles, &mut req)?;
let control_handle =
InspectPuppetControlHandle { inner: this.inner.clone() };
Ok(InspectPuppetRequest::InitializeTree {
params: req.params,
responder: InspectPuppetInitializeTreeResponder {
control_handle: std::mem::ManuallyDrop::new(control_handle),
tx_id: header.tx_id,
},
})
}
0x2cb88b53aa897dd8 => {
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 =
InspectPuppetControlHandle { inner: this.inner.clone() };
Ok(InspectPuppetRequest::Publish {
responder: InspectPuppetPublishResponder {
control_handle: std::mem::ManuallyDrop::new(control_handle),
tx_id: header.tx_id,
},
})
}
0x72760753739e292f => {
header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
let mut req = fidl::new_empty!(
InspectPuppetActRequest,
fidl::encoding::DefaultFuchsiaResourceDialect
);
fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<InspectPuppetActRequest>(&header, _body_bytes, handles, &mut req)?;
let control_handle =
InspectPuppetControlHandle { inner: this.inner.clone() };
Ok(InspectPuppetRequest::Act {
action: req.action,
responder: InspectPuppetActResponder {
control_handle: std::mem::ManuallyDrop::new(control_handle),
tx_id: header.tx_id,
},
})
}
0x2d43263540a22a5f => {
header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
let mut req = fidl::new_empty!(
InspectPuppetActLazyRequest,
fidl::encoding::DefaultFuchsiaResourceDialect
);
fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<InspectPuppetActLazyRequest>(&header, _body_bytes, handles, &mut req)?;
let control_handle =
InspectPuppetControlHandle { inner: this.inner.clone() };
Ok(InspectPuppetRequest::ActLazy {
lazy_action: req.lazy_action,
responder: InspectPuppetActLazyResponder {
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(InspectPuppetRequest::_UnknownMethod {
ordinal: header.ordinal,
control_handle: InspectPuppetControlHandle {
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(InspectPuppetRequest::_UnknownMethod {
ordinal: header.ordinal,
control_handle: InspectPuppetControlHandle {
inner: this.inner.clone(),
},
method_type: fidl::MethodType::TwoWay,
})
}
_ => Err(fidl::Error::UnknownOrdinal {
ordinal: header.ordinal,
protocol_name:
<InspectPuppetMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
}),
}))
},
)
}
}
#[derive(Debug)]
pub enum InspectPuppetRequest {
Initialize { params: InitializationParams, responder: InspectPuppetInitializeResponder },
GetConfig { responder: InspectPuppetGetConfigResponder },
InitializeTree { params: InitializationParams, responder: InspectPuppetInitializeTreeResponder },
Publish { responder: InspectPuppetPublishResponder },
Act { action: Action, responder: InspectPuppetActResponder },
ActLazy { lazy_action: LazyAction, responder: InspectPuppetActLazyResponder },
#[non_exhaustive]
_UnknownMethod {
ordinal: u64,
control_handle: InspectPuppetControlHandle,
method_type: fidl::MethodType,
},
}
impl InspectPuppetRequest {
#[allow(irrefutable_let_patterns)]
pub fn into_initialize(
self,
) -> Option<(InitializationParams, InspectPuppetInitializeResponder)> {
if let InspectPuppetRequest::Initialize { params, responder } = self {
Some((params, responder))
} else {
None
}
}
#[allow(irrefutable_let_patterns)]
pub fn into_get_config(self) -> Option<(InspectPuppetGetConfigResponder)> {
if let InspectPuppetRequest::GetConfig { responder } = self {
Some((responder))
} else {
None
}
}
#[allow(irrefutable_let_patterns)]
pub fn into_initialize_tree(
self,
) -> Option<(InitializationParams, InspectPuppetInitializeTreeResponder)> {
if let InspectPuppetRequest::InitializeTree { params, responder } = self {
Some((params, responder))
} else {
None
}
}
#[allow(irrefutable_let_patterns)]
pub fn into_publish(self) -> Option<(InspectPuppetPublishResponder)> {
if let InspectPuppetRequest::Publish { responder } = self {
Some((responder))
} else {
None
}
}
#[allow(irrefutable_let_patterns)]
pub fn into_act(self) -> Option<(Action, InspectPuppetActResponder)> {
if let InspectPuppetRequest::Act { action, responder } = self {
Some((action, responder))
} else {
None
}
}
#[allow(irrefutable_let_patterns)]
pub fn into_act_lazy(self) -> Option<(LazyAction, InspectPuppetActLazyResponder)> {
if let InspectPuppetRequest::ActLazy { lazy_action, responder } = self {
Some((lazy_action, responder))
} else {
None
}
}
pub fn method_name(&self) -> &'static str {
match *self {
InspectPuppetRequest::Initialize { .. } => "initialize",
InspectPuppetRequest::GetConfig { .. } => "get_config",
InspectPuppetRequest::InitializeTree { .. } => "initialize_tree",
InspectPuppetRequest::Publish { .. } => "publish",
InspectPuppetRequest::Act { .. } => "act",
InspectPuppetRequest::ActLazy { .. } => "act_lazy",
InspectPuppetRequest::_UnknownMethod {
method_type: fidl::MethodType::OneWay, ..
} => "unknown one-way method",
InspectPuppetRequest::_UnknownMethod {
method_type: fidl::MethodType::TwoWay, ..
} => "unknown two-way method",
}
}
}
#[derive(Debug, Clone)]
pub struct InspectPuppetControlHandle {
inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
}
impl fidl::endpoints::ControlHandle for InspectPuppetControlHandle {
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 InspectPuppetControlHandle {}
#[must_use = "FIDL methods require a response to be sent"]
#[derive(Debug)]
pub struct InspectPuppetInitializeResponder {
control_handle: std::mem::ManuallyDrop<InspectPuppetControlHandle>,
tx_id: u32,
}
impl std::ops::Drop for InspectPuppetInitializeResponder {
fn drop(&mut self) {
self.control_handle.shutdown();
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
}
}
impl fidl::endpoints::Responder for InspectPuppetInitializeResponder {
type ControlHandle = InspectPuppetControlHandle;
fn control_handle(&self) -> &InspectPuppetControlHandle {
&self.control_handle
}
fn drop_without_shutdown(mut self) {
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
std::mem::forget(self);
}
}
impl InspectPuppetInitializeResponder {
pub fn send(
self,
mut vmo: Option<fidl::Handle>,
mut result: TestResult,
) -> Result<(), fidl::Error> {
let _result = self.send_raw(vmo, result);
if _result.is_err() {
self.control_handle.shutdown();
}
self.drop_without_shutdown();
_result
}
pub fn send_no_shutdown_on_err(
self,
mut vmo: Option<fidl::Handle>,
mut result: TestResult,
) -> Result<(), fidl::Error> {
let _result = self.send_raw(vmo, result);
self.drop_without_shutdown();
_result
}
fn send_raw(
&self,
mut vmo: Option<fidl::Handle>,
mut result: TestResult,
) -> Result<(), fidl::Error> {
self.control_handle
.inner
.send::<fidl::encoding::FlexibleType<InspectPuppetInitializeResponse>>(
fidl::encoding::Flexible::new((vmo, result)),
self.tx_id,
0x6f6c1f23e5665591,
fidl::encoding::DynamicFlags::FLEXIBLE,
)
}
}
#[must_use = "FIDL methods require a response to be sent"]
#[derive(Debug)]
pub struct InspectPuppetGetConfigResponder {
control_handle: std::mem::ManuallyDrop<InspectPuppetControlHandle>,
tx_id: u32,
}
impl std::ops::Drop for InspectPuppetGetConfigResponder {
fn drop(&mut self) {
self.control_handle.shutdown();
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
}
}
impl fidl::endpoints::Responder for InspectPuppetGetConfigResponder {
type ControlHandle = InspectPuppetControlHandle;
fn control_handle(&self) -> &InspectPuppetControlHandle {
&self.control_handle
}
fn drop_without_shutdown(mut self) {
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
std::mem::forget(self);
}
}
impl InspectPuppetGetConfigResponder {
pub fn send(self, mut printable_name: &str, mut options: Options) -> Result<(), fidl::Error> {
let _result = self.send_raw(printable_name, options);
if _result.is_err() {
self.control_handle.shutdown();
}
self.drop_without_shutdown();
_result
}
pub fn send_no_shutdown_on_err(
self,
mut printable_name: &str,
mut options: Options,
) -> Result<(), fidl::Error> {
let _result = self.send_raw(printable_name, options);
self.drop_without_shutdown();
_result
}
fn send_raw(&self, mut printable_name: &str, mut options: Options) -> Result<(), fidl::Error> {
self.control_handle
.inner
.send::<fidl::encoding::FlexibleType<InspectPuppetGetConfigResponse>>(
fidl::encoding::Flexible::new((printable_name, &mut options)),
self.tx_id,
0x61588d76bae449fd,
fidl::encoding::DynamicFlags::FLEXIBLE,
)
}
}
#[must_use = "FIDL methods require a response to be sent"]
#[derive(Debug)]
pub struct InspectPuppetInitializeTreeResponder {
control_handle: std::mem::ManuallyDrop<InspectPuppetControlHandle>,
tx_id: u32,
}
impl std::ops::Drop for InspectPuppetInitializeTreeResponder {
fn drop(&mut self) {
self.control_handle.shutdown();
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
}
}
impl fidl::endpoints::Responder for InspectPuppetInitializeTreeResponder {
type ControlHandle = InspectPuppetControlHandle;
fn control_handle(&self) -> &InspectPuppetControlHandle {
&self.control_handle
}
fn drop_without_shutdown(mut self) {
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
std::mem::forget(self);
}
}
impl InspectPuppetInitializeTreeResponder {
pub fn send(
self,
mut tree: Option<fidl::endpoints::ClientEnd<fidl_fuchsia_inspect::TreeMarker>>,
mut result: TestResult,
) -> Result<(), fidl::Error> {
let _result = self.send_raw(tree, result);
if _result.is_err() {
self.control_handle.shutdown();
}
self.drop_without_shutdown();
_result
}
pub fn send_no_shutdown_on_err(
self,
mut tree: Option<fidl::endpoints::ClientEnd<fidl_fuchsia_inspect::TreeMarker>>,
mut result: TestResult,
) -> Result<(), fidl::Error> {
let _result = self.send_raw(tree, result);
self.drop_without_shutdown();
_result
}
fn send_raw(
&self,
mut tree: Option<fidl::endpoints::ClientEnd<fidl_fuchsia_inspect::TreeMarker>>,
mut result: TestResult,
) -> Result<(), fidl::Error> {
self.control_handle
.inner
.send::<fidl::encoding::FlexibleType<InspectPuppetInitializeTreeResponse>>(
fidl::encoding::Flexible::new((tree, result)),
self.tx_id,
0x1dba90332d970658,
fidl::encoding::DynamicFlags::FLEXIBLE,
)
}
}
#[must_use = "FIDL methods require a response to be sent"]
#[derive(Debug)]
pub struct InspectPuppetPublishResponder {
control_handle: std::mem::ManuallyDrop<InspectPuppetControlHandle>,
tx_id: u32,
}
impl std::ops::Drop for InspectPuppetPublishResponder {
fn drop(&mut self) {
self.control_handle.shutdown();
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
}
}
impl fidl::endpoints::Responder for InspectPuppetPublishResponder {
type ControlHandle = InspectPuppetControlHandle;
fn control_handle(&self) -> &InspectPuppetControlHandle {
&self.control_handle
}
fn drop_without_shutdown(mut self) {
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
std::mem::forget(self);
}
}
impl InspectPuppetPublishResponder {
pub fn send(self, mut result: TestResult) -> 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: TestResult) -> Result<(), fidl::Error> {
let _result = self.send_raw(result);
self.drop_without_shutdown();
_result
}
fn send_raw(&self, mut result: TestResult) -> Result<(), fidl::Error> {
self.control_handle
.inner
.send::<fidl::encoding::FlexibleType<InspectPuppetPublishResponse>>(
fidl::encoding::Flexible::new((result,)),
self.tx_id,
0x2cb88b53aa897dd8,
fidl::encoding::DynamicFlags::FLEXIBLE,
)
}
}
#[must_use = "FIDL methods require a response to be sent"]
#[derive(Debug)]
pub struct InspectPuppetActResponder {
control_handle: std::mem::ManuallyDrop<InspectPuppetControlHandle>,
tx_id: u32,
}
impl std::ops::Drop for InspectPuppetActResponder {
fn drop(&mut self) {
self.control_handle.shutdown();
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
}
}
impl fidl::endpoints::Responder for InspectPuppetActResponder {
type ControlHandle = InspectPuppetControlHandle;
fn control_handle(&self) -> &InspectPuppetControlHandle {
&self.control_handle
}
fn drop_without_shutdown(mut self) {
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
std::mem::forget(self);
}
}
impl InspectPuppetActResponder {
pub fn send(self, mut result: TestResult) -> 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: TestResult) -> Result<(), fidl::Error> {
let _result = self.send_raw(result);
self.drop_without_shutdown();
_result
}
fn send_raw(&self, mut result: TestResult) -> Result<(), fidl::Error> {
self.control_handle.inner.send::<fidl::encoding::FlexibleType<InspectPuppetActResponse>>(
fidl::encoding::Flexible::new((result,)),
self.tx_id,
0x72760753739e292f,
fidl::encoding::DynamicFlags::FLEXIBLE,
)
}
}
#[must_use = "FIDL methods require a response to be sent"]
#[derive(Debug)]
pub struct InspectPuppetActLazyResponder {
control_handle: std::mem::ManuallyDrop<InspectPuppetControlHandle>,
tx_id: u32,
}
impl std::ops::Drop for InspectPuppetActLazyResponder {
fn drop(&mut self) {
self.control_handle.shutdown();
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
}
}
impl fidl::endpoints::Responder for InspectPuppetActLazyResponder {
type ControlHandle = InspectPuppetControlHandle;
fn control_handle(&self) -> &InspectPuppetControlHandle {
&self.control_handle
}
fn drop_without_shutdown(mut self) {
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
std::mem::forget(self);
}
}
impl InspectPuppetActLazyResponder {
pub fn send(self, mut result: TestResult) -> 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: TestResult) -> Result<(), fidl::Error> {
let _result = self.send_raw(result);
self.drop_without_shutdown();
_result
}
fn send_raw(&self, mut result: TestResult) -> Result<(), fidl::Error> {
self.control_handle
.inner
.send::<fidl::encoding::FlexibleType<InspectPuppetActLazyResponse>>(
fidl::encoding::Flexible::new((result,)),
self.tx_id,
0x2d43263540a22a5f,
fidl::encoding::DynamicFlags::FLEXIBLE,
)
}
}
mod internal {
use super::*;
unsafe impl fidl::encoding::TypeMarker for DiffType {
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 DiffType {
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 DiffType {
#[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 DiffType {
#[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 LinkDisposition {
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 LinkDisposition {
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 LinkDisposition
{
#[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 LinkDisposition {
#[inline(always)]
fn new_empty() -> Self {
Self::Child
}
#[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 TestResult {
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 TestResult {
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 TestResult {
#[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 TestResult {
#[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 ValueType {
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
std::mem::align_of::<u8>()
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
std::mem::size_of::<u8>()
}
#[inline(always)]
fn encode_is_copy() -> bool {
false
}
#[inline(always)]
fn decode_is_copy() -> bool {
false
}
}
impl fidl::encoding::ValueTypeMarker for ValueType {
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 ValueType {
#[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 ValueType {
#[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::<u8>(offset);
*self = Self::from_primitive_allow_unknown(prim);
Ok(())
}
}
impl fidl::encoding::ValueTypeMarker for AddNumber {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for AddNumber {
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
8
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
24
}
}
unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<AddNumber, D>
for &AddNumber
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<AddNumber>(offset);
fidl::encoding::Encode::<AddNumber, D>::encode(
(
<u32 as fidl::encoding::ValueTypeMarker>::borrow(&self.id),
<Value as fidl::encoding::ValueTypeMarker>::borrow(&self.value),
),
encoder,
offset,
_depth,
)
}
}
unsafe impl<
D: fidl::encoding::ResourceDialect,
T0: fidl::encoding::Encode<u32, D>,
T1: fidl::encoding::Encode<Value, D>,
> fidl::encoding::Encode<AddNumber, 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::<AddNumber>(offset);
unsafe {
let ptr = encoder.buf.as_mut_ptr().add(offset).offset(0);
(ptr as *mut u64).write_unaligned(0);
}
self.0.encode(encoder, offset + 0, depth)?;
self.1.encode(encoder, offset + 8, depth)?;
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for AddNumber {
#[inline(always)]
fn new_empty() -> Self {
Self { id: fidl::new_empty!(u32, D), value: fidl::new_empty!(Value, D) }
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(0) };
let padval = unsafe { (ptr as *const u64).read_unaligned() };
let mask = 0xffffffff00000000u64;
let maskedval = padval & mask;
if maskedval != 0 {
return Err(fidl::Error::NonZeroPadding {
padding_start: offset + 0 + ((mask as u64).trailing_zeros() / 8) as usize,
});
}
fidl::decode!(u32, D, &mut self.id, decoder, offset + 0, _depth)?;
fidl::decode!(Value, D, &mut self.value, decoder, offset + 8, _depth)?;
Ok(())
}
}
impl fidl::encoding::ValueTypeMarker for ArrayAdd {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for ArrayAdd {
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
8
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
32
}
}
unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<ArrayAdd, D> for &ArrayAdd {
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<ArrayAdd>(offset);
fidl::encoding::Encode::<ArrayAdd, D>::encode(
(
<u32 as fidl::encoding::ValueTypeMarker>::borrow(&self.id),
<u64 as fidl::encoding::ValueTypeMarker>::borrow(&self.index),
<Value as fidl::encoding::ValueTypeMarker>::borrow(&self.value),
),
encoder,
offset,
_depth,
)
}
}
unsafe impl<
D: fidl::encoding::ResourceDialect,
T0: fidl::encoding::Encode<u32, D>,
T1: fidl::encoding::Encode<u64, D>,
T2: fidl::encoding::Encode<Value, D>,
> fidl::encoding::Encode<ArrayAdd, D> for (T0, T1, T2)
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<ArrayAdd>(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)?;
self.2.encode(encoder, offset + 16, depth)?;
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for ArrayAdd {
#[inline(always)]
fn new_empty() -> Self {
Self {
id: fidl::new_empty!(u32, D),
index: fidl::new_empty!(u64, D),
value: fidl::new_empty!(Value, D),
}
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(0) };
let padval = unsafe { (ptr as *const u64).read_unaligned() };
let mask = 0xffffffff00000000u64;
let maskedval = padval & mask;
if maskedval != 0 {
return Err(fidl::Error::NonZeroPadding {
padding_start: offset + 0 + ((mask as u64).trailing_zeros() / 8) as usize,
});
}
fidl::decode!(u32, D, &mut self.id, decoder, offset + 0, _depth)?;
fidl::decode!(u64, D, &mut self.index, decoder, offset + 8, _depth)?;
fidl::decode!(Value, D, &mut self.value, decoder, offset + 16, _depth)?;
Ok(())
}
}
impl fidl::encoding::ValueTypeMarker for ArraySet {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for ArraySet {
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
8
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
32
}
}
unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<ArraySet, D> for &ArraySet {
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<ArraySet>(offset);
fidl::encoding::Encode::<ArraySet, D>::encode(
(
<u32 as fidl::encoding::ValueTypeMarker>::borrow(&self.id),
<u64 as fidl::encoding::ValueTypeMarker>::borrow(&self.index),
<Value as fidl::encoding::ValueTypeMarker>::borrow(&self.value),
),
encoder,
offset,
_depth,
)
}
}
unsafe impl<
D: fidl::encoding::ResourceDialect,
T0: fidl::encoding::Encode<u32, D>,
T1: fidl::encoding::Encode<u64, D>,
T2: fidl::encoding::Encode<Value, D>,
> fidl::encoding::Encode<ArraySet, D> for (T0, T1, T2)
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<ArraySet>(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)?;
self.2.encode(encoder, offset + 16, depth)?;
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for ArraySet {
#[inline(always)]
fn new_empty() -> Self {
Self {
id: fidl::new_empty!(u32, D),
index: fidl::new_empty!(u64, D),
value: fidl::new_empty!(Value, D),
}
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(0) };
let padval = unsafe { (ptr as *const u64).read_unaligned() };
let mask = 0xffffffff00000000u64;
let maskedval = padval & mask;
if maskedval != 0 {
return Err(fidl::Error::NonZeroPadding {
padding_start: offset + 0 + ((mask as u64).trailing_zeros() / 8) as usize,
});
}
fidl::decode!(u32, D, &mut self.id, decoder, offset + 0, _depth)?;
fidl::decode!(u64, D, &mut self.index, decoder, offset + 8, _depth)?;
fidl::decode!(Value, D, &mut self.value, decoder, offset + 16, _depth)?;
Ok(())
}
}
impl fidl::encoding::ValueTypeMarker for ArraySubtract {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for ArraySubtract {
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
8
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
32
}
}
unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<ArraySubtract, D>
for &ArraySubtract
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<ArraySubtract>(offset);
fidl::encoding::Encode::<ArraySubtract, D>::encode(
(
<u32 as fidl::encoding::ValueTypeMarker>::borrow(&self.id),
<u64 as fidl::encoding::ValueTypeMarker>::borrow(&self.index),
<Value as fidl::encoding::ValueTypeMarker>::borrow(&self.value),
),
encoder,
offset,
_depth,
)
}
}
unsafe impl<
D: fidl::encoding::ResourceDialect,
T0: fidl::encoding::Encode<u32, D>,
T1: fidl::encoding::Encode<u64, D>,
T2: fidl::encoding::Encode<Value, D>,
> fidl::encoding::Encode<ArraySubtract, D> for (T0, T1, T2)
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<ArraySubtract>(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)?;
self.2.encode(encoder, offset + 16, depth)?;
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for ArraySubtract {
#[inline(always)]
fn new_empty() -> Self {
Self {
id: fidl::new_empty!(u32, D),
index: fidl::new_empty!(u64, D),
value: fidl::new_empty!(Value, D),
}
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(0) };
let padval = unsafe { (ptr as *const u64).read_unaligned() };
let mask = 0xffffffff00000000u64;
let maskedval = padval & mask;
if maskedval != 0 {
return Err(fidl::Error::NonZeroPadding {
padding_start: offset + 0 + ((mask as u64).trailing_zeros() / 8) as usize,
});
}
fidl::decode!(u32, D, &mut self.id, decoder, offset + 0, _depth)?;
fidl::decode!(u64, D, &mut self.index, decoder, offset + 8, _depth)?;
fidl::decode!(Value, D, &mut self.value, decoder, offset + 16, _depth)?;
Ok(())
}
}
impl fidl::encoding::ValueTypeMarker for CreateArrayProperty {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for CreateArrayProperty {
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
8
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
40
}
}
unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<CreateArrayProperty, D>
for &CreateArrayProperty
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<CreateArrayProperty>(offset);
fidl::encoding::Encode::<CreateArrayProperty, D>::encode(
(
<u32 as fidl::encoding::ValueTypeMarker>::borrow(&self.parent),
<u32 as fidl::encoding::ValueTypeMarker>::borrow(&self.id),
<fidl::encoding::UnboundedString as fidl::encoding::ValueTypeMarker>::borrow(
&self.name,
),
<u64 as fidl::encoding::ValueTypeMarker>::borrow(&self.slots),
<ValueType as fidl::encoding::ValueTypeMarker>::borrow(&self.value_type),
),
encoder,
offset,
_depth,
)
}
}
unsafe impl<
D: fidl::encoding::ResourceDialect,
T0: fidl::encoding::Encode<u32, D>,
T1: fidl::encoding::Encode<u32, D>,
T2: fidl::encoding::Encode<fidl::encoding::UnboundedString, D>,
T3: fidl::encoding::Encode<u64, D>,
T4: fidl::encoding::Encode<ValueType, D>,
> fidl::encoding::Encode<CreateArrayProperty, D> for (T0, T1, T2, T3, T4)
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<CreateArrayProperty>(offset);
unsafe {
let ptr = encoder.buf.as_mut_ptr().add(offset).offset(32);
(ptr as *mut u64).write_unaligned(0);
}
self.0.encode(encoder, offset + 0, depth)?;
self.1.encode(encoder, offset + 4, depth)?;
self.2.encode(encoder, offset + 8, depth)?;
self.3.encode(encoder, offset + 24, depth)?;
self.4.encode(encoder, offset + 32, depth)?;
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for CreateArrayProperty {
#[inline(always)]
fn new_empty() -> Self {
Self {
parent: fidl::new_empty!(u32, D),
id: fidl::new_empty!(u32, D),
name: fidl::new_empty!(fidl::encoding::UnboundedString, D),
slots: fidl::new_empty!(u64, D),
value_type: fidl::new_empty!(ValueType, 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(32) };
let padval = unsafe { (ptr as *const u64).read_unaligned() };
let mask = 0xffffffffffffff00u64;
let maskedval = padval & mask;
if maskedval != 0 {
return Err(fidl::Error::NonZeroPadding {
padding_start: offset + 32 + ((mask as u64).trailing_zeros() / 8) as usize,
});
}
fidl::decode!(u32, D, &mut self.parent, decoder, offset + 0, _depth)?;
fidl::decode!(u32, D, &mut self.id, decoder, offset + 4, _depth)?;
fidl::decode!(
fidl::encoding::UnboundedString,
D,
&mut self.name,
decoder,
offset + 8,
_depth
)?;
fidl::decode!(u64, D, &mut self.slots, decoder, offset + 24, _depth)?;
fidl::decode!(ValueType, D, &mut self.value_type, decoder, offset + 32, _depth)?;
Ok(())
}
}
impl fidl::encoding::ValueTypeMarker for CreateBoolProperty {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for CreateBoolProperty {
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
8
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
32
}
}
unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<CreateBoolProperty, D>
for &CreateBoolProperty
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<CreateBoolProperty>(offset);
fidl::encoding::Encode::<CreateBoolProperty, D>::encode(
(
<u32 as fidl::encoding::ValueTypeMarker>::borrow(&self.parent),
<u32 as fidl::encoding::ValueTypeMarker>::borrow(&self.id),
<fidl::encoding::UnboundedString as fidl::encoding::ValueTypeMarker>::borrow(
&self.name,
),
<bool as fidl::encoding::ValueTypeMarker>::borrow(&self.value),
),
encoder,
offset,
_depth,
)
}
}
unsafe impl<
D: fidl::encoding::ResourceDialect,
T0: fidl::encoding::Encode<u32, D>,
T1: fidl::encoding::Encode<u32, D>,
T2: fidl::encoding::Encode<fidl::encoding::UnboundedString, D>,
T3: fidl::encoding::Encode<bool, D>,
> fidl::encoding::Encode<CreateBoolProperty, D> for (T0, T1, T2, T3)
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<CreateBoolProperty>(offset);
unsafe {
let ptr = encoder.buf.as_mut_ptr().add(offset).offset(24);
(ptr as *mut u64).write_unaligned(0);
}
self.0.encode(encoder, offset + 0, depth)?;
self.1.encode(encoder, offset + 4, depth)?;
self.2.encode(encoder, offset + 8, depth)?;
self.3.encode(encoder, offset + 24, depth)?;
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for CreateBoolProperty {
#[inline(always)]
fn new_empty() -> Self {
Self {
parent: fidl::new_empty!(u32, D),
id: fidl::new_empty!(u32, D),
name: fidl::new_empty!(fidl::encoding::UnboundedString, D),
value: fidl::new_empty!(bool, D),
}
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(24) };
let padval = unsafe { (ptr as *const u64).read_unaligned() };
let mask = 0xffffffffffffff00u64;
let maskedval = padval & mask;
if maskedval != 0 {
return Err(fidl::Error::NonZeroPadding {
padding_start: offset + 24 + ((mask as u64).trailing_zeros() / 8) as usize,
});
}
fidl::decode!(u32, D, &mut self.parent, decoder, offset + 0, _depth)?;
fidl::decode!(u32, D, &mut self.id, decoder, offset + 4, _depth)?;
fidl::decode!(
fidl::encoding::UnboundedString,
D,
&mut self.name,
decoder,
offset + 8,
_depth
)?;
fidl::decode!(bool, D, &mut self.value, decoder, offset + 24, _depth)?;
Ok(())
}
}
impl fidl::encoding::ValueTypeMarker for CreateBytesProperty {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for CreateBytesProperty {
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
8
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
40
}
}
unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<CreateBytesProperty, D>
for &CreateBytesProperty
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<CreateBytesProperty>(offset);
fidl::encoding::Encode::<CreateBytesProperty, D>::encode(
(
<u32 as fidl::encoding::ValueTypeMarker>::borrow(&self.parent),
<u32 as fidl::encoding::ValueTypeMarker>::borrow(&self.id),
<fidl::encoding::UnboundedString as fidl::encoding::ValueTypeMarker>::borrow(&self.name),
<fidl::encoding::UnboundedVector<u8> as fidl::encoding::ValueTypeMarker>::borrow(&self.value),
),
encoder, offset, _depth
)
}
}
unsafe impl<
D: fidl::encoding::ResourceDialect,
T0: fidl::encoding::Encode<u32, D>,
T1: fidl::encoding::Encode<u32, D>,
T2: fidl::encoding::Encode<fidl::encoding::UnboundedString, D>,
T3: fidl::encoding::Encode<fidl::encoding::UnboundedVector<u8>, D>,
> fidl::encoding::Encode<CreateBytesProperty, D> for (T0, T1, T2, T3)
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<CreateBytesProperty>(offset);
self.0.encode(encoder, offset + 0, depth)?;
self.1.encode(encoder, offset + 4, depth)?;
self.2.encode(encoder, offset + 8, depth)?;
self.3.encode(encoder, offset + 24, depth)?;
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for CreateBytesProperty {
#[inline(always)]
fn new_empty() -> Self {
Self {
parent: fidl::new_empty!(u32, D),
id: fidl::new_empty!(u32, D),
name: fidl::new_empty!(fidl::encoding::UnboundedString, D),
value: 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!(u32, D, &mut self.parent, decoder, offset + 0, _depth)?;
fidl::decode!(u32, D, &mut self.id, decoder, offset + 4, _depth)?;
fidl::decode!(
fidl::encoding::UnboundedString,
D,
&mut self.name,
decoder,
offset + 8,
_depth
)?;
fidl::decode!(
fidl::encoding::UnboundedVector<u8>,
D,
&mut self.value,
decoder,
offset + 24,
_depth
)?;
Ok(())
}
}
impl fidl::encoding::ValueTypeMarker for CreateExponentialHistogram {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for CreateExponentialHistogram {
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
8
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
80
}
}
unsafe impl<D: fidl::encoding::ResourceDialect>
fidl::encoding::Encode<CreateExponentialHistogram, D> for &CreateExponentialHistogram
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<CreateExponentialHistogram>(offset);
fidl::encoding::Encode::<CreateExponentialHistogram, D>::encode(
(
<u32 as fidl::encoding::ValueTypeMarker>::borrow(&self.parent),
<u32 as fidl::encoding::ValueTypeMarker>::borrow(&self.id),
<fidl::encoding::UnboundedString as fidl::encoding::ValueTypeMarker>::borrow(
&self.name,
),
<Value as fidl::encoding::ValueTypeMarker>::borrow(&self.floor),
<Value as fidl::encoding::ValueTypeMarker>::borrow(&self.initial_step),
<Value as fidl::encoding::ValueTypeMarker>::borrow(&self.step_multiplier),
<u64 as fidl::encoding::ValueTypeMarker>::borrow(&self.buckets),
),
encoder,
offset,
_depth,
)
}
}
unsafe impl<
D: fidl::encoding::ResourceDialect,
T0: fidl::encoding::Encode<u32, D>,
T1: fidl::encoding::Encode<u32, D>,
T2: fidl::encoding::Encode<fidl::encoding::UnboundedString, D>,
T3: fidl::encoding::Encode<Value, D>,
T4: fidl::encoding::Encode<Value, D>,
T5: fidl::encoding::Encode<Value, D>,
T6: fidl::encoding::Encode<u64, D>,
> fidl::encoding::Encode<CreateExponentialHistogram, D> for (T0, T1, T2, T3, T4, T5, T6)
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<CreateExponentialHistogram>(offset);
self.0.encode(encoder, offset + 0, depth)?;
self.1.encode(encoder, offset + 4, depth)?;
self.2.encode(encoder, offset + 8, depth)?;
self.3.encode(encoder, offset + 24, depth)?;
self.4.encode(encoder, offset + 40, depth)?;
self.5.encode(encoder, offset + 56, depth)?;
self.6.encode(encoder, offset + 72, depth)?;
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
for CreateExponentialHistogram
{
#[inline(always)]
fn new_empty() -> Self {
Self {
parent: fidl::new_empty!(u32, D),
id: fidl::new_empty!(u32, D),
name: fidl::new_empty!(fidl::encoding::UnboundedString, D),
floor: fidl::new_empty!(Value, D),
initial_step: fidl::new_empty!(Value, D),
step_multiplier: fidl::new_empty!(Value, D),
buckets: 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);
fidl::decode!(u32, D, &mut self.parent, decoder, offset + 0, _depth)?;
fidl::decode!(u32, D, &mut self.id, decoder, offset + 4, _depth)?;
fidl::decode!(
fidl::encoding::UnboundedString,
D,
&mut self.name,
decoder,
offset + 8,
_depth
)?;
fidl::decode!(Value, D, &mut self.floor, decoder, offset + 24, _depth)?;
fidl::decode!(Value, D, &mut self.initial_step, decoder, offset + 40, _depth)?;
fidl::decode!(Value, D, &mut self.step_multiplier, decoder, offset + 56, _depth)?;
fidl::decode!(u64, D, &mut self.buckets, decoder, offset + 72, _depth)?;
Ok(())
}
}
impl fidl::encoding::ValueTypeMarker for CreateLazyNode {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for CreateLazyNode {
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
8
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
48
}
}
unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<CreateLazyNode, D>
for &CreateLazyNode
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<CreateLazyNode>(offset);
fidl::encoding::Encode::<CreateLazyNode, D>::encode(
(
<u32 as fidl::encoding::ValueTypeMarker>::borrow(&self.parent),
<u32 as fidl::encoding::ValueTypeMarker>::borrow(&self.id),
<fidl::encoding::UnboundedString as fidl::encoding::ValueTypeMarker>::borrow(&self.name),
<LinkDisposition as fidl::encoding::ValueTypeMarker>::borrow(&self.disposition),
<fidl::encoding::UnboundedVector<Action> as fidl::encoding::ValueTypeMarker>::borrow(&self.actions),
),
encoder, offset, _depth
)
}
}
unsafe impl<
D: fidl::encoding::ResourceDialect,
T0: fidl::encoding::Encode<u32, D>,
T1: fidl::encoding::Encode<u32, D>,
T2: fidl::encoding::Encode<fidl::encoding::UnboundedString, D>,
T3: fidl::encoding::Encode<LinkDisposition, D>,
T4: fidl::encoding::Encode<fidl::encoding::UnboundedVector<Action>, D>,
> fidl::encoding::Encode<CreateLazyNode, D> for (T0, T1, T2, T3, T4)
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<CreateLazyNode>(offset);
unsafe {
let ptr = encoder.buf.as_mut_ptr().add(offset).offset(24);
(ptr as *mut u64).write_unaligned(0);
}
self.0.encode(encoder, offset + 0, depth)?;
self.1.encode(encoder, offset + 4, depth)?;
self.2.encode(encoder, offset + 8, depth)?;
self.3.encode(encoder, offset + 24, depth)?;
self.4.encode(encoder, offset + 32, depth)?;
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for CreateLazyNode {
#[inline(always)]
fn new_empty() -> Self {
Self {
parent: fidl::new_empty!(u32, D),
id: fidl::new_empty!(u32, D),
name: fidl::new_empty!(fidl::encoding::UnboundedString, D),
disposition: fidl::new_empty!(LinkDisposition, D),
actions: fidl::new_empty!(fidl::encoding::UnboundedVector<Action>, 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(24) };
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 + 24 + ((mask as u64).trailing_zeros() / 8) as usize,
});
}
fidl::decode!(u32, D, &mut self.parent, decoder, offset + 0, _depth)?;
fidl::decode!(u32, D, &mut self.id, decoder, offset + 4, _depth)?;
fidl::decode!(
fidl::encoding::UnboundedString,
D,
&mut self.name,
decoder,
offset + 8,
_depth
)?;
fidl::decode!(LinkDisposition, D, &mut self.disposition, decoder, offset + 24, _depth)?;
fidl::decode!(
fidl::encoding::UnboundedVector<Action>,
D,
&mut self.actions,
decoder,
offset + 32,
_depth
)?;
Ok(())
}
}
impl fidl::encoding::ValueTypeMarker for CreateLinearHistogram {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for CreateLinearHistogram {
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
8
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
64
}
}
unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<CreateLinearHistogram, D>
for &CreateLinearHistogram
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<CreateLinearHistogram>(offset);
fidl::encoding::Encode::<CreateLinearHistogram, D>::encode(
(
<u32 as fidl::encoding::ValueTypeMarker>::borrow(&self.parent),
<u32 as fidl::encoding::ValueTypeMarker>::borrow(&self.id),
<fidl::encoding::UnboundedString as fidl::encoding::ValueTypeMarker>::borrow(
&self.name,
),
<Value as fidl::encoding::ValueTypeMarker>::borrow(&self.floor),
<Value as fidl::encoding::ValueTypeMarker>::borrow(&self.step_size),
<u64 as fidl::encoding::ValueTypeMarker>::borrow(&self.buckets),
),
encoder,
offset,
_depth,
)
}
}
unsafe impl<
D: fidl::encoding::ResourceDialect,
T0: fidl::encoding::Encode<u32, D>,
T1: fidl::encoding::Encode<u32, D>,
T2: fidl::encoding::Encode<fidl::encoding::UnboundedString, D>,
T3: fidl::encoding::Encode<Value, D>,
T4: fidl::encoding::Encode<Value, D>,
T5: fidl::encoding::Encode<u64, D>,
> fidl::encoding::Encode<CreateLinearHistogram, D> for (T0, T1, T2, T3, T4, T5)
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<CreateLinearHistogram>(offset);
self.0.encode(encoder, offset + 0, depth)?;
self.1.encode(encoder, offset + 4, depth)?;
self.2.encode(encoder, offset + 8, depth)?;
self.3.encode(encoder, offset + 24, depth)?;
self.4.encode(encoder, offset + 40, depth)?;
self.5.encode(encoder, offset + 56, depth)?;
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for CreateLinearHistogram {
#[inline(always)]
fn new_empty() -> Self {
Self {
parent: fidl::new_empty!(u32, D),
id: fidl::new_empty!(u32, D),
name: fidl::new_empty!(fidl::encoding::UnboundedString, D),
floor: fidl::new_empty!(Value, D),
step_size: fidl::new_empty!(Value, D),
buckets: 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);
fidl::decode!(u32, D, &mut self.parent, decoder, offset + 0, _depth)?;
fidl::decode!(u32, D, &mut self.id, decoder, offset + 4, _depth)?;
fidl::decode!(
fidl::encoding::UnboundedString,
D,
&mut self.name,
decoder,
offset + 8,
_depth
)?;
fidl::decode!(Value, D, &mut self.floor, decoder, offset + 24, _depth)?;
fidl::decode!(Value, D, &mut self.step_size, decoder, offset + 40, _depth)?;
fidl::decode!(u64, D, &mut self.buckets, decoder, offset + 56, _depth)?;
Ok(())
}
}
impl fidl::encoding::ValueTypeMarker for CreateNode {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for CreateNode {
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
8
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
24
}
}
unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<CreateNode, D>
for &CreateNode
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<CreateNode>(offset);
fidl::encoding::Encode::<CreateNode, D>::encode(
(
<u32 as fidl::encoding::ValueTypeMarker>::borrow(&self.parent),
<u32 as fidl::encoding::ValueTypeMarker>::borrow(&self.id),
<fidl::encoding::UnboundedString as fidl::encoding::ValueTypeMarker>::borrow(
&self.name,
),
),
encoder,
offset,
_depth,
)
}
}
unsafe impl<
D: fidl::encoding::ResourceDialect,
T0: fidl::encoding::Encode<u32, D>,
T1: fidl::encoding::Encode<u32, D>,
T2: fidl::encoding::Encode<fidl::encoding::UnboundedString, D>,
> fidl::encoding::Encode<CreateNode, D> for (T0, T1, T2)
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<CreateNode>(offset);
self.0.encode(encoder, offset + 0, depth)?;
self.1.encode(encoder, offset + 4, depth)?;
self.2.encode(encoder, offset + 8, depth)?;
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for CreateNode {
#[inline(always)]
fn new_empty() -> Self {
Self {
parent: fidl::new_empty!(u32, D),
id: fidl::new_empty!(u32, D),
name: 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!(u32, D, &mut self.parent, decoder, offset + 0, _depth)?;
fidl::decode!(u32, D, &mut self.id, decoder, offset + 4, _depth)?;
fidl::decode!(
fidl::encoding::UnboundedString,
D,
&mut self.name,
decoder,
offset + 8,
_depth
)?;
Ok(())
}
}
impl fidl::encoding::ValueTypeMarker for CreateNumericProperty {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for CreateNumericProperty {
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
8
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
40
}
}
unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<CreateNumericProperty, D>
for &CreateNumericProperty
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<CreateNumericProperty>(offset);
fidl::encoding::Encode::<CreateNumericProperty, D>::encode(
(
<u32 as fidl::encoding::ValueTypeMarker>::borrow(&self.parent),
<u32 as fidl::encoding::ValueTypeMarker>::borrow(&self.id),
<fidl::encoding::UnboundedString as fidl::encoding::ValueTypeMarker>::borrow(
&self.name,
),
<Value as fidl::encoding::ValueTypeMarker>::borrow(&self.value),
),
encoder,
offset,
_depth,
)
}
}
unsafe impl<
D: fidl::encoding::ResourceDialect,
T0: fidl::encoding::Encode<u32, D>,
T1: fidl::encoding::Encode<u32, D>,
T2: fidl::encoding::Encode<fidl::encoding::UnboundedString, D>,
T3: fidl::encoding::Encode<Value, D>,
> fidl::encoding::Encode<CreateNumericProperty, D> for (T0, T1, T2, T3)
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<CreateNumericProperty>(offset);
self.0.encode(encoder, offset + 0, depth)?;
self.1.encode(encoder, offset + 4, depth)?;
self.2.encode(encoder, offset + 8, depth)?;
self.3.encode(encoder, offset + 24, depth)?;
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for CreateNumericProperty {
#[inline(always)]
fn new_empty() -> Self {
Self {
parent: fidl::new_empty!(u32, D),
id: fidl::new_empty!(u32, D),
name: fidl::new_empty!(fidl::encoding::UnboundedString, D),
value: fidl::new_empty!(Value, 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!(u32, D, &mut self.parent, decoder, offset + 0, _depth)?;
fidl::decode!(u32, D, &mut self.id, decoder, offset + 4, _depth)?;
fidl::decode!(
fidl::encoding::UnboundedString,
D,
&mut self.name,
decoder,
offset + 8,
_depth
)?;
fidl::decode!(Value, D, &mut self.value, decoder, offset + 24, _depth)?;
Ok(())
}
}
impl fidl::encoding::ValueTypeMarker for CreateStringProperty {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for CreateStringProperty {
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
8
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
40
}
}
unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<CreateStringProperty, D>
for &CreateStringProperty
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<CreateStringProperty>(offset);
fidl::encoding::Encode::<CreateStringProperty, D>::encode(
(
<u32 as fidl::encoding::ValueTypeMarker>::borrow(&self.parent),
<u32 as fidl::encoding::ValueTypeMarker>::borrow(&self.id),
<fidl::encoding::UnboundedString as fidl::encoding::ValueTypeMarker>::borrow(
&self.name,
),
<fidl::encoding::UnboundedString as fidl::encoding::ValueTypeMarker>::borrow(
&self.value,
),
),
encoder,
offset,
_depth,
)
}
}
unsafe impl<
D: fidl::encoding::ResourceDialect,
T0: fidl::encoding::Encode<u32, D>,
T1: fidl::encoding::Encode<u32, D>,
T2: fidl::encoding::Encode<fidl::encoding::UnboundedString, D>,
T3: fidl::encoding::Encode<fidl::encoding::UnboundedString, D>,
> fidl::encoding::Encode<CreateStringProperty, D> for (T0, T1, T2, T3)
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<CreateStringProperty>(offset);
self.0.encode(encoder, offset + 0, depth)?;
self.1.encode(encoder, offset + 4, depth)?;
self.2.encode(encoder, offset + 8, depth)?;
self.3.encode(encoder, offset + 24, depth)?;
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for CreateStringProperty {
#[inline(always)]
fn new_empty() -> Self {
Self {
parent: fidl::new_empty!(u32, D),
id: fidl::new_empty!(u32, D),
name: fidl::new_empty!(fidl::encoding::UnboundedString, D),
value: 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!(u32, D, &mut self.parent, decoder, offset + 0, _depth)?;
fidl::decode!(u32, D, &mut self.id, decoder, offset + 4, _depth)?;
fidl::decode!(
fidl::encoding::UnboundedString,
D,
&mut self.name,
decoder,
offset + 8,
_depth
)?;
fidl::decode!(
fidl::encoding::UnboundedString,
D,
&mut self.value,
decoder,
offset + 24,
_depth
)?;
Ok(())
}
}
impl fidl::encoding::ValueTypeMarker for DeleteLazyNode {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for DeleteLazyNode {
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<DeleteLazyNode, D>
for &DeleteLazyNode
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<DeleteLazyNode>(offset);
unsafe {
let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
(buf_ptr as *mut DeleteLazyNode)
.write_unaligned((self as *const DeleteLazyNode).read());
}
Ok(())
}
}
unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<u32, D>>
fidl::encoding::Encode<DeleteLazyNode, 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::<DeleteLazyNode>(offset);
self.0.encode(encoder, offset + 0, depth)?;
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for DeleteLazyNode {
#[inline(always)]
fn new_empty() -> Self {
Self { id: 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 DeleteNode {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for DeleteNode {
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<DeleteNode, D>
for &DeleteNode
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<DeleteNode>(offset);
unsafe {
let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
(buf_ptr as *mut DeleteNode).write_unaligned((self as *const DeleteNode).read());
}
Ok(())
}
}
unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<u32, D>>
fidl::encoding::Encode<DeleteNode, 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::<DeleteNode>(offset);
self.0.encode(encoder, offset + 0, depth)?;
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for DeleteNode {
#[inline(always)]
fn new_empty() -> Self {
Self { id: 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 DeleteProperty {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for DeleteProperty {
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<DeleteProperty, D>
for &DeleteProperty
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<DeleteProperty>(offset);
unsafe {
let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
(buf_ptr as *mut DeleteProperty)
.write_unaligned((self as *const DeleteProperty).read());
}
Ok(())
}
}
unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<u32, D>>
fidl::encoding::Encode<DeleteProperty, 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::<DeleteProperty>(offset);
self.0.encode(encoder, offset + 0, depth)?;
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for DeleteProperty {
#[inline(always)]
fn new_empty() -> Self {
Self { id: 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 Insert {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for Insert {
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
8
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
24
}
}
unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Insert, D> for &Insert {
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<Insert>(offset);
fidl::encoding::Encode::<Insert, D>::encode(
(
<u32 as fidl::encoding::ValueTypeMarker>::borrow(&self.id),
<Value as fidl::encoding::ValueTypeMarker>::borrow(&self.value),
),
encoder,
offset,
_depth,
)
}
}
unsafe impl<
D: fidl::encoding::ResourceDialect,
T0: fidl::encoding::Encode<u32, D>,
T1: fidl::encoding::Encode<Value, D>,
> fidl::encoding::Encode<Insert, 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::<Insert>(offset);
unsafe {
let ptr = encoder.buf.as_mut_ptr().add(offset).offset(0);
(ptr as *mut u64).write_unaligned(0);
}
self.0.encode(encoder, offset + 0, depth)?;
self.1.encode(encoder, offset + 8, depth)?;
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for Insert {
#[inline(always)]
fn new_empty() -> Self {
Self { id: fidl::new_empty!(u32, D), value: fidl::new_empty!(Value, D) }
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(0) };
let padval = unsafe { (ptr as *const u64).read_unaligned() };
let mask = 0xffffffff00000000u64;
let maskedval = padval & mask;
if maskedval != 0 {
return Err(fidl::Error::NonZeroPadding {
padding_start: offset + 0 + ((mask as u64).trailing_zeros() / 8) as usize,
});
}
fidl::decode!(u32, D, &mut self.id, decoder, offset + 0, _depth)?;
fidl::decode!(Value, D, &mut self.value, decoder, offset + 8, _depth)?;
Ok(())
}
}
impl fidl::encoding::ValueTypeMarker for InsertMultiple {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for InsertMultiple {
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
8
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
32
}
}
unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<InsertMultiple, D>
for &InsertMultiple
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<InsertMultiple>(offset);
fidl::encoding::Encode::<InsertMultiple, D>::encode(
(
<u32 as fidl::encoding::ValueTypeMarker>::borrow(&self.id),
<Value as fidl::encoding::ValueTypeMarker>::borrow(&self.value),
<u64 as fidl::encoding::ValueTypeMarker>::borrow(&self.count),
),
encoder,
offset,
_depth,
)
}
}
unsafe impl<
D: fidl::encoding::ResourceDialect,
T0: fidl::encoding::Encode<u32, D>,
T1: fidl::encoding::Encode<Value, D>,
T2: fidl::encoding::Encode<u64, D>,
> fidl::encoding::Encode<InsertMultiple, D> for (T0, T1, T2)
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<InsertMultiple>(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)?;
self.2.encode(encoder, offset + 24, depth)?;
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for InsertMultiple {
#[inline(always)]
fn new_empty() -> Self {
Self {
id: fidl::new_empty!(u32, D),
value: fidl::new_empty!(Value, D),
count: 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 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!(u32, D, &mut self.id, decoder, offset + 0, _depth)?;
fidl::decode!(Value, D, &mut self.value, decoder, offset + 8, _depth)?;
fidl::decode!(u64, D, &mut self.count, decoder, offset + 24, _depth)?;
Ok(())
}
}
impl fidl::encoding::ValueTypeMarker for InspectPuppetActLazyRequest {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for InspectPuppetActLazyRequest {
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<InspectPuppetActLazyRequest, D> for &InspectPuppetActLazyRequest
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<InspectPuppetActLazyRequest>(offset);
fidl::encoding::Encode::<InspectPuppetActLazyRequest, D>::encode(
(<LazyAction as fidl::encoding::ValueTypeMarker>::borrow(&self.lazy_action),),
encoder,
offset,
_depth,
)
}
}
unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<LazyAction, D>>
fidl::encoding::Encode<InspectPuppetActLazyRequest, 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::<InspectPuppetActLazyRequest>(offset);
self.0.encode(encoder, offset + 0, depth)?;
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
for InspectPuppetActLazyRequest
{
#[inline(always)]
fn new_empty() -> Self {
Self { lazy_action: fidl::new_empty!(LazyAction, 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!(LazyAction, D, &mut self.lazy_action, decoder, offset + 0, _depth)?;
Ok(())
}
}
impl fidl::encoding::ValueTypeMarker for InspectPuppetActRequest {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for InspectPuppetActRequest {
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<InspectPuppetActRequest, D> for &InspectPuppetActRequest
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<InspectPuppetActRequest>(offset);
fidl::encoding::Encode::<InspectPuppetActRequest, D>::encode(
(<Action as fidl::encoding::ValueTypeMarker>::borrow(&self.action),),
encoder,
offset,
_depth,
)
}
}
unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<Action, D>>
fidl::encoding::Encode<InspectPuppetActRequest, 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::<InspectPuppetActRequest>(offset);
self.0.encode(encoder, offset + 0, depth)?;
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
for InspectPuppetActRequest
{
#[inline(always)]
fn new_empty() -> Self {
Self { action: fidl::new_empty!(Action, 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!(Action, D, &mut self.action, decoder, offset + 0, _depth)?;
Ok(())
}
}
impl fidl::encoding::ValueTypeMarker for InspectPuppetInitializeRequest {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for InspectPuppetInitializeRequest {
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<InspectPuppetInitializeRequest, D>
for &InspectPuppetInitializeRequest
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<InspectPuppetInitializeRequest>(offset);
fidl::encoding::Encode::<InspectPuppetInitializeRequest, D>::encode(
(<InitializationParams as fidl::encoding::ValueTypeMarker>::borrow(&self.params),),
encoder,
offset,
_depth,
)
}
}
unsafe impl<
D: fidl::encoding::ResourceDialect,
T0: fidl::encoding::Encode<InitializationParams, D>,
> fidl::encoding::Encode<InspectPuppetInitializeRequest, 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::<InspectPuppetInitializeRequest>(offset);
self.0.encode(encoder, offset + 0, depth)?;
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
for InspectPuppetInitializeRequest
{
#[inline(always)]
fn new_empty() -> Self {
Self { params: fidl::new_empty!(InitializationParams, 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!(InitializationParams, D, &mut self.params, decoder, offset + 0, _depth)?;
Ok(())
}
}
impl fidl::encoding::ValueTypeMarker for InspectPuppetInitializeTreeRequest {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for InspectPuppetInitializeTreeRequest {
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<InspectPuppetInitializeTreeRequest, D>
for &InspectPuppetInitializeTreeRequest
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<InspectPuppetInitializeTreeRequest>(offset);
fidl::encoding::Encode::<InspectPuppetInitializeTreeRequest, D>::encode(
(<InitializationParams as fidl::encoding::ValueTypeMarker>::borrow(&self.params),),
encoder,
offset,
_depth,
)
}
}
unsafe impl<
D: fidl::encoding::ResourceDialect,
T0: fidl::encoding::Encode<InitializationParams, D>,
> fidl::encoding::Encode<InspectPuppetInitializeTreeRequest, 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::<InspectPuppetInitializeTreeRequest>(offset);
self.0.encode(encoder, offset + 0, depth)?;
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
for InspectPuppetInitializeTreeRequest
{
#[inline(always)]
fn new_empty() -> Self {
Self { params: fidl::new_empty!(InitializationParams, 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!(InitializationParams, D, &mut self.params, decoder, offset + 0, _depth)?;
Ok(())
}
}
impl fidl::encoding::ValueTypeMarker for InspectPuppetActLazyResponse {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for InspectPuppetActLazyResponse {
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<InspectPuppetActLazyResponse, D> for &InspectPuppetActLazyResponse
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<InspectPuppetActLazyResponse>(offset);
fidl::encoding::Encode::<InspectPuppetActLazyResponse, D>::encode(
(<TestResult as fidl::encoding::ValueTypeMarker>::borrow(&self.result),),
encoder,
offset,
_depth,
)
}
}
unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<TestResult, D>>
fidl::encoding::Encode<InspectPuppetActLazyResponse, 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::<InspectPuppetActLazyResponse>(offset);
self.0.encode(encoder, offset + 0, depth)?;
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
for InspectPuppetActLazyResponse
{
#[inline(always)]
fn new_empty() -> Self {
Self { result: fidl::new_empty!(TestResult, 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!(TestResult, D, &mut self.result, decoder, offset + 0, _depth)?;
Ok(())
}
}
impl fidl::encoding::ValueTypeMarker for InspectPuppetActResponse {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for InspectPuppetActResponse {
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<InspectPuppetActResponse, D> for &InspectPuppetActResponse
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<InspectPuppetActResponse>(offset);
fidl::encoding::Encode::<InspectPuppetActResponse, D>::encode(
(<TestResult as fidl::encoding::ValueTypeMarker>::borrow(&self.result),),
encoder,
offset,
_depth,
)
}
}
unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<TestResult, D>>
fidl::encoding::Encode<InspectPuppetActResponse, 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::<InspectPuppetActResponse>(offset);
self.0.encode(encoder, offset + 0, depth)?;
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
for InspectPuppetActResponse
{
#[inline(always)]
fn new_empty() -> Self {
Self { result: fidl::new_empty!(TestResult, 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!(TestResult, D, &mut self.result, decoder, offset + 0, _depth)?;
Ok(())
}
}
impl fidl::encoding::ResourceTypeMarker for InspectPuppetGetConfigResponse {
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 InspectPuppetGetConfigResponse {
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
8
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
32
}
}
unsafe impl
fidl::encoding::Encode<
InspectPuppetGetConfigResponse,
fidl::encoding::DefaultFuchsiaResourceDialect,
> for &mut InspectPuppetGetConfigResponse
{
#[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::<InspectPuppetGetConfigResponse>(offset);
fidl::encoding::Encode::<
InspectPuppetGetConfigResponse,
fidl::encoding::DefaultFuchsiaResourceDialect,
>::encode(
(
<fidl::encoding::UnboundedString as fidl::encoding::ValueTypeMarker>::borrow(
&self.printable_name,
),
<Options as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
&mut self.options,
),
),
encoder,
offset,
_depth,
)
}
}
unsafe impl<
T0: fidl::encoding::Encode<
fidl::encoding::UnboundedString,
fidl::encoding::DefaultFuchsiaResourceDialect,
>,
T1: fidl::encoding::Encode<Options, fidl::encoding::DefaultFuchsiaResourceDialect>,
>
fidl::encoding::Encode<
InspectPuppetGetConfigResponse,
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::<InspectPuppetGetConfigResponse>(offset);
self.0.encode(encoder, offset + 0, depth)?;
self.1.encode(encoder, offset + 16, depth)?;
Ok(())
}
}
impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
for InspectPuppetGetConfigResponse
{
#[inline(always)]
fn new_empty() -> Self {
Self {
printable_name: fidl::new_empty!(
fidl::encoding::UnboundedString,
fidl::encoding::DefaultFuchsiaResourceDialect
),
options: fidl::new_empty!(Options, 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::UnboundedString,
fidl::encoding::DefaultFuchsiaResourceDialect,
&mut self.printable_name,
decoder,
offset + 0,
_depth
)?;
fidl::decode!(
Options,
fidl::encoding::DefaultFuchsiaResourceDialect,
&mut self.options,
decoder,
offset + 16,
_depth
)?;
Ok(())
}
}
impl fidl::encoding::ResourceTypeMarker for InspectPuppetInitializeTreeResponse {
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 InspectPuppetInitializeTreeResponse {
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
4
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
8
}
}
unsafe impl
fidl::encoding::Encode<
InspectPuppetInitializeTreeResponse,
fidl::encoding::DefaultFuchsiaResourceDialect,
> for &mut InspectPuppetInitializeTreeResponse
{
#[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::<InspectPuppetInitializeTreeResponse>(offset);
fidl::encoding::Encode::<
InspectPuppetInitializeTreeResponse,
fidl::encoding::DefaultFuchsiaResourceDialect,
>::encode(
(
<fidl::encoding::Optional<
fidl::encoding::Endpoint<
fidl::endpoints::ClientEnd<fidl_fuchsia_inspect::TreeMarker>,
>,
> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
&mut self.tree
),
<TestResult as fidl::encoding::ValueTypeMarker>::borrow(&self.result),
),
encoder,
offset,
_depth,
)
}
}
unsafe impl<
T0: fidl::encoding::Encode<
fidl::encoding::Optional<
fidl::encoding::Endpoint<
fidl::endpoints::ClientEnd<fidl_fuchsia_inspect::TreeMarker>,
>,
>,
fidl::encoding::DefaultFuchsiaResourceDialect,
>,
T1: fidl::encoding::Encode<TestResult, fidl::encoding::DefaultFuchsiaResourceDialect>,
>
fidl::encoding::Encode<
InspectPuppetInitializeTreeResponse,
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::<InspectPuppetInitializeTreeResponse>(offset);
self.0.encode(encoder, offset + 0, depth)?;
self.1.encode(encoder, offset + 4, depth)?;
Ok(())
}
}
impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
for InspectPuppetInitializeTreeResponse
{
#[inline(always)]
fn new_empty() -> Self {
Self {
tree: fidl::new_empty!(
fidl::encoding::Optional<
fidl::encoding::Endpoint<
fidl::endpoints::ClientEnd<fidl_fuchsia_inspect::TreeMarker>,
>,
>,
fidl::encoding::DefaultFuchsiaResourceDialect
),
result: fidl::new_empty!(TestResult, 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::Optional<
fidl::encoding::Endpoint<
fidl::endpoints::ClientEnd<fidl_fuchsia_inspect::TreeMarker>,
>,
>,
fidl::encoding::DefaultFuchsiaResourceDialect,
&mut self.tree,
decoder,
offset + 0,
_depth
)?;
fidl::decode!(
TestResult,
fidl::encoding::DefaultFuchsiaResourceDialect,
&mut self.result,
decoder,
offset + 4,
_depth
)?;
Ok(())
}
}
impl fidl::encoding::ResourceTypeMarker for InspectPuppetInitializeResponse {
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 InspectPuppetInitializeResponse {
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
4
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
8
}
}
unsafe impl
fidl::encoding::Encode<
InspectPuppetInitializeResponse,
fidl::encoding::DefaultFuchsiaResourceDialect,
> for &mut InspectPuppetInitializeResponse
{
#[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::<InspectPuppetInitializeResponse>(offset);
fidl::encoding::Encode::<
InspectPuppetInitializeResponse,
fidl::encoding::DefaultFuchsiaResourceDialect,
>::encode(
(
<fidl::encoding::Optional<
fidl::encoding::HandleType<
fidl::Handle,
{ fidl::ObjectType::NONE.into_raw() },
2147483648,
>,
> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
&mut self.vmo
),
<TestResult as fidl::encoding::ValueTypeMarker>::borrow(&self.result),
),
encoder,
offset,
_depth,
)
}
}
unsafe impl<
T0: fidl::encoding::Encode<
fidl::encoding::Optional<
fidl::encoding::HandleType<
fidl::Handle,
{ fidl::ObjectType::NONE.into_raw() },
2147483648,
>,
>,
fidl::encoding::DefaultFuchsiaResourceDialect,
>,
T1: fidl::encoding::Encode<TestResult, fidl::encoding::DefaultFuchsiaResourceDialect>,
>
fidl::encoding::Encode<
InspectPuppetInitializeResponse,
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::<InspectPuppetInitializeResponse>(offset);
self.0.encode(encoder, offset + 0, depth)?;
self.1.encode(encoder, offset + 4, depth)?;
Ok(())
}
}
impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
for InspectPuppetInitializeResponse
{
#[inline(always)]
fn new_empty() -> Self {
Self {
vmo: fidl::new_empty!(
fidl::encoding::Optional<
fidl::encoding::HandleType<
fidl::Handle,
{ fidl::ObjectType::NONE.into_raw() },
2147483648,
>,
>,
fidl::encoding::DefaultFuchsiaResourceDialect
),
result: fidl::new_empty!(TestResult, 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::Optional<
fidl::encoding::HandleType<
fidl::Handle,
{ fidl::ObjectType::NONE.into_raw() },
2147483648,
>,
>,
fidl::encoding::DefaultFuchsiaResourceDialect,
&mut self.vmo,
decoder,
offset + 0,
_depth
)?;
fidl::decode!(
TestResult,
fidl::encoding::DefaultFuchsiaResourceDialect,
&mut self.result,
decoder,
offset + 4,
_depth
)?;
Ok(())
}
}
impl fidl::encoding::ValueTypeMarker for InspectPuppetPublishResponse {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for InspectPuppetPublishResponse {
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<InspectPuppetPublishResponse, D> for &InspectPuppetPublishResponse
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<InspectPuppetPublishResponse>(offset);
fidl::encoding::Encode::<InspectPuppetPublishResponse, D>::encode(
(<TestResult as fidl::encoding::ValueTypeMarker>::borrow(&self.result),),
encoder,
offset,
_depth,
)
}
}
unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<TestResult, D>>
fidl::encoding::Encode<InspectPuppetPublishResponse, 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::<InspectPuppetPublishResponse>(offset);
self.0.encode(encoder, offset + 0, depth)?;
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
for InspectPuppetPublishResponse
{
#[inline(always)]
fn new_empty() -> Self {
Self { result: fidl::new_empty!(TestResult, 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!(TestResult, D, &mut self.result, decoder, offset + 0, _depth)?;
Ok(())
}
}
impl fidl::encoding::ValueTypeMarker for SetBool {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for SetBool {
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
4
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
8
}
}
unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<SetBool, D> for &SetBool {
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<SetBool>(offset);
fidl::encoding::Encode::<SetBool, D>::encode(
(
<u32 as fidl::encoding::ValueTypeMarker>::borrow(&self.id),
<bool as fidl::encoding::ValueTypeMarker>::borrow(&self.value),
),
encoder,
offset,
_depth,
)
}
}
unsafe impl<
D: fidl::encoding::ResourceDialect,
T0: fidl::encoding::Encode<u32, D>,
T1: fidl::encoding::Encode<bool, D>,
> fidl::encoding::Encode<SetBool, 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::<SetBool>(offset);
unsafe {
let ptr = encoder.buf.as_mut_ptr().add(offset).offset(4);
(ptr as *mut u32).write_unaligned(0);
}
self.0.encode(encoder, offset + 0, depth)?;
self.1.encode(encoder, offset + 4, depth)?;
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for SetBool {
#[inline(always)]
fn new_empty() -> Self {
Self { id: fidl::new_empty!(u32, D), value: fidl::new_empty!(bool, D) }
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(4) };
let padval = unsafe { (ptr as *const u32).read_unaligned() };
let mask = 0xffffff00u32;
let maskedval = padval & mask;
if maskedval != 0 {
return Err(fidl::Error::NonZeroPadding {
padding_start: offset + 4 + ((mask as u64).trailing_zeros() / 8) as usize,
});
}
fidl::decode!(u32, D, &mut self.id, decoder, offset + 0, _depth)?;
fidl::decode!(bool, D, &mut self.value, decoder, offset + 4, _depth)?;
Ok(())
}
}
impl fidl::encoding::ValueTypeMarker for SetBytes {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for SetBytes {
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
8
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
24
}
}
unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<SetBytes, D> for &SetBytes {
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<SetBytes>(offset);
fidl::encoding::Encode::<SetBytes, D>::encode(
(
<u32 as fidl::encoding::ValueTypeMarker>::borrow(&self.id),
<fidl::encoding::UnboundedVector<u8> as fidl::encoding::ValueTypeMarker>::borrow(&self.value),
),
encoder, offset, _depth
)
}
}
unsafe impl<
D: fidl::encoding::ResourceDialect,
T0: fidl::encoding::Encode<u32, D>,
T1: fidl::encoding::Encode<fidl::encoding::UnboundedVector<u8>, D>,
> fidl::encoding::Encode<SetBytes, 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::<SetBytes>(offset);
unsafe {
let ptr = encoder.buf.as_mut_ptr().add(offset).offset(0);
(ptr as *mut u64).write_unaligned(0);
}
self.0.encode(encoder, offset + 0, depth)?;
self.1.encode(encoder, offset + 8, depth)?;
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for SetBytes {
#[inline(always)]
fn new_empty() -> Self {
Self {
id: fidl::new_empty!(u32, D),
value: 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);
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!(u32, D, &mut self.id, decoder, offset + 0, _depth)?;
fidl::decode!(
fidl::encoding::UnboundedVector<u8>,
D,
&mut self.value,
decoder,
offset + 8,
_depth
)?;
Ok(())
}
}
impl fidl::encoding::ValueTypeMarker for SetNumber {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for SetNumber {
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
8
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
24
}
}
unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<SetNumber, D>
for &SetNumber
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<SetNumber>(offset);
fidl::encoding::Encode::<SetNumber, D>::encode(
(
<u32 as fidl::encoding::ValueTypeMarker>::borrow(&self.id),
<Value as fidl::encoding::ValueTypeMarker>::borrow(&self.value),
),
encoder,
offset,
_depth,
)
}
}
unsafe impl<
D: fidl::encoding::ResourceDialect,
T0: fidl::encoding::Encode<u32, D>,
T1: fidl::encoding::Encode<Value, D>,
> fidl::encoding::Encode<SetNumber, 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::<SetNumber>(offset);
unsafe {
let ptr = encoder.buf.as_mut_ptr().add(offset).offset(0);
(ptr as *mut u64).write_unaligned(0);
}
self.0.encode(encoder, offset + 0, depth)?;
self.1.encode(encoder, offset + 8, depth)?;
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for SetNumber {
#[inline(always)]
fn new_empty() -> Self {
Self { id: fidl::new_empty!(u32, D), value: fidl::new_empty!(Value, D) }
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(0) };
let padval = unsafe { (ptr as *const u64).read_unaligned() };
let mask = 0xffffffff00000000u64;
let maskedval = padval & mask;
if maskedval != 0 {
return Err(fidl::Error::NonZeroPadding {
padding_start: offset + 0 + ((mask as u64).trailing_zeros() / 8) as usize,
});
}
fidl::decode!(u32, D, &mut self.id, decoder, offset + 0, _depth)?;
fidl::decode!(Value, D, &mut self.value, decoder, offset + 8, _depth)?;
Ok(())
}
}
impl fidl::encoding::ValueTypeMarker for SetString {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for SetString {
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
8
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
24
}
}
unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<SetString, D>
for &SetString
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<SetString>(offset);
fidl::encoding::Encode::<SetString, D>::encode(
(
<u32 as fidl::encoding::ValueTypeMarker>::borrow(&self.id),
<fidl::encoding::UnboundedString as fidl::encoding::ValueTypeMarker>::borrow(
&self.value,
),
),
encoder,
offset,
_depth,
)
}
}
unsafe impl<
D: fidl::encoding::ResourceDialect,
T0: fidl::encoding::Encode<u32, D>,
T1: fidl::encoding::Encode<fidl::encoding::UnboundedString, D>,
> fidl::encoding::Encode<SetString, 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::<SetString>(offset);
unsafe {
let ptr = encoder.buf.as_mut_ptr().add(offset).offset(0);
(ptr as *mut u64).write_unaligned(0);
}
self.0.encode(encoder, offset + 0, depth)?;
self.1.encode(encoder, offset + 8, depth)?;
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for SetString {
#[inline(always)]
fn new_empty() -> Self {
Self {
id: fidl::new_empty!(u32, D),
value: 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);
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!(u32, D, &mut self.id, decoder, offset + 0, _depth)?;
fidl::decode!(
fidl::encoding::UnboundedString,
D,
&mut self.value,
decoder,
offset + 8,
_depth
)?;
Ok(())
}
}
impl fidl::encoding::ValueTypeMarker for SubtractNumber {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for SubtractNumber {
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
8
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
24
}
}
unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<SubtractNumber, D>
for &SubtractNumber
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<SubtractNumber>(offset);
fidl::encoding::Encode::<SubtractNumber, D>::encode(
(
<u32 as fidl::encoding::ValueTypeMarker>::borrow(&self.id),
<Value as fidl::encoding::ValueTypeMarker>::borrow(&self.value),
),
encoder,
offset,
_depth,
)
}
}
unsafe impl<
D: fidl::encoding::ResourceDialect,
T0: fidl::encoding::Encode<u32, D>,
T1: fidl::encoding::Encode<Value, D>,
> fidl::encoding::Encode<SubtractNumber, 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::<SubtractNumber>(offset);
unsafe {
let ptr = encoder.buf.as_mut_ptr().add(offset).offset(0);
(ptr as *mut u64).write_unaligned(0);
}
self.0.encode(encoder, offset + 0, depth)?;
self.1.encode(encoder, offset + 8, depth)?;
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for SubtractNumber {
#[inline(always)]
fn new_empty() -> Self {
Self { id: fidl::new_empty!(u32, D), value: fidl::new_empty!(Value, D) }
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(0) };
let padval = unsafe { (ptr as *const u64).read_unaligned() };
let mask = 0xffffffff00000000u64;
let maskedval = padval & mask;
if maskedval != 0 {
return Err(fidl::Error::NonZeroPadding {
padding_start: offset + 0 + ((mask as u64).trailing_zeros() / 8) as usize,
});
}
fidl::decode!(u32, D, &mut self.id, decoder, offset + 0, _depth)?;
fidl::decode!(Value, D, &mut self.value, decoder, offset + 8, _depth)?;
Ok(())
}
}
impl InitializationParams {
#[inline(always)]
fn max_ordinal_present(&self) -> u64 {
if let Some(_) = self.vmo_size {
return 1;
}
0
}
}
impl fidl::encoding::ValueTypeMarker for InitializationParams {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for InitializationParams {
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<InitializationParams, D>
for &InitializationParams
{
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
mut depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<InitializationParams>(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::<u64, D>(
self.vmo_size.as_ref().map(<u64 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 InitializationParams {
#[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 =
<u64 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.vmo_size.get_or_insert_with(|| fidl::new_empty!(u64, D));
fidl::decode!(u64, 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 Options {
#[inline(always)]
fn max_ordinal_present(&self) -> u64 {
if let Some(_) = self.diff_type {
return 2;
}
if let Some(_) = self.has_runner_node {
return 1;
}
0
}
}
impl fidl::encoding::ResourceTypeMarker for Options {
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 Options {
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<Options, fidl::encoding::DefaultFuchsiaResourceDialect>
for &mut Options
{
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<
'_,
fidl::encoding::DefaultFuchsiaResourceDialect,
>,
offset: usize,
mut depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<Options>(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::<
bool,
fidl::encoding::DefaultFuchsiaResourceDialect,
>(
self.has_runner_node
.as_ref()
.map(<bool as fidl::encoding::ValueTypeMarker>::borrow),
encoder,
offset + cur_offset,
depth,
)?;
_prev_end_offset = cur_offset + envelope_size;
if 2 > max_ordinal {
return Ok(());
}
let cur_offset: usize = (2 - 1) * envelope_size;
encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
fidl::encoding::encode_in_envelope_optional::<
DiffType,
fidl::encoding::DefaultFuchsiaResourceDialect,
>(
self.diff_type.as_ref().map(<DiffType as fidl::encoding::ValueTypeMarker>::borrow),
encoder,
offset + cur_offset,
depth,
)?;
_prev_end_offset = cur_offset + envelope_size;
Ok(())
}
}
impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect> for Options {
#[inline(always)]
fn new_empty() -> Self {
Self::default()
}
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<
'_,
fidl::encoding::DefaultFuchsiaResourceDialect,
>,
offset: usize,
mut depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
None => return Err(fidl::Error::NotNullable),
Some(len) => len,
};
if len == 0 {
return Ok(());
};
depth.increment()?;
let envelope_size = 8;
let bytes_len = len * envelope_size;
let offset = decoder.out_of_line_offset(bytes_len)?;
let mut _next_ordinal_to_read = 0;
let mut next_offset = offset;
let end_offset = offset + bytes_len;
_next_ordinal_to_read += 1;
if next_offset >= end_offset {
return Ok(());
}
while _next_ordinal_to_read < 1 {
fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
_next_ordinal_to_read += 1;
next_offset += envelope_size;
}
let next_out_of_line = decoder.next_out_of_line();
let handles_before = decoder.remaining_handles();
if let Some((inlined, num_bytes, num_handles)) =
fidl::encoding::decode_envelope_header(decoder, next_offset)?
{
let member_inline_size =
<bool 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.has_runner_node.get_or_insert_with(|| {
fidl::new_empty!(bool, fidl::encoding::DefaultFuchsiaResourceDialect)
});
fidl::decode!(
bool,
fidl::encoding::DefaultFuchsiaResourceDialect,
val_ref,
decoder,
inner_offset,
inner_depth
)?;
if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
{
return Err(fidl::Error::InvalidNumBytesInEnvelope);
}
if handles_before != decoder.remaining_handles() + (num_handles as usize) {
return Err(fidl::Error::InvalidNumHandlesInEnvelope);
}
}
next_offset += envelope_size;
_next_ordinal_to_read += 1;
if next_offset >= end_offset {
return Ok(());
}
while _next_ordinal_to_read < 2 {
fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
_next_ordinal_to_read += 1;
next_offset += envelope_size;
}
let next_out_of_line = decoder.next_out_of_line();
let handles_before = decoder.remaining_handles();
if let Some((inlined, num_bytes, num_handles)) =
fidl::encoding::decode_envelope_header(decoder, next_offset)?
{
let member_inline_size =
<DiffType 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.diff_type.get_or_insert_with(|| {
fidl::new_empty!(DiffType, fidl::encoding::DefaultFuchsiaResourceDialect)
});
fidl::decode!(
DiffType,
fidl::encoding::DefaultFuchsiaResourceDialect,
val_ref,
decoder,
inner_offset,
inner_depth
)?;
if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
{
return Err(fidl::Error::InvalidNumBytesInEnvelope);
}
if handles_before != decoder.remaining_handles() + (num_handles as usize) {
return Err(fidl::Error::InvalidNumHandlesInEnvelope);
}
}
next_offset += envelope_size;
while next_offset < end_offset {
_next_ordinal_to_read += 1;
fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
next_offset += envelope_size;
}
Ok(())
}
}
impl fidl::encoding::ValueTypeMarker for Action {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for Action {
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<Action, D> for &Action {
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<Action>(offset);
encoder.write_num::<u64>(self.ordinal(), offset);
match self {
Action::CreateNode(ref val) => fidl::encoding::encode_in_envelope::<CreateNode, D>(
<CreateNode as fidl::encoding::ValueTypeMarker>::borrow(val),
encoder,
offset + 8,
_depth,
),
Action::DeleteNode(ref val) => fidl::encoding::encode_in_envelope::<DeleteNode, D>(
<DeleteNode as fidl::encoding::ValueTypeMarker>::borrow(val),
encoder,
offset + 8,
_depth,
),
Action::CreateNumericProperty(ref val) => {
fidl::encoding::encode_in_envelope::<CreateNumericProperty, D>(
<CreateNumericProperty as fidl::encoding::ValueTypeMarker>::borrow(val),
encoder,
offset + 8,
_depth,
)
}
Action::CreateBytesProperty(ref val) => {
fidl::encoding::encode_in_envelope::<CreateBytesProperty, D>(
<CreateBytesProperty as fidl::encoding::ValueTypeMarker>::borrow(val),
encoder,
offset + 8,
_depth,
)
}
Action::CreateStringProperty(ref val) => {
fidl::encoding::encode_in_envelope::<CreateStringProperty, D>(
<CreateStringProperty as fidl::encoding::ValueTypeMarker>::borrow(val),
encoder,
offset + 8,
_depth,
)
}
Action::DeleteProperty(ref val) => {
fidl::encoding::encode_in_envelope::<DeleteProperty, D>(
<DeleteProperty as fidl::encoding::ValueTypeMarker>::borrow(val),
encoder,
offset + 8,
_depth,
)
}
Action::SetNumber(ref val) => fidl::encoding::encode_in_envelope::<SetNumber, D>(
<SetNumber as fidl::encoding::ValueTypeMarker>::borrow(val),
encoder,
offset + 8,
_depth,
),
Action::SetString(ref val) => fidl::encoding::encode_in_envelope::<SetString, D>(
<SetString as fidl::encoding::ValueTypeMarker>::borrow(val),
encoder,
offset + 8,
_depth,
),
Action::SetBytes(ref val) => fidl::encoding::encode_in_envelope::<SetBytes, D>(
<SetBytes as fidl::encoding::ValueTypeMarker>::borrow(val),
encoder,
offset + 8,
_depth,
),
Action::AddNumber(ref val) => fidl::encoding::encode_in_envelope::<AddNumber, D>(
<AddNumber as fidl::encoding::ValueTypeMarker>::borrow(val),
encoder,
offset + 8,
_depth,
),
Action::SubtractNumber(ref val) => {
fidl::encoding::encode_in_envelope::<SubtractNumber, D>(
<SubtractNumber as fidl::encoding::ValueTypeMarker>::borrow(val),
encoder,
offset + 8,
_depth,
)
}
Action::CreateArrayProperty(ref val) => {
fidl::encoding::encode_in_envelope::<CreateArrayProperty, D>(
<CreateArrayProperty as fidl::encoding::ValueTypeMarker>::borrow(val),
encoder,
offset + 8,
_depth,
)
}
Action::ArraySet(ref val) => fidl::encoding::encode_in_envelope::<ArraySet, D>(
<ArraySet as fidl::encoding::ValueTypeMarker>::borrow(val),
encoder,
offset + 8,
_depth,
),
Action::ArrayAdd(ref val) => fidl::encoding::encode_in_envelope::<ArrayAdd, D>(
<ArrayAdd as fidl::encoding::ValueTypeMarker>::borrow(val),
encoder,
offset + 8,
_depth,
),
Action::ArraySubtract(ref val) => {
fidl::encoding::encode_in_envelope::<ArraySubtract, D>(
<ArraySubtract as fidl::encoding::ValueTypeMarker>::borrow(val),
encoder,
offset + 8,
_depth,
)
}
Action::CreateLinearHistogram(ref val) => {
fidl::encoding::encode_in_envelope::<CreateLinearHistogram, D>(
<CreateLinearHistogram as fidl::encoding::ValueTypeMarker>::borrow(val),
encoder,
offset + 8,
_depth,
)
}
Action::CreateExponentialHistogram(ref val) => {
fidl::encoding::encode_in_envelope::<CreateExponentialHistogram, D>(
<CreateExponentialHistogram as fidl::encoding::ValueTypeMarker>::borrow(
val,
),
encoder,
offset + 8,
_depth,
)
}
Action::Insert(ref val) => fidl::encoding::encode_in_envelope::<Insert, D>(
<Insert as fidl::encoding::ValueTypeMarker>::borrow(val),
encoder,
offset + 8,
_depth,
),
Action::InsertMultiple(ref val) => {
fidl::encoding::encode_in_envelope::<InsertMultiple, D>(
<InsertMultiple as fidl::encoding::ValueTypeMarker>::borrow(val),
encoder,
offset + 8,
_depth,
)
}
Action::CreateBoolProperty(ref val) => {
fidl::encoding::encode_in_envelope::<CreateBoolProperty, D>(
<CreateBoolProperty as fidl::encoding::ValueTypeMarker>::borrow(val),
encoder,
offset + 8,
_depth,
)
}
Action::SetBool(ref val) => fidl::encoding::encode_in_envelope::<SetBool, D>(
<SetBool as fidl::encoding::ValueTypeMarker>::borrow(val),
encoder,
offset + 8,
_depth,
),
Action::__SourceBreaking { .. } => Err(fidl::Error::UnknownUnionTag),
}
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for Action {
#[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 => <CreateNode as fidl::encoding::TypeMarker>::inline_size(decoder.context),
2 => <DeleteNode as fidl::encoding::TypeMarker>::inline_size(decoder.context),
3 => <CreateNumericProperty as fidl::encoding::TypeMarker>::inline_size(
decoder.context,
),
4 => <CreateBytesProperty as fidl::encoding::TypeMarker>::inline_size(
decoder.context,
),
5 => <CreateStringProperty as fidl::encoding::TypeMarker>::inline_size(
decoder.context,
),
6 => <DeleteProperty as fidl::encoding::TypeMarker>::inline_size(decoder.context),
7 => <SetNumber as fidl::encoding::TypeMarker>::inline_size(decoder.context),
8 => <SetString as fidl::encoding::TypeMarker>::inline_size(decoder.context),
9 => <SetBytes as fidl::encoding::TypeMarker>::inline_size(decoder.context),
10 => <AddNumber as fidl::encoding::TypeMarker>::inline_size(decoder.context),
11 => <SubtractNumber as fidl::encoding::TypeMarker>::inline_size(decoder.context),
12 => <CreateArrayProperty as fidl::encoding::TypeMarker>::inline_size(
decoder.context,
),
13 => <ArraySet as fidl::encoding::TypeMarker>::inline_size(decoder.context),
14 => <ArrayAdd as fidl::encoding::TypeMarker>::inline_size(decoder.context),
15 => <ArraySubtract as fidl::encoding::TypeMarker>::inline_size(decoder.context),
16 => <CreateLinearHistogram as fidl::encoding::TypeMarker>::inline_size(
decoder.context,
),
17 => <CreateExponentialHistogram as fidl::encoding::TypeMarker>::inline_size(
decoder.context,
),
18 => <Insert as fidl::encoding::TypeMarker>::inline_size(decoder.context),
19 => <InsertMultiple as fidl::encoding::TypeMarker>::inline_size(decoder.context),
20 => {
<CreateBoolProperty as fidl::encoding::TypeMarker>::inline_size(decoder.context)
}
21 => <SetBool 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 Action::CreateNode(_) = self {
} else {
*self = Action::CreateNode(fidl::new_empty!(CreateNode, D));
}
#[allow(irrefutable_let_patterns)]
if let Action::CreateNode(ref mut val) = self {
fidl::decode!(CreateNode, D, val, decoder, _inner_offset, depth)?;
} else {
unreachable!()
}
}
2 => {
#[allow(irrefutable_let_patterns)]
if let Action::DeleteNode(_) = self {
} else {
*self = Action::DeleteNode(fidl::new_empty!(DeleteNode, D));
}
#[allow(irrefutable_let_patterns)]
if let Action::DeleteNode(ref mut val) = self {
fidl::decode!(DeleteNode, D, val, decoder, _inner_offset, depth)?;
} else {
unreachable!()
}
}
3 => {
#[allow(irrefutable_let_patterns)]
if let Action::CreateNumericProperty(_) = self {
} else {
*self = Action::CreateNumericProperty(fidl::new_empty!(
CreateNumericProperty,
D
));
}
#[allow(irrefutable_let_patterns)]
if let Action::CreateNumericProperty(ref mut val) = self {
fidl::decode!(
CreateNumericProperty,
D,
val,
decoder,
_inner_offset,
depth
)?;
} else {
unreachable!()
}
}
4 => {
#[allow(irrefutable_let_patterns)]
if let Action::CreateBytesProperty(_) = self {
} else {
*self =
Action::CreateBytesProperty(fidl::new_empty!(CreateBytesProperty, D));
}
#[allow(irrefutable_let_patterns)]
if let Action::CreateBytesProperty(ref mut val) = self {
fidl::decode!(CreateBytesProperty, D, val, decoder, _inner_offset, depth)?;
} else {
unreachable!()
}
}
5 => {
#[allow(irrefutable_let_patterns)]
if let Action::CreateStringProperty(_) = self {
} else {
*self =
Action::CreateStringProperty(fidl::new_empty!(CreateStringProperty, D));
}
#[allow(irrefutable_let_patterns)]
if let Action::CreateStringProperty(ref mut val) = self {
fidl::decode!(CreateStringProperty, D, val, decoder, _inner_offset, depth)?;
} else {
unreachable!()
}
}
6 => {
#[allow(irrefutable_let_patterns)]
if let Action::DeleteProperty(_) = self {
} else {
*self = Action::DeleteProperty(fidl::new_empty!(DeleteProperty, D));
}
#[allow(irrefutable_let_patterns)]
if let Action::DeleteProperty(ref mut val) = self {
fidl::decode!(DeleteProperty, D, val, decoder, _inner_offset, depth)?;
} else {
unreachable!()
}
}
7 => {
#[allow(irrefutable_let_patterns)]
if let Action::SetNumber(_) = self {
} else {
*self = Action::SetNumber(fidl::new_empty!(SetNumber, D));
}
#[allow(irrefutable_let_patterns)]
if let Action::SetNumber(ref mut val) = self {
fidl::decode!(SetNumber, D, val, decoder, _inner_offset, depth)?;
} else {
unreachable!()
}
}
8 => {
#[allow(irrefutable_let_patterns)]
if let Action::SetString(_) = self {
} else {
*self = Action::SetString(fidl::new_empty!(SetString, D));
}
#[allow(irrefutable_let_patterns)]
if let Action::SetString(ref mut val) = self {
fidl::decode!(SetString, D, val, decoder, _inner_offset, depth)?;
} else {
unreachable!()
}
}
9 => {
#[allow(irrefutable_let_patterns)]
if let Action::SetBytes(_) = self {
} else {
*self = Action::SetBytes(fidl::new_empty!(SetBytes, D));
}
#[allow(irrefutable_let_patterns)]
if let Action::SetBytes(ref mut val) = self {
fidl::decode!(SetBytes, D, val, decoder, _inner_offset, depth)?;
} else {
unreachable!()
}
}
10 => {
#[allow(irrefutable_let_patterns)]
if let Action::AddNumber(_) = self {
} else {
*self = Action::AddNumber(fidl::new_empty!(AddNumber, D));
}
#[allow(irrefutable_let_patterns)]
if let Action::AddNumber(ref mut val) = self {
fidl::decode!(AddNumber, D, val, decoder, _inner_offset, depth)?;
} else {
unreachable!()
}
}
11 => {
#[allow(irrefutable_let_patterns)]
if let Action::SubtractNumber(_) = self {
} else {
*self = Action::SubtractNumber(fidl::new_empty!(SubtractNumber, D));
}
#[allow(irrefutable_let_patterns)]
if let Action::SubtractNumber(ref mut val) = self {
fidl::decode!(SubtractNumber, D, val, decoder, _inner_offset, depth)?;
} else {
unreachable!()
}
}
12 => {
#[allow(irrefutable_let_patterns)]
if let Action::CreateArrayProperty(_) = self {
} else {
*self =
Action::CreateArrayProperty(fidl::new_empty!(CreateArrayProperty, D));
}
#[allow(irrefutable_let_patterns)]
if let Action::CreateArrayProperty(ref mut val) = self {
fidl::decode!(CreateArrayProperty, D, val, decoder, _inner_offset, depth)?;
} else {
unreachable!()
}
}
13 => {
#[allow(irrefutable_let_patterns)]
if let Action::ArraySet(_) = self {
} else {
*self = Action::ArraySet(fidl::new_empty!(ArraySet, D));
}
#[allow(irrefutable_let_patterns)]
if let Action::ArraySet(ref mut val) = self {
fidl::decode!(ArraySet, D, val, decoder, _inner_offset, depth)?;
} else {
unreachable!()
}
}
14 => {
#[allow(irrefutable_let_patterns)]
if let Action::ArrayAdd(_) = self {
} else {
*self = Action::ArrayAdd(fidl::new_empty!(ArrayAdd, D));
}
#[allow(irrefutable_let_patterns)]
if let Action::ArrayAdd(ref mut val) = self {
fidl::decode!(ArrayAdd, D, val, decoder, _inner_offset, depth)?;
} else {
unreachable!()
}
}
15 => {
#[allow(irrefutable_let_patterns)]
if let Action::ArraySubtract(_) = self {
} else {
*self = Action::ArraySubtract(fidl::new_empty!(ArraySubtract, D));
}
#[allow(irrefutable_let_patterns)]
if let Action::ArraySubtract(ref mut val) = self {
fidl::decode!(ArraySubtract, D, val, decoder, _inner_offset, depth)?;
} else {
unreachable!()
}
}
16 => {
#[allow(irrefutable_let_patterns)]
if let Action::CreateLinearHistogram(_) = self {
} else {
*self = Action::CreateLinearHistogram(fidl::new_empty!(
CreateLinearHistogram,
D
));
}
#[allow(irrefutable_let_patterns)]
if let Action::CreateLinearHistogram(ref mut val) = self {
fidl::decode!(
CreateLinearHistogram,
D,
val,
decoder,
_inner_offset,
depth
)?;
} else {
unreachable!()
}
}
17 => {
#[allow(irrefutable_let_patterns)]
if let Action::CreateExponentialHistogram(_) = self {
} else {
*self = Action::CreateExponentialHistogram(fidl::new_empty!(
CreateExponentialHistogram,
D
));
}
#[allow(irrefutable_let_patterns)]
if let Action::CreateExponentialHistogram(ref mut val) = self {
fidl::decode!(
CreateExponentialHistogram,
D,
val,
decoder,
_inner_offset,
depth
)?;
} else {
unreachable!()
}
}
18 => {
#[allow(irrefutable_let_patterns)]
if let Action::Insert(_) = self {
} else {
*self = Action::Insert(fidl::new_empty!(Insert, D));
}
#[allow(irrefutable_let_patterns)]
if let Action::Insert(ref mut val) = self {
fidl::decode!(Insert, D, val, decoder, _inner_offset, depth)?;
} else {
unreachable!()
}
}
19 => {
#[allow(irrefutable_let_patterns)]
if let Action::InsertMultiple(_) = self {
} else {
*self = Action::InsertMultiple(fidl::new_empty!(InsertMultiple, D));
}
#[allow(irrefutable_let_patterns)]
if let Action::InsertMultiple(ref mut val) = self {
fidl::decode!(InsertMultiple, D, val, decoder, _inner_offset, depth)?;
} else {
unreachable!()
}
}
20 => {
#[allow(irrefutable_let_patterns)]
if let Action::CreateBoolProperty(_) = self {
} else {
*self = Action::CreateBoolProperty(fidl::new_empty!(CreateBoolProperty, D));
}
#[allow(irrefutable_let_patterns)]
if let Action::CreateBoolProperty(ref mut val) = self {
fidl::decode!(CreateBoolProperty, D, val, decoder, _inner_offset, depth)?;
} else {
unreachable!()
}
}
21 => {
#[allow(irrefutable_let_patterns)]
if let Action::SetBool(_) = self {
} else {
*self = Action::SetBool(fidl::new_empty!(SetBool, D));
}
#[allow(irrefutable_let_patterns)]
if let Action::SetBool(ref mut val) = self {
fidl::decode!(SetBool, D, val, decoder, _inner_offset, depth)?;
} else {
unreachable!()
}
}
#[allow(deprecated)]
ordinal => {
for _ in 0..num_handles {
decoder.drop_next_handle()?;
}
*self = Action::__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 LazyAction {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for LazyAction {
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<LazyAction, D>
for &LazyAction
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<LazyAction>(offset);
encoder.write_num::<u64>(self.ordinal(), offset);
match self {
LazyAction::CreateLazyNode(ref val) => {
fidl::encoding::encode_in_envelope::<CreateLazyNode, D>(
<CreateLazyNode as fidl::encoding::ValueTypeMarker>::borrow(val),
encoder,
offset + 8,
_depth,
)
}
LazyAction::DeleteLazyNode(ref val) => {
fidl::encoding::encode_in_envelope::<DeleteLazyNode, D>(
<DeleteLazyNode as fidl::encoding::ValueTypeMarker>::borrow(val),
encoder,
offset + 8,
_depth,
)
}
LazyAction::__SourceBreaking { .. } => Err(fidl::Error::UnknownUnionTag),
}
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for LazyAction {
#[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 => <CreateLazyNode as fidl::encoding::TypeMarker>::inline_size(decoder.context),
2 => <DeleteLazyNode 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 LazyAction::CreateLazyNode(_) = self {
} else {
*self = LazyAction::CreateLazyNode(fidl::new_empty!(CreateLazyNode, D));
}
#[allow(irrefutable_let_patterns)]
if let LazyAction::CreateLazyNode(ref mut val) = self {
fidl::decode!(CreateLazyNode, D, val, decoder, _inner_offset, depth)?;
} else {
unreachable!()
}
}
2 => {
#[allow(irrefutable_let_patterns)]
if let LazyAction::DeleteLazyNode(_) = self {
} else {
*self = LazyAction::DeleteLazyNode(fidl::new_empty!(DeleteLazyNode, D));
}
#[allow(irrefutable_let_patterns)]
if let LazyAction::DeleteLazyNode(ref mut val) = self {
fidl::decode!(DeleteLazyNode, D, val, decoder, _inner_offset, depth)?;
} else {
unreachable!()
}
}
#[allow(deprecated)]
ordinal => {
for _ in 0..num_handles {
decoder.drop_next_handle()?;
}
*self = LazyAction::__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 Value {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for Value {
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<Value, D> for &Value {
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<Value>(offset);
encoder.write_num::<u64>(self.ordinal(), offset);
match self {
Value::IntT(ref val) => fidl::encoding::encode_in_envelope::<i64, D>(
<i64 as fidl::encoding::ValueTypeMarker>::borrow(val),
encoder,
offset + 8,
_depth,
),
Value::UintT(ref val) => fidl::encoding::encode_in_envelope::<u64, D>(
<u64 as fidl::encoding::ValueTypeMarker>::borrow(val),
encoder,
offset + 8,
_depth,
),
Value::DoubleT(ref val) => fidl::encoding::encode_in_envelope::<f64, D>(
<f64 as fidl::encoding::ValueTypeMarker>::borrow(val),
encoder,
offset + 8,
_depth,
),
Value::StringT(ref val) => fidl::encoding::encode_in_envelope::<
fidl::encoding::UnboundedString,
D,
>(
<fidl::encoding::UnboundedString as fidl::encoding::ValueTypeMarker>::borrow(
val,
),
encoder,
offset + 8,
_depth,
),
Value::__SourceBreaking { .. } => Err(fidl::Error::UnknownUnionTag),
}
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for Value {
#[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 => <i64 as fidl::encoding::TypeMarker>::inline_size(decoder.context),
2 => <u64 as fidl::encoding::TypeMarker>::inline_size(decoder.context),
3 => <f64 as fidl::encoding::TypeMarker>::inline_size(decoder.context),
4 => <fidl::encoding::UnboundedString 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 Value::IntT(_) = self {
} else {
*self = Value::IntT(fidl::new_empty!(i64, D));
}
#[allow(irrefutable_let_patterns)]
if let Value::IntT(ref mut val) = self {
fidl::decode!(i64, D, val, decoder, _inner_offset, depth)?;
} else {
unreachable!()
}
}
2 => {
#[allow(irrefutable_let_patterns)]
if let Value::UintT(_) = self {
} else {
*self = Value::UintT(fidl::new_empty!(u64, D));
}
#[allow(irrefutable_let_patterns)]
if let Value::UintT(ref mut val) = self {
fidl::decode!(u64, D, val, decoder, _inner_offset, depth)?;
} else {
unreachable!()
}
}
3 => {
#[allow(irrefutable_let_patterns)]
if let Value::DoubleT(_) = self {
} else {
*self = Value::DoubleT(fidl::new_empty!(f64, D));
}
#[allow(irrefutable_let_patterns)]
if let Value::DoubleT(ref mut val) = self {
fidl::decode!(f64, D, val, decoder, _inner_offset, depth)?;
} else {
unreachable!()
}
}
4 => {
#[allow(irrefutable_let_patterns)]
if let Value::StringT(_) = self {
} else {
*self =
Value::StringT(fidl::new_empty!(fidl::encoding::UnboundedString, D));
}
#[allow(irrefutable_let_patterns)]
if let Value::StringT(ref mut val) = self {
fidl::decode!(
fidl::encoding::UnboundedString,
D,
val,
decoder,
_inner_offset,
depth
)?;
} else {
unreachable!()
}
}
#[allow(deprecated)]
ordinal => {
for _ in 0..num_handles {
decoder.drop_next_handle()?;
}
*self = Value::__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(())
}
}
}