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, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
17pub struct ExecutableFile {
18 pub name: String,
19}
20
21impl fidl::Persistable for ExecutableFile {}
22
23#[derive(Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
26pub struct File {
27 pub name: String,
28 pub contents: Vec<u8>,
29}
30
31impl fidl::Persistable for File {}
32
33#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
57pub struct HarnessConfig {
58 pub supports_executable_file: bool,
60 pub supports_mutable_file: bool,
62 pub supports_get_backing_memory: bool,
64 pub supports_remote_dir: bool,
66 pub supports_get_token: bool,
68 pub supports_link_into: bool,
70 pub supports_append: bool,
72 pub supports_truncate: bool,
74 pub supported_attributes: fidl_fuchsia_io__common::NodeAttributesQuery,
77 pub supports_modify_directory: bool,
79 pub supports_services: bool,
81 pub supports_unnamed_temporary_file: bool,
83}
84
85impl fidl::Persistable for HarnessConfig {}
86
87#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
88pub struct TestHarnessGetConfigResponse {
89 pub config: HarnessConfig,
90}
91
92impl fidl::Persistable for TestHarnessGetConfigResponse {}
93
94pub mod test_harness_ordinals {
95 pub const GET_CONFIG: u64 = 0x758882a165dbaa23;
96 pub const CREATE_DIRECTORY: u64 = 0x626b0ce412a0cb4c;
97 pub const OPEN_SERVICE_DIRECTORY: u64 = 0x42904fe08b12ef88;
98}
99
100mod internal {
101 use super::*;
102
103 impl fidl::encoding::ValueTypeMarker for ExecutableFile {
104 type Borrowed<'a> = &'a Self;
105 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
106 value
107 }
108 }
109
110 unsafe impl fidl::encoding::TypeMarker for ExecutableFile {
111 type Owned = Self;
112
113 #[inline(always)]
114 fn inline_align(_context: fidl::encoding::Context) -> usize {
115 8
116 }
117
118 #[inline(always)]
119 fn inline_size(_context: fidl::encoding::Context) -> usize {
120 16
121 }
122 }
123
124 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<ExecutableFile, D>
125 for &ExecutableFile
126 {
127 #[inline]
128 unsafe fn encode(
129 self,
130 encoder: &mut fidl::encoding::Encoder<'_, D>,
131 offset: usize,
132 _depth: fidl::encoding::Depth,
133 ) -> fidl::Result<()> {
134 encoder.debug_check_bounds::<ExecutableFile>(offset);
135 fidl::encoding::Encode::<ExecutableFile, D>::encode(
137 (<fidl::encoding::BoundedString<255> as fidl::encoding::ValueTypeMarker>::borrow(
138 &self.name,
139 ),),
140 encoder,
141 offset,
142 _depth,
143 )
144 }
145 }
146 unsafe impl<
147 D: fidl::encoding::ResourceDialect,
148 T0: fidl::encoding::Encode<fidl::encoding::BoundedString<255>, D>,
149 > fidl::encoding::Encode<ExecutableFile, D> for (T0,)
150 {
151 #[inline]
152 unsafe fn encode(
153 self,
154 encoder: &mut fidl::encoding::Encoder<'_, D>,
155 offset: usize,
156 depth: fidl::encoding::Depth,
157 ) -> fidl::Result<()> {
158 encoder.debug_check_bounds::<ExecutableFile>(offset);
159 self.0.encode(encoder, offset + 0, depth)?;
163 Ok(())
164 }
165 }
166
167 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for ExecutableFile {
168 #[inline(always)]
169 fn new_empty() -> Self {
170 Self { name: fidl::new_empty!(fidl::encoding::BoundedString<255>, D) }
171 }
172
173 #[inline]
174 unsafe fn decode(
175 &mut self,
176 decoder: &mut fidl::encoding::Decoder<'_, D>,
177 offset: usize,
178 _depth: fidl::encoding::Depth,
179 ) -> fidl::Result<()> {
180 decoder.debug_check_bounds::<Self>(offset);
181 fidl::decode!(
183 fidl::encoding::BoundedString<255>,
184 D,
185 &mut self.name,
186 decoder,
187 offset + 0,
188 _depth
189 )?;
190 Ok(())
191 }
192 }
193
194 impl fidl::encoding::ValueTypeMarker for File {
195 type Borrowed<'a> = &'a Self;
196 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
197 value
198 }
199 }
200
201 unsafe impl fidl::encoding::TypeMarker for File {
202 type Owned = Self;
203
204 #[inline(always)]
205 fn inline_align(_context: fidl::encoding::Context) -> usize {
206 8
207 }
208
209 #[inline(always)]
210 fn inline_size(_context: fidl::encoding::Context) -> usize {
211 32
212 }
213 }
214
215 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<File, D> for &File {
216 #[inline]
217 unsafe fn encode(
218 self,
219 encoder: &mut fidl::encoding::Encoder<'_, D>,
220 offset: usize,
221 _depth: fidl::encoding::Depth,
222 ) -> fidl::Result<()> {
223 encoder.debug_check_bounds::<File>(offset);
224 fidl::encoding::Encode::<File, D>::encode(
226 (
227 <fidl::encoding::BoundedString<255> as fidl::encoding::ValueTypeMarker>::borrow(&self.name),
228 <fidl::encoding::UnboundedVector<u8> as fidl::encoding::ValueTypeMarker>::borrow(&self.contents),
229 ),
230 encoder, offset, _depth
231 )
232 }
233 }
234 unsafe impl<
235 D: fidl::encoding::ResourceDialect,
236 T0: fidl::encoding::Encode<fidl::encoding::BoundedString<255>, D>,
237 T1: fidl::encoding::Encode<fidl::encoding::UnboundedVector<u8>, D>,
238 > fidl::encoding::Encode<File, D> for (T0, T1)
239 {
240 #[inline]
241 unsafe fn encode(
242 self,
243 encoder: &mut fidl::encoding::Encoder<'_, D>,
244 offset: usize,
245 depth: fidl::encoding::Depth,
246 ) -> fidl::Result<()> {
247 encoder.debug_check_bounds::<File>(offset);
248 self.0.encode(encoder, offset + 0, depth)?;
252 self.1.encode(encoder, offset + 16, depth)?;
253 Ok(())
254 }
255 }
256
257 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for File {
258 #[inline(always)]
259 fn new_empty() -> Self {
260 Self {
261 name: fidl::new_empty!(fidl::encoding::BoundedString<255>, D),
262 contents: fidl::new_empty!(fidl::encoding::UnboundedVector<u8>, D),
263 }
264 }
265
266 #[inline]
267 unsafe fn decode(
268 &mut self,
269 decoder: &mut fidl::encoding::Decoder<'_, D>,
270 offset: usize,
271 _depth: fidl::encoding::Depth,
272 ) -> fidl::Result<()> {
273 decoder.debug_check_bounds::<Self>(offset);
274 fidl::decode!(
276 fidl::encoding::BoundedString<255>,
277 D,
278 &mut self.name,
279 decoder,
280 offset + 0,
281 _depth
282 )?;
283 fidl::decode!(
284 fidl::encoding::UnboundedVector<u8>,
285 D,
286 &mut self.contents,
287 decoder,
288 offset + 16,
289 _depth
290 )?;
291 Ok(())
292 }
293 }
294
295 impl fidl::encoding::ValueTypeMarker for HarnessConfig {
296 type Borrowed<'a> = &'a Self;
297 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
298 value
299 }
300 }
301
302 unsafe impl fidl::encoding::TypeMarker for HarnessConfig {
303 type Owned = Self;
304
305 #[inline(always)]
306 fn inline_align(_context: fidl::encoding::Context) -> usize {
307 8
308 }
309
310 #[inline(always)]
311 fn inline_size(_context: fidl::encoding::Context) -> usize {
312 24
313 }
314 }
315
316 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<HarnessConfig, D>
317 for &HarnessConfig
318 {
319 #[inline]
320 unsafe fn encode(
321 self,
322 encoder: &mut fidl::encoding::Encoder<'_, D>,
323 offset: usize,
324 _depth: fidl::encoding::Depth,
325 ) -> fidl::Result<()> {
326 encoder.debug_check_bounds::<HarnessConfig>(offset);
327 fidl::encoding::Encode::<HarnessConfig, D>::encode(
329 (
330 <bool as fidl::encoding::ValueTypeMarker>::borrow(&self.supports_executable_file),
331 <bool as fidl::encoding::ValueTypeMarker>::borrow(&self.supports_mutable_file),
332 <bool as fidl::encoding::ValueTypeMarker>::borrow(&self.supports_get_backing_memory),
333 <bool as fidl::encoding::ValueTypeMarker>::borrow(&self.supports_remote_dir),
334 <bool as fidl::encoding::ValueTypeMarker>::borrow(&self.supports_get_token),
335 <bool as fidl::encoding::ValueTypeMarker>::borrow(&self.supports_link_into),
336 <bool as fidl::encoding::ValueTypeMarker>::borrow(&self.supports_append),
337 <bool as fidl::encoding::ValueTypeMarker>::borrow(&self.supports_truncate),
338 <fidl_fuchsia_io__common::NodeAttributesQuery as fidl::encoding::ValueTypeMarker>::borrow(&self.supported_attributes),
339 <bool as fidl::encoding::ValueTypeMarker>::borrow(&self.supports_modify_directory),
340 <bool as fidl::encoding::ValueTypeMarker>::borrow(&self.supports_services),
341 <bool as fidl::encoding::ValueTypeMarker>::borrow(&self.supports_unnamed_temporary_file),
342 ),
343 encoder, offset, _depth
344 )
345 }
346 }
347 unsafe impl<
348 D: fidl::encoding::ResourceDialect,
349 T0: fidl::encoding::Encode<bool, D>,
350 T1: fidl::encoding::Encode<bool, D>,
351 T2: fidl::encoding::Encode<bool, D>,
352 T3: fidl::encoding::Encode<bool, D>,
353 T4: fidl::encoding::Encode<bool, D>,
354 T5: fidl::encoding::Encode<bool, D>,
355 T6: fidl::encoding::Encode<bool, D>,
356 T7: fidl::encoding::Encode<bool, D>,
357 T8: fidl::encoding::Encode<fidl_fuchsia_io__common::NodeAttributesQuery, D>,
358 T9: fidl::encoding::Encode<bool, D>,
359 T10: fidl::encoding::Encode<bool, D>,
360 T11: fidl::encoding::Encode<bool, D>,
361 > fidl::encoding::Encode<HarnessConfig, D>
362 for (T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11)
363 {
364 #[inline]
365 unsafe fn encode(
366 self,
367 encoder: &mut fidl::encoding::Encoder<'_, D>,
368 offset: usize,
369 depth: fidl::encoding::Depth,
370 ) -> fidl::Result<()> {
371 encoder.debug_check_bounds::<HarnessConfig>(offset);
372 unsafe {
375 let ptr = encoder.buf.as_mut_ptr().add(offset).offset(16);
376 (ptr as *mut u64).write_unaligned(0);
377 }
378 self.0.encode(encoder, offset + 0, depth)?;
380 self.1.encode(encoder, offset + 1, depth)?;
381 self.2.encode(encoder, offset + 2, depth)?;
382 self.3.encode(encoder, offset + 3, depth)?;
383 self.4.encode(encoder, offset + 4, depth)?;
384 self.5.encode(encoder, offset + 5, depth)?;
385 self.6.encode(encoder, offset + 6, depth)?;
386 self.7.encode(encoder, offset + 7, depth)?;
387 self.8.encode(encoder, offset + 8, depth)?;
388 self.9.encode(encoder, offset + 16, depth)?;
389 self.10.encode(encoder, offset + 17, depth)?;
390 self.11.encode(encoder, offset + 18, depth)?;
391 Ok(())
392 }
393 }
394
395 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for HarnessConfig {
396 #[inline(always)]
397 fn new_empty() -> Self {
398 Self {
399 supports_executable_file: fidl::new_empty!(bool, D),
400 supports_mutable_file: fidl::new_empty!(bool, D),
401 supports_get_backing_memory: fidl::new_empty!(bool, D),
402 supports_remote_dir: fidl::new_empty!(bool, D),
403 supports_get_token: fidl::new_empty!(bool, D),
404 supports_link_into: fidl::new_empty!(bool, D),
405 supports_append: fidl::new_empty!(bool, D),
406 supports_truncate: fidl::new_empty!(bool, D),
407 supported_attributes: fidl::new_empty!(
408 fidl_fuchsia_io__common::NodeAttributesQuery,
409 D
410 ),
411 supports_modify_directory: fidl::new_empty!(bool, D),
412 supports_services: fidl::new_empty!(bool, D),
413 supports_unnamed_temporary_file: fidl::new_empty!(bool, D),
414 }
415 }
416
417 #[inline]
418 unsafe fn decode(
419 &mut self,
420 decoder: &mut fidl::encoding::Decoder<'_, D>,
421 offset: usize,
422 _depth: fidl::encoding::Depth,
423 ) -> fidl::Result<()> {
424 decoder.debug_check_bounds::<Self>(offset);
425 let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(16) };
427 let padval = unsafe { (ptr as *const u64).read_unaligned() };
428 let mask = 0xffffffffff000000u64;
429 let maskedval = padval & mask;
430 if maskedval != 0 {
431 return Err(fidl::Error::NonZeroPadding {
432 padding_start: offset + 16 + ((mask as u64).trailing_zeros() / 8) as usize,
433 });
434 }
435 fidl::decode!(
436 bool,
437 D,
438 &mut self.supports_executable_file,
439 decoder,
440 offset + 0,
441 _depth
442 )?;
443 fidl::decode!(bool, D, &mut self.supports_mutable_file, decoder, offset + 1, _depth)?;
444 fidl::decode!(
445 bool,
446 D,
447 &mut self.supports_get_backing_memory,
448 decoder,
449 offset + 2,
450 _depth
451 )?;
452 fidl::decode!(bool, D, &mut self.supports_remote_dir, decoder, offset + 3, _depth)?;
453 fidl::decode!(bool, D, &mut self.supports_get_token, decoder, offset + 4, _depth)?;
454 fidl::decode!(bool, D, &mut self.supports_link_into, decoder, offset + 5, _depth)?;
455 fidl::decode!(bool, D, &mut self.supports_append, decoder, offset + 6, _depth)?;
456 fidl::decode!(bool, D, &mut self.supports_truncate, decoder, offset + 7, _depth)?;
457 fidl::decode!(
458 fidl_fuchsia_io__common::NodeAttributesQuery,
459 D,
460 &mut self.supported_attributes,
461 decoder,
462 offset + 8,
463 _depth
464 )?;
465 fidl::decode!(
466 bool,
467 D,
468 &mut self.supports_modify_directory,
469 decoder,
470 offset + 16,
471 _depth
472 )?;
473 fidl::decode!(bool, D, &mut self.supports_services, decoder, offset + 17, _depth)?;
474 fidl::decode!(
475 bool,
476 D,
477 &mut self.supports_unnamed_temporary_file,
478 decoder,
479 offset + 18,
480 _depth
481 )?;
482 Ok(())
483 }
484 }
485
486 impl fidl::encoding::ValueTypeMarker for TestHarnessGetConfigResponse {
487 type Borrowed<'a> = &'a Self;
488 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
489 value
490 }
491 }
492
493 unsafe impl fidl::encoding::TypeMarker for TestHarnessGetConfigResponse {
494 type Owned = Self;
495
496 #[inline(always)]
497 fn inline_align(_context: fidl::encoding::Context) -> usize {
498 8
499 }
500
501 #[inline(always)]
502 fn inline_size(_context: fidl::encoding::Context) -> usize {
503 24
504 }
505 }
506
507 unsafe impl<D: fidl::encoding::ResourceDialect>
508 fidl::encoding::Encode<TestHarnessGetConfigResponse, D> for &TestHarnessGetConfigResponse
509 {
510 #[inline]
511 unsafe fn encode(
512 self,
513 encoder: &mut fidl::encoding::Encoder<'_, D>,
514 offset: usize,
515 _depth: fidl::encoding::Depth,
516 ) -> fidl::Result<()> {
517 encoder.debug_check_bounds::<TestHarnessGetConfigResponse>(offset);
518 fidl::encoding::Encode::<TestHarnessGetConfigResponse, D>::encode(
520 (<HarnessConfig as fidl::encoding::ValueTypeMarker>::borrow(&self.config),),
521 encoder,
522 offset,
523 _depth,
524 )
525 }
526 }
527 unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<HarnessConfig, D>>
528 fidl::encoding::Encode<TestHarnessGetConfigResponse, D> for (T0,)
529 {
530 #[inline]
531 unsafe fn encode(
532 self,
533 encoder: &mut fidl::encoding::Encoder<'_, D>,
534 offset: usize,
535 depth: fidl::encoding::Depth,
536 ) -> fidl::Result<()> {
537 encoder.debug_check_bounds::<TestHarnessGetConfigResponse>(offset);
538 self.0.encode(encoder, offset + 0, depth)?;
542 Ok(())
543 }
544 }
545
546 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
547 for TestHarnessGetConfigResponse
548 {
549 #[inline(always)]
550 fn new_empty() -> Self {
551 Self { config: fidl::new_empty!(HarnessConfig, D) }
552 }
553
554 #[inline]
555 unsafe fn decode(
556 &mut self,
557 decoder: &mut fidl::encoding::Decoder<'_, D>,
558 offset: usize,
559 _depth: fidl::encoding::Depth,
560 ) -> fidl::Result<()> {
561 decoder.debug_check_bounds::<Self>(offset);
562 fidl::decode!(HarnessConfig, D, &mut self.config, decoder, offset + 0, _depth)?;
564 Ok(())
565 }
566 }
567}