#![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;
#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
pub struct BrowseControllerExtIsConnectedResponse {
pub connected: bool,
}
impl fidl::Persistable for BrowseControllerExtIsConnectedResponse {}
#[derive(Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
pub struct BrowseControllerExtSendRawBrowseCommandRequest {
pub pdu_id: u8,
pub command: Vec<u8>,
}
impl fidl::Persistable for BrowseControllerExtSendRawBrowseCommandRequest {}
#[derive(Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
pub struct BrowseControllerExtSendRawBrowseCommandResponse {
pub response: Vec<u8>,
}
impl fidl::Persistable for BrowseControllerExtSendRawBrowseCommandResponse {}
#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
pub struct ControllerExtIsConnectedResponse {
pub connected: bool,
}
impl fidl::Persistable for ControllerExtIsConnectedResponse {}
#[derive(Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
pub struct ControllerExtSendRawVendorDependentCommandRequest {
pub pdu_id: u8,
pub command: Vec<u8>,
}
impl fidl::Persistable for ControllerExtSendRawVendorDependentCommandRequest {}
#[derive(Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
pub struct ControllerExtGetEventsSupportedResponse {
pub events_supported: Vec<fidl_fuchsia_bluetooth_avrcp::NotificationEvent>,
}
impl fidl::Persistable for ControllerExtGetEventsSupportedResponse {}
#[derive(Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
pub struct ControllerExtSendRawVendorDependentCommandResponse {
pub response: Vec<u8>,
}
impl fidl::Persistable for ControllerExtSendRawVendorDependentCommandResponse {}
#[derive(Debug, PartialEq)]
pub struct PeerManagerExtGetBrowseControllerForTargetRequest {
pub peer_id: fidl_fuchsia_bluetooth::PeerId,
pub client: fidl::endpoints::ServerEnd<BrowseControllerExtMarker>,
}
impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
for PeerManagerExtGetBrowseControllerForTargetRequest
{
}
#[derive(Debug, PartialEq)]
pub struct PeerManagerExtGetControllerForTargetRequest {
pub peer_id: fidl_fuchsia_bluetooth::PeerId,
pub client: fidl::endpoints::ServerEnd<ControllerExtMarker>,
}
impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
for PeerManagerExtGetControllerForTargetRequest
{
}
#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
pub struct BrowseControllerExtMarker;
impl fidl::endpoints::ProtocolMarker for BrowseControllerExtMarker {
type Proxy = BrowseControllerExtProxy;
type RequestStream = BrowseControllerExtRequestStream;
#[cfg(target_os = "fuchsia")]
type SynchronousProxy = BrowseControllerExtSynchronousProxy;
const DEBUG_NAME: &'static str = "(anonymous) BrowseControllerExt";
}
pub type BrowseControllerExtSendRawBrowseCommandResult =
Result<Vec<u8>, fidl_fuchsia_bluetooth_avrcp::BrowseControllerError>;
pub trait BrowseControllerExtProxyInterface: Send + Sync {
type IsConnectedResponseFut: std::future::Future<Output = Result<bool, fidl::Error>> + Send;
fn r#is_connected(&self) -> Self::IsConnectedResponseFut;
type SendRawBrowseCommandResponseFut: std::future::Future<
Output = Result<BrowseControllerExtSendRawBrowseCommandResult, fidl::Error>,
> + Send;
fn r#send_raw_browse_command(
&self,
pdu_id: u8,
command: &[u8],
) -> Self::SendRawBrowseCommandResponseFut;
}
#[derive(Debug)]
#[cfg(target_os = "fuchsia")]
pub struct BrowseControllerExtSynchronousProxy {
client: fidl::client::sync::Client,
}
#[cfg(target_os = "fuchsia")]
impl fidl::endpoints::SynchronousProxy for BrowseControllerExtSynchronousProxy {
type Proxy = BrowseControllerExtProxy;
type Protocol = BrowseControllerExtMarker;
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 BrowseControllerExtSynchronousProxy {
pub fn new(channel: fidl::Channel) -> Self {
let protocol_name =
<BrowseControllerExtMarker 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<BrowseControllerExtEvent, fidl::Error> {
BrowseControllerExtEvent::decode(self.client.wait_for_event(deadline)?)
}
pub fn r#is_connected(&self, ___deadline: zx::MonotonicInstant) -> Result<bool, fidl::Error> {
let _response = self
.client
.send_query::<fidl::encoding::EmptyPayload, BrowseControllerExtIsConnectedResponse>(
(),
0x276450990f1915b6,
fidl::encoding::DynamicFlags::empty(),
___deadline,
)?;
Ok(_response.connected)
}
pub fn r#send_raw_browse_command(
&self,
mut pdu_id: u8,
mut command: &[u8],
___deadline: zx::MonotonicInstant,
) -> Result<BrowseControllerExtSendRawBrowseCommandResult, fidl::Error> {
let _response = self.client.send_query::<
BrowseControllerExtSendRawBrowseCommandRequest,
fidl::encoding::ResultType<BrowseControllerExtSendRawBrowseCommandResponse, fidl_fuchsia_bluetooth_avrcp::BrowseControllerError>,
>(
(pdu_id, command,),
0x7346e59b68ac4a71,
fidl::encoding::DynamicFlags::empty(),
___deadline,
)?;
Ok(_response.map(|x| x.response))
}
}
#[derive(Debug, Clone)]
pub struct BrowseControllerExtProxy {
client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
}
impl fidl::endpoints::Proxy for BrowseControllerExtProxy {
type Protocol = BrowseControllerExtMarker;
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 BrowseControllerExtProxy {
pub fn new(channel: ::fidl::AsyncChannel) -> Self {
let protocol_name =
<BrowseControllerExtMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
Self { client: fidl::client::Client::new(channel, protocol_name) }
}
pub fn take_event_stream(&self) -> BrowseControllerExtEventStream {
BrowseControllerExtEventStream { event_receiver: self.client.take_event_receiver() }
}
pub fn r#is_connected(
&self,
) -> fidl::client::QueryResponseFut<bool, fidl::encoding::DefaultFuchsiaResourceDialect> {
BrowseControllerExtProxyInterface::r#is_connected(self)
}
pub fn r#send_raw_browse_command(
&self,
mut pdu_id: u8,
mut command: &[u8],
) -> fidl::client::QueryResponseFut<
BrowseControllerExtSendRawBrowseCommandResult,
fidl::encoding::DefaultFuchsiaResourceDialect,
> {
BrowseControllerExtProxyInterface::r#send_raw_browse_command(self, pdu_id, command)
}
}
impl BrowseControllerExtProxyInterface for BrowseControllerExtProxy {
type IsConnectedResponseFut =
fidl::client::QueryResponseFut<bool, fidl::encoding::DefaultFuchsiaResourceDialect>;
fn r#is_connected(&self) -> Self::IsConnectedResponseFut {
fn _decode(
mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
) -> Result<bool, fidl::Error> {
let _response = fidl::client::decode_transaction_body::<
BrowseControllerExtIsConnectedResponse,
fidl::encoding::DefaultFuchsiaResourceDialect,
0x276450990f1915b6,
>(_buf?)?;
Ok(_response.connected)
}
self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, bool>(
(),
0x276450990f1915b6,
fidl::encoding::DynamicFlags::empty(),
_decode,
)
}
type SendRawBrowseCommandResponseFut = fidl::client::QueryResponseFut<
BrowseControllerExtSendRawBrowseCommandResult,
fidl::encoding::DefaultFuchsiaResourceDialect,
>;
fn r#send_raw_browse_command(
&self,
mut pdu_id: u8,
mut command: &[u8],
) -> Self::SendRawBrowseCommandResponseFut {
fn _decode(
mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
) -> Result<BrowseControllerExtSendRawBrowseCommandResult, fidl::Error> {
let _response = fidl::client::decode_transaction_body::<
fidl::encoding::ResultType<
BrowseControllerExtSendRawBrowseCommandResponse,
fidl_fuchsia_bluetooth_avrcp::BrowseControllerError,
>,
fidl::encoding::DefaultFuchsiaResourceDialect,
0x7346e59b68ac4a71,
>(_buf?)?;
Ok(_response.map(|x| x.response))
}
self.client.send_query_and_decode::<
BrowseControllerExtSendRawBrowseCommandRequest,
BrowseControllerExtSendRawBrowseCommandResult,
>(
(pdu_id, command,),
0x7346e59b68ac4a71,
fidl::encoding::DynamicFlags::empty(),
_decode,
)
}
}
pub struct BrowseControllerExtEventStream {
event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
}
impl std::marker::Unpin for BrowseControllerExtEventStream {}
impl futures::stream::FusedStream for BrowseControllerExtEventStream {
fn is_terminated(&self) -> bool {
self.event_receiver.is_terminated()
}
}
impl futures::Stream for BrowseControllerExtEventStream {
type Item = Result<BrowseControllerExtEvent, 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(BrowseControllerExtEvent::decode(buf))),
None => std::task::Poll::Ready(None),
}
}
}
#[derive(Debug)]
pub enum BrowseControllerExtEvent {}
impl BrowseControllerExtEvent {
fn decode(
mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
) -> Result<BrowseControllerExtEvent, fidl::Error> {
let (bytes, _handles) = buf.split_mut();
let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
debug_assert_eq!(tx_header.tx_id, 0);
match tx_header.ordinal {
_ => Err(fidl::Error::UnknownOrdinal {
ordinal: tx_header.ordinal,
protocol_name:
<BrowseControllerExtMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
}),
}
}
}
pub struct BrowseControllerExtRequestStream {
inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
is_terminated: bool,
}
impl std::marker::Unpin for BrowseControllerExtRequestStream {}
impl futures::stream::FusedStream for BrowseControllerExtRequestStream {
fn is_terminated(&self) -> bool {
self.is_terminated
}
}
impl fidl::endpoints::RequestStream for BrowseControllerExtRequestStream {
type Protocol = BrowseControllerExtMarker;
type ControlHandle = BrowseControllerExtControlHandle;
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 {
BrowseControllerExtControlHandle { 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 BrowseControllerExtRequestStream {
type Item = Result<BrowseControllerExtRequest, 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 BrowseControllerExtRequestStream 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 {
0x276450990f1915b6 => {
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 = BrowseControllerExtControlHandle {
inner: this.inner.clone(),
};
Ok(BrowseControllerExtRequest::IsConnected {
responder: BrowseControllerExtIsConnectedResponder {
control_handle: std::mem::ManuallyDrop::new(control_handle),
tx_id: header.tx_id,
},
})
}
0x7346e59b68ac4a71 => {
header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
let mut req = fidl::new_empty!(BrowseControllerExtSendRawBrowseCommandRequest, fidl::encoding::DefaultFuchsiaResourceDialect);
fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<BrowseControllerExtSendRawBrowseCommandRequest>(&header, _body_bytes, handles, &mut req)?;
let control_handle = BrowseControllerExtControlHandle {
inner: this.inner.clone(),
};
Ok(BrowseControllerExtRequest::SendRawBrowseCommand {pdu_id: req.pdu_id,
command: req.command,
responder: BrowseControllerExtSendRawBrowseCommandResponder {
control_handle: std::mem::ManuallyDrop::new(control_handle),
tx_id: header.tx_id,
},
})
}
_ => Err(fidl::Error::UnknownOrdinal {
ordinal: header.ordinal,
protocol_name: <BrowseControllerExtMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
}),
}))
},
)
}
}
#[derive(Debug)]
pub enum BrowseControllerExtRequest {
IsConnected { responder: BrowseControllerExtIsConnectedResponder },
SendRawBrowseCommand {
pdu_id: u8,
command: Vec<u8>,
responder: BrowseControllerExtSendRawBrowseCommandResponder,
},
}
impl BrowseControllerExtRequest {
#[allow(irrefutable_let_patterns)]
pub fn into_is_connected(self) -> Option<(BrowseControllerExtIsConnectedResponder)> {
if let BrowseControllerExtRequest::IsConnected { responder } = self {
Some((responder))
} else {
None
}
}
#[allow(irrefutable_let_patterns)]
pub fn into_send_raw_browse_command(
self,
) -> Option<(u8, Vec<u8>, BrowseControllerExtSendRawBrowseCommandResponder)> {
if let BrowseControllerExtRequest::SendRawBrowseCommand { pdu_id, command, responder } =
self
{
Some((pdu_id, command, responder))
} else {
None
}
}
pub fn method_name(&self) -> &'static str {
match *self {
BrowseControllerExtRequest::IsConnected { .. } => "is_connected",
BrowseControllerExtRequest::SendRawBrowseCommand { .. } => "send_raw_browse_command",
}
}
}
#[derive(Debug, Clone)]
pub struct BrowseControllerExtControlHandle {
inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
}
impl fidl::endpoints::ControlHandle for BrowseControllerExtControlHandle {
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 BrowseControllerExtControlHandle {}
#[must_use = "FIDL methods require a response to be sent"]
#[derive(Debug)]
pub struct BrowseControllerExtIsConnectedResponder {
control_handle: std::mem::ManuallyDrop<BrowseControllerExtControlHandle>,
tx_id: u32,
}
impl std::ops::Drop for BrowseControllerExtIsConnectedResponder {
fn drop(&mut self) {
self.control_handle.shutdown();
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
}
}
impl fidl::endpoints::Responder for BrowseControllerExtIsConnectedResponder {
type ControlHandle = BrowseControllerExtControlHandle;
fn control_handle(&self) -> &BrowseControllerExtControlHandle {
&self.control_handle
}
fn drop_without_shutdown(mut self) {
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
std::mem::forget(self);
}
}
impl BrowseControllerExtIsConnectedResponder {
pub fn send(self, mut connected: bool) -> Result<(), fidl::Error> {
let _result = self.send_raw(connected);
if _result.is_err() {
self.control_handle.shutdown();
}
self.drop_without_shutdown();
_result
}
pub fn send_no_shutdown_on_err(self, mut connected: bool) -> Result<(), fidl::Error> {
let _result = self.send_raw(connected);
self.drop_without_shutdown();
_result
}
fn send_raw(&self, mut connected: bool) -> Result<(), fidl::Error> {
self.control_handle.inner.send::<BrowseControllerExtIsConnectedResponse>(
(connected,),
self.tx_id,
0x276450990f1915b6,
fidl::encoding::DynamicFlags::empty(),
)
}
}
#[must_use = "FIDL methods require a response to be sent"]
#[derive(Debug)]
pub struct BrowseControllerExtSendRawBrowseCommandResponder {
control_handle: std::mem::ManuallyDrop<BrowseControllerExtControlHandle>,
tx_id: u32,
}
impl std::ops::Drop for BrowseControllerExtSendRawBrowseCommandResponder {
fn drop(&mut self) {
self.control_handle.shutdown();
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
}
}
impl fidl::endpoints::Responder for BrowseControllerExtSendRawBrowseCommandResponder {
type ControlHandle = BrowseControllerExtControlHandle;
fn control_handle(&self) -> &BrowseControllerExtControlHandle {
&self.control_handle
}
fn drop_without_shutdown(mut self) {
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
std::mem::forget(self);
}
}
impl BrowseControllerExtSendRawBrowseCommandResponder {
pub fn send(
self,
mut result: Result<&[u8], fidl_fuchsia_bluetooth_avrcp::BrowseControllerError>,
) -> Result<(), fidl::Error> {
let _result = self.send_raw(result);
if _result.is_err() {
self.control_handle.shutdown();
}
self.drop_without_shutdown();
_result
}
pub fn send_no_shutdown_on_err(
self,
mut result: Result<&[u8], fidl_fuchsia_bluetooth_avrcp::BrowseControllerError>,
) -> Result<(), fidl::Error> {
let _result = self.send_raw(result);
self.drop_without_shutdown();
_result
}
fn send_raw(
&self,
mut result: Result<&[u8], fidl_fuchsia_bluetooth_avrcp::BrowseControllerError>,
) -> Result<(), fidl::Error> {
self.control_handle.inner.send::<fidl::encoding::ResultType<
BrowseControllerExtSendRawBrowseCommandResponse,
fidl_fuchsia_bluetooth_avrcp::BrowseControllerError,
>>(
result.map(|response| (response,)),
self.tx_id,
0x7346e59b68ac4a71,
fidl::encoding::DynamicFlags::empty(),
)
}
}
#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
pub struct ControllerExtMarker;
impl fidl::endpoints::ProtocolMarker for ControllerExtMarker {
type Proxy = ControllerExtProxy;
type RequestStream = ControllerExtRequestStream;
#[cfg(target_os = "fuchsia")]
type SynchronousProxy = ControllerExtSynchronousProxy;
const DEBUG_NAME: &'static str = "(anonymous) ControllerExt";
}
pub type ControllerExtGetEventsSupportedResult = Result<
Vec<fidl_fuchsia_bluetooth_avrcp::NotificationEvent>,
fidl_fuchsia_bluetooth_avrcp::ControllerError,
>;
pub type ControllerExtSendRawVendorDependentCommandResult =
Result<Vec<u8>, fidl_fuchsia_bluetooth_avrcp::ControllerError>;
pub trait ControllerExtProxyInterface: Send + Sync {
type IsConnectedResponseFut: std::future::Future<Output = Result<bool, fidl::Error>> + Send;
fn r#is_connected(&self) -> Self::IsConnectedResponseFut;
type GetEventsSupportedResponseFut: std::future::Future<Output = Result<ControllerExtGetEventsSupportedResult, fidl::Error>>
+ Send;
fn r#get_events_supported(&self) -> Self::GetEventsSupportedResponseFut;
type SendRawVendorDependentCommandResponseFut: std::future::Future<
Output = Result<ControllerExtSendRawVendorDependentCommandResult, fidl::Error>,
> + Send;
fn r#send_raw_vendor_dependent_command(
&self,
pdu_id: u8,
command: &[u8],
) -> Self::SendRawVendorDependentCommandResponseFut;
}
#[derive(Debug)]
#[cfg(target_os = "fuchsia")]
pub struct ControllerExtSynchronousProxy {
client: fidl::client::sync::Client,
}
#[cfg(target_os = "fuchsia")]
impl fidl::endpoints::SynchronousProxy for ControllerExtSynchronousProxy {
type Proxy = ControllerExtProxy;
type Protocol = ControllerExtMarker;
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 ControllerExtSynchronousProxy {
pub fn new(channel: fidl::Channel) -> Self {
let protocol_name = <ControllerExtMarker 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<ControllerExtEvent, fidl::Error> {
ControllerExtEvent::decode(self.client.wait_for_event(deadline)?)
}
pub fn r#is_connected(&self, ___deadline: zx::MonotonicInstant) -> Result<bool, fidl::Error> {
let _response = self
.client
.send_query::<fidl::encoding::EmptyPayload, ControllerExtIsConnectedResponse>(
(),
0x403f7bc6dbbcfc4f,
fidl::encoding::DynamicFlags::empty(),
___deadline,
)?;
Ok(_response.connected)
}
pub fn r#get_events_supported(
&self,
___deadline: zx::MonotonicInstant,
) -> Result<ControllerExtGetEventsSupportedResult, fidl::Error> {
let _response = self
.client
.send_query::<fidl::encoding::EmptyPayload, fidl::encoding::ResultType<
ControllerExtGetEventsSupportedResponse,
fidl_fuchsia_bluetooth_avrcp::ControllerError,
>>(
(), 0x13465d8abf04dd26, fidl::encoding::DynamicFlags::empty(), ___deadline
)?;
Ok(_response.map(|x| x.events_supported))
}
pub fn r#send_raw_vendor_dependent_command(
&self,
mut pdu_id: u8,
mut command: &[u8],
___deadline: zx::MonotonicInstant,
) -> Result<ControllerExtSendRawVendorDependentCommandResult, fidl::Error> {
let _response = self.client.send_query::<
ControllerExtSendRawVendorDependentCommandRequest,
fidl::encoding::ResultType<ControllerExtSendRawVendorDependentCommandResponse, fidl_fuchsia_bluetooth_avrcp::ControllerError>,
>(
(pdu_id, command,),
0x48004b651df5f606,
fidl::encoding::DynamicFlags::empty(),
___deadline,
)?;
Ok(_response.map(|x| x.response))
}
}
#[derive(Debug, Clone)]
pub struct ControllerExtProxy {
client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
}
impl fidl::endpoints::Proxy for ControllerExtProxy {
type Protocol = ControllerExtMarker;
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 ControllerExtProxy {
pub fn new(channel: ::fidl::AsyncChannel) -> Self {
let protocol_name = <ControllerExtMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
Self { client: fidl::client::Client::new(channel, protocol_name) }
}
pub fn take_event_stream(&self) -> ControllerExtEventStream {
ControllerExtEventStream { event_receiver: self.client.take_event_receiver() }
}
pub fn r#is_connected(
&self,
) -> fidl::client::QueryResponseFut<bool, fidl::encoding::DefaultFuchsiaResourceDialect> {
ControllerExtProxyInterface::r#is_connected(self)
}
pub fn r#get_events_supported(
&self,
) -> fidl::client::QueryResponseFut<
ControllerExtGetEventsSupportedResult,
fidl::encoding::DefaultFuchsiaResourceDialect,
> {
ControllerExtProxyInterface::r#get_events_supported(self)
}
pub fn r#send_raw_vendor_dependent_command(
&self,
mut pdu_id: u8,
mut command: &[u8],
) -> fidl::client::QueryResponseFut<
ControllerExtSendRawVendorDependentCommandResult,
fidl::encoding::DefaultFuchsiaResourceDialect,
> {
ControllerExtProxyInterface::r#send_raw_vendor_dependent_command(self, pdu_id, command)
}
}
impl ControllerExtProxyInterface for ControllerExtProxy {
type IsConnectedResponseFut =
fidl::client::QueryResponseFut<bool, fidl::encoding::DefaultFuchsiaResourceDialect>;
fn r#is_connected(&self) -> Self::IsConnectedResponseFut {
fn _decode(
mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
) -> Result<bool, fidl::Error> {
let _response = fidl::client::decode_transaction_body::<
ControllerExtIsConnectedResponse,
fidl::encoding::DefaultFuchsiaResourceDialect,
0x403f7bc6dbbcfc4f,
>(_buf?)?;
Ok(_response.connected)
}
self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, bool>(
(),
0x403f7bc6dbbcfc4f,
fidl::encoding::DynamicFlags::empty(),
_decode,
)
}
type GetEventsSupportedResponseFut = fidl::client::QueryResponseFut<
ControllerExtGetEventsSupportedResult,
fidl::encoding::DefaultFuchsiaResourceDialect,
>;
fn r#get_events_supported(&self) -> Self::GetEventsSupportedResponseFut {
fn _decode(
mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
) -> Result<ControllerExtGetEventsSupportedResult, fidl::Error> {
let _response = fidl::client::decode_transaction_body::<
fidl::encoding::ResultType<
ControllerExtGetEventsSupportedResponse,
fidl_fuchsia_bluetooth_avrcp::ControllerError,
>,
fidl::encoding::DefaultFuchsiaResourceDialect,
0x13465d8abf04dd26,
>(_buf?)?;
Ok(_response.map(|x| x.events_supported))
}
self.client.send_query_and_decode::<
fidl::encoding::EmptyPayload,
ControllerExtGetEventsSupportedResult,
>(
(),
0x13465d8abf04dd26,
fidl::encoding::DynamicFlags::empty(),
_decode,
)
}
type SendRawVendorDependentCommandResponseFut = fidl::client::QueryResponseFut<
ControllerExtSendRawVendorDependentCommandResult,
fidl::encoding::DefaultFuchsiaResourceDialect,
>;
fn r#send_raw_vendor_dependent_command(
&self,
mut pdu_id: u8,
mut command: &[u8],
) -> Self::SendRawVendorDependentCommandResponseFut {
fn _decode(
mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
) -> Result<ControllerExtSendRawVendorDependentCommandResult, fidl::Error> {
let _response = fidl::client::decode_transaction_body::<
fidl::encoding::ResultType<
ControllerExtSendRawVendorDependentCommandResponse,
fidl_fuchsia_bluetooth_avrcp::ControllerError,
>,
fidl::encoding::DefaultFuchsiaResourceDialect,
0x48004b651df5f606,
>(_buf?)?;
Ok(_response.map(|x| x.response))
}
self.client.send_query_and_decode::<
ControllerExtSendRawVendorDependentCommandRequest,
ControllerExtSendRawVendorDependentCommandResult,
>(
(pdu_id, command,),
0x48004b651df5f606,
fidl::encoding::DynamicFlags::empty(),
_decode,
)
}
}
pub struct ControllerExtEventStream {
event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
}
impl std::marker::Unpin for ControllerExtEventStream {}
impl futures::stream::FusedStream for ControllerExtEventStream {
fn is_terminated(&self) -> bool {
self.event_receiver.is_terminated()
}
}
impl futures::Stream for ControllerExtEventStream {
type Item = Result<ControllerExtEvent, 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(ControllerExtEvent::decode(buf))),
None => std::task::Poll::Ready(None),
}
}
}
#[derive(Debug)]
pub enum ControllerExtEvent {}
impl ControllerExtEvent {
fn decode(
mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
) -> Result<ControllerExtEvent, fidl::Error> {
let (bytes, _handles) = buf.split_mut();
let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
debug_assert_eq!(tx_header.tx_id, 0);
match tx_header.ordinal {
_ => Err(fidl::Error::UnknownOrdinal {
ordinal: tx_header.ordinal,
protocol_name: <ControllerExtMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
}),
}
}
}
pub struct ControllerExtRequestStream {
inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
is_terminated: bool,
}
impl std::marker::Unpin for ControllerExtRequestStream {}
impl futures::stream::FusedStream for ControllerExtRequestStream {
fn is_terminated(&self) -> bool {
self.is_terminated
}
}
impl fidl::endpoints::RequestStream for ControllerExtRequestStream {
type Protocol = ControllerExtMarker;
type ControlHandle = ControllerExtControlHandle;
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 {
ControllerExtControlHandle { 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 ControllerExtRequestStream {
type Item = Result<ControllerExtRequest, 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 ControllerExtRequestStream 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 {
0x403f7bc6dbbcfc4f => {
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 =
ControllerExtControlHandle { inner: this.inner.clone() };
Ok(ControllerExtRequest::IsConnected {
responder: ControllerExtIsConnectedResponder {
control_handle: std::mem::ManuallyDrop::new(control_handle),
tx_id: header.tx_id,
},
})
}
0x13465d8abf04dd26 => {
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 =
ControllerExtControlHandle { inner: this.inner.clone() };
Ok(ControllerExtRequest::GetEventsSupported {
responder: ControllerExtGetEventsSupportedResponder {
control_handle: std::mem::ManuallyDrop::new(control_handle),
tx_id: header.tx_id,
},
})
}
0x48004b651df5f606 => {
header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
let mut req = fidl::new_empty!(
ControllerExtSendRawVendorDependentCommandRequest,
fidl::encoding::DefaultFuchsiaResourceDialect
);
fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<ControllerExtSendRawVendorDependentCommandRequest>(&header, _body_bytes, handles, &mut req)?;
let control_handle =
ControllerExtControlHandle { inner: this.inner.clone() };
Ok(ControllerExtRequest::SendRawVendorDependentCommand {
pdu_id: req.pdu_id,
command: req.command,
responder: ControllerExtSendRawVendorDependentCommandResponder {
control_handle: std::mem::ManuallyDrop::new(control_handle),
tx_id: header.tx_id,
},
})
}
_ => Err(fidl::Error::UnknownOrdinal {
ordinal: header.ordinal,
protocol_name:
<ControllerExtMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
}),
}))
},
)
}
}
#[derive(Debug)]
pub enum ControllerExtRequest {
IsConnected { responder: ControllerExtIsConnectedResponder },
GetEventsSupported { responder: ControllerExtGetEventsSupportedResponder },
SendRawVendorDependentCommand {
pdu_id: u8,
command: Vec<u8>,
responder: ControllerExtSendRawVendorDependentCommandResponder,
},
}
impl ControllerExtRequest {
#[allow(irrefutable_let_patterns)]
pub fn into_is_connected(self) -> Option<(ControllerExtIsConnectedResponder)> {
if let ControllerExtRequest::IsConnected { responder } = self {
Some((responder))
} else {
None
}
}
#[allow(irrefutable_let_patterns)]
pub fn into_get_events_supported(self) -> Option<(ControllerExtGetEventsSupportedResponder)> {
if let ControllerExtRequest::GetEventsSupported { responder } = self {
Some((responder))
} else {
None
}
}
#[allow(irrefutable_let_patterns)]
pub fn into_send_raw_vendor_dependent_command(
self,
) -> Option<(u8, Vec<u8>, ControllerExtSendRawVendorDependentCommandResponder)> {
if let ControllerExtRequest::SendRawVendorDependentCommand { pdu_id, command, responder } =
self
{
Some((pdu_id, command, responder))
} else {
None
}
}
pub fn method_name(&self) -> &'static str {
match *self {
ControllerExtRequest::IsConnected { .. } => "is_connected",
ControllerExtRequest::GetEventsSupported { .. } => "get_events_supported",
ControllerExtRequest::SendRawVendorDependentCommand { .. } => {
"send_raw_vendor_dependent_command"
}
}
}
}
#[derive(Debug, Clone)]
pub struct ControllerExtControlHandle {
inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
}
impl fidl::endpoints::ControlHandle for ControllerExtControlHandle {
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 ControllerExtControlHandle {}
#[must_use = "FIDL methods require a response to be sent"]
#[derive(Debug)]
pub struct ControllerExtIsConnectedResponder {
control_handle: std::mem::ManuallyDrop<ControllerExtControlHandle>,
tx_id: u32,
}
impl std::ops::Drop for ControllerExtIsConnectedResponder {
fn drop(&mut self) {
self.control_handle.shutdown();
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
}
}
impl fidl::endpoints::Responder for ControllerExtIsConnectedResponder {
type ControlHandle = ControllerExtControlHandle;
fn control_handle(&self) -> &ControllerExtControlHandle {
&self.control_handle
}
fn drop_without_shutdown(mut self) {
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
std::mem::forget(self);
}
}
impl ControllerExtIsConnectedResponder {
pub fn send(self, mut connected: bool) -> Result<(), fidl::Error> {
let _result = self.send_raw(connected);
if _result.is_err() {
self.control_handle.shutdown();
}
self.drop_without_shutdown();
_result
}
pub fn send_no_shutdown_on_err(self, mut connected: bool) -> Result<(), fidl::Error> {
let _result = self.send_raw(connected);
self.drop_without_shutdown();
_result
}
fn send_raw(&self, mut connected: bool) -> Result<(), fidl::Error> {
self.control_handle.inner.send::<ControllerExtIsConnectedResponse>(
(connected,),
self.tx_id,
0x403f7bc6dbbcfc4f,
fidl::encoding::DynamicFlags::empty(),
)
}
}
#[must_use = "FIDL methods require a response to be sent"]
#[derive(Debug)]
pub struct ControllerExtGetEventsSupportedResponder {
control_handle: std::mem::ManuallyDrop<ControllerExtControlHandle>,
tx_id: u32,
}
impl std::ops::Drop for ControllerExtGetEventsSupportedResponder {
fn drop(&mut self) {
self.control_handle.shutdown();
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
}
}
impl fidl::endpoints::Responder for ControllerExtGetEventsSupportedResponder {
type ControlHandle = ControllerExtControlHandle;
fn control_handle(&self) -> &ControllerExtControlHandle {
&self.control_handle
}
fn drop_without_shutdown(mut self) {
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
std::mem::forget(self);
}
}
impl ControllerExtGetEventsSupportedResponder {
pub fn send(
self,
mut result: Result<
&[fidl_fuchsia_bluetooth_avrcp::NotificationEvent],
fidl_fuchsia_bluetooth_avrcp::ControllerError,
>,
) -> Result<(), fidl::Error> {
let _result = self.send_raw(result);
if _result.is_err() {
self.control_handle.shutdown();
}
self.drop_without_shutdown();
_result
}
pub fn send_no_shutdown_on_err(
self,
mut result: Result<
&[fidl_fuchsia_bluetooth_avrcp::NotificationEvent],
fidl_fuchsia_bluetooth_avrcp::ControllerError,
>,
) -> Result<(), fidl::Error> {
let _result = self.send_raw(result);
self.drop_without_shutdown();
_result
}
fn send_raw(
&self,
mut result: Result<
&[fidl_fuchsia_bluetooth_avrcp::NotificationEvent],
fidl_fuchsia_bluetooth_avrcp::ControllerError,
>,
) -> Result<(), fidl::Error> {
self.control_handle.inner.send::<fidl::encoding::ResultType<
ControllerExtGetEventsSupportedResponse,
fidl_fuchsia_bluetooth_avrcp::ControllerError,
>>(
result.map(|events_supported| (events_supported,)),
self.tx_id,
0x13465d8abf04dd26,
fidl::encoding::DynamicFlags::empty(),
)
}
}
#[must_use = "FIDL methods require a response to be sent"]
#[derive(Debug)]
pub struct ControllerExtSendRawVendorDependentCommandResponder {
control_handle: std::mem::ManuallyDrop<ControllerExtControlHandle>,
tx_id: u32,
}
impl std::ops::Drop for ControllerExtSendRawVendorDependentCommandResponder {
fn drop(&mut self) {
self.control_handle.shutdown();
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
}
}
impl fidl::endpoints::Responder for ControllerExtSendRawVendorDependentCommandResponder {
type ControlHandle = ControllerExtControlHandle;
fn control_handle(&self) -> &ControllerExtControlHandle {
&self.control_handle
}
fn drop_without_shutdown(mut self) {
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
std::mem::forget(self);
}
}
impl ControllerExtSendRawVendorDependentCommandResponder {
pub fn send(
self,
mut result: Result<&[u8], fidl_fuchsia_bluetooth_avrcp::ControllerError>,
) -> Result<(), fidl::Error> {
let _result = self.send_raw(result);
if _result.is_err() {
self.control_handle.shutdown();
}
self.drop_without_shutdown();
_result
}
pub fn send_no_shutdown_on_err(
self,
mut result: Result<&[u8], fidl_fuchsia_bluetooth_avrcp::ControllerError>,
) -> Result<(), fidl::Error> {
let _result = self.send_raw(result);
self.drop_without_shutdown();
_result
}
fn send_raw(
&self,
mut result: Result<&[u8], fidl_fuchsia_bluetooth_avrcp::ControllerError>,
) -> Result<(), fidl::Error> {
self.control_handle.inner.send::<fidl::encoding::ResultType<
ControllerExtSendRawVendorDependentCommandResponse,
fidl_fuchsia_bluetooth_avrcp::ControllerError,
>>(
result.map(|response| (response,)),
self.tx_id,
0x48004b651df5f606,
fidl::encoding::DynamicFlags::empty(),
)
}
}
#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
pub struct PeerManagerExtMarker;
impl fidl::endpoints::ProtocolMarker for PeerManagerExtMarker {
type Proxy = PeerManagerExtProxy;
type RequestStream = PeerManagerExtRequestStream;
#[cfg(target_os = "fuchsia")]
type SynchronousProxy = PeerManagerExtSynchronousProxy;
const DEBUG_NAME: &'static str = "fuchsia.bluetooth.avrcp.test.PeerManagerExt";
}
impl fidl::endpoints::DiscoverableProtocolMarker for PeerManagerExtMarker {}
pub type PeerManagerExtGetBrowseControllerForTargetResult = Result<(), i32>;
pub type PeerManagerExtGetControllerForTargetResult = Result<(), i32>;
pub trait PeerManagerExtProxyInterface: Send + Sync {
type GetBrowseControllerForTargetResponseFut: std::future::Future<
Output = Result<PeerManagerExtGetBrowseControllerForTargetResult, fidl::Error>,
> + Send;
fn r#get_browse_controller_for_target(
&self,
peer_id: &fidl_fuchsia_bluetooth::PeerId,
client: fidl::endpoints::ServerEnd<BrowseControllerExtMarker>,
) -> Self::GetBrowseControllerForTargetResponseFut;
type GetControllerForTargetResponseFut: std::future::Future<
Output = Result<PeerManagerExtGetControllerForTargetResult, fidl::Error>,
> + Send;
fn r#get_controller_for_target(
&self,
peer_id: &fidl_fuchsia_bluetooth::PeerId,
client: fidl::endpoints::ServerEnd<ControllerExtMarker>,
) -> Self::GetControllerForTargetResponseFut;
}
#[derive(Debug)]
#[cfg(target_os = "fuchsia")]
pub struct PeerManagerExtSynchronousProxy {
client: fidl::client::sync::Client,
}
#[cfg(target_os = "fuchsia")]
impl fidl::endpoints::SynchronousProxy for PeerManagerExtSynchronousProxy {
type Proxy = PeerManagerExtProxy;
type Protocol = PeerManagerExtMarker;
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 PeerManagerExtSynchronousProxy {
pub fn new(channel: fidl::Channel) -> Self {
let protocol_name = <PeerManagerExtMarker 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<PeerManagerExtEvent, fidl::Error> {
PeerManagerExtEvent::decode(self.client.wait_for_event(deadline)?)
}
pub fn r#get_browse_controller_for_target(
&self,
mut peer_id: &fidl_fuchsia_bluetooth::PeerId,
mut client: fidl::endpoints::ServerEnd<BrowseControllerExtMarker>,
___deadline: zx::MonotonicInstant,
) -> Result<PeerManagerExtGetBrowseControllerForTargetResult, fidl::Error> {
let _response = self.client.send_query::<
PeerManagerExtGetBrowseControllerForTargetRequest,
fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
>(
(peer_id, client,),
0x3b838b67d5a5aeac,
fidl::encoding::DynamicFlags::empty(),
___deadline,
)?;
Ok(_response.map(|x| x))
}
pub fn r#get_controller_for_target(
&self,
mut peer_id: &fidl_fuchsia_bluetooth::PeerId,
mut client: fidl::endpoints::ServerEnd<ControllerExtMarker>,
___deadline: zx::MonotonicInstant,
) -> Result<PeerManagerExtGetControllerForTargetResult, fidl::Error> {
let _response = self.client.send_query::<
PeerManagerExtGetControllerForTargetRequest,
fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
>(
(peer_id, client,),
0x39448b0c65966553,
fidl::encoding::DynamicFlags::empty(),
___deadline,
)?;
Ok(_response.map(|x| x))
}
}
#[derive(Debug, Clone)]
pub struct PeerManagerExtProxy {
client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
}
impl fidl::endpoints::Proxy for PeerManagerExtProxy {
type Protocol = PeerManagerExtMarker;
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 PeerManagerExtProxy {
pub fn new(channel: ::fidl::AsyncChannel) -> Self {
let protocol_name = <PeerManagerExtMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
Self { client: fidl::client::Client::new(channel, protocol_name) }
}
pub fn take_event_stream(&self) -> PeerManagerExtEventStream {
PeerManagerExtEventStream { event_receiver: self.client.take_event_receiver() }
}
pub fn r#get_browse_controller_for_target(
&self,
mut peer_id: &fidl_fuchsia_bluetooth::PeerId,
mut client: fidl::endpoints::ServerEnd<BrowseControllerExtMarker>,
) -> fidl::client::QueryResponseFut<
PeerManagerExtGetBrowseControllerForTargetResult,
fidl::encoding::DefaultFuchsiaResourceDialect,
> {
PeerManagerExtProxyInterface::r#get_browse_controller_for_target(self, peer_id, client)
}
pub fn r#get_controller_for_target(
&self,
mut peer_id: &fidl_fuchsia_bluetooth::PeerId,
mut client: fidl::endpoints::ServerEnd<ControllerExtMarker>,
) -> fidl::client::QueryResponseFut<
PeerManagerExtGetControllerForTargetResult,
fidl::encoding::DefaultFuchsiaResourceDialect,
> {
PeerManagerExtProxyInterface::r#get_controller_for_target(self, peer_id, client)
}
}
impl PeerManagerExtProxyInterface for PeerManagerExtProxy {
type GetBrowseControllerForTargetResponseFut = fidl::client::QueryResponseFut<
PeerManagerExtGetBrowseControllerForTargetResult,
fidl::encoding::DefaultFuchsiaResourceDialect,
>;
fn r#get_browse_controller_for_target(
&self,
mut peer_id: &fidl_fuchsia_bluetooth::PeerId,
mut client: fidl::endpoints::ServerEnd<BrowseControllerExtMarker>,
) -> Self::GetBrowseControllerForTargetResponseFut {
fn _decode(
mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
) -> Result<PeerManagerExtGetBrowseControllerForTargetResult, fidl::Error> {
let _response = fidl::client::decode_transaction_body::<
fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
fidl::encoding::DefaultFuchsiaResourceDialect,
0x3b838b67d5a5aeac,
>(_buf?)?;
Ok(_response.map(|x| x))
}
self.client.send_query_and_decode::<
PeerManagerExtGetBrowseControllerForTargetRequest,
PeerManagerExtGetBrowseControllerForTargetResult,
>(
(peer_id, client,),
0x3b838b67d5a5aeac,
fidl::encoding::DynamicFlags::empty(),
_decode,
)
}
type GetControllerForTargetResponseFut = fidl::client::QueryResponseFut<
PeerManagerExtGetControllerForTargetResult,
fidl::encoding::DefaultFuchsiaResourceDialect,
>;
fn r#get_controller_for_target(
&self,
mut peer_id: &fidl_fuchsia_bluetooth::PeerId,
mut client: fidl::endpoints::ServerEnd<ControllerExtMarker>,
) -> Self::GetControllerForTargetResponseFut {
fn _decode(
mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
) -> Result<PeerManagerExtGetControllerForTargetResult, fidl::Error> {
let _response = fidl::client::decode_transaction_body::<
fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
fidl::encoding::DefaultFuchsiaResourceDialect,
0x39448b0c65966553,
>(_buf?)?;
Ok(_response.map(|x| x))
}
self.client.send_query_and_decode::<
PeerManagerExtGetControllerForTargetRequest,
PeerManagerExtGetControllerForTargetResult,
>(
(peer_id, client,),
0x39448b0c65966553,
fidl::encoding::DynamicFlags::empty(),
_decode,
)
}
}
pub struct PeerManagerExtEventStream {
event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
}
impl std::marker::Unpin for PeerManagerExtEventStream {}
impl futures::stream::FusedStream for PeerManagerExtEventStream {
fn is_terminated(&self) -> bool {
self.event_receiver.is_terminated()
}
}
impl futures::Stream for PeerManagerExtEventStream {
type Item = Result<PeerManagerExtEvent, 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(PeerManagerExtEvent::decode(buf))),
None => std::task::Poll::Ready(None),
}
}
}
#[derive(Debug)]
pub enum PeerManagerExtEvent {}
impl PeerManagerExtEvent {
fn decode(
mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
) -> Result<PeerManagerExtEvent, fidl::Error> {
let (bytes, _handles) = buf.split_mut();
let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
debug_assert_eq!(tx_header.tx_id, 0);
match tx_header.ordinal {
_ => Err(fidl::Error::UnknownOrdinal {
ordinal: tx_header.ordinal,
protocol_name:
<PeerManagerExtMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
}),
}
}
}
pub struct PeerManagerExtRequestStream {
inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
is_terminated: bool,
}
impl std::marker::Unpin for PeerManagerExtRequestStream {}
impl futures::stream::FusedStream for PeerManagerExtRequestStream {
fn is_terminated(&self) -> bool {
self.is_terminated
}
}
impl fidl::endpoints::RequestStream for PeerManagerExtRequestStream {
type Protocol = PeerManagerExtMarker;
type ControlHandle = PeerManagerExtControlHandle;
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 {
PeerManagerExtControlHandle { 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 PeerManagerExtRequestStream {
type Item = Result<PeerManagerExtRequest, 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 PeerManagerExtRequestStream 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 {
0x3b838b67d5a5aeac => {
header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
let mut req = fidl::new_empty!(
PeerManagerExtGetBrowseControllerForTargetRequest,
fidl::encoding::DefaultFuchsiaResourceDialect
);
fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<PeerManagerExtGetBrowseControllerForTargetRequest>(&header, _body_bytes, handles, &mut req)?;
let control_handle =
PeerManagerExtControlHandle { inner: this.inner.clone() };
Ok(PeerManagerExtRequest::GetBrowseControllerForTarget {
peer_id: req.peer_id,
client: req.client,
responder: PeerManagerExtGetBrowseControllerForTargetResponder {
control_handle: std::mem::ManuallyDrop::new(control_handle),
tx_id: header.tx_id,
},
})
}
0x39448b0c65966553 => {
header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
let mut req = fidl::new_empty!(
PeerManagerExtGetControllerForTargetRequest,
fidl::encoding::DefaultFuchsiaResourceDialect
);
fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<PeerManagerExtGetControllerForTargetRequest>(&header, _body_bytes, handles, &mut req)?;
let control_handle =
PeerManagerExtControlHandle { inner: this.inner.clone() };
Ok(PeerManagerExtRequest::GetControllerForTarget {
peer_id: req.peer_id,
client: req.client,
responder: PeerManagerExtGetControllerForTargetResponder {
control_handle: std::mem::ManuallyDrop::new(control_handle),
tx_id: header.tx_id,
},
})
}
_ => Err(fidl::Error::UnknownOrdinal {
ordinal: header.ordinal,
protocol_name:
<PeerManagerExtMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
}),
}))
},
)
}
}
#[derive(Debug)]
pub enum PeerManagerExtRequest {
GetBrowseControllerForTarget {
peer_id: fidl_fuchsia_bluetooth::PeerId,
client: fidl::endpoints::ServerEnd<BrowseControllerExtMarker>,
responder: PeerManagerExtGetBrowseControllerForTargetResponder,
},
GetControllerForTarget {
peer_id: fidl_fuchsia_bluetooth::PeerId,
client: fidl::endpoints::ServerEnd<ControllerExtMarker>,
responder: PeerManagerExtGetControllerForTargetResponder,
},
}
impl PeerManagerExtRequest {
#[allow(irrefutable_let_patterns)]
pub fn into_get_browse_controller_for_target(
self,
) -> Option<(
fidl_fuchsia_bluetooth::PeerId,
fidl::endpoints::ServerEnd<BrowseControllerExtMarker>,
PeerManagerExtGetBrowseControllerForTargetResponder,
)> {
if let PeerManagerExtRequest::GetBrowseControllerForTarget { peer_id, client, responder } =
self
{
Some((peer_id, client, responder))
} else {
None
}
}
#[allow(irrefutable_let_patterns)]
pub fn into_get_controller_for_target(
self,
) -> Option<(
fidl_fuchsia_bluetooth::PeerId,
fidl::endpoints::ServerEnd<ControllerExtMarker>,
PeerManagerExtGetControllerForTargetResponder,
)> {
if let PeerManagerExtRequest::GetControllerForTarget { peer_id, client, responder } = self {
Some((peer_id, client, responder))
} else {
None
}
}
pub fn method_name(&self) -> &'static str {
match *self {
PeerManagerExtRequest::GetBrowseControllerForTarget { .. } => {
"get_browse_controller_for_target"
}
PeerManagerExtRequest::GetControllerForTarget { .. } => "get_controller_for_target",
}
}
}
#[derive(Debug, Clone)]
pub struct PeerManagerExtControlHandle {
inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
}
impl fidl::endpoints::ControlHandle for PeerManagerExtControlHandle {
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 PeerManagerExtControlHandle {}
#[must_use = "FIDL methods require a response to be sent"]
#[derive(Debug)]
pub struct PeerManagerExtGetBrowseControllerForTargetResponder {
control_handle: std::mem::ManuallyDrop<PeerManagerExtControlHandle>,
tx_id: u32,
}
impl std::ops::Drop for PeerManagerExtGetBrowseControllerForTargetResponder {
fn drop(&mut self) {
self.control_handle.shutdown();
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
}
}
impl fidl::endpoints::Responder for PeerManagerExtGetBrowseControllerForTargetResponder {
type ControlHandle = PeerManagerExtControlHandle;
fn control_handle(&self) -> &PeerManagerExtControlHandle {
&self.control_handle
}
fn drop_without_shutdown(mut self) {
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
std::mem::forget(self);
}
}
impl PeerManagerExtGetBrowseControllerForTargetResponder {
pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
let _result = self.send_raw(result);
if _result.is_err() {
self.control_handle.shutdown();
}
self.drop_without_shutdown();
_result
}
pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
let _result = self.send_raw(result);
self.drop_without_shutdown();
_result
}
fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
self.control_handle
.inner
.send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>>(
result,
self.tx_id,
0x3b838b67d5a5aeac,
fidl::encoding::DynamicFlags::empty(),
)
}
}
#[must_use = "FIDL methods require a response to be sent"]
#[derive(Debug)]
pub struct PeerManagerExtGetControllerForTargetResponder {
control_handle: std::mem::ManuallyDrop<PeerManagerExtControlHandle>,
tx_id: u32,
}
impl std::ops::Drop for PeerManagerExtGetControllerForTargetResponder {
fn drop(&mut self) {
self.control_handle.shutdown();
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
}
}
impl fidl::endpoints::Responder for PeerManagerExtGetControllerForTargetResponder {
type ControlHandle = PeerManagerExtControlHandle;
fn control_handle(&self) -> &PeerManagerExtControlHandle {
&self.control_handle
}
fn drop_without_shutdown(mut self) {
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
std::mem::forget(self);
}
}
impl PeerManagerExtGetControllerForTargetResponder {
pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
let _result = self.send_raw(result);
if _result.is_err() {
self.control_handle.shutdown();
}
self.drop_without_shutdown();
_result
}
pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
let _result = self.send_raw(result);
self.drop_without_shutdown();
_result
}
fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
self.control_handle
.inner
.send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>>(
result,
self.tx_id,
0x39448b0c65966553,
fidl::encoding::DynamicFlags::empty(),
)
}
}
mod internal {
use super::*;
impl fidl::encoding::ValueTypeMarker for BrowseControllerExtIsConnectedResponse {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for BrowseControllerExtIsConnectedResponse {
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
1
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
1
}
}
unsafe impl<D: fidl::encoding::ResourceDialect>
fidl::encoding::Encode<BrowseControllerExtIsConnectedResponse, D>
for &BrowseControllerExtIsConnectedResponse
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<BrowseControllerExtIsConnectedResponse>(offset);
fidl::encoding::Encode::<BrowseControllerExtIsConnectedResponse, D>::encode(
(<bool as fidl::encoding::ValueTypeMarker>::borrow(&self.connected),),
encoder,
offset,
_depth,
)
}
}
unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<bool, D>>
fidl::encoding::Encode<BrowseControllerExtIsConnectedResponse, 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::<BrowseControllerExtIsConnectedResponse>(offset);
self.0.encode(encoder, offset + 0, depth)?;
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
for BrowseControllerExtIsConnectedResponse
{
#[inline(always)]
fn new_empty() -> Self {
Self { connected: fidl::new_empty!(bool, D) }
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
fidl::decode!(bool, D, &mut self.connected, decoder, offset + 0, _depth)?;
Ok(())
}
}
impl fidl::encoding::ValueTypeMarker for BrowseControllerExtSendRawBrowseCommandRequest {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for BrowseControllerExtSendRawBrowseCommandRequest {
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<BrowseControllerExtSendRawBrowseCommandRequest, D>
for &BrowseControllerExtSendRawBrowseCommandRequest
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<BrowseControllerExtSendRawBrowseCommandRequest>(offset);
fidl::encoding::Encode::<BrowseControllerExtSendRawBrowseCommandRequest, D>::encode(
(
<u8 as fidl::encoding::ValueTypeMarker>::borrow(&self.pdu_id),
<fidl::encoding::UnboundedVector<u8> as fidl::encoding::ValueTypeMarker>::borrow(&self.command),
),
encoder, offset, _depth
)
}
}
unsafe impl<
D: fidl::encoding::ResourceDialect,
T0: fidl::encoding::Encode<u8, D>,
T1: fidl::encoding::Encode<fidl::encoding::UnboundedVector<u8>, D>,
> fidl::encoding::Encode<BrowseControllerExtSendRawBrowseCommandRequest, 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::<BrowseControllerExtSendRawBrowseCommandRequest>(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 BrowseControllerExtSendRawBrowseCommandRequest
{
#[inline(always)]
fn new_empty() -> Self {
Self {
pdu_id: fidl::new_empty!(u8, D),
command: 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 = 0xffffffffffffff00u64;
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!(u8, D, &mut self.pdu_id, decoder, offset + 0, _depth)?;
fidl::decode!(
fidl::encoding::UnboundedVector<u8>,
D,
&mut self.command,
decoder,
offset + 8,
_depth
)?;
Ok(())
}
}
impl fidl::encoding::ValueTypeMarker for BrowseControllerExtSendRawBrowseCommandResponse {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for BrowseControllerExtSendRawBrowseCommandResponse {
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<BrowseControllerExtSendRawBrowseCommandResponse, D>
for &BrowseControllerExtSendRawBrowseCommandResponse
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<BrowseControllerExtSendRawBrowseCommandResponse>(offset);
fidl::encoding::Encode::<BrowseControllerExtSendRawBrowseCommandResponse, D>::encode(
(<fidl::encoding::UnboundedVector<u8> as fidl::encoding::ValueTypeMarker>::borrow(
&self.response,
),),
encoder,
offset,
_depth,
)
}
}
unsafe impl<
D: fidl::encoding::ResourceDialect,
T0: fidl::encoding::Encode<fidl::encoding::UnboundedVector<u8>, D>,
> fidl::encoding::Encode<BrowseControllerExtSendRawBrowseCommandResponse, 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::<BrowseControllerExtSendRawBrowseCommandResponse>(offset);
self.0.encode(encoder, offset + 0, depth)?;
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
for BrowseControllerExtSendRawBrowseCommandResponse
{
#[inline(always)]
fn new_empty() -> Self {
Self { response: fidl::new_empty!(fidl::encoding::UnboundedVector<u8>, D) }
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
fidl::decode!(
fidl::encoding::UnboundedVector<u8>,
D,
&mut self.response,
decoder,
offset + 0,
_depth
)?;
Ok(())
}
}
impl fidl::encoding::ValueTypeMarker for ControllerExtIsConnectedResponse {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for ControllerExtIsConnectedResponse {
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
1
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
1
}
}
unsafe impl<D: fidl::encoding::ResourceDialect>
fidl::encoding::Encode<ControllerExtIsConnectedResponse, D>
for &ControllerExtIsConnectedResponse
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<ControllerExtIsConnectedResponse>(offset);
fidl::encoding::Encode::<ControllerExtIsConnectedResponse, D>::encode(
(<bool as fidl::encoding::ValueTypeMarker>::borrow(&self.connected),),
encoder,
offset,
_depth,
)
}
}
unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<bool, D>>
fidl::encoding::Encode<ControllerExtIsConnectedResponse, 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::<ControllerExtIsConnectedResponse>(offset);
self.0.encode(encoder, offset + 0, depth)?;
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
for ControllerExtIsConnectedResponse
{
#[inline(always)]
fn new_empty() -> Self {
Self { connected: fidl::new_empty!(bool, D) }
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
fidl::decode!(bool, D, &mut self.connected, decoder, offset + 0, _depth)?;
Ok(())
}
}
impl fidl::encoding::ValueTypeMarker for ControllerExtSendRawVendorDependentCommandRequest {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for ControllerExtSendRawVendorDependentCommandRequest {
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<ControllerExtSendRawVendorDependentCommandRequest, D>
for &ControllerExtSendRawVendorDependentCommandRequest
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<ControllerExtSendRawVendorDependentCommandRequest>(offset);
fidl::encoding::Encode::<ControllerExtSendRawVendorDependentCommandRequest, D>::encode(
(
<u8 as fidl::encoding::ValueTypeMarker>::borrow(&self.pdu_id),
<fidl::encoding::UnboundedVector<u8> as fidl::encoding::ValueTypeMarker>::borrow(&self.command),
),
encoder, offset, _depth
)
}
}
unsafe impl<
D: fidl::encoding::ResourceDialect,
T0: fidl::encoding::Encode<u8, D>,
T1: fidl::encoding::Encode<fidl::encoding::UnboundedVector<u8>, D>,
> fidl::encoding::Encode<ControllerExtSendRawVendorDependentCommandRequest, 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::<ControllerExtSendRawVendorDependentCommandRequest>(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 ControllerExtSendRawVendorDependentCommandRequest
{
#[inline(always)]
fn new_empty() -> Self {
Self {
pdu_id: fidl::new_empty!(u8, D),
command: 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 = 0xffffffffffffff00u64;
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!(u8, D, &mut self.pdu_id, decoder, offset + 0, _depth)?;
fidl::decode!(
fidl::encoding::UnboundedVector<u8>,
D,
&mut self.command,
decoder,
offset + 8,
_depth
)?;
Ok(())
}
}
impl fidl::encoding::ValueTypeMarker for ControllerExtGetEventsSupportedResponse {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for ControllerExtGetEventsSupportedResponse {
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<ControllerExtGetEventsSupportedResponse, D>
for &ControllerExtGetEventsSupportedResponse
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<ControllerExtGetEventsSupportedResponse>(offset);
fidl::encoding::Encode::<ControllerExtGetEventsSupportedResponse, D>::encode(
(
<fidl::encoding::Vector<fidl_fuchsia_bluetooth_avrcp::NotificationEvent, 255> as fidl::encoding::ValueTypeMarker>::borrow(&self.events_supported),
),
encoder, offset, _depth
)
}
}
unsafe impl<
D: fidl::encoding::ResourceDialect,
T0: fidl::encoding::Encode<
fidl::encoding::Vector<fidl_fuchsia_bluetooth_avrcp::NotificationEvent, 255>,
D,
>,
> fidl::encoding::Encode<ControllerExtGetEventsSupportedResponse, 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::<ControllerExtGetEventsSupportedResponse>(offset);
self.0.encode(encoder, offset + 0, depth)?;
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
for ControllerExtGetEventsSupportedResponse
{
#[inline(always)]
fn new_empty() -> Self {
Self {
events_supported: fidl::new_empty!(fidl::encoding::Vector<fidl_fuchsia_bluetooth_avrcp::NotificationEvent, 255>, D),
}
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
fidl::decode!(fidl::encoding::Vector<fidl_fuchsia_bluetooth_avrcp::NotificationEvent, 255>, D, &mut self.events_supported, decoder, offset + 0, _depth)?;
Ok(())
}
}
impl fidl::encoding::ValueTypeMarker for ControllerExtSendRawVendorDependentCommandResponse {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for ControllerExtSendRawVendorDependentCommandResponse {
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<ControllerExtSendRawVendorDependentCommandResponse, D>
for &ControllerExtSendRawVendorDependentCommandResponse
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder
.debug_check_bounds::<ControllerExtSendRawVendorDependentCommandResponse>(offset);
fidl::encoding::Encode::<ControllerExtSendRawVendorDependentCommandResponse, D>::encode(
(<fidl::encoding::UnboundedVector<u8> as fidl::encoding::ValueTypeMarker>::borrow(
&self.response,
),),
encoder,
offset,
_depth,
)
}
}
unsafe impl<
D: fidl::encoding::ResourceDialect,
T0: fidl::encoding::Encode<fidl::encoding::UnboundedVector<u8>, D>,
> fidl::encoding::Encode<ControllerExtSendRawVendorDependentCommandResponse, 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::<ControllerExtSendRawVendorDependentCommandResponse>(offset);
self.0.encode(encoder, offset + 0, depth)?;
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
for ControllerExtSendRawVendorDependentCommandResponse
{
#[inline(always)]
fn new_empty() -> Self {
Self { response: fidl::new_empty!(fidl::encoding::UnboundedVector<u8>, D) }
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
fidl::decode!(
fidl::encoding::UnboundedVector<u8>,
D,
&mut self.response,
decoder,
offset + 0,
_depth
)?;
Ok(())
}
}
impl fidl::encoding::ResourceTypeMarker for PeerManagerExtGetBrowseControllerForTargetRequest {
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 PeerManagerExtGetBrowseControllerForTargetRequest {
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<
PeerManagerExtGetBrowseControllerForTargetRequest,
fidl::encoding::DefaultFuchsiaResourceDialect,
> for &mut PeerManagerExtGetBrowseControllerForTargetRequest
{
#[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::<PeerManagerExtGetBrowseControllerForTargetRequest>(offset);
fidl::encoding::Encode::<PeerManagerExtGetBrowseControllerForTargetRequest, fidl::encoding::DefaultFuchsiaResourceDialect>::encode(
(
<fidl_fuchsia_bluetooth::PeerId as fidl::encoding::ValueTypeMarker>::borrow(&self.peer_id),
<fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<BrowseControllerExtMarker>> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.client),
),
encoder, offset, _depth
)
}
}
unsafe impl<
T0: fidl::encoding::Encode<
fidl_fuchsia_bluetooth::PeerId,
fidl::encoding::DefaultFuchsiaResourceDialect,
>,
T1: fidl::encoding::Encode<
fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<BrowseControllerExtMarker>>,
fidl::encoding::DefaultFuchsiaResourceDialect,
>,
>
fidl::encoding::Encode<
PeerManagerExtGetBrowseControllerForTargetRequest,
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::<PeerManagerExtGetBrowseControllerForTargetRequest>(offset);
unsafe {
let ptr = encoder.buf.as_mut_ptr().add(offset).offset(8);
(ptr as *mut u64).write_unaligned(0);
}
self.0.encode(encoder, offset + 0, depth)?;
self.1.encode(encoder, offset + 8, depth)?;
Ok(())
}
}
impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
for PeerManagerExtGetBrowseControllerForTargetRequest
{
#[inline(always)]
fn new_empty() -> Self {
Self {
peer_id: fidl::new_empty!(
fidl_fuchsia_bluetooth::PeerId,
fidl::encoding::DefaultFuchsiaResourceDialect
),
client: fidl::new_empty!(
fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<BrowseControllerExtMarker>>,
fidl::encoding::DefaultFuchsiaResourceDialect
),
}
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<
'_,
fidl::encoding::DefaultFuchsiaResourceDialect,
>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(8) };
let padval = unsafe { (ptr as *const u64).read_unaligned() };
let mask = 0xffffffff00000000u64;
let maskedval = padval & mask;
if maskedval != 0 {
return Err(fidl::Error::NonZeroPadding {
padding_start: offset + 8 + ((mask as u64).trailing_zeros() / 8) as usize,
});
}
fidl::decode!(
fidl_fuchsia_bluetooth::PeerId,
fidl::encoding::DefaultFuchsiaResourceDialect,
&mut self.peer_id,
decoder,
offset + 0,
_depth
)?;
fidl::decode!(
fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<BrowseControllerExtMarker>>,
fidl::encoding::DefaultFuchsiaResourceDialect,
&mut self.client,
decoder,
offset + 8,
_depth
)?;
Ok(())
}
}
impl fidl::encoding::ResourceTypeMarker for PeerManagerExtGetControllerForTargetRequest {
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 PeerManagerExtGetControllerForTargetRequest {
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<
PeerManagerExtGetControllerForTargetRequest,
fidl::encoding::DefaultFuchsiaResourceDialect,
> for &mut PeerManagerExtGetControllerForTargetRequest
{
#[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::<PeerManagerExtGetControllerForTargetRequest>(offset);
fidl::encoding::Encode::<PeerManagerExtGetControllerForTargetRequest, fidl::encoding::DefaultFuchsiaResourceDialect>::encode(
(
<fidl_fuchsia_bluetooth::PeerId as fidl::encoding::ValueTypeMarker>::borrow(&self.peer_id),
<fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<ControllerExtMarker>> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.client),
),
encoder, offset, _depth
)
}
}
unsafe impl<
T0: fidl::encoding::Encode<
fidl_fuchsia_bluetooth::PeerId,
fidl::encoding::DefaultFuchsiaResourceDialect,
>,
T1: fidl::encoding::Encode<
fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<ControllerExtMarker>>,
fidl::encoding::DefaultFuchsiaResourceDialect,
>,
>
fidl::encoding::Encode<
PeerManagerExtGetControllerForTargetRequest,
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::<PeerManagerExtGetControllerForTargetRequest>(offset);
unsafe {
let ptr = encoder.buf.as_mut_ptr().add(offset).offset(8);
(ptr as *mut u64).write_unaligned(0);
}
self.0.encode(encoder, offset + 0, depth)?;
self.1.encode(encoder, offset + 8, depth)?;
Ok(())
}
}
impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
for PeerManagerExtGetControllerForTargetRequest
{
#[inline(always)]
fn new_empty() -> Self {
Self {
peer_id: fidl::new_empty!(
fidl_fuchsia_bluetooth::PeerId,
fidl::encoding::DefaultFuchsiaResourceDialect
),
client: fidl::new_empty!(
fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<ControllerExtMarker>>,
fidl::encoding::DefaultFuchsiaResourceDialect
),
}
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<
'_,
fidl::encoding::DefaultFuchsiaResourceDialect,
>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(8) };
let padval = unsafe { (ptr as *const u64).read_unaligned() };
let mask = 0xffffffff00000000u64;
let maskedval = padval & mask;
if maskedval != 0 {
return Err(fidl::Error::NonZeroPadding {
padding_start: offset + 8 + ((mask as u64).trailing_zeros() / 8) as usize,
});
}
fidl::decode!(
fidl_fuchsia_bluetooth::PeerId,
fidl::encoding::DefaultFuchsiaResourceDialect,
&mut self.peer_id,
decoder,
offset + 0,
_depth
)?;
fidl::decode!(
fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<ControllerExtMarker>>,
fidl::encoding::DefaultFuchsiaResourceDialect,
&mut self.client,
decoder,
offset + 8,
_depth
)?;
Ok(())
}
}
}