#![warn(clippy::all)]
#![allow(unused_parens, unused_mut, unused_imports, nonstandard_style)]
use bitflags::bitflags;
use fidl::client::QueryResponseFut;
use fidl::encoding::{MessageBufFor, ProxyChannelBox, ResourceDialect};
use fidl::endpoints::{ControlHandle as _, Responder as _};
use futures::future::{self, MaybeDone, TryFutureExt};
use zx_status;
pub const EDEADLOCK: Errno = Errno::Edeadlk;
pub const ENOTSUP: Errno = Errno::Eopnotsupp;
pub const EWOULDBLOCK: Errno = Errno::Eagain;
#[derive(Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd, Hash)]
#[repr(i32)]
pub enum Errno {
Eperm = 1,
Enoent = 2,
Esrch = 3,
Eintr = 4,
Eio = 5,
Enxio = 6,
E2Big = 7,
Enoexec = 8,
Ebadf = 9,
Echild = 10,
Eagain = 11,
Enomem = 12,
Eacces = 13,
Efault = 14,
Enotblk = 15,
Ebusy = 16,
Eexist = 17,
Exdev = 18,
Enodev = 19,
Enotdir = 20,
Eisdir = 21,
Einval = 22,
Enfile = 23,
Emfile = 24,
Enotty = 25,
Etxtbsy = 26,
Efbig = 27,
Enospc = 28,
Espipe = 29,
Erofs = 30,
Emlink = 31,
Epipe = 32,
Edom = 33,
Erange = 34,
Edeadlk = 35,
Enametoolong = 36,
Enolck = 37,
Enosys = 38,
Enotempty = 39,
Eloop = 40,
Enomsg = 42,
Eidrm = 43,
Echrng = 44,
El2Nsync = 45,
El3Hlt = 46,
El3Rst = 47,
Elnrng = 48,
Eunatch = 49,
Enocsi = 50,
El2Hlt = 51,
Ebade = 52,
Ebadr = 53,
Exfull = 54,
Enoano = 55,
Ebadrqc = 56,
Ebadslt = 57,
Ebfont = 59,
Enostr = 60,
Enodata = 61,
Etime = 62,
Enosr = 63,
Enonet = 64,
Enopkg = 65,
Eremote = 66,
Enolink = 67,
Eadv = 68,
Esrmnt = 69,
Ecomm = 70,
Eproto = 71,
Emultihop = 72,
Edotdot = 73,
Ebadmsg = 74,
Eoverflow = 75,
Enotuniq = 76,
Ebadfd = 77,
Eremchg = 78,
Elibacc = 79,
Elibbad = 80,
Elibscn = 81,
Elibmax = 82,
Elibexec = 83,
Eilseq = 84,
Erestart = 85,
Estrpipe = 86,
Eusers = 87,
Enotsock = 88,
Edestaddrreq = 89,
Emsgsize = 90,
Eprototype = 91,
Enoprotoopt = 92,
Eprotonosupport = 93,
Esocktnosupport = 94,
Eopnotsupp = 95,
Epfnosupport = 96,
Eafnosupport = 97,
Eaddrinuse = 98,
Eaddrnotavail = 99,
Enetdown = 100,
Enetunreach = 101,
Enetreset = 102,
Econnaborted = 103,
Econnreset = 104,
Enobufs = 105,
Eisconn = 106,
Enotconn = 107,
Eshutdown = 108,
Etoomanyrefs = 109,
Etimedout = 110,
Econnrefused = 111,
Ehostdown = 112,
Ehostunreach = 113,
Ealready = 114,
Einprogress = 115,
Estale = 116,
Euclean = 117,
Enotnam = 118,
Enavail = 119,
Eisnam = 120,
Eremoteio = 121,
Edquot = 122,
Enomedium = 123,
Emediumtype = 124,
Ecanceled = 125,
Enokey = 126,
Ekeyexpired = 127,
Ekeyrevoked = 128,
Ekeyrejected = 129,
Eownerdead = 130,
Enotrecoverable = 131,
Erfkill = 132,
Ehwpoison = 133,
}
impl Errno {
#[inline]
pub fn from_primitive(prim: i32) -> Option<Self> {
match prim {
1 => Some(Self::Eperm),
2 => Some(Self::Enoent),
3 => Some(Self::Esrch),
4 => Some(Self::Eintr),
5 => Some(Self::Eio),
6 => Some(Self::Enxio),
7 => Some(Self::E2Big),
8 => Some(Self::Enoexec),
9 => Some(Self::Ebadf),
10 => Some(Self::Echild),
11 => Some(Self::Eagain),
12 => Some(Self::Enomem),
13 => Some(Self::Eacces),
14 => Some(Self::Efault),
15 => Some(Self::Enotblk),
16 => Some(Self::Ebusy),
17 => Some(Self::Eexist),
18 => Some(Self::Exdev),
19 => Some(Self::Enodev),
20 => Some(Self::Enotdir),
21 => Some(Self::Eisdir),
22 => Some(Self::Einval),
23 => Some(Self::Enfile),
24 => Some(Self::Emfile),
25 => Some(Self::Enotty),
26 => Some(Self::Etxtbsy),
27 => Some(Self::Efbig),
28 => Some(Self::Enospc),
29 => Some(Self::Espipe),
30 => Some(Self::Erofs),
31 => Some(Self::Emlink),
32 => Some(Self::Epipe),
33 => Some(Self::Edom),
34 => Some(Self::Erange),
35 => Some(Self::Edeadlk),
36 => Some(Self::Enametoolong),
37 => Some(Self::Enolck),
38 => Some(Self::Enosys),
39 => Some(Self::Enotempty),
40 => Some(Self::Eloop),
42 => Some(Self::Enomsg),
43 => Some(Self::Eidrm),
44 => Some(Self::Echrng),
45 => Some(Self::El2Nsync),
46 => Some(Self::El3Hlt),
47 => Some(Self::El3Rst),
48 => Some(Self::Elnrng),
49 => Some(Self::Eunatch),
50 => Some(Self::Enocsi),
51 => Some(Self::El2Hlt),
52 => Some(Self::Ebade),
53 => Some(Self::Ebadr),
54 => Some(Self::Exfull),
55 => Some(Self::Enoano),
56 => Some(Self::Ebadrqc),
57 => Some(Self::Ebadslt),
59 => Some(Self::Ebfont),
60 => Some(Self::Enostr),
61 => Some(Self::Enodata),
62 => Some(Self::Etime),
63 => Some(Self::Enosr),
64 => Some(Self::Enonet),
65 => Some(Self::Enopkg),
66 => Some(Self::Eremote),
67 => Some(Self::Enolink),
68 => Some(Self::Eadv),
69 => Some(Self::Esrmnt),
70 => Some(Self::Ecomm),
71 => Some(Self::Eproto),
72 => Some(Self::Emultihop),
73 => Some(Self::Edotdot),
74 => Some(Self::Ebadmsg),
75 => Some(Self::Eoverflow),
76 => Some(Self::Enotuniq),
77 => Some(Self::Ebadfd),
78 => Some(Self::Eremchg),
79 => Some(Self::Elibacc),
80 => Some(Self::Elibbad),
81 => Some(Self::Elibscn),
82 => Some(Self::Elibmax),
83 => Some(Self::Elibexec),
84 => Some(Self::Eilseq),
85 => Some(Self::Erestart),
86 => Some(Self::Estrpipe),
87 => Some(Self::Eusers),
88 => Some(Self::Enotsock),
89 => Some(Self::Edestaddrreq),
90 => Some(Self::Emsgsize),
91 => Some(Self::Eprototype),
92 => Some(Self::Enoprotoopt),
93 => Some(Self::Eprotonosupport),
94 => Some(Self::Esocktnosupport),
95 => Some(Self::Eopnotsupp),
96 => Some(Self::Epfnosupport),
97 => Some(Self::Eafnosupport),
98 => Some(Self::Eaddrinuse),
99 => Some(Self::Eaddrnotavail),
100 => Some(Self::Enetdown),
101 => Some(Self::Enetunreach),
102 => Some(Self::Enetreset),
103 => Some(Self::Econnaborted),
104 => Some(Self::Econnreset),
105 => Some(Self::Enobufs),
106 => Some(Self::Eisconn),
107 => Some(Self::Enotconn),
108 => Some(Self::Eshutdown),
109 => Some(Self::Etoomanyrefs),
110 => Some(Self::Etimedout),
111 => Some(Self::Econnrefused),
112 => Some(Self::Ehostdown),
113 => Some(Self::Ehostunreach),
114 => Some(Self::Ealready),
115 => Some(Self::Einprogress),
116 => Some(Self::Estale),
117 => Some(Self::Euclean),
118 => Some(Self::Enotnam),
119 => Some(Self::Enavail),
120 => Some(Self::Eisnam),
121 => Some(Self::Eremoteio),
122 => Some(Self::Edquot),
123 => Some(Self::Enomedium),
124 => Some(Self::Emediumtype),
125 => Some(Self::Ecanceled),
126 => Some(Self::Enokey),
127 => Some(Self::Ekeyexpired),
128 => Some(Self::Ekeyrevoked),
129 => Some(Self::Ekeyrejected),
130 => Some(Self::Eownerdead),
131 => Some(Self::Enotrecoverable),
132 => Some(Self::Erfkill),
133 => Some(Self::Ehwpoison),
_ => None,
}
}
#[inline]
pub const fn into_primitive(self) -> i32 {
self as i32
}
#[deprecated = "Strict enums should not use `is_unknown`"]
#[inline]
pub fn is_unknown(&self) -> bool {
false
}
}
mod internal {
use super::*;
unsafe impl fidl::encoding::TypeMarker for Errno {
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
std::mem::align_of::<i32>()
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
std::mem::size_of::<i32>()
}
#[inline(always)]
fn encode_is_copy() -> bool {
true
}
#[inline(always)]
fn decode_is_copy() -> bool {
false
}
}
impl fidl::encoding::ValueTypeMarker for Errno {
type Borrowed<'a> = Self;
#[inline(always)]
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
*value
}
}
unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Self, D> for Errno {
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<Self>(offset);
encoder.write_num(self.into_primitive(), offset);
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for Errno {
#[inline(always)]
fn new_empty() -> Self {
Self::Eperm
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
let prim = decoder.read_num::<i32>(offset);
*self = Self::from_primitive(prim).ok_or(fidl::Error::InvalidEnumValue)?;
Ok(())
}
}
}