1#![warn(clippy::all)]
4#![allow(unused_parens, unused_mut, unused_imports, nonstandard_style)]
5
6use bitflags::bitflags;
7use fidl::encoding::{MessageBufFor, ProxyChannelBox, ResourceDialect};
8use futures::future::{self, MaybeDone, TryFutureExt};
9use zx_status;
10
11#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
12#[repr(C)]
13pub struct CpuSet {
14 pub mask: [u64; 8],
15}
16
17impl fidl::Persistable for CpuSet {}
18
19#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
20#[repr(C)]
21pub struct ProfileProviderGetCpuAffinityProfileRequest {
22 pub cpu_mask: CpuSet,
23}
24
25impl fidl::Persistable for ProfileProviderGetCpuAffinityProfileRequest {}
26
27#[derive(Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
28pub struct ProfileProviderGetDeadlineProfileRequest {
29 pub capacity: u64,
30 pub deadline: u64,
31 pub period: u64,
32 pub name: String,
33}
34
35impl fidl::Persistable for ProfileProviderGetDeadlineProfileRequest {}
36
37#[derive(Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
38pub struct ProfileProviderGetProfileRequest {
39 pub priority: u32,
40 pub name: String,
41}
42
43impl fidl::Persistable for ProfileProviderGetProfileRequest {}
44
45#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
46#[repr(C)]
47pub struct ProfileProviderSetProfileByRoleResponse {
48 pub status: i32,
49}
50
51impl fidl::Persistable for ProfileProviderSetProfileByRoleResponse {}
52
53mod internal {
54 use super::*;
55
56 impl fidl::encoding::ValueTypeMarker for CpuSet {
57 type Borrowed<'a> = &'a Self;
58 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
59 value
60 }
61 }
62
63 unsafe impl fidl::encoding::TypeMarker for CpuSet {
64 type Owned = Self;
65
66 #[inline(always)]
67 fn inline_align(_context: fidl::encoding::Context) -> usize {
68 8
69 }
70
71 #[inline(always)]
72 fn inline_size(_context: fidl::encoding::Context) -> usize {
73 64
74 }
75 #[inline(always)]
76 fn encode_is_copy() -> bool {
77 true
78 }
79
80 #[inline(always)]
81 fn decode_is_copy() -> bool {
82 true
83 }
84 }
85
86 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<CpuSet, D> for &CpuSet {
87 #[inline]
88 unsafe fn encode(
89 self,
90 encoder: &mut fidl::encoding::Encoder<'_, D>,
91 offset: usize,
92 _depth: fidl::encoding::Depth,
93 ) -> fidl::Result<()> {
94 encoder.debug_check_bounds::<CpuSet>(offset);
95 unsafe {
96 let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
98 (buf_ptr as *mut CpuSet).write_unaligned((self as *const CpuSet).read());
99 }
102 Ok(())
103 }
104 }
105 unsafe impl<
106 D: fidl::encoding::ResourceDialect,
107 T0: fidl::encoding::Encode<fidl::encoding::Array<u64, 8>, D>,
108 > fidl::encoding::Encode<CpuSet, D> for (T0,)
109 {
110 #[inline]
111 unsafe fn encode(
112 self,
113 encoder: &mut fidl::encoding::Encoder<'_, D>,
114 offset: usize,
115 depth: fidl::encoding::Depth,
116 ) -> fidl::Result<()> {
117 encoder.debug_check_bounds::<CpuSet>(offset);
118 self.0.encode(encoder, offset + 0, depth)?;
122 Ok(())
123 }
124 }
125
126 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for CpuSet {
127 #[inline(always)]
128 fn new_empty() -> Self {
129 Self { mask: fidl::new_empty!(fidl::encoding::Array<u64, 8>, D) }
130 }
131
132 #[inline]
133 unsafe fn decode(
134 &mut self,
135 decoder: &mut fidl::encoding::Decoder<'_, D>,
136 offset: usize,
137 _depth: fidl::encoding::Depth,
138 ) -> fidl::Result<()> {
139 decoder.debug_check_bounds::<Self>(offset);
140 let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
141 unsafe {
144 std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 64);
145 }
146 Ok(())
147 }
148 }
149
150 impl fidl::encoding::ValueTypeMarker for ProfileProviderGetCpuAffinityProfileRequest {
151 type Borrowed<'a> = &'a Self;
152 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
153 value
154 }
155 }
156
157 unsafe impl fidl::encoding::TypeMarker for ProfileProviderGetCpuAffinityProfileRequest {
158 type Owned = Self;
159
160 #[inline(always)]
161 fn inline_align(_context: fidl::encoding::Context) -> usize {
162 8
163 }
164
165 #[inline(always)]
166 fn inline_size(_context: fidl::encoding::Context) -> usize {
167 64
168 }
169 #[inline(always)]
170 fn encode_is_copy() -> bool {
171 true
172 }
173
174 #[inline(always)]
175 fn decode_is_copy() -> bool {
176 true
177 }
178 }
179
180 unsafe impl<D: fidl::encoding::ResourceDialect>
181 fidl::encoding::Encode<ProfileProviderGetCpuAffinityProfileRequest, D>
182 for &ProfileProviderGetCpuAffinityProfileRequest
183 {
184 #[inline]
185 unsafe fn encode(
186 self,
187 encoder: &mut fidl::encoding::Encoder<'_, D>,
188 offset: usize,
189 _depth: fidl::encoding::Depth,
190 ) -> fidl::Result<()> {
191 encoder.debug_check_bounds::<ProfileProviderGetCpuAffinityProfileRequest>(offset);
192 unsafe {
193 let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
195 (buf_ptr as *mut ProfileProviderGetCpuAffinityProfileRequest).write_unaligned(
196 (self as *const ProfileProviderGetCpuAffinityProfileRequest).read(),
197 );
198 }
201 Ok(())
202 }
203 }
204 unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<CpuSet, D>>
205 fidl::encoding::Encode<ProfileProviderGetCpuAffinityProfileRequest, D> for (T0,)
206 {
207 #[inline]
208 unsafe fn encode(
209 self,
210 encoder: &mut fidl::encoding::Encoder<'_, D>,
211 offset: usize,
212 depth: fidl::encoding::Depth,
213 ) -> fidl::Result<()> {
214 encoder.debug_check_bounds::<ProfileProviderGetCpuAffinityProfileRequest>(offset);
215 self.0.encode(encoder, offset + 0, depth)?;
219 Ok(())
220 }
221 }
222
223 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
224 for ProfileProviderGetCpuAffinityProfileRequest
225 {
226 #[inline(always)]
227 fn new_empty() -> Self {
228 Self { cpu_mask: fidl::new_empty!(CpuSet, D) }
229 }
230
231 #[inline]
232 unsafe fn decode(
233 &mut self,
234 decoder: &mut fidl::encoding::Decoder<'_, D>,
235 offset: usize,
236 _depth: fidl::encoding::Depth,
237 ) -> fidl::Result<()> {
238 decoder.debug_check_bounds::<Self>(offset);
239 let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
240 unsafe {
243 std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 64);
244 }
245 Ok(())
246 }
247 }
248
249 impl fidl::encoding::ValueTypeMarker for ProfileProviderGetDeadlineProfileRequest {
250 type Borrowed<'a> = &'a Self;
251 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
252 value
253 }
254 }
255
256 unsafe impl fidl::encoding::TypeMarker for ProfileProviderGetDeadlineProfileRequest {
257 type Owned = Self;
258
259 #[inline(always)]
260 fn inline_align(_context: fidl::encoding::Context) -> usize {
261 8
262 }
263
264 #[inline(always)]
265 fn inline_size(_context: fidl::encoding::Context) -> usize {
266 40
267 }
268 }
269
270 unsafe impl<D: fidl::encoding::ResourceDialect>
271 fidl::encoding::Encode<ProfileProviderGetDeadlineProfileRequest, D>
272 for &ProfileProviderGetDeadlineProfileRequest
273 {
274 #[inline]
275 unsafe fn encode(
276 self,
277 encoder: &mut fidl::encoding::Encoder<'_, D>,
278 offset: usize,
279 _depth: fidl::encoding::Depth,
280 ) -> fidl::Result<()> {
281 encoder.debug_check_bounds::<ProfileProviderGetDeadlineProfileRequest>(offset);
282 fidl::encoding::Encode::<ProfileProviderGetDeadlineProfileRequest, D>::encode(
284 (
285 <u64 as fidl::encoding::ValueTypeMarker>::borrow(&self.capacity),
286 <u64 as fidl::encoding::ValueTypeMarker>::borrow(&self.deadline),
287 <u64 as fidl::encoding::ValueTypeMarker>::borrow(&self.period),
288 <fidl::encoding::BoundedString<64> as fidl::encoding::ValueTypeMarker>::borrow(
289 &self.name,
290 ),
291 ),
292 encoder,
293 offset,
294 _depth,
295 )
296 }
297 }
298 unsafe impl<
299 D: fidl::encoding::ResourceDialect,
300 T0: fidl::encoding::Encode<u64, D>,
301 T1: fidl::encoding::Encode<u64, D>,
302 T2: fidl::encoding::Encode<u64, D>,
303 T3: fidl::encoding::Encode<fidl::encoding::BoundedString<64>, D>,
304 > fidl::encoding::Encode<ProfileProviderGetDeadlineProfileRequest, D> for (T0, T1, T2, T3)
305 {
306 #[inline]
307 unsafe fn encode(
308 self,
309 encoder: &mut fidl::encoding::Encoder<'_, D>,
310 offset: usize,
311 depth: fidl::encoding::Depth,
312 ) -> fidl::Result<()> {
313 encoder.debug_check_bounds::<ProfileProviderGetDeadlineProfileRequest>(offset);
314 self.0.encode(encoder, offset + 0, depth)?;
318 self.1.encode(encoder, offset + 8, depth)?;
319 self.2.encode(encoder, offset + 16, depth)?;
320 self.3.encode(encoder, offset + 24, depth)?;
321 Ok(())
322 }
323 }
324
325 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
326 for ProfileProviderGetDeadlineProfileRequest
327 {
328 #[inline(always)]
329 fn new_empty() -> Self {
330 Self {
331 capacity: fidl::new_empty!(u64, D),
332 deadline: fidl::new_empty!(u64, D),
333 period: fidl::new_empty!(u64, D),
334 name: fidl::new_empty!(fidl::encoding::BoundedString<64>, D),
335 }
336 }
337
338 #[inline]
339 unsafe fn decode(
340 &mut self,
341 decoder: &mut fidl::encoding::Decoder<'_, D>,
342 offset: usize,
343 _depth: fidl::encoding::Depth,
344 ) -> fidl::Result<()> {
345 decoder.debug_check_bounds::<Self>(offset);
346 fidl::decode!(u64, D, &mut self.capacity, decoder, offset + 0, _depth)?;
348 fidl::decode!(u64, D, &mut self.deadline, decoder, offset + 8, _depth)?;
349 fidl::decode!(u64, D, &mut self.period, decoder, offset + 16, _depth)?;
350 fidl::decode!(
351 fidl::encoding::BoundedString<64>,
352 D,
353 &mut self.name,
354 decoder,
355 offset + 24,
356 _depth
357 )?;
358 Ok(())
359 }
360 }
361
362 impl fidl::encoding::ValueTypeMarker for ProfileProviderGetProfileRequest {
363 type Borrowed<'a> = &'a Self;
364 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
365 value
366 }
367 }
368
369 unsafe impl fidl::encoding::TypeMarker for ProfileProviderGetProfileRequest {
370 type Owned = Self;
371
372 #[inline(always)]
373 fn inline_align(_context: fidl::encoding::Context) -> usize {
374 8
375 }
376
377 #[inline(always)]
378 fn inline_size(_context: fidl::encoding::Context) -> usize {
379 24
380 }
381 }
382
383 unsafe impl<D: fidl::encoding::ResourceDialect>
384 fidl::encoding::Encode<ProfileProviderGetProfileRequest, D>
385 for &ProfileProviderGetProfileRequest
386 {
387 #[inline]
388 unsafe fn encode(
389 self,
390 encoder: &mut fidl::encoding::Encoder<'_, D>,
391 offset: usize,
392 _depth: fidl::encoding::Depth,
393 ) -> fidl::Result<()> {
394 encoder.debug_check_bounds::<ProfileProviderGetProfileRequest>(offset);
395 fidl::encoding::Encode::<ProfileProviderGetProfileRequest, D>::encode(
397 (
398 <u32 as fidl::encoding::ValueTypeMarker>::borrow(&self.priority),
399 <fidl::encoding::BoundedString<64> as fidl::encoding::ValueTypeMarker>::borrow(
400 &self.name,
401 ),
402 ),
403 encoder,
404 offset,
405 _depth,
406 )
407 }
408 }
409 unsafe impl<
410 D: fidl::encoding::ResourceDialect,
411 T0: fidl::encoding::Encode<u32, D>,
412 T1: fidl::encoding::Encode<fidl::encoding::BoundedString<64>, D>,
413 > fidl::encoding::Encode<ProfileProviderGetProfileRequest, D> for (T0, T1)
414 {
415 #[inline]
416 unsafe fn encode(
417 self,
418 encoder: &mut fidl::encoding::Encoder<'_, D>,
419 offset: usize,
420 depth: fidl::encoding::Depth,
421 ) -> fidl::Result<()> {
422 encoder.debug_check_bounds::<ProfileProviderGetProfileRequest>(offset);
423 unsafe {
426 let ptr = encoder.buf.as_mut_ptr().add(offset).offset(0);
427 (ptr as *mut u64).write_unaligned(0);
428 }
429 self.0.encode(encoder, offset + 0, depth)?;
431 self.1.encode(encoder, offset + 8, depth)?;
432 Ok(())
433 }
434 }
435
436 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
437 for ProfileProviderGetProfileRequest
438 {
439 #[inline(always)]
440 fn new_empty() -> Self {
441 Self {
442 priority: fidl::new_empty!(u32, D),
443 name: fidl::new_empty!(fidl::encoding::BoundedString<64>, D),
444 }
445 }
446
447 #[inline]
448 unsafe fn decode(
449 &mut self,
450 decoder: &mut fidl::encoding::Decoder<'_, D>,
451 offset: usize,
452 _depth: fidl::encoding::Depth,
453 ) -> fidl::Result<()> {
454 decoder.debug_check_bounds::<Self>(offset);
455 let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(0) };
457 let padval = unsafe { (ptr as *const u64).read_unaligned() };
458 let mask = 0xffffffff00000000u64;
459 let maskedval = padval & mask;
460 if maskedval != 0 {
461 return Err(fidl::Error::NonZeroPadding {
462 padding_start: offset + 0 + ((mask as u64).trailing_zeros() / 8) as usize,
463 });
464 }
465 fidl::decode!(u32, D, &mut self.priority, decoder, offset + 0, _depth)?;
466 fidl::decode!(
467 fidl::encoding::BoundedString<64>,
468 D,
469 &mut self.name,
470 decoder,
471 offset + 8,
472 _depth
473 )?;
474 Ok(())
475 }
476 }
477
478 impl fidl::encoding::ValueTypeMarker for ProfileProviderSetProfileByRoleResponse {
479 type Borrowed<'a> = &'a Self;
480 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
481 value
482 }
483 }
484
485 unsafe impl fidl::encoding::TypeMarker for ProfileProviderSetProfileByRoleResponse {
486 type Owned = Self;
487
488 #[inline(always)]
489 fn inline_align(_context: fidl::encoding::Context) -> usize {
490 4
491 }
492
493 #[inline(always)]
494 fn inline_size(_context: fidl::encoding::Context) -> usize {
495 4
496 }
497 #[inline(always)]
498 fn encode_is_copy() -> bool {
499 true
500 }
501
502 #[inline(always)]
503 fn decode_is_copy() -> bool {
504 true
505 }
506 }
507
508 unsafe impl<D: fidl::encoding::ResourceDialect>
509 fidl::encoding::Encode<ProfileProviderSetProfileByRoleResponse, D>
510 for &ProfileProviderSetProfileByRoleResponse
511 {
512 #[inline]
513 unsafe fn encode(
514 self,
515 encoder: &mut fidl::encoding::Encoder<'_, D>,
516 offset: usize,
517 _depth: fidl::encoding::Depth,
518 ) -> fidl::Result<()> {
519 encoder.debug_check_bounds::<ProfileProviderSetProfileByRoleResponse>(offset);
520 unsafe {
521 let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
523 (buf_ptr as *mut ProfileProviderSetProfileByRoleResponse).write_unaligned(
524 (self as *const ProfileProviderSetProfileByRoleResponse).read(),
525 );
526 }
529 Ok(())
530 }
531 }
532 unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<i32, D>>
533 fidl::encoding::Encode<ProfileProviderSetProfileByRoleResponse, D> for (T0,)
534 {
535 #[inline]
536 unsafe fn encode(
537 self,
538 encoder: &mut fidl::encoding::Encoder<'_, D>,
539 offset: usize,
540 depth: fidl::encoding::Depth,
541 ) -> fidl::Result<()> {
542 encoder.debug_check_bounds::<ProfileProviderSetProfileByRoleResponse>(offset);
543 self.0.encode(encoder, offset + 0, depth)?;
547 Ok(())
548 }
549 }
550
551 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
552 for ProfileProviderSetProfileByRoleResponse
553 {
554 #[inline(always)]
555 fn new_empty() -> Self {
556 Self { status: fidl::new_empty!(i32, D) }
557 }
558
559 #[inline]
560 unsafe fn decode(
561 &mut self,
562 decoder: &mut fidl::encoding::Decoder<'_, D>,
563 offset: usize,
564 _depth: fidl::encoding::Depth,
565 ) -> fidl::Result<()> {
566 decoder.debug_check_bounds::<Self>(offset);
567 let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
568 unsafe {
571 std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 4);
572 }
573 Ok(())
574 }
575 }
576}