#![warn(clippy::all)]
#![allow(unused_parens, unused_mut, unused_imports, nonstandard_style)]
use {
bitflags::bitflags,
fidl::{
client::QueryResponseFut,
endpoints::{ControlHandle as _, Responder as _},
},
fuchsia_zircon_status as zx_status,
futures::future::{self, MaybeDone, TryFutureExt},
};
#[cfg(target_os = "fuchsia")]
use fuchsia_zircon as zx;
#[derive(Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd, Hash)]
#[repr(u32)]
pub enum OutOfBoundsDirection {
Below = 1,
Above = 2,
}
impl OutOfBoundsDirection {
#[inline]
pub fn from_primitive(prim: u32) -> Option<Self> {
match prim {
1 => Some(Self::Below),
2 => Some(Self::Above),
_ => None,
}
}
#[inline]
pub const fn into_primitive(self) -> u32 {
self as u32
}
#[deprecated = "Strict enums should not use `is_unknown`"]
#[inline]
pub fn is_unknown(&self) -> bool {
false
}
}
#[derive(Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
pub struct BadDirectory {
pub path: String,
}
impl fidl::Persistable for BadDirectory {}
#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
#[repr(C)]
pub struct BadEntryType {
pub value: u8,
}
impl fidl::Persistable for BadEntryType {}
#[derive(Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
pub struct BadFile {
pub path: String,
}
impl fidl::Persistable for BadFile {}
#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
#[repr(C)]
pub struct BannedFeatureIncompat {
pub value: u32,
}
impl fidl::Persistable for BannedFeatureIncompat {}
#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
#[repr(C)]
pub struct BlockNumberOutOfBounds {
pub block_number: u64,
}
impl fidl::Persistable for BlockNumberOutOfBounds {}
#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
#[repr(C)]
pub struct BlockSizeInvalid {
pub block_size: u32,
}
impl fidl::Persistable for BlockSizeInvalid {}
#[derive(Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
pub struct DirEntry2NonUtf8 {
pub data: Vec<u8>,
}
impl fidl::Persistable for DirEntry2NonUtf8 {}
#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
#[repr(C)]
pub struct ExtentUnexpectedLength {
pub size: u64,
pub expected: u64,
}
impl fidl::Persistable for ExtentUnexpectedLength {}
#[derive(Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
pub struct Incompatible {
pub msg: String,
}
impl fidl::Persistable for Incompatible {}
#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
pub struct InvalidAddress {
pub position: u64,
pub direction: OutOfBoundsDirection,
pub bound: u64,
}
impl fidl::Persistable for InvalidAddress {}
#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
#[repr(C)]
pub struct InvalidBlockGroupDesc {
pub position: u64,
}
impl fidl::Persistable for InvalidBlockGroupDesc {}
#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
#[repr(C)]
pub struct InvalidDirEntry2 {
pub position: u64,
}
impl fidl::Persistable for InvalidDirEntry2 {}
#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
#[repr(C)]
pub struct InvalidExtent {
pub position: u64,
}
impl fidl::Persistable for InvalidExtent {}
#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
pub struct InvalidExtentHeader;
impl fidl::Persistable for InvalidExtentHeader {}
#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
#[repr(C)]
pub struct InvalidExtentHeaderMagic {
pub value: u16,
}
impl fidl::Persistable for InvalidExtentHeaderMagic {}
#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
#[repr(C)]
pub struct InvalidINode {
pub inode_number: u32,
}
impl fidl::Persistable for InvalidINode {}
#[derive(Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
pub struct InvalidInputPath {
pub path: String,
}
impl fidl::Persistable for InvalidInputPath {}
#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
#[repr(C)]
pub struct InvalidSuperBlock {
pub position: u64,
}
impl fidl::Persistable for InvalidSuperBlock {}
#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
#[repr(C)]
pub struct InvalidSuperBlockMagic {
pub value: u16,
}
impl fidl::Persistable for InvalidSuperBlockMagic {}
#[derive(Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
pub struct PathNotFound {
pub path: String,
}
impl fidl::Persistable for PathNotFound {}
#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
#[repr(C)]
pub struct ReaderOutOfBounds {
pub position: u64,
pub size: u64,
}
impl fidl::Persistable for ReaderOutOfBounds {}
#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
#[repr(C)]
pub struct ReaderReadError {
pub position: u64,
}
impl fidl::Persistable for ReaderReadError {}
#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
#[repr(C)]
pub struct RequiredFeatureIncompat {
pub value: u32,
}
impl fidl::Persistable for RequiredFeatureIncompat {}
#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
pub struct ServerMountVmoRequest {
pub source: fidl::Vmo,
pub flags: fidl_fuchsia_io::OpenFlags,
pub root: fidl::endpoints::ServerEnd<fidl_fuchsia_io::DirectoryMarker>,
}
impl fidl::Standalone for ServerMountVmoRequest {}
#[derive(Clone, Debug, PartialEq)]
pub struct ServerMountVmoResponse {
pub result: MountVmoResult,
}
impl fidl::Persistable for ServerMountVmoResponse {}
#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
pub struct Success;
impl fidl::Persistable for Success {}
#[derive(Clone, Debug)]
pub enum MountVmoResult {
Success(Success),
VmoReadFailure(i32),
ParseError(ParseError),
#[deprecated = "Use `MountVmoResult::unknown()` to construct and `MountVmoResultUnknown!()` to exhaustively match."]
#[doc(hidden)]
#[non_exhaustive]
__Unknown {
ordinal: u64,
},
}
#[macro_export]
macro_rules! MountVmoResultUnknown {
() => {
_
};
}
impl PartialEq for MountVmoResult {
fn eq(&self, other: &Self) -> bool {
match (self, other) {
(Self::Success(x), Self::Success(y)) => *x == *y,
(Self::VmoReadFailure(x), Self::VmoReadFailure(y)) => *x == *y,
(Self::ParseError(x), Self::ParseError(y)) => *x == *y,
_ => false,
}
}
}
impl MountVmoResult {
#[inline]
pub fn ordinal(&self) -> u64 {
match *self {
Self::Success(_) => 1,
Self::VmoReadFailure(_) => 2,
Self::ParseError(_) => 3,
#[allow(deprecated)]
Self::__Unknown { ordinal } => ordinal,
}
}
#[inline]
pub fn unknown_variant_for_testing() -> Self {
#[allow(deprecated)]
Self::__Unknown { ordinal: 0 }
}
#[inline]
pub fn is_unknown(&self) -> bool {
match self {
#[allow(deprecated)]
Self::__Unknown { .. } => true,
_ => false,
}
}
}
impl fidl::Persistable for MountVmoResult {}
#[derive(Clone, Debug)]
pub enum ParseError {
InvalidSuperBlock(InvalidSuperBlock),
InvalidSuperBlockMagic(InvalidSuperBlockMagic),
BlockNumberOutOfBounds(BlockNumberOutOfBounds),
BlockSizeInvalid(BlockSizeInvalid),
InvalidBlockGroupDesc(InvalidBlockGroupDesc),
InvalidInode(InvalidINode),
InvalidExtentHeader(InvalidExtentHeader),
InvalidExtentHeaderMagic(InvalidExtentHeaderMagic),
InvalidExtent(InvalidExtent),
ExtentUnexpectedLength(ExtentUnexpectedLength),
InvalidDirEntry2(InvalidDirEntry2),
DirEntry2NonUtf8(DirEntry2NonUtf8),
InvalidInputPath(InvalidInputPath),
PathNotFound(PathNotFound),
BadEntryType(BadEntryType),
Incompatible(Incompatible),
BadFile(BadFile),
BadDirectory(BadDirectory),
ReaderReadError(ReaderReadError),
ReaderOutOfBounds(ReaderOutOfBounds),
RequiredFeatureIncompat(RequiredFeatureIncompat),
BannedFeatureIncompat(BannedFeatureIncompat),
InvalidAddress(InvalidAddress),
#[deprecated = "Use `ParseError::unknown()` to construct and `ParseErrorUnknown!()` to exhaustively match."]
#[doc(hidden)]
#[non_exhaustive]
__Unknown {
ordinal: u64,
},
}
#[macro_export]
macro_rules! ParseErrorUnknown {
() => {
_
};
}
impl PartialEq for ParseError {
fn eq(&self, other: &Self) -> bool {
match (self, other) {
(Self::InvalidSuperBlock(x), Self::InvalidSuperBlock(y)) => *x == *y,
(Self::InvalidSuperBlockMagic(x), Self::InvalidSuperBlockMagic(y)) => *x == *y,
(Self::BlockNumberOutOfBounds(x), Self::BlockNumberOutOfBounds(y)) => *x == *y,
(Self::BlockSizeInvalid(x), Self::BlockSizeInvalid(y)) => *x == *y,
(Self::InvalidBlockGroupDesc(x), Self::InvalidBlockGroupDesc(y)) => *x == *y,
(Self::InvalidInode(x), Self::InvalidInode(y)) => *x == *y,
(Self::InvalidExtentHeader(x), Self::InvalidExtentHeader(y)) => *x == *y,
(Self::InvalidExtentHeaderMagic(x), Self::InvalidExtentHeaderMagic(y)) => *x == *y,
(Self::InvalidExtent(x), Self::InvalidExtent(y)) => *x == *y,
(Self::ExtentUnexpectedLength(x), Self::ExtentUnexpectedLength(y)) => *x == *y,
(Self::InvalidDirEntry2(x), Self::InvalidDirEntry2(y)) => *x == *y,
(Self::DirEntry2NonUtf8(x), Self::DirEntry2NonUtf8(y)) => *x == *y,
(Self::InvalidInputPath(x), Self::InvalidInputPath(y)) => *x == *y,
(Self::PathNotFound(x), Self::PathNotFound(y)) => *x == *y,
(Self::BadEntryType(x), Self::BadEntryType(y)) => *x == *y,
(Self::Incompatible(x), Self::Incompatible(y)) => *x == *y,
(Self::BadFile(x), Self::BadFile(y)) => *x == *y,
(Self::BadDirectory(x), Self::BadDirectory(y)) => *x == *y,
(Self::ReaderReadError(x), Self::ReaderReadError(y)) => *x == *y,
(Self::ReaderOutOfBounds(x), Self::ReaderOutOfBounds(y)) => *x == *y,
(Self::RequiredFeatureIncompat(x), Self::RequiredFeatureIncompat(y)) => *x == *y,
(Self::BannedFeatureIncompat(x), Self::BannedFeatureIncompat(y)) => *x == *y,
(Self::InvalidAddress(x), Self::InvalidAddress(y)) => *x == *y,
_ => false,
}
}
}
impl ParseError {
#[inline]
pub fn ordinal(&self) -> u64 {
match *self {
Self::InvalidSuperBlock(_) => 1,
Self::InvalidSuperBlockMagic(_) => 2,
Self::BlockNumberOutOfBounds(_) => 3,
Self::BlockSizeInvalid(_) => 4,
Self::InvalidBlockGroupDesc(_) => 5,
Self::InvalidInode(_) => 6,
Self::InvalidExtentHeader(_) => 7,
Self::InvalidExtentHeaderMagic(_) => 8,
Self::InvalidExtent(_) => 9,
Self::ExtentUnexpectedLength(_) => 10,
Self::InvalidDirEntry2(_) => 11,
Self::DirEntry2NonUtf8(_) => 12,
Self::InvalidInputPath(_) => 13,
Self::PathNotFound(_) => 14,
Self::BadEntryType(_) => 15,
Self::Incompatible(_) => 16,
Self::BadFile(_) => 17,
Self::BadDirectory(_) => 18,
Self::ReaderReadError(_) => 19,
Self::ReaderOutOfBounds(_) => 20,
Self::RequiredFeatureIncompat(_) => 21,
Self::BannedFeatureIncompat(_) => 22,
Self::InvalidAddress(_) => 23,
#[allow(deprecated)]
Self::__Unknown { ordinal } => ordinal,
}
}
#[inline]
pub fn unknown_variant_for_testing() -> Self {
#[allow(deprecated)]
Self::__Unknown { ordinal: 0 }
}
#[inline]
pub fn is_unknown(&self) -> bool {
match self {
#[allow(deprecated)]
Self::__Unknown { .. } => true,
_ => false,
}
}
}
impl fidl::Persistable for ParseError {}
#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
pub struct Server_Marker;
impl fidl::endpoints::ProtocolMarker for Server_Marker {
type Proxy = Server_Proxy;
type RequestStream = Server_RequestStream;
const DEBUG_NAME: &'static str = "fuchsia.storage.ext4.Server";
}
impl fidl::endpoints::DiscoverableProtocolMarker for Server_Marker {}
pub trait Server_ProxyInterface: Send + Sync {
type MountVmoResponseFut: std::future::Future<Output = Result<MountVmoResult, fidl::Error>>
+ Send;
fn r#mount_vmo(
&self,
source: fidl::Vmo,
flags: fidl_fuchsia_io::OpenFlags,
root: fidl::endpoints::ServerEnd<fidl_fuchsia_io::DirectoryMarker>,
) -> Self::MountVmoResponseFut;
}
#[derive(Debug)]
#[cfg(target_os = "fuchsia")]
pub struct Server_SynchronousProxy {
client: fidl::client::sync::Client,
}
#[cfg(target_os = "fuchsia")]
impl Server_SynchronousProxy {
pub fn new(channel: fidl::Channel) -> Self {
let protocol_name = <Server_Marker 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::Time) -> Result<Server_Event, fidl::Error> {
Server_Event::decode(self.client.wait_for_event(deadline)?)
}
pub fn r#mount_vmo(
&self,
mut source: fidl::Vmo,
mut flags: fidl_fuchsia_io::OpenFlags,
mut root: fidl::endpoints::ServerEnd<fidl_fuchsia_io::DirectoryMarker>,
___deadline: zx::Time,
) -> Result<MountVmoResult, fidl::Error> {
let _response = self.client.send_query::<ServerMountVmoRequest, ServerMountVmoResponse>(
(source, flags, root),
0x191360124db7f6a6,
fidl::encoding::DynamicFlags::empty(),
___deadline,
)?;
Ok(_response.result)
}
}
#[derive(Debug, Clone)]
pub struct Server_Proxy {
client: fidl::client::Client,
}
impl fidl::endpoints::Proxy for Server_Proxy {
type Protocol = Server_Marker;
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 Server_Proxy {
pub fn new(channel: fidl::AsyncChannel) -> Self {
let protocol_name = <Server_Marker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
Self { client: fidl::client::Client::new(channel, protocol_name) }
}
pub fn take_event_stream(&self) -> Server_EventStream {
Server_EventStream { event_receiver: self.client.take_event_receiver() }
}
pub fn r#mount_vmo(
&self,
mut source: fidl::Vmo,
mut flags: fidl_fuchsia_io::OpenFlags,
mut root: fidl::endpoints::ServerEnd<fidl_fuchsia_io::DirectoryMarker>,
) -> fidl::client::QueryResponseFut<MountVmoResult> {
Server_ProxyInterface::r#mount_vmo(self, source, flags, root)
}
}
impl Server_ProxyInterface for Server_Proxy {
type MountVmoResponseFut = fidl::client::QueryResponseFut<MountVmoResult>;
fn r#mount_vmo(
&self,
mut source: fidl::Vmo,
mut flags: fidl_fuchsia_io::OpenFlags,
mut root: fidl::endpoints::ServerEnd<fidl_fuchsia_io::DirectoryMarker>,
) -> Self::MountVmoResponseFut {
fn _decode(
mut _buf: Result<fidl::MessageBufEtc, fidl::Error>,
) -> Result<MountVmoResult, fidl::Error> {
let _response = fidl::client::decode_transaction_body::<
ServerMountVmoResponse,
0x191360124db7f6a6,
>(_buf?)?;
Ok(_response.result)
}
self.client.send_query_and_decode::<ServerMountVmoRequest, MountVmoResult>(
(source, flags, root),
0x191360124db7f6a6,
fidl::encoding::DynamicFlags::empty(),
_decode,
)
}
}
pub struct Server_EventStream {
event_receiver: fidl::client::EventReceiver,
}
impl std::marker::Unpin for Server_EventStream {}
impl futures::stream::FusedStream for Server_EventStream {
fn is_terminated(&self) -> bool {
self.event_receiver.is_terminated()
}
}
impl futures::Stream for Server_EventStream {
type Item = Result<Server_Event, 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(Server_Event::decode(buf))),
None => std::task::Poll::Ready(None),
}
}
}
#[derive(Debug)]
pub enum Server_Event {}
impl Server_Event {
fn decode(mut buf: fidl::MessageBufEtc) -> Result<Server_Event, 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: <Server_Marker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
}),
}
}
}
pub struct Server_RequestStream {
inner: std::sync::Arc<fidl::ServeInner>,
is_terminated: bool,
}
impl std::marker::Unpin for Server_RequestStream {}
impl futures::stream::FusedStream for Server_RequestStream {
fn is_terminated(&self) -> bool {
self.is_terminated
}
}
impl fidl::endpoints::RequestStream for Server_RequestStream {
type Protocol = Server_Marker;
type ControlHandle = Server_ControlHandle;
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 {
Server_ControlHandle { inner: self.inner.clone() }
}
fn into_inner(self) -> (::std::sync::Arc<fidl::ServeInner>, bool) {
(self.inner, self.is_terminated)
}
fn from_inner(inner: std::sync::Arc<fidl::ServeInner>, is_terminated: bool) -> Self {
Self { inner, is_terminated }
}
}
impl futures::Stream for Server_RequestStream {
type Item = Result<Server_Request, 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 Server_RequestStream after completion");
}
fidl::encoding::with_tls_decode_buf(|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))))
}
}
let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
std::task::Poll::Ready(Some(match header.ordinal {
0x191360124db7f6a6 => {
header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
let mut req = fidl::new_empty!(ServerMountVmoRequest);
fidl::encoding::Decoder::decode_into::<ServerMountVmoRequest>(
&header,
_body_bytes,
handles,
&mut req,
)?;
let control_handle = Server_ControlHandle { inner: this.inner.clone() };
Ok(Server_Request::MountVmo {
source: req.source,
flags: req.flags,
root: req.root,
responder: Server_MountVmoResponder {
control_handle: std::mem::ManuallyDrop::new(control_handle),
tx_id: header.tx_id,
},
})
}
_ => Err(fidl::Error::UnknownOrdinal {
ordinal: header.ordinal,
protocol_name: <Server_Marker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
}),
}))
})
}
}
#[derive(Debug)]
pub enum Server_Request {
MountVmo {
source: fidl::Vmo,
flags: fidl_fuchsia_io::OpenFlags,
root: fidl::endpoints::ServerEnd<fidl_fuchsia_io::DirectoryMarker>,
responder: Server_MountVmoResponder,
},
}
impl Server_Request {
#[allow(irrefutable_let_patterns)]
pub fn into_mount_vmo(
self,
) -> Option<(
fidl::Vmo,
fidl_fuchsia_io::OpenFlags,
fidl::endpoints::ServerEnd<fidl_fuchsia_io::DirectoryMarker>,
Server_MountVmoResponder,
)> {
if let Server_Request::MountVmo { source, flags, root, responder } = self {
Some((source, flags, root, responder))
} else {
None
}
}
pub fn method_name(&self) -> &'static str {
match *self {
Server_Request::MountVmo { .. } => "mount_vmo",
}
}
}
#[derive(Debug, Clone)]
pub struct Server_ControlHandle {
inner: std::sync::Arc<fidl::ServeInner>,
}
impl fidl::endpoints::ControlHandle for Server_ControlHandle {
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<'a>(&'a self) -> fidl::OnSignals<'a> {
self.inner.channel().on_closed()
}
}
impl Server_ControlHandle {}
#[must_use = "FIDL methods require a response to be sent"]
#[derive(Debug)]
pub struct Server_MountVmoResponder {
control_handle: std::mem::ManuallyDrop<Server_ControlHandle>,
tx_id: u32,
}
impl std::ops::Drop for Server_MountVmoResponder {
fn drop(&mut self) {
self.control_handle.shutdown();
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
}
}
impl fidl::endpoints::Responder for Server_MountVmoResponder {
type ControlHandle = Server_ControlHandle;
fn control_handle(&self) -> &Server_ControlHandle {
&self.control_handle
}
fn drop_without_shutdown(mut self) {
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
std::mem::forget(self);
}
}
impl Server_MountVmoResponder {
pub fn send(self, mut result: &MountVmoResult) -> 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: &MountVmoResult) -> Result<(), fidl::Error> {
let _result = self.send_raw(result);
self.drop_without_shutdown();
_result
}
fn send_raw(&self, mut result: &MountVmoResult) -> Result<(), fidl::Error> {
self.control_handle.inner.send::<ServerMountVmoResponse>(
(result,),
self.tx_id,
0x191360124db7f6a6,
fidl::encoding::DynamicFlags::empty(),
)
}
}
#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
pub struct ServiceMarker;
#[cfg(target_os = "fuchsia")]
impl fidl::endpoints::ServiceMarker for ServiceMarker {
type Proxy = ServiceProxy;
type Request = ServiceRequest;
const SERVICE_NAME: &'static str = "fuchsia.storage.ext4.Service";
}
#[cfg(target_os = "fuchsia")]
pub enum ServiceRequest {
Server(Server_RequestStream),
}
#[cfg(target_os = "fuchsia")]
impl fidl::endpoints::ServiceRequest for ServiceRequest {
type Service = ServiceMarker;
fn dispatch(name: &str, _channel: fidl::AsyncChannel) -> Self {
match name {
"server" => Self::Server(
<Server_RequestStream as fidl::endpoints::RequestStream>::from_channel(_channel),
),
_ => panic!("no such member protocol name for service Service"),
}
}
fn member_names() -> &'static [&'static str] {
&["server"]
}
}
#[cfg(target_os = "fuchsia")]
pub struct ServiceProxy(Box<dyn fidl::endpoints::MemberOpener>);
#[cfg(target_os = "fuchsia")]
impl fidl::endpoints::ServiceProxy for ServiceProxy {
type Service = ServiceMarker;
fn from_member_opener(opener: Box<dyn fidl::endpoints::MemberOpener>) -> Self {
Self(opener)
}
}
#[cfg(target_os = "fuchsia")]
impl ServiceProxy {
pub fn connect_to_server(&self) -> Result<Server_Proxy, fidl::Error> {
let (proxy, server_end) = fidl::endpoints::create_proxy::<Server_Marker>()?;
self.connect_channel_to_server(server_end)?;
Ok(proxy)
}
pub fn connect_channel_to_server(
&self,
server_end: fidl::endpoints::ServerEnd<Server_Marker>,
) -> Result<(), fidl::Error> {
self.0.open_member("server", server_end.into_channel())
}
}
mod internal {
use super::*;
unsafe impl fidl::encoding::TypeMarker for OutOfBoundsDirection {
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 OutOfBoundsDirection {
type Borrowed<'a> = Self;
#[inline(always)]
fn borrow<'a>(
value: &'a <Self as fidl::encoding::TypeMarker>::Owned,
) -> Self::Borrowed<'a> {
*value
}
}
unsafe impl fidl::encoding::Encode<Self> for OutOfBoundsDirection {
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<Self>(offset);
encoder.write_num(self.into_primitive(), offset);
Ok(())
}
}
impl fidl::encoding::Decode<Self> for OutOfBoundsDirection {
#[inline(always)]
fn new_empty() -> Self {
Self::Below
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_>,
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 BadDirectory {
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
}
}
impl fidl::encoding::ValueTypeMarker for BadDirectory {
type Borrowed<'a> = &'a Self;
fn borrow<'a>(
value: &'a <Self as fidl::encoding::TypeMarker>::Owned,
) -> Self::Borrowed<'a> {
value
}
}
unsafe impl fidl::encoding::Encode<BadDirectory> for &BadDirectory {
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<BadDirectory>(offset);
fidl::encoding::Encode::<BadDirectory>::encode(
(<fidl::encoding::BoundedString<1024> as fidl::encoding::ValueTypeMarker>::borrow(
&self.path,
),),
encoder,
offset,
_depth,
)
}
}
unsafe impl<T0: fidl::encoding::Encode<fidl::encoding::BoundedString<1024>>>
fidl::encoding::Encode<BadDirectory> for (T0,)
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_>,
offset: usize,
depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<BadDirectory>(offset);
self.0.encode(encoder, offset + 0, depth)?;
Ok(())
}
}
impl fidl::encoding::Decode<Self> for BadDirectory {
#[inline(always)]
fn new_empty() -> Self {
Self { path: fidl::new_empty!(fidl::encoding::BoundedString<1024>) }
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
fidl::decode!(
fidl::encoding::BoundedString<1024>,
&mut self.path,
decoder,
offset + 0,
_depth
)?;
Ok(())
}
}
unsafe impl fidl::encoding::TypeMarker for BadEntryType {
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
1
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
1
}
#[inline(always)]
fn encode_is_copy() -> bool {
true
}
#[inline(always)]
fn decode_is_copy() -> bool {
true
}
}
impl fidl::encoding::ValueTypeMarker for BadEntryType {
type Borrowed<'a> = &'a Self;
fn borrow<'a>(
value: &'a <Self as fidl::encoding::TypeMarker>::Owned,
) -> Self::Borrowed<'a> {
value
}
}
unsafe impl fidl::encoding::Encode<BadEntryType> for &BadEntryType {
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<BadEntryType>(offset);
unsafe {
let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
(buf_ptr as *mut BadEntryType)
.write_unaligned((self as *const BadEntryType).read());
}
Ok(())
}
}
unsafe impl<T0: fidl::encoding::Encode<u8>> fidl::encoding::Encode<BadEntryType> for (T0,) {
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_>,
offset: usize,
depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<BadEntryType>(offset);
self.0.encode(encoder, offset + 0, depth)?;
Ok(())
}
}
impl fidl::encoding::Decode<Self> for BadEntryType {
#[inline(always)]
fn new_empty() -> Self {
Self { value: fidl::new_empty!(u8) }
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
unsafe {
std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 1);
}
Ok(())
}
}
unsafe impl fidl::encoding::TypeMarker for BadFile {
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
}
}
impl fidl::encoding::ValueTypeMarker for BadFile {
type Borrowed<'a> = &'a Self;
fn borrow<'a>(
value: &'a <Self as fidl::encoding::TypeMarker>::Owned,
) -> Self::Borrowed<'a> {
value
}
}
unsafe impl fidl::encoding::Encode<BadFile> for &BadFile {
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<BadFile>(offset);
fidl::encoding::Encode::<BadFile>::encode(
(<fidl::encoding::BoundedString<1024> as fidl::encoding::ValueTypeMarker>::borrow(
&self.path,
),),
encoder,
offset,
_depth,
)
}
}
unsafe impl<T0: fidl::encoding::Encode<fidl::encoding::BoundedString<1024>>>
fidl::encoding::Encode<BadFile> for (T0,)
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_>,
offset: usize,
depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<BadFile>(offset);
self.0.encode(encoder, offset + 0, depth)?;
Ok(())
}
}
impl fidl::encoding::Decode<Self> for BadFile {
#[inline(always)]
fn new_empty() -> Self {
Self { path: fidl::new_empty!(fidl::encoding::BoundedString<1024>) }
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
fidl::decode!(
fidl::encoding::BoundedString<1024>,
&mut self.path,
decoder,
offset + 0,
_depth
)?;
Ok(())
}
}
unsafe impl fidl::encoding::TypeMarker for BannedFeatureIncompat {
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
}
}
impl fidl::encoding::ValueTypeMarker for BannedFeatureIncompat {
type Borrowed<'a> = &'a Self;
fn borrow<'a>(
value: &'a <Self as fidl::encoding::TypeMarker>::Owned,
) -> Self::Borrowed<'a> {
value
}
}
unsafe impl fidl::encoding::Encode<BannedFeatureIncompat> for &BannedFeatureIncompat {
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<BannedFeatureIncompat>(offset);
unsafe {
let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
(buf_ptr as *mut BannedFeatureIncompat)
.write_unaligned((self as *const BannedFeatureIncompat).read());
}
Ok(())
}
}
unsafe impl<T0: fidl::encoding::Encode<u32>> fidl::encoding::Encode<BannedFeatureIncompat>
for (T0,)
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_>,
offset: usize,
depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<BannedFeatureIncompat>(offset);
self.0.encode(encoder, offset + 0, depth)?;
Ok(())
}
}
impl fidl::encoding::Decode<Self> for BannedFeatureIncompat {
#[inline(always)]
fn new_empty() -> Self {
Self { value: fidl::new_empty!(u32) }
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_>,
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(())
}
}
unsafe impl fidl::encoding::TypeMarker for BlockNumberOutOfBounds {
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
8
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
8
}
#[inline(always)]
fn encode_is_copy() -> bool {
true
}
#[inline(always)]
fn decode_is_copy() -> bool {
true
}
}
impl fidl::encoding::ValueTypeMarker for BlockNumberOutOfBounds {
type Borrowed<'a> = &'a Self;
fn borrow<'a>(
value: &'a <Self as fidl::encoding::TypeMarker>::Owned,
) -> Self::Borrowed<'a> {
value
}
}
unsafe impl fidl::encoding::Encode<BlockNumberOutOfBounds> for &BlockNumberOutOfBounds {
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<BlockNumberOutOfBounds>(offset);
unsafe {
let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
(buf_ptr as *mut BlockNumberOutOfBounds)
.write_unaligned((self as *const BlockNumberOutOfBounds).read());
}
Ok(())
}
}
unsafe impl<T0: fidl::encoding::Encode<u64>> fidl::encoding::Encode<BlockNumberOutOfBounds>
for (T0,)
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_>,
offset: usize,
depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<BlockNumberOutOfBounds>(offset);
self.0.encode(encoder, offset + 0, depth)?;
Ok(())
}
}
impl fidl::encoding::Decode<Self> for BlockNumberOutOfBounds {
#[inline(always)]
fn new_empty() -> Self {
Self { block_number: fidl::new_empty!(u64) }
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
unsafe {
std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 8);
}
Ok(())
}
}
unsafe impl fidl::encoding::TypeMarker for BlockSizeInvalid {
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
}
}
impl fidl::encoding::ValueTypeMarker for BlockSizeInvalid {
type Borrowed<'a> = &'a Self;
fn borrow<'a>(
value: &'a <Self as fidl::encoding::TypeMarker>::Owned,
) -> Self::Borrowed<'a> {
value
}
}
unsafe impl fidl::encoding::Encode<BlockSizeInvalid> for &BlockSizeInvalid {
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<BlockSizeInvalid>(offset);
unsafe {
let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
(buf_ptr as *mut BlockSizeInvalid)
.write_unaligned((self as *const BlockSizeInvalid).read());
}
Ok(())
}
}
unsafe impl<T0: fidl::encoding::Encode<u32>> fidl::encoding::Encode<BlockSizeInvalid> for (T0,) {
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_>,
offset: usize,
depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<BlockSizeInvalid>(offset);
self.0.encode(encoder, offset + 0, depth)?;
Ok(())
}
}
impl fidl::encoding::Decode<Self> for BlockSizeInvalid {
#[inline(always)]
fn new_empty() -> Self {
Self { block_size: fidl::new_empty!(u32) }
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_>,
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(())
}
}
unsafe impl fidl::encoding::TypeMarker for DirEntry2NonUtf8 {
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
}
}
impl fidl::encoding::ValueTypeMarker for DirEntry2NonUtf8 {
type Borrowed<'a> = &'a Self;
fn borrow<'a>(
value: &'a <Self as fidl::encoding::TypeMarker>::Owned,
) -> Self::Borrowed<'a> {
value
}
}
unsafe impl fidl::encoding::Encode<DirEntry2NonUtf8> for &DirEntry2NonUtf8 {
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<DirEntry2NonUtf8>(offset);
fidl::encoding::Encode::<DirEntry2NonUtf8>::encode(
(<fidl::encoding::Vector<u8, 255> as fidl::encoding::ValueTypeMarker>::borrow(
&self.data,
),),
encoder,
offset,
_depth,
)
}
}
unsafe impl<T0: fidl::encoding::Encode<fidl::encoding::Vector<u8, 255>>>
fidl::encoding::Encode<DirEntry2NonUtf8> for (T0,)
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_>,
offset: usize,
depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<DirEntry2NonUtf8>(offset);
self.0.encode(encoder, offset + 0, depth)?;
Ok(())
}
}
impl fidl::encoding::Decode<Self> for DirEntry2NonUtf8 {
#[inline(always)]
fn new_empty() -> Self {
Self { data: fidl::new_empty!(fidl::encoding::Vector<u8, 255>) }
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
fidl::decode!(fidl::encoding::Vector<u8, 255>, &mut self.data, decoder, offset + 0, _depth)?;
Ok(())
}
}
unsafe impl fidl::encoding::TypeMarker for ExtentUnexpectedLength {
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
8
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
16
}
#[inline(always)]
fn encode_is_copy() -> bool {
true
}
#[inline(always)]
fn decode_is_copy() -> bool {
true
}
}
impl fidl::encoding::ValueTypeMarker for ExtentUnexpectedLength {
type Borrowed<'a> = &'a Self;
fn borrow<'a>(
value: &'a <Self as fidl::encoding::TypeMarker>::Owned,
) -> Self::Borrowed<'a> {
value
}
}
unsafe impl fidl::encoding::Encode<ExtentUnexpectedLength> for &ExtentUnexpectedLength {
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<ExtentUnexpectedLength>(offset);
unsafe {
let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
(buf_ptr as *mut ExtentUnexpectedLength)
.write_unaligned((self as *const ExtentUnexpectedLength).read());
}
Ok(())
}
}
unsafe impl<T0: fidl::encoding::Encode<u64>, T1: fidl::encoding::Encode<u64>>
fidl::encoding::Encode<ExtentUnexpectedLength> for (T0, T1)
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_>,
offset: usize,
depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<ExtentUnexpectedLength>(offset);
self.0.encode(encoder, offset + 0, depth)?;
self.1.encode(encoder, offset + 8, depth)?;
Ok(())
}
}
impl fidl::encoding::Decode<Self> for ExtentUnexpectedLength {
#[inline(always)]
fn new_empty() -> Self {
Self { size: fidl::new_empty!(u64), expected: fidl::new_empty!(u64) }
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
unsafe {
std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 16);
}
Ok(())
}
}
unsafe impl fidl::encoding::TypeMarker for Incompatible {
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
}
}
impl fidl::encoding::ValueTypeMarker for Incompatible {
type Borrowed<'a> = &'a Self;
fn borrow<'a>(
value: &'a <Self as fidl::encoding::TypeMarker>::Owned,
) -> Self::Borrowed<'a> {
value
}
}
unsafe impl fidl::encoding::Encode<Incompatible> for &Incompatible {
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<Incompatible>(offset);
fidl::encoding::Encode::<Incompatible>::encode(
(<fidl::encoding::BoundedString<1024> as fidl::encoding::ValueTypeMarker>::borrow(
&self.msg,
),),
encoder,
offset,
_depth,
)
}
}
unsafe impl<T0: fidl::encoding::Encode<fidl::encoding::BoundedString<1024>>>
fidl::encoding::Encode<Incompatible> for (T0,)
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_>,
offset: usize,
depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<Incompatible>(offset);
self.0.encode(encoder, offset + 0, depth)?;
Ok(())
}
}
impl fidl::encoding::Decode<Self> for Incompatible {
#[inline(always)]
fn new_empty() -> Self {
Self { msg: fidl::new_empty!(fidl::encoding::BoundedString<1024>) }
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
fidl::decode!(
fidl::encoding::BoundedString<1024>,
&mut self.msg,
decoder,
offset + 0,
_depth
)?;
Ok(())
}
}
unsafe impl fidl::encoding::TypeMarker for InvalidAddress {
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
}
}
impl fidl::encoding::ValueTypeMarker for InvalidAddress {
type Borrowed<'a> = &'a Self;
fn borrow<'a>(
value: &'a <Self as fidl::encoding::TypeMarker>::Owned,
) -> Self::Borrowed<'a> {
value
}
}
unsafe impl fidl::encoding::Encode<InvalidAddress> for &InvalidAddress {
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<InvalidAddress>(offset);
fidl::encoding::Encode::<InvalidAddress>::encode(
(
<u64 as fidl::encoding::ValueTypeMarker>::borrow(&self.position),
<OutOfBoundsDirection as fidl::encoding::ValueTypeMarker>::borrow(
&self.direction,
),
<u64 as fidl::encoding::ValueTypeMarker>::borrow(&self.bound),
),
encoder,
offset,
_depth,
)
}
}
unsafe impl<
T0: fidl::encoding::Encode<u64>,
T1: fidl::encoding::Encode<OutOfBoundsDirection>,
T2: fidl::encoding::Encode<u64>,
> fidl::encoding::Encode<InvalidAddress> for (T0, T1, T2)
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_>,
offset: usize,
depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<InvalidAddress>(offset);
unsafe {
let ptr = encoder.buf.as_mut_ptr().add(offset).offset(8);
(ptr as *mut u64).write_unaligned(0);
}
self.0.encode(encoder, offset + 0, depth)?;
self.1.encode(encoder, offset + 8, depth)?;
self.2.encode(encoder, offset + 16, depth)?;
Ok(())
}
}
impl fidl::encoding::Decode<Self> for InvalidAddress {
#[inline(always)]
fn new_empty() -> Self {
Self {
position: fidl::new_empty!(u64),
direction: fidl::new_empty!(OutOfBoundsDirection),
bound: fidl::new_empty!(u64),
}
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_>,
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 maskedval = padval & 0xffffffff00000000u64;
if (maskedval != 0) {
return Err(fidl::Error::NonZeroPadding {
padding_start: offset
+ 8
+ ((0xffffffff00000000u64 as u64).trailing_zeros() / 8) as usize,
});
}
fidl::decode!(u64, &mut self.position, decoder, offset + 0, _depth)?;
fidl::decode!(OutOfBoundsDirection, &mut self.direction, decoder, offset + 8, _depth)?;
fidl::decode!(u64, &mut self.bound, decoder, offset + 16, _depth)?;
Ok(())
}
}
unsafe impl fidl::encoding::TypeMarker for InvalidBlockGroupDesc {
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
8
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
8
}
#[inline(always)]
fn encode_is_copy() -> bool {
true
}
#[inline(always)]
fn decode_is_copy() -> bool {
true
}
}
impl fidl::encoding::ValueTypeMarker for InvalidBlockGroupDesc {
type Borrowed<'a> = &'a Self;
fn borrow<'a>(
value: &'a <Self as fidl::encoding::TypeMarker>::Owned,
) -> Self::Borrowed<'a> {
value
}
}
unsafe impl fidl::encoding::Encode<InvalidBlockGroupDesc> for &InvalidBlockGroupDesc {
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<InvalidBlockGroupDesc>(offset);
unsafe {
let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
(buf_ptr as *mut InvalidBlockGroupDesc)
.write_unaligned((self as *const InvalidBlockGroupDesc).read());
}
Ok(())
}
}
unsafe impl<T0: fidl::encoding::Encode<u64>> fidl::encoding::Encode<InvalidBlockGroupDesc>
for (T0,)
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_>,
offset: usize,
depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<InvalidBlockGroupDesc>(offset);
self.0.encode(encoder, offset + 0, depth)?;
Ok(())
}
}
impl fidl::encoding::Decode<Self> for InvalidBlockGroupDesc {
#[inline(always)]
fn new_empty() -> Self {
Self { position: fidl::new_empty!(u64) }
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
unsafe {
std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 8);
}
Ok(())
}
}
unsafe impl fidl::encoding::TypeMarker for InvalidDirEntry2 {
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
8
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
8
}
#[inline(always)]
fn encode_is_copy() -> bool {
true
}
#[inline(always)]
fn decode_is_copy() -> bool {
true
}
}
impl fidl::encoding::ValueTypeMarker for InvalidDirEntry2 {
type Borrowed<'a> = &'a Self;
fn borrow<'a>(
value: &'a <Self as fidl::encoding::TypeMarker>::Owned,
) -> Self::Borrowed<'a> {
value
}
}
unsafe impl fidl::encoding::Encode<InvalidDirEntry2> for &InvalidDirEntry2 {
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<InvalidDirEntry2>(offset);
unsafe {
let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
(buf_ptr as *mut InvalidDirEntry2)
.write_unaligned((self as *const InvalidDirEntry2).read());
}
Ok(())
}
}
unsafe impl<T0: fidl::encoding::Encode<u64>> fidl::encoding::Encode<InvalidDirEntry2> for (T0,) {
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_>,
offset: usize,
depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<InvalidDirEntry2>(offset);
self.0.encode(encoder, offset + 0, depth)?;
Ok(())
}
}
impl fidl::encoding::Decode<Self> for InvalidDirEntry2 {
#[inline(always)]
fn new_empty() -> Self {
Self { position: fidl::new_empty!(u64) }
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
unsafe {
std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 8);
}
Ok(())
}
}
unsafe impl fidl::encoding::TypeMarker for InvalidExtent {
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
8
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
8
}
#[inline(always)]
fn encode_is_copy() -> bool {
true
}
#[inline(always)]
fn decode_is_copy() -> bool {
true
}
}
impl fidl::encoding::ValueTypeMarker for InvalidExtent {
type Borrowed<'a> = &'a Self;
fn borrow<'a>(
value: &'a <Self as fidl::encoding::TypeMarker>::Owned,
) -> Self::Borrowed<'a> {
value
}
}
unsafe impl fidl::encoding::Encode<InvalidExtent> for &InvalidExtent {
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<InvalidExtent>(offset);
unsafe {
let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
(buf_ptr as *mut InvalidExtent)
.write_unaligned((self as *const InvalidExtent).read());
}
Ok(())
}
}
unsafe impl<T0: fidl::encoding::Encode<u64>> fidl::encoding::Encode<InvalidExtent> for (T0,) {
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_>,
offset: usize,
depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<InvalidExtent>(offset);
self.0.encode(encoder, offset + 0, depth)?;
Ok(())
}
}
impl fidl::encoding::Decode<Self> for InvalidExtent {
#[inline(always)]
fn new_empty() -> Self {
Self { position: fidl::new_empty!(u64) }
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
unsafe {
std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 8);
}
Ok(())
}
}
unsafe impl fidl::encoding::TypeMarker for InvalidExtentHeader {
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
}
}
impl fidl::encoding::ValueTypeMarker for InvalidExtentHeader {
type Borrowed<'a> = &'a Self;
fn borrow<'a>(
value: &'a <Self as fidl::encoding::TypeMarker>::Owned,
) -> Self::Borrowed<'a> {
value
}
}
unsafe impl fidl::encoding::Encode<InvalidExtentHeader> for &InvalidExtentHeader {
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<InvalidExtentHeader>(offset);
encoder.write_num(0u8, offset);
Ok(())
}
}
impl fidl::encoding::Decode<Self> for InvalidExtentHeader {
#[inline(always)]
fn new_empty() -> Self {
Self
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
match decoder.read_num::<u8>(offset) {
0 => Ok(()),
_ => Err(fidl::Error::Invalid),
}
}
}
unsafe impl fidl::encoding::TypeMarker for InvalidExtentHeaderMagic {
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
2
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
2
}
#[inline(always)]
fn encode_is_copy() -> bool {
true
}
#[inline(always)]
fn decode_is_copy() -> bool {
true
}
}
impl fidl::encoding::ValueTypeMarker for InvalidExtentHeaderMagic {
type Borrowed<'a> = &'a Self;
fn borrow<'a>(
value: &'a <Self as fidl::encoding::TypeMarker>::Owned,
) -> Self::Borrowed<'a> {
value
}
}
unsafe impl fidl::encoding::Encode<InvalidExtentHeaderMagic> for &InvalidExtentHeaderMagic {
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<InvalidExtentHeaderMagic>(offset);
unsafe {
let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
(buf_ptr as *mut InvalidExtentHeaderMagic)
.write_unaligned((self as *const InvalidExtentHeaderMagic).read());
}
Ok(())
}
}
unsafe impl<T0: fidl::encoding::Encode<u16>> fidl::encoding::Encode<InvalidExtentHeaderMagic>
for (T0,)
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_>,
offset: usize,
depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<InvalidExtentHeaderMagic>(offset);
self.0.encode(encoder, offset + 0, depth)?;
Ok(())
}
}
impl fidl::encoding::Decode<Self> for InvalidExtentHeaderMagic {
#[inline(always)]
fn new_empty() -> Self {
Self { value: fidl::new_empty!(u16) }
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_>,
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, 2);
}
Ok(())
}
}
unsafe impl fidl::encoding::TypeMarker for InvalidINode {
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
}
}
impl fidl::encoding::ValueTypeMarker for InvalidINode {
type Borrowed<'a> = &'a Self;
fn borrow<'a>(
value: &'a <Self as fidl::encoding::TypeMarker>::Owned,
) -> Self::Borrowed<'a> {
value
}
}
unsafe impl fidl::encoding::Encode<InvalidINode> for &InvalidINode {
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<InvalidINode>(offset);
unsafe {
let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
(buf_ptr as *mut InvalidINode)
.write_unaligned((self as *const InvalidINode).read());
}
Ok(())
}
}
unsafe impl<T0: fidl::encoding::Encode<u32>> fidl::encoding::Encode<InvalidINode> for (T0,) {
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_>,
offset: usize,
depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<InvalidINode>(offset);
self.0.encode(encoder, offset + 0, depth)?;
Ok(())
}
}
impl fidl::encoding::Decode<Self> for InvalidINode {
#[inline(always)]
fn new_empty() -> Self {
Self { inode_number: fidl::new_empty!(u32) }
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_>,
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(())
}
}
unsafe impl fidl::encoding::TypeMarker for InvalidInputPath {
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
}
}
impl fidl::encoding::ValueTypeMarker for InvalidInputPath {
type Borrowed<'a> = &'a Self;
fn borrow<'a>(
value: &'a <Self as fidl::encoding::TypeMarker>::Owned,
) -> Self::Borrowed<'a> {
value
}
}
unsafe impl fidl::encoding::Encode<InvalidInputPath> for &InvalidInputPath {
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<InvalidInputPath>(offset);
fidl::encoding::Encode::<InvalidInputPath>::encode(
(<fidl::encoding::BoundedString<1024> as fidl::encoding::ValueTypeMarker>::borrow(
&self.path,
),),
encoder,
offset,
_depth,
)
}
}
unsafe impl<T0: fidl::encoding::Encode<fidl::encoding::BoundedString<1024>>>
fidl::encoding::Encode<InvalidInputPath> for (T0,)
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_>,
offset: usize,
depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<InvalidInputPath>(offset);
self.0.encode(encoder, offset + 0, depth)?;
Ok(())
}
}
impl fidl::encoding::Decode<Self> for InvalidInputPath {
#[inline(always)]
fn new_empty() -> Self {
Self { path: fidl::new_empty!(fidl::encoding::BoundedString<1024>) }
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
fidl::decode!(
fidl::encoding::BoundedString<1024>,
&mut self.path,
decoder,
offset + 0,
_depth
)?;
Ok(())
}
}
unsafe impl fidl::encoding::TypeMarker for InvalidSuperBlock {
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
8
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
8
}
#[inline(always)]
fn encode_is_copy() -> bool {
true
}
#[inline(always)]
fn decode_is_copy() -> bool {
true
}
}
impl fidl::encoding::ValueTypeMarker for InvalidSuperBlock {
type Borrowed<'a> = &'a Self;
fn borrow<'a>(
value: &'a <Self as fidl::encoding::TypeMarker>::Owned,
) -> Self::Borrowed<'a> {
value
}
}
unsafe impl fidl::encoding::Encode<InvalidSuperBlock> for &InvalidSuperBlock {
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<InvalidSuperBlock>(offset);
unsafe {
let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
(buf_ptr as *mut InvalidSuperBlock)
.write_unaligned((self as *const InvalidSuperBlock).read());
}
Ok(())
}
}
unsafe impl<T0: fidl::encoding::Encode<u64>> fidl::encoding::Encode<InvalidSuperBlock> for (T0,) {
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_>,
offset: usize,
depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<InvalidSuperBlock>(offset);
self.0.encode(encoder, offset + 0, depth)?;
Ok(())
}
}
impl fidl::encoding::Decode<Self> for InvalidSuperBlock {
#[inline(always)]
fn new_empty() -> Self {
Self { position: fidl::new_empty!(u64) }
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
unsafe {
std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 8);
}
Ok(())
}
}
unsafe impl fidl::encoding::TypeMarker for InvalidSuperBlockMagic {
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
2
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
2
}
#[inline(always)]
fn encode_is_copy() -> bool {
true
}
#[inline(always)]
fn decode_is_copy() -> bool {
true
}
}
impl fidl::encoding::ValueTypeMarker for InvalidSuperBlockMagic {
type Borrowed<'a> = &'a Self;
fn borrow<'a>(
value: &'a <Self as fidl::encoding::TypeMarker>::Owned,
) -> Self::Borrowed<'a> {
value
}
}
unsafe impl fidl::encoding::Encode<InvalidSuperBlockMagic> for &InvalidSuperBlockMagic {
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<InvalidSuperBlockMagic>(offset);
unsafe {
let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
(buf_ptr as *mut InvalidSuperBlockMagic)
.write_unaligned((self as *const InvalidSuperBlockMagic).read());
}
Ok(())
}
}
unsafe impl<T0: fidl::encoding::Encode<u16>> fidl::encoding::Encode<InvalidSuperBlockMagic>
for (T0,)
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_>,
offset: usize,
depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<InvalidSuperBlockMagic>(offset);
self.0.encode(encoder, offset + 0, depth)?;
Ok(())
}
}
impl fidl::encoding::Decode<Self> for InvalidSuperBlockMagic {
#[inline(always)]
fn new_empty() -> Self {
Self { value: fidl::new_empty!(u16) }
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_>,
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, 2);
}
Ok(())
}
}
unsafe impl fidl::encoding::TypeMarker for PathNotFound {
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
}
}
impl fidl::encoding::ValueTypeMarker for PathNotFound {
type Borrowed<'a> = &'a Self;
fn borrow<'a>(
value: &'a <Self as fidl::encoding::TypeMarker>::Owned,
) -> Self::Borrowed<'a> {
value
}
}
unsafe impl fidl::encoding::Encode<PathNotFound> for &PathNotFound {
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<PathNotFound>(offset);
fidl::encoding::Encode::<PathNotFound>::encode(
(<fidl::encoding::BoundedString<1024> as fidl::encoding::ValueTypeMarker>::borrow(
&self.path,
),),
encoder,
offset,
_depth,
)
}
}
unsafe impl<T0: fidl::encoding::Encode<fidl::encoding::BoundedString<1024>>>
fidl::encoding::Encode<PathNotFound> for (T0,)
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_>,
offset: usize,
depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<PathNotFound>(offset);
self.0.encode(encoder, offset + 0, depth)?;
Ok(())
}
}
impl fidl::encoding::Decode<Self> for PathNotFound {
#[inline(always)]
fn new_empty() -> Self {
Self { path: fidl::new_empty!(fidl::encoding::BoundedString<1024>) }
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
fidl::decode!(
fidl::encoding::BoundedString<1024>,
&mut self.path,
decoder,
offset + 0,
_depth
)?;
Ok(())
}
}
unsafe impl fidl::encoding::TypeMarker for ReaderOutOfBounds {
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
8
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
16
}
#[inline(always)]
fn encode_is_copy() -> bool {
true
}
#[inline(always)]
fn decode_is_copy() -> bool {
true
}
}
impl fidl::encoding::ValueTypeMarker for ReaderOutOfBounds {
type Borrowed<'a> = &'a Self;
fn borrow<'a>(
value: &'a <Self as fidl::encoding::TypeMarker>::Owned,
) -> Self::Borrowed<'a> {
value
}
}
unsafe impl fidl::encoding::Encode<ReaderOutOfBounds> for &ReaderOutOfBounds {
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<ReaderOutOfBounds>(offset);
unsafe {
let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
(buf_ptr as *mut ReaderOutOfBounds)
.write_unaligned((self as *const ReaderOutOfBounds).read());
}
Ok(())
}
}
unsafe impl<T0: fidl::encoding::Encode<u64>, T1: fidl::encoding::Encode<u64>>
fidl::encoding::Encode<ReaderOutOfBounds> for (T0, T1)
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_>,
offset: usize,
depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<ReaderOutOfBounds>(offset);
self.0.encode(encoder, offset + 0, depth)?;
self.1.encode(encoder, offset + 8, depth)?;
Ok(())
}
}
impl fidl::encoding::Decode<Self> for ReaderOutOfBounds {
#[inline(always)]
fn new_empty() -> Self {
Self { position: fidl::new_empty!(u64), size: fidl::new_empty!(u64) }
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
unsafe {
std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 16);
}
Ok(())
}
}
unsafe impl fidl::encoding::TypeMarker for ReaderReadError {
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
8
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
8
}
#[inline(always)]
fn encode_is_copy() -> bool {
true
}
#[inline(always)]
fn decode_is_copy() -> bool {
true
}
}
impl fidl::encoding::ValueTypeMarker for ReaderReadError {
type Borrowed<'a> = &'a Self;
fn borrow<'a>(
value: &'a <Self as fidl::encoding::TypeMarker>::Owned,
) -> Self::Borrowed<'a> {
value
}
}
unsafe impl fidl::encoding::Encode<ReaderReadError> for &ReaderReadError {
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<ReaderReadError>(offset);
unsafe {
let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
(buf_ptr as *mut ReaderReadError)
.write_unaligned((self as *const ReaderReadError).read());
}
Ok(())
}
}
unsafe impl<T0: fidl::encoding::Encode<u64>> fidl::encoding::Encode<ReaderReadError> for (T0,) {
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_>,
offset: usize,
depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<ReaderReadError>(offset);
self.0.encode(encoder, offset + 0, depth)?;
Ok(())
}
}
impl fidl::encoding::Decode<Self> for ReaderReadError {
#[inline(always)]
fn new_empty() -> Self {
Self { position: fidl::new_empty!(u64) }
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
unsafe {
std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 8);
}
Ok(())
}
}
unsafe impl fidl::encoding::TypeMarker for RequiredFeatureIncompat {
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
}
}
impl fidl::encoding::ValueTypeMarker for RequiredFeatureIncompat {
type Borrowed<'a> = &'a Self;
fn borrow<'a>(
value: &'a <Self as fidl::encoding::TypeMarker>::Owned,
) -> Self::Borrowed<'a> {
value
}
}
unsafe impl fidl::encoding::Encode<RequiredFeatureIncompat> for &RequiredFeatureIncompat {
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<RequiredFeatureIncompat>(offset);
unsafe {
let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
(buf_ptr as *mut RequiredFeatureIncompat)
.write_unaligned((self as *const RequiredFeatureIncompat).read());
}
Ok(())
}
}
unsafe impl<T0: fidl::encoding::Encode<u32>> fidl::encoding::Encode<RequiredFeatureIncompat>
for (T0,)
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_>,
offset: usize,
depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<RequiredFeatureIncompat>(offset);
self.0.encode(encoder, offset + 0, depth)?;
Ok(())
}
}
impl fidl::encoding::Decode<Self> for RequiredFeatureIncompat {
#[inline(always)]
fn new_empty() -> Self {
Self { value: fidl::new_empty!(u32) }
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_>,
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(())
}
}
unsafe impl fidl::encoding::TypeMarker for ServerMountVmoRequest {
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
4
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
12
}
}
impl fidl::encoding::ResourceTypeMarker for ServerMountVmoRequest {
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::Encode<ServerMountVmoRequest> for &mut ServerMountVmoRequest {
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<ServerMountVmoRequest>(offset);
fidl::encoding::Encode::<ServerMountVmoRequest>::encode(
(
<fidl::encoding::HandleType<
fidl::Vmo,
{ fidl::ObjectType::VMO.into_raw() },
2147483648,
> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
&mut self.source
),
<fidl_fuchsia_io::OpenFlags as fidl::encoding::ValueTypeMarker>::borrow(
&self.flags,
),
<fidl::encoding::Endpoint<
fidl::endpoints::ServerEnd<fidl_fuchsia_io::DirectoryMarker>,
> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
&mut self.root
),
),
encoder,
offset,
_depth,
)
}
}
unsafe impl<
T0: fidl::encoding::Encode<
fidl::encoding::HandleType<
fidl::Vmo,
{ fidl::ObjectType::VMO.into_raw() },
2147483648,
>,
>,
T1: fidl::encoding::Encode<fidl_fuchsia_io::OpenFlags>,
T2: fidl::encoding::Encode<
fidl::encoding::Endpoint<
fidl::endpoints::ServerEnd<fidl_fuchsia_io::DirectoryMarker>,
>,
>,
> fidl::encoding::Encode<ServerMountVmoRequest> for (T0, T1, T2)
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_>,
offset: usize,
depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<ServerMountVmoRequest>(offset);
self.0.encode(encoder, offset + 0, depth)?;
self.1.encode(encoder, offset + 4, depth)?;
self.2.encode(encoder, offset + 8, depth)?;
Ok(())
}
}
impl fidl::encoding::Decode<Self> for ServerMountVmoRequest {
#[inline(always)]
fn new_empty() -> Self {
Self {
source: fidl::new_empty!(fidl::encoding::HandleType<fidl::Vmo, { fidl::ObjectType::VMO.into_raw() }, 2147483648>),
flags: fidl::new_empty!(fidl_fuchsia_io::OpenFlags),
root: fidl::new_empty!(
fidl::encoding::Endpoint<
fidl::endpoints::ServerEnd<fidl_fuchsia_io::DirectoryMarker>,
>
),
}
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
fidl::decode!(fidl::encoding::HandleType<fidl::Vmo, { fidl::ObjectType::VMO.into_raw() }, 2147483648>, &mut self.source, decoder, offset + 0, _depth)?;
fidl::decode!(
fidl_fuchsia_io::OpenFlags,
&mut self.flags,
decoder,
offset + 4,
_depth
)?;
fidl::decode!(
fidl::encoding::Endpoint<
fidl::endpoints::ServerEnd<fidl_fuchsia_io::DirectoryMarker>,
>,
&mut self.root,
decoder,
offset + 8,
_depth
)?;
Ok(())
}
}
unsafe impl fidl::encoding::TypeMarker for ServerMountVmoResponse {
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
}
}
impl fidl::encoding::ValueTypeMarker for ServerMountVmoResponse {
type Borrowed<'a> = &'a Self;
fn borrow<'a>(
value: &'a <Self as fidl::encoding::TypeMarker>::Owned,
) -> Self::Borrowed<'a> {
value
}
}
unsafe impl fidl::encoding::Encode<ServerMountVmoResponse> for &ServerMountVmoResponse {
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<ServerMountVmoResponse>(offset);
fidl::encoding::Encode::<ServerMountVmoResponse>::encode(
(<MountVmoResult as fidl::encoding::ValueTypeMarker>::borrow(&self.result),),
encoder,
offset,
_depth,
)
}
}
unsafe impl<T0: fidl::encoding::Encode<MountVmoResult>>
fidl::encoding::Encode<ServerMountVmoResponse> for (T0,)
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_>,
offset: usize,
depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<ServerMountVmoResponse>(offset);
self.0.encode(encoder, offset + 0, depth)?;
Ok(())
}
}
impl fidl::encoding::Decode<Self> for ServerMountVmoResponse {
#[inline(always)]
fn new_empty() -> Self {
Self { result: fidl::new_empty!(MountVmoResult) }
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
fidl::decode!(MountVmoResult, &mut self.result, decoder, offset + 0, _depth)?;
Ok(())
}
}
unsafe impl fidl::encoding::TypeMarker for Success {
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
}
}
impl fidl::encoding::ValueTypeMarker for Success {
type Borrowed<'a> = &'a Self;
fn borrow<'a>(
value: &'a <Self as fidl::encoding::TypeMarker>::Owned,
) -> Self::Borrowed<'a> {
value
}
}
unsafe impl fidl::encoding::Encode<Success> for &Success {
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<Success>(offset);
encoder.write_num(0u8, offset);
Ok(())
}
}
impl fidl::encoding::Decode<Self> for Success {
#[inline(always)]
fn new_empty() -> Self {
Self
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
match decoder.read_num::<u8>(offset) {
0 => Ok(()),
_ => Err(fidl::Error::Invalid),
}
}
}
unsafe impl fidl::encoding::TypeMarker for MountVmoResult {
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
}
}
impl fidl::encoding::ValueTypeMarker for MountVmoResult {
type Borrowed<'a> = &'a Self;
fn borrow<'a>(
value: &'a <Self as fidl::encoding::TypeMarker>::Owned,
) -> Self::Borrowed<'a> {
value
}
}
unsafe impl fidl::encoding::Encode<MountVmoResult> for &MountVmoResult {
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<MountVmoResult>(offset);
encoder.write_num::<u64>(self.ordinal(), offset);
match self {
MountVmoResult::Success(ref val) => fidl::encoding::encode_in_envelope::<Success>(
<Success as fidl::encoding::ValueTypeMarker>::borrow(val),
encoder,
offset + 8,
_depth,
),
MountVmoResult::VmoReadFailure(ref val) => {
fidl::encoding::encode_in_envelope::<i32>(
<i32 as fidl::encoding::ValueTypeMarker>::borrow(val),
encoder,
offset + 8,
_depth,
)
}
MountVmoResult::ParseError(ref val) => {
fidl::encoding::encode_in_envelope::<ParseError>(
<ParseError as fidl::encoding::ValueTypeMarker>::borrow(val),
encoder,
offset + 8,
_depth,
)
}
#[allow(deprecated)]
MountVmoResult::__Unknown { .. } => Err(fidl::Error::UnknownUnionTag),
}
}
}
impl fidl::encoding::Decode<Self> for MountVmoResult {
#[inline(always)]
fn new_empty() -> Self {
#[allow(deprecated)]
Self::__Unknown { ordinal: 0 }
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_>,
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 => <Success as fidl::encoding::TypeMarker>::inline_size(decoder.context),
2 => <i32 as fidl::encoding::TypeMarker>::inline_size(decoder.context),
3 => <ParseError 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 MountVmoResult::Success(_) = self {
} else {
*self = MountVmoResult::Success(fidl::new_empty!(Success));
}
#[allow(irrefutable_let_patterns)]
if let MountVmoResult::Success(ref mut val) = self {
fidl::decode!(Success, val, decoder, _inner_offset, depth)?;
} else {
unreachable!()
}
}
2 => {
#[allow(irrefutable_let_patterns)]
if let MountVmoResult::VmoReadFailure(_) = self {
} else {
*self = MountVmoResult::VmoReadFailure(fidl::new_empty!(i32));
}
#[allow(irrefutable_let_patterns)]
if let MountVmoResult::VmoReadFailure(ref mut val) = self {
fidl::decode!(i32, val, decoder, _inner_offset, depth)?;
} else {
unreachable!()
}
}
3 => {
#[allow(irrefutable_let_patterns)]
if let MountVmoResult::ParseError(_) = self {
} else {
*self = MountVmoResult::ParseError(fidl::new_empty!(ParseError));
}
#[allow(irrefutable_let_patterns)]
if let MountVmoResult::ParseError(ref mut val) = self {
fidl::decode!(ParseError, val, decoder, _inner_offset, depth)?;
} else {
unreachable!()
}
}
#[allow(deprecated)]
ordinal => {
for _ in 0..num_handles {
decoder.drop_next_handle()?;
}
*self = MountVmoResult::__Unknown { 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(())
}
}
unsafe impl fidl::encoding::TypeMarker for ParseError {
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
}
}
impl fidl::encoding::ValueTypeMarker for ParseError {
type Borrowed<'a> = &'a Self;
fn borrow<'a>(
value: &'a <Self as fidl::encoding::TypeMarker>::Owned,
) -> Self::Borrowed<'a> {
value
}
}
unsafe impl fidl::encoding::Encode<ParseError> for &ParseError {
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<ParseError>(offset);
encoder.write_num::<u64>(self.ordinal(), offset);
match self {
ParseError::InvalidSuperBlock(ref val) => {
fidl::encoding::encode_in_envelope::<InvalidSuperBlock>(
<InvalidSuperBlock as fidl::encoding::ValueTypeMarker>::borrow(val),
encoder,
offset + 8,
_depth,
)
}
ParseError::InvalidSuperBlockMagic(ref val) => {
fidl::encoding::encode_in_envelope::<InvalidSuperBlockMagic>(
<InvalidSuperBlockMagic as fidl::encoding::ValueTypeMarker>::borrow(val),
encoder,
offset + 8,
_depth,
)
}
ParseError::BlockNumberOutOfBounds(ref val) => {
fidl::encoding::encode_in_envelope::<BlockNumberOutOfBounds>(
<BlockNumberOutOfBounds as fidl::encoding::ValueTypeMarker>::borrow(val),
encoder,
offset + 8,
_depth,
)
}
ParseError::BlockSizeInvalid(ref val) => {
fidl::encoding::encode_in_envelope::<BlockSizeInvalid>(
<BlockSizeInvalid as fidl::encoding::ValueTypeMarker>::borrow(val),
encoder,
offset + 8,
_depth,
)
}
ParseError::InvalidBlockGroupDesc(ref val) => {
fidl::encoding::encode_in_envelope::<InvalidBlockGroupDesc>(
<InvalidBlockGroupDesc as fidl::encoding::ValueTypeMarker>::borrow(val),
encoder,
offset + 8,
_depth,
)
}
ParseError::InvalidInode(ref val) => {
fidl::encoding::encode_in_envelope::<InvalidINode>(
<InvalidINode as fidl::encoding::ValueTypeMarker>::borrow(val),
encoder,
offset + 8,
_depth,
)
}
ParseError::InvalidExtentHeader(ref val) => {
fidl::encoding::encode_in_envelope::<InvalidExtentHeader>(
<InvalidExtentHeader as fidl::encoding::ValueTypeMarker>::borrow(val),
encoder,
offset + 8,
_depth,
)
}
ParseError::InvalidExtentHeaderMagic(ref val) => {
fidl::encoding::encode_in_envelope::<InvalidExtentHeaderMagic>(
<InvalidExtentHeaderMagic as fidl::encoding::ValueTypeMarker>::borrow(val),
encoder,
offset + 8,
_depth,
)
}
ParseError::InvalidExtent(ref val) => {
fidl::encoding::encode_in_envelope::<InvalidExtent>(
<InvalidExtent as fidl::encoding::ValueTypeMarker>::borrow(val),
encoder,
offset + 8,
_depth,
)
}
ParseError::ExtentUnexpectedLength(ref val) => {
fidl::encoding::encode_in_envelope::<ExtentUnexpectedLength>(
<ExtentUnexpectedLength as fidl::encoding::ValueTypeMarker>::borrow(val),
encoder,
offset + 8,
_depth,
)
}
ParseError::InvalidDirEntry2(ref val) => {
fidl::encoding::encode_in_envelope::<InvalidDirEntry2>(
<InvalidDirEntry2 as fidl::encoding::ValueTypeMarker>::borrow(val),
encoder,
offset + 8,
_depth,
)
}
ParseError::DirEntry2NonUtf8(ref val) => {
fidl::encoding::encode_in_envelope::<DirEntry2NonUtf8>(
<DirEntry2NonUtf8 as fidl::encoding::ValueTypeMarker>::borrow(val),
encoder,
offset + 8,
_depth,
)
}
ParseError::InvalidInputPath(ref val) => {
fidl::encoding::encode_in_envelope::<InvalidInputPath>(
<InvalidInputPath as fidl::encoding::ValueTypeMarker>::borrow(val),
encoder,
offset + 8,
_depth,
)
}
ParseError::PathNotFound(ref val) => {
fidl::encoding::encode_in_envelope::<PathNotFound>(
<PathNotFound as fidl::encoding::ValueTypeMarker>::borrow(val),
encoder,
offset + 8,
_depth,
)
}
ParseError::BadEntryType(ref val) => {
fidl::encoding::encode_in_envelope::<BadEntryType>(
<BadEntryType as fidl::encoding::ValueTypeMarker>::borrow(val),
encoder,
offset + 8,
_depth,
)
}
ParseError::Incompatible(ref val) => {
fidl::encoding::encode_in_envelope::<Incompatible>(
<Incompatible as fidl::encoding::ValueTypeMarker>::borrow(val),
encoder,
offset + 8,
_depth,
)
}
ParseError::BadFile(ref val) => fidl::encoding::encode_in_envelope::<BadFile>(
<BadFile as fidl::encoding::ValueTypeMarker>::borrow(val),
encoder,
offset + 8,
_depth,
),
ParseError::BadDirectory(ref val) => {
fidl::encoding::encode_in_envelope::<BadDirectory>(
<BadDirectory as fidl::encoding::ValueTypeMarker>::borrow(val),
encoder,
offset + 8,
_depth,
)
}
ParseError::ReaderReadError(ref val) => {
fidl::encoding::encode_in_envelope::<ReaderReadError>(
<ReaderReadError as fidl::encoding::ValueTypeMarker>::borrow(val),
encoder,
offset + 8,
_depth,
)
}
ParseError::ReaderOutOfBounds(ref val) => {
fidl::encoding::encode_in_envelope::<ReaderOutOfBounds>(
<ReaderOutOfBounds as fidl::encoding::ValueTypeMarker>::borrow(val),
encoder,
offset + 8,
_depth,
)
}
ParseError::RequiredFeatureIncompat(ref val) => {
fidl::encoding::encode_in_envelope::<RequiredFeatureIncompat>(
<RequiredFeatureIncompat as fidl::encoding::ValueTypeMarker>::borrow(val),
encoder,
offset + 8,
_depth,
)
}
ParseError::BannedFeatureIncompat(ref val) => {
fidl::encoding::encode_in_envelope::<BannedFeatureIncompat>(
<BannedFeatureIncompat as fidl::encoding::ValueTypeMarker>::borrow(val),
encoder,
offset + 8,
_depth,
)
}
ParseError::InvalidAddress(ref val) => {
fidl::encoding::encode_in_envelope::<InvalidAddress>(
<InvalidAddress as fidl::encoding::ValueTypeMarker>::borrow(val),
encoder,
offset + 8,
_depth,
)
}
#[allow(deprecated)]
ParseError::__Unknown { .. } => Err(fidl::Error::UnknownUnionTag),
}
}
}
impl fidl::encoding::Decode<Self> for ParseError {
#[inline(always)]
fn new_empty() -> Self {
#[allow(deprecated)]
Self::__Unknown { ordinal: 0 }
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_>,
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 => {
<InvalidSuperBlock as fidl::encoding::TypeMarker>::inline_size(decoder.context)
}
2 => <InvalidSuperBlockMagic as fidl::encoding::TypeMarker>::inline_size(
decoder.context,
),
3 => <BlockNumberOutOfBounds as fidl::encoding::TypeMarker>::inline_size(
decoder.context,
),
4 => <BlockSizeInvalid as fidl::encoding::TypeMarker>::inline_size(decoder.context),
5 => <InvalidBlockGroupDesc as fidl::encoding::TypeMarker>::inline_size(
decoder.context,
),
6 => <InvalidINode as fidl::encoding::TypeMarker>::inline_size(decoder.context),
7 => <InvalidExtentHeader as fidl::encoding::TypeMarker>::inline_size(
decoder.context,
),
8 => <InvalidExtentHeaderMagic as fidl::encoding::TypeMarker>::inline_size(
decoder.context,
),
9 => <InvalidExtent as fidl::encoding::TypeMarker>::inline_size(decoder.context),
10 => <ExtentUnexpectedLength as fidl::encoding::TypeMarker>::inline_size(
decoder.context,
),
11 => {
<InvalidDirEntry2 as fidl::encoding::TypeMarker>::inline_size(decoder.context)
}
12 => {
<DirEntry2NonUtf8 as fidl::encoding::TypeMarker>::inline_size(decoder.context)
}
13 => {
<InvalidInputPath as fidl::encoding::TypeMarker>::inline_size(decoder.context)
}
14 => <PathNotFound as fidl::encoding::TypeMarker>::inline_size(decoder.context),
15 => <BadEntryType as fidl::encoding::TypeMarker>::inline_size(decoder.context),
16 => <Incompatible as fidl::encoding::TypeMarker>::inline_size(decoder.context),
17 => <BadFile as fidl::encoding::TypeMarker>::inline_size(decoder.context),
18 => <BadDirectory as fidl::encoding::TypeMarker>::inline_size(decoder.context),
19 => <ReaderReadError as fidl::encoding::TypeMarker>::inline_size(decoder.context),
20 => {
<ReaderOutOfBounds as fidl::encoding::TypeMarker>::inline_size(decoder.context)
}
21 => <RequiredFeatureIncompat as fidl::encoding::TypeMarker>::inline_size(
decoder.context,
),
22 => <BannedFeatureIncompat as fidl::encoding::TypeMarker>::inline_size(
decoder.context,
),
23 => <InvalidAddress 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 ParseError::InvalidSuperBlock(_) = self {
} else {
*self = ParseError::InvalidSuperBlock(fidl::new_empty!(InvalidSuperBlock));
}
#[allow(irrefutable_let_patterns)]
if let ParseError::InvalidSuperBlock(ref mut val) = self {
fidl::decode!(InvalidSuperBlock, val, decoder, _inner_offset, depth)?;
} else {
unreachable!()
}
}
2 => {
#[allow(irrefutable_let_patterns)]
if let ParseError::InvalidSuperBlockMagic(_) = self {
} else {
*self = ParseError::InvalidSuperBlockMagic(fidl::new_empty!(
InvalidSuperBlockMagic
));
}
#[allow(irrefutable_let_patterns)]
if let ParseError::InvalidSuperBlockMagic(ref mut val) = self {
fidl::decode!(InvalidSuperBlockMagic, val, decoder, _inner_offset, depth)?;
} else {
unreachable!()
}
}
3 => {
#[allow(irrefutable_let_patterns)]
if let ParseError::BlockNumberOutOfBounds(_) = self {
} else {
*self = ParseError::BlockNumberOutOfBounds(fidl::new_empty!(
BlockNumberOutOfBounds
));
}
#[allow(irrefutable_let_patterns)]
if let ParseError::BlockNumberOutOfBounds(ref mut val) = self {
fidl::decode!(BlockNumberOutOfBounds, val, decoder, _inner_offset, depth)?;
} else {
unreachable!()
}
}
4 => {
#[allow(irrefutable_let_patterns)]
if let ParseError::BlockSizeInvalid(_) = self {
} else {
*self = ParseError::BlockSizeInvalid(fidl::new_empty!(BlockSizeInvalid));
}
#[allow(irrefutable_let_patterns)]
if let ParseError::BlockSizeInvalid(ref mut val) = self {
fidl::decode!(BlockSizeInvalid, val, decoder, _inner_offset, depth)?;
} else {
unreachable!()
}
}
5 => {
#[allow(irrefutable_let_patterns)]
if let ParseError::InvalidBlockGroupDesc(_) = self {
} else {
*self = ParseError::InvalidBlockGroupDesc(fidl::new_empty!(
InvalidBlockGroupDesc
));
}
#[allow(irrefutable_let_patterns)]
if let ParseError::InvalidBlockGroupDesc(ref mut val) = self {
fidl::decode!(InvalidBlockGroupDesc, val, decoder, _inner_offset, depth)?;
} else {
unreachable!()
}
}
6 => {
#[allow(irrefutable_let_patterns)]
if let ParseError::InvalidInode(_) = self {
} else {
*self = ParseError::InvalidInode(fidl::new_empty!(InvalidINode));
}
#[allow(irrefutable_let_patterns)]
if let ParseError::InvalidInode(ref mut val) = self {
fidl::decode!(InvalidINode, val, decoder, _inner_offset, depth)?;
} else {
unreachable!()
}
}
7 => {
#[allow(irrefutable_let_patterns)]
if let ParseError::InvalidExtentHeader(_) = self {
} else {
*self =
ParseError::InvalidExtentHeader(fidl::new_empty!(InvalidExtentHeader));
}
#[allow(irrefutable_let_patterns)]
if let ParseError::InvalidExtentHeader(ref mut val) = self {
fidl::decode!(InvalidExtentHeader, val, decoder, _inner_offset, depth)?;
} else {
unreachable!()
}
}
8 => {
#[allow(irrefutable_let_patterns)]
if let ParseError::InvalidExtentHeaderMagic(_) = self {
} else {
*self = ParseError::InvalidExtentHeaderMagic(fidl::new_empty!(
InvalidExtentHeaderMagic
));
}
#[allow(irrefutable_let_patterns)]
if let ParseError::InvalidExtentHeaderMagic(ref mut val) = self {
fidl::decode!(
InvalidExtentHeaderMagic,
val,
decoder,
_inner_offset,
depth
)?;
} else {
unreachable!()
}
}
9 => {
#[allow(irrefutable_let_patterns)]
if let ParseError::InvalidExtent(_) = self {
} else {
*self = ParseError::InvalidExtent(fidl::new_empty!(InvalidExtent));
}
#[allow(irrefutable_let_patterns)]
if let ParseError::InvalidExtent(ref mut val) = self {
fidl::decode!(InvalidExtent, val, decoder, _inner_offset, depth)?;
} else {
unreachable!()
}
}
10 => {
#[allow(irrefutable_let_patterns)]
if let ParseError::ExtentUnexpectedLength(_) = self {
} else {
*self = ParseError::ExtentUnexpectedLength(fidl::new_empty!(
ExtentUnexpectedLength
));
}
#[allow(irrefutable_let_patterns)]
if let ParseError::ExtentUnexpectedLength(ref mut val) = self {
fidl::decode!(ExtentUnexpectedLength, val, decoder, _inner_offset, depth)?;
} else {
unreachable!()
}
}
11 => {
#[allow(irrefutable_let_patterns)]
if let ParseError::InvalidDirEntry2(_) = self {
} else {
*self = ParseError::InvalidDirEntry2(fidl::new_empty!(InvalidDirEntry2));
}
#[allow(irrefutable_let_patterns)]
if let ParseError::InvalidDirEntry2(ref mut val) = self {
fidl::decode!(InvalidDirEntry2, val, decoder, _inner_offset, depth)?;
} else {
unreachable!()
}
}
12 => {
#[allow(irrefutable_let_patterns)]
if let ParseError::DirEntry2NonUtf8(_) = self {
} else {
*self = ParseError::DirEntry2NonUtf8(fidl::new_empty!(DirEntry2NonUtf8));
}
#[allow(irrefutable_let_patterns)]
if let ParseError::DirEntry2NonUtf8(ref mut val) = self {
fidl::decode!(DirEntry2NonUtf8, val, decoder, _inner_offset, depth)?;
} else {
unreachable!()
}
}
13 => {
#[allow(irrefutable_let_patterns)]
if let ParseError::InvalidInputPath(_) = self {
} else {
*self = ParseError::InvalidInputPath(fidl::new_empty!(InvalidInputPath));
}
#[allow(irrefutable_let_patterns)]
if let ParseError::InvalidInputPath(ref mut val) = self {
fidl::decode!(InvalidInputPath, val, decoder, _inner_offset, depth)?;
} else {
unreachable!()
}
}
14 => {
#[allow(irrefutable_let_patterns)]
if let ParseError::PathNotFound(_) = self {
} else {
*self = ParseError::PathNotFound(fidl::new_empty!(PathNotFound));
}
#[allow(irrefutable_let_patterns)]
if let ParseError::PathNotFound(ref mut val) = self {
fidl::decode!(PathNotFound, val, decoder, _inner_offset, depth)?;
} else {
unreachable!()
}
}
15 => {
#[allow(irrefutable_let_patterns)]
if let ParseError::BadEntryType(_) = self {
} else {
*self = ParseError::BadEntryType(fidl::new_empty!(BadEntryType));
}
#[allow(irrefutable_let_patterns)]
if let ParseError::BadEntryType(ref mut val) = self {
fidl::decode!(BadEntryType, val, decoder, _inner_offset, depth)?;
} else {
unreachable!()
}
}
16 => {
#[allow(irrefutable_let_patterns)]
if let ParseError::Incompatible(_) = self {
} else {
*self = ParseError::Incompatible(fidl::new_empty!(Incompatible));
}
#[allow(irrefutable_let_patterns)]
if let ParseError::Incompatible(ref mut val) = self {
fidl::decode!(Incompatible, val, decoder, _inner_offset, depth)?;
} else {
unreachable!()
}
}
17 => {
#[allow(irrefutable_let_patterns)]
if let ParseError::BadFile(_) = self {
} else {
*self = ParseError::BadFile(fidl::new_empty!(BadFile));
}
#[allow(irrefutable_let_patterns)]
if let ParseError::BadFile(ref mut val) = self {
fidl::decode!(BadFile, val, decoder, _inner_offset, depth)?;
} else {
unreachable!()
}
}
18 => {
#[allow(irrefutable_let_patterns)]
if let ParseError::BadDirectory(_) = self {
} else {
*self = ParseError::BadDirectory(fidl::new_empty!(BadDirectory));
}
#[allow(irrefutable_let_patterns)]
if let ParseError::BadDirectory(ref mut val) = self {
fidl::decode!(BadDirectory, val, decoder, _inner_offset, depth)?;
} else {
unreachable!()
}
}
19 => {
#[allow(irrefutable_let_patterns)]
if let ParseError::ReaderReadError(_) = self {
} else {
*self = ParseError::ReaderReadError(fidl::new_empty!(ReaderReadError));
}
#[allow(irrefutable_let_patterns)]
if let ParseError::ReaderReadError(ref mut val) = self {
fidl::decode!(ReaderReadError, val, decoder, _inner_offset, depth)?;
} else {
unreachable!()
}
}
20 => {
#[allow(irrefutable_let_patterns)]
if let ParseError::ReaderOutOfBounds(_) = self {
} else {
*self = ParseError::ReaderOutOfBounds(fidl::new_empty!(ReaderOutOfBounds));
}
#[allow(irrefutable_let_patterns)]
if let ParseError::ReaderOutOfBounds(ref mut val) = self {
fidl::decode!(ReaderOutOfBounds, val, decoder, _inner_offset, depth)?;
} else {
unreachable!()
}
}
21 => {
#[allow(irrefutable_let_patterns)]
if let ParseError::RequiredFeatureIncompat(_) = self {
} else {
*self = ParseError::RequiredFeatureIncompat(fidl::new_empty!(
RequiredFeatureIncompat
));
}
#[allow(irrefutable_let_patterns)]
if let ParseError::RequiredFeatureIncompat(ref mut val) = self {
fidl::decode!(RequiredFeatureIncompat, val, decoder, _inner_offset, depth)?;
} else {
unreachable!()
}
}
22 => {
#[allow(irrefutable_let_patterns)]
if let ParseError::BannedFeatureIncompat(_) = self {
} else {
*self = ParseError::BannedFeatureIncompat(fidl::new_empty!(
BannedFeatureIncompat
));
}
#[allow(irrefutable_let_patterns)]
if let ParseError::BannedFeatureIncompat(ref mut val) = self {
fidl::decode!(BannedFeatureIncompat, val, decoder, _inner_offset, depth)?;
} else {
unreachable!()
}
}
23 => {
#[allow(irrefutable_let_patterns)]
if let ParseError::InvalidAddress(_) = self {
} else {
*self = ParseError::InvalidAddress(fidl::new_empty!(InvalidAddress));
}
#[allow(irrefutable_let_patterns)]
if let ParseError::InvalidAddress(ref mut val) = self {
fidl::decode!(InvalidAddress, val, decoder, _inner_offset, depth)?;
} else {
unreachable!()
}
}
#[allow(deprecated)]
ordinal => {
for _ in 0..num_handles {
decoder.drop_next_handle()?;
}
*self = ParseError::__Unknown { 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(())
}
}
}