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
11pub const MAX_ATTRIBUTE_COUNT: u16 = 65535;
12
13pub const MAX_CHARACTERISTIC_COUNT: u16 = 32767;
14
15pub const MAX_DESCRIPTOR_COUNT: u16 = 65532;
16
17pub const MAX_READ_BY_TYPE_RESULTS: u16 = 189;
18
19pub const MAX_READ_BY_TYPE_VALUE_LENGTH: u16 = 253;
20
21pub const MAX_SERVICE_COUNT: u16 = MAX_ATTRIBUTE_COUNT as u16;
22
23pub const MAX_VALUE_LENGTH: u16 = 512;
24
25pub const PROPERTY_AUTHENTICATED_SIGNED_WRITES: u32 = 64;
26
27pub const PROPERTY_BROADCAST: u32 = 1;
30
31pub const PROPERTY_INDICATE: u32 = 32;
32
33pub const PROPERTY_NOTIFY: u32 = 16;
34
35pub const PROPERTY_READ: u32 = 2;
36
37pub const PROPERTY_RELIABLE_WRITE: u32 = 256;
38
39pub const PROPERTY_WRITABLE_AUXILIARIES: u32 = 512;
40
41pub const PROPERTY_WRITE: u32 = 8;
42
43pub const PROPERTY_WRITE_WITHOUT_RESPONSE: u32 = 4;
44
45#[derive(Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd, Hash)]
47#[repr(u32)]
48pub enum Error {
49 Failure = 1,
51 InvalidResponse = 2,
53 TooManyResults = 3,
56 InsufficientAuthorization = 4,
58 InsufficientAuthentication = 5,
60 InsufficientEncryptionKeySize = 6,
62 InsufficientEncryption = 7,
64 ReadNotPermitted = 8,
66}
67
68impl Error {
69 #[inline]
70 pub fn from_primitive(prim: u32) -> Option<Self> {
71 match prim {
72 1 => Some(Self::Failure),
73 2 => Some(Self::InvalidResponse),
74 3 => Some(Self::TooManyResults),
75 4 => Some(Self::InsufficientAuthorization),
76 5 => Some(Self::InsufficientAuthentication),
77 6 => Some(Self::InsufficientEncryptionKeySize),
78 7 => Some(Self::InsufficientEncryption),
79 8 => Some(Self::ReadNotPermitted),
80 _ => None,
81 }
82 }
83
84 #[inline]
85 pub const fn into_primitive(self) -> u32 {
86 self as u32
87 }
88
89 #[deprecated = "Strict enums should not use `is_unknown`"]
90 #[inline]
91 pub fn is_unknown(&self) -> bool {
92 false
93 }
94}
95
96#[derive(Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd, Hash)]
99#[repr(u32)]
100pub enum ErrorCode {
101 NoError = 0,
103 InvalidOffset = 1,
106 InvalidValueLength = 2,
109 NotPermitted = 3,
111}
112
113impl ErrorCode {
114 #[inline]
115 pub fn from_primitive(prim: u32) -> Option<Self> {
116 match prim {
117 0 => Some(Self::NoError),
118 1 => Some(Self::InvalidOffset),
119 2 => Some(Self::InvalidValueLength),
120 3 => Some(Self::NotPermitted),
121 _ => None,
122 }
123 }
124
125 #[inline]
126 pub const fn into_primitive(self) -> u32 {
127 self as u32
128 }
129
130 #[deprecated = "Strict enums should not use `is_unknown`"]
131 #[inline]
132 pub fn is_unknown(&self) -> bool {
133 false
134 }
135}
136
137#[derive(Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd, Hash)]
142#[repr(u32)]
143pub enum ReliableMode {
144 Disabled = 1,
145 Enabled = 2,
146}
147
148impl ReliableMode {
149 #[inline]
150 pub fn from_primitive(prim: u32) -> Option<Self> {
151 match prim {
152 1 => Some(Self::Disabled),
153 2 => Some(Self::Enabled),
154 _ => None,
155 }
156 }
157
158 #[inline]
159 pub const fn into_primitive(self) -> u32 {
160 self as u32
161 }
162
163 #[deprecated = "Strict enums should not use `is_unknown`"]
164 #[inline]
165 pub fn is_unknown(&self) -> bool {
166 false
167 }
168}
169
170#[derive(Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
172pub struct AttributePermissions {
173 pub read: Option<Box<SecurityRequirements>>,
177 pub write: Option<Box<SecurityRequirements>>,
181 pub update: Option<Box<SecurityRequirements>>,
190}
191
192impl fidl::Persistable for AttributePermissions {}
193
194#[derive(Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
196pub struct Characteristic {
197 pub id: u64,
199 pub type_: String,
202 pub properties: u32,
205 pub permissions: Option<Box<AttributePermissions>>,
211 pub descriptors: Option<Vec<Descriptor>>,
213}
214
215impl fidl::Persistable for Characteristic {}
216
217#[derive(Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
218pub struct ClientListServicesRequest {
219 pub uuids: Option<Vec<String>>,
220}
221
222impl fidl::Persistable for ClientListServicesRequest {}
223
224#[derive(Clone, Debug, PartialEq)]
225pub struct ClientListServicesResponse {
226 pub status: fidl_fuchsia_bluetooth::Status,
227 pub services: Vec<ServiceInfo>,
228}
229
230impl fidl::Persistable for ClientListServicesResponse {}
231
232#[derive(Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
234pub struct Descriptor {
235 pub id: u64,
238 pub type_: String,
241 pub permissions: Option<Box<AttributePermissions>>,
247}
248
249impl fidl::Persistable for Descriptor {}
250
251#[derive(Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
252pub struct LocalServiceDelegateOnCharacteristicConfigurationRequest {
253 pub characteristic_id: u64,
254 pub peer_id: String,
255 pub notify: bool,
256 pub indicate: bool,
257}
258
259impl fidl::Persistable for LocalServiceDelegateOnCharacteristicConfigurationRequest {}
260
261#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
262#[repr(C)]
263pub struct LocalServiceDelegateOnReadValueRequest {
264 pub id: u64,
265 pub offset: i32,
266}
267
268impl fidl::Persistable for LocalServiceDelegateOnReadValueRequest {}
269
270#[derive(Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
271pub struct LocalServiceDelegateOnReadValueResponse {
272 pub value: Option<Vec<u8>>,
273 pub status: ErrorCode,
274}
275
276impl fidl::Persistable for LocalServiceDelegateOnReadValueResponse {}
277
278#[derive(Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
279pub struct LocalServiceDelegateOnWriteValueRequest {
280 pub id: u64,
281 pub offset: u16,
282 pub value: Vec<u8>,
283}
284
285impl fidl::Persistable for LocalServiceDelegateOnWriteValueRequest {}
286
287#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
288pub struct LocalServiceDelegateOnWriteValueResponse {
289 pub status: ErrorCode,
290}
291
292impl fidl::Persistable for LocalServiceDelegateOnWriteValueResponse {}
293
294#[derive(Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
295pub struct LocalServiceDelegateOnWriteWithoutResponseRequest {
296 pub id: u64,
297 pub offset: u16,
298 pub value: Vec<u8>,
299}
300
301impl fidl::Persistable for LocalServiceDelegateOnWriteWithoutResponseRequest {}
302
303#[derive(Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
304pub struct LocalServiceNotifyValueRequest {
305 pub characteristic_id: u64,
306 pub peer_id: String,
307 pub value: Vec<u8>,
308 pub confirm: bool,
309}
310
311impl fidl::Persistable for LocalServiceNotifyValueRequest {}
312
313#[derive(Clone, Debug, PartialEq)]
314pub struct RemoteServiceDiscoverCharacteristicsResponse {
315 pub status: fidl_fuchsia_bluetooth::Status,
316 pub characteristics: Vec<Characteristic>,
317}
318
319impl fidl::Persistable for RemoteServiceDiscoverCharacteristicsResponse {}
320
321#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
322pub struct RemoteServiceNotifyCharacteristicRequest {
323 pub id: u64,
324 pub enable: bool,
325}
326
327impl fidl::Persistable for RemoteServiceNotifyCharacteristicRequest {}
328
329#[derive(Clone, Debug, PartialEq)]
330pub struct RemoteServiceNotifyCharacteristicResponse {
331 pub status: fidl_fuchsia_bluetooth::Status,
332}
333
334impl fidl::Persistable for RemoteServiceNotifyCharacteristicResponse {}
335
336#[derive(Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
337pub struct RemoteServiceOnCharacteristicValueUpdatedRequest {
338 pub id: u64,
339 pub value: Vec<u8>,
340}
341
342impl fidl::Persistable for RemoteServiceOnCharacteristicValueUpdatedRequest {}
343
344#[derive(Clone, Debug, PartialEq)]
345pub struct RemoteServiceReadByTypeRequest {
346 pub uuid: fidl_fuchsia_bluetooth::Uuid,
347}
348
349impl fidl::Persistable for RemoteServiceReadByTypeRequest {}
350
351#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
352#[repr(C)]
353pub struct RemoteServiceReadCharacteristicRequest {
354 pub id: u64,
355}
356
357impl fidl::Persistable for RemoteServiceReadCharacteristicRequest {}
358
359#[derive(Clone, Debug, PartialEq)]
360pub struct RemoteServiceReadCharacteristicResponse {
361 pub status: fidl_fuchsia_bluetooth::Status,
362 pub value: Vec<u8>,
363}
364
365impl fidl::Persistable for RemoteServiceReadCharacteristicResponse {}
366
367#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
368#[repr(C)]
369pub struct RemoteServiceReadDescriptorRequest {
370 pub id: u64,
371}
372
373impl fidl::Persistable for RemoteServiceReadDescriptorRequest {}
374
375#[derive(Clone, Debug, PartialEq)]
376pub struct RemoteServiceReadDescriptorResponse {
377 pub status: fidl_fuchsia_bluetooth::Status,
378 pub value: Vec<u8>,
379}
380
381impl fidl::Persistable for RemoteServiceReadDescriptorResponse {}
382
383#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
384#[repr(C)]
385pub struct RemoteServiceReadLongCharacteristicRequest {
386 pub id: u64,
387 pub offset: u16,
388 pub max_bytes: u16,
389}
390
391impl fidl::Persistable for RemoteServiceReadLongCharacteristicRequest {}
392
393#[derive(Clone, Debug, PartialEq)]
394pub struct RemoteServiceReadLongCharacteristicResponse {
395 pub status: fidl_fuchsia_bluetooth::Status,
396 pub value: Vec<u8>,
397}
398
399impl fidl::Persistable for RemoteServiceReadLongCharacteristicResponse {}
400
401#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
402#[repr(C)]
403pub struct RemoteServiceReadLongDescriptorRequest {
404 pub id: u64,
405 pub offset: u16,
406 pub max_bytes: u16,
407}
408
409impl fidl::Persistable for RemoteServiceReadLongDescriptorRequest {}
410
411#[derive(Clone, Debug, PartialEq)]
412pub struct RemoteServiceReadLongDescriptorResponse {
413 pub status: fidl_fuchsia_bluetooth::Status,
414 pub value: Vec<u8>,
415}
416
417impl fidl::Persistable for RemoteServiceReadLongDescriptorResponse {}
418
419#[derive(Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
420pub struct RemoteServiceWriteCharacteristicRequest {
421 pub id: u64,
422 pub value: Vec<u8>,
423}
424
425impl fidl::Persistable for RemoteServiceWriteCharacteristicRequest {}
426
427#[derive(Clone, Debug, PartialEq)]
428pub struct RemoteServiceWriteCharacteristicResponse {
429 pub status: fidl_fuchsia_bluetooth::Status,
430}
431
432impl fidl::Persistable for RemoteServiceWriteCharacteristicResponse {}
433
434#[derive(Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
435pub struct RemoteServiceWriteCharacteristicWithoutResponseRequest {
436 pub id: u64,
437 pub value: Vec<u8>,
438}
439
440impl fidl::Persistable for RemoteServiceWriteCharacteristicWithoutResponseRequest {}
441
442#[derive(Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
443pub struct RemoteServiceWriteDescriptorRequest {
444 pub id: u64,
445 pub value: Vec<u8>,
446}
447
448impl fidl::Persistable for RemoteServiceWriteDescriptorRequest {}
449
450#[derive(Clone, Debug, PartialEq)]
451pub struct RemoteServiceWriteDescriptorResponse {
452 pub status: fidl_fuchsia_bluetooth::Status,
453}
454
455impl fidl::Persistable for RemoteServiceWriteDescriptorResponse {}
456
457#[derive(Clone, Debug, PartialEq)]
458pub struct RemoteServiceWriteLongCharacteristicRequest {
459 pub id: u64,
460 pub offset: u16,
461 pub value: Vec<u8>,
462 pub write_options: WriteOptions,
463}
464
465impl fidl::Persistable for RemoteServiceWriteLongCharacteristicRequest {}
466
467#[derive(Clone, Debug, PartialEq)]
468pub struct RemoteServiceWriteLongCharacteristicResponse {
469 pub status: fidl_fuchsia_bluetooth::Status,
470}
471
472impl fidl::Persistable for RemoteServiceWriteLongCharacteristicResponse {}
473
474#[derive(Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
475pub struct RemoteServiceWriteLongDescriptorRequest {
476 pub id: u64,
477 pub offset: u16,
478 pub value: Vec<u8>,
479}
480
481impl fidl::Persistable for RemoteServiceWriteLongDescriptorRequest {}
482
483#[derive(Clone, Debug, PartialEq)]
484pub struct RemoteServiceWriteLongDescriptorResponse {
485 pub status: fidl_fuchsia_bluetooth::Status,
486}
487
488impl fidl::Persistable for RemoteServiceWriteLongDescriptorResponse {}
489
490#[derive(Clone, Debug, PartialEq)]
491pub struct RemoteServiceReadByTypeResponse {
492 pub results: Vec<ReadByTypeResult>,
493}
494
495impl fidl::Persistable for RemoteServiceReadByTypeResponse {}
496
497#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
500pub struct SecurityRequirements {
501 pub encryption_required: bool,
503 pub authentication_required: bool,
506 pub authorization_required: bool,
509}
510
511impl fidl::Persistable for SecurityRequirements {}
512
513#[derive(Clone, Debug, PartialEq)]
514pub struct ServerPublishServiceResponse {
515 pub status: fidl_fuchsia_bluetooth::Status,
516}
517
518impl fidl::Persistable for ServerPublishServiceResponse {}
519
520#[derive(Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
522pub struct ServiceInfo {
523 pub id: u64,
526 pub primary: bool,
528 pub type_: String,
531 pub characteristics: Option<Vec<Characteristic>>,
533 pub includes: Option<Vec<u64>>,
535}
536
537impl fidl::Persistable for ServiceInfo {}
538
539#[derive(Clone, Debug, Default, PartialEq)]
540pub struct ReadByTypeResult {
541 pub id: Option<u64>,
543 pub value: Option<Vec<u8>>,
545 pub error: Option<Error>,
547 #[doc(hidden)]
548 pub __source_breaking: fidl::marker::SourceBreaking,
549}
550
551impl fidl::Persistable for ReadByTypeResult {}
552
553#[derive(Clone, Debug, Default, PartialEq)]
555pub struct WriteOptions {
556 pub reliable_mode: Option<ReliableMode>,
560 #[doc(hidden)]
561 pub __source_breaking: fidl::marker::SourceBreaking,
562}
563
564impl fidl::Persistable for WriteOptions {}
565
566mod internal {
567 use super::*;
568 unsafe impl fidl::encoding::TypeMarker for Error {
569 type Owned = Self;
570
571 #[inline(always)]
572 fn inline_align(_context: fidl::encoding::Context) -> usize {
573 std::mem::align_of::<u32>()
574 }
575
576 #[inline(always)]
577 fn inline_size(_context: fidl::encoding::Context) -> usize {
578 std::mem::size_of::<u32>()
579 }
580
581 #[inline(always)]
582 fn encode_is_copy() -> bool {
583 true
584 }
585
586 #[inline(always)]
587 fn decode_is_copy() -> bool {
588 false
589 }
590 }
591
592 impl fidl::encoding::ValueTypeMarker for Error {
593 type Borrowed<'a> = Self;
594 #[inline(always)]
595 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
596 *value
597 }
598 }
599
600 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Self, D> for Error {
601 #[inline]
602 unsafe fn encode(
603 self,
604 encoder: &mut fidl::encoding::Encoder<'_, D>,
605 offset: usize,
606 _depth: fidl::encoding::Depth,
607 ) -> fidl::Result<()> {
608 encoder.debug_check_bounds::<Self>(offset);
609 encoder.write_num(self.into_primitive(), offset);
610 Ok(())
611 }
612 }
613
614 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for Error {
615 #[inline(always)]
616 fn new_empty() -> Self {
617 Self::Failure
618 }
619
620 #[inline]
621 unsafe fn decode(
622 &mut self,
623 decoder: &mut fidl::encoding::Decoder<'_, D>,
624 offset: usize,
625 _depth: fidl::encoding::Depth,
626 ) -> fidl::Result<()> {
627 decoder.debug_check_bounds::<Self>(offset);
628 let prim = decoder.read_num::<u32>(offset);
629
630 *self = Self::from_primitive(prim).ok_or(fidl::Error::InvalidEnumValue)?;
631 Ok(())
632 }
633 }
634 unsafe impl fidl::encoding::TypeMarker for ErrorCode {
635 type Owned = Self;
636
637 #[inline(always)]
638 fn inline_align(_context: fidl::encoding::Context) -> usize {
639 std::mem::align_of::<u32>()
640 }
641
642 #[inline(always)]
643 fn inline_size(_context: fidl::encoding::Context) -> usize {
644 std::mem::size_of::<u32>()
645 }
646
647 #[inline(always)]
648 fn encode_is_copy() -> bool {
649 true
650 }
651
652 #[inline(always)]
653 fn decode_is_copy() -> bool {
654 false
655 }
656 }
657
658 impl fidl::encoding::ValueTypeMarker for ErrorCode {
659 type Borrowed<'a> = Self;
660 #[inline(always)]
661 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
662 *value
663 }
664 }
665
666 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Self, D> for ErrorCode {
667 #[inline]
668 unsafe fn encode(
669 self,
670 encoder: &mut fidl::encoding::Encoder<'_, D>,
671 offset: usize,
672 _depth: fidl::encoding::Depth,
673 ) -> fidl::Result<()> {
674 encoder.debug_check_bounds::<Self>(offset);
675 encoder.write_num(self.into_primitive(), offset);
676 Ok(())
677 }
678 }
679
680 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for ErrorCode {
681 #[inline(always)]
682 fn new_empty() -> Self {
683 Self::NoError
684 }
685
686 #[inline]
687 unsafe fn decode(
688 &mut self,
689 decoder: &mut fidl::encoding::Decoder<'_, D>,
690 offset: usize,
691 _depth: fidl::encoding::Depth,
692 ) -> fidl::Result<()> {
693 decoder.debug_check_bounds::<Self>(offset);
694 let prim = decoder.read_num::<u32>(offset);
695
696 *self = Self::from_primitive(prim).ok_or(fidl::Error::InvalidEnumValue)?;
697 Ok(())
698 }
699 }
700 unsafe impl fidl::encoding::TypeMarker for ReliableMode {
701 type Owned = Self;
702
703 #[inline(always)]
704 fn inline_align(_context: fidl::encoding::Context) -> usize {
705 std::mem::align_of::<u32>()
706 }
707
708 #[inline(always)]
709 fn inline_size(_context: fidl::encoding::Context) -> usize {
710 std::mem::size_of::<u32>()
711 }
712
713 #[inline(always)]
714 fn encode_is_copy() -> bool {
715 true
716 }
717
718 #[inline(always)]
719 fn decode_is_copy() -> bool {
720 false
721 }
722 }
723
724 impl fidl::encoding::ValueTypeMarker for ReliableMode {
725 type Borrowed<'a> = Self;
726 #[inline(always)]
727 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
728 *value
729 }
730 }
731
732 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Self, D> for ReliableMode {
733 #[inline]
734 unsafe fn encode(
735 self,
736 encoder: &mut fidl::encoding::Encoder<'_, D>,
737 offset: usize,
738 _depth: fidl::encoding::Depth,
739 ) -> fidl::Result<()> {
740 encoder.debug_check_bounds::<Self>(offset);
741 encoder.write_num(self.into_primitive(), offset);
742 Ok(())
743 }
744 }
745
746 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for ReliableMode {
747 #[inline(always)]
748 fn new_empty() -> Self {
749 Self::Disabled
750 }
751
752 #[inline]
753 unsafe fn decode(
754 &mut self,
755 decoder: &mut fidl::encoding::Decoder<'_, D>,
756 offset: usize,
757 _depth: fidl::encoding::Depth,
758 ) -> fidl::Result<()> {
759 decoder.debug_check_bounds::<Self>(offset);
760 let prim = decoder.read_num::<u32>(offset);
761
762 *self = Self::from_primitive(prim).ok_or(fidl::Error::InvalidEnumValue)?;
763 Ok(())
764 }
765 }
766
767 impl fidl::encoding::ValueTypeMarker for AttributePermissions {
768 type Borrowed<'a> = &'a Self;
769 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
770 value
771 }
772 }
773
774 unsafe impl fidl::encoding::TypeMarker for AttributePermissions {
775 type Owned = Self;
776
777 #[inline(always)]
778 fn inline_align(_context: fidl::encoding::Context) -> usize {
779 8
780 }
781
782 #[inline(always)]
783 fn inline_size(_context: fidl::encoding::Context) -> usize {
784 24
785 }
786 }
787
788 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<AttributePermissions, D>
789 for &AttributePermissions
790 {
791 #[inline]
792 unsafe fn encode(
793 self,
794 encoder: &mut fidl::encoding::Encoder<'_, D>,
795 offset: usize,
796 _depth: fidl::encoding::Depth,
797 ) -> fidl::Result<()> {
798 encoder.debug_check_bounds::<AttributePermissions>(offset);
799 fidl::encoding::Encode::<AttributePermissions, D>::encode(
801 (
802 <fidl::encoding::Boxed<SecurityRequirements> as fidl::encoding::ValueTypeMarker>::borrow(&self.read),
803 <fidl::encoding::Boxed<SecurityRequirements> as fidl::encoding::ValueTypeMarker>::borrow(&self.write),
804 <fidl::encoding::Boxed<SecurityRequirements> as fidl::encoding::ValueTypeMarker>::borrow(&self.update),
805 ),
806 encoder, offset, _depth
807 )
808 }
809 }
810 unsafe impl<
811 D: fidl::encoding::ResourceDialect,
812 T0: fidl::encoding::Encode<fidl::encoding::Boxed<SecurityRequirements>, D>,
813 T1: fidl::encoding::Encode<fidl::encoding::Boxed<SecurityRequirements>, D>,
814 T2: fidl::encoding::Encode<fidl::encoding::Boxed<SecurityRequirements>, D>,
815 > fidl::encoding::Encode<AttributePermissions, D> for (T0, T1, T2)
816 {
817 #[inline]
818 unsafe fn encode(
819 self,
820 encoder: &mut fidl::encoding::Encoder<'_, D>,
821 offset: usize,
822 depth: fidl::encoding::Depth,
823 ) -> fidl::Result<()> {
824 encoder.debug_check_bounds::<AttributePermissions>(offset);
825 self.0.encode(encoder, offset + 0, depth)?;
829 self.1.encode(encoder, offset + 8, depth)?;
830 self.2.encode(encoder, offset + 16, depth)?;
831 Ok(())
832 }
833 }
834
835 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for AttributePermissions {
836 #[inline(always)]
837 fn new_empty() -> Self {
838 Self {
839 read: fidl::new_empty!(fidl::encoding::Boxed<SecurityRequirements>, D),
840 write: fidl::new_empty!(fidl::encoding::Boxed<SecurityRequirements>, D),
841 update: fidl::new_empty!(fidl::encoding::Boxed<SecurityRequirements>, D),
842 }
843 }
844
845 #[inline]
846 unsafe fn decode(
847 &mut self,
848 decoder: &mut fidl::encoding::Decoder<'_, D>,
849 offset: usize,
850 _depth: fidl::encoding::Depth,
851 ) -> fidl::Result<()> {
852 decoder.debug_check_bounds::<Self>(offset);
853 fidl::decode!(
855 fidl::encoding::Boxed<SecurityRequirements>,
856 D,
857 &mut self.read,
858 decoder,
859 offset + 0,
860 _depth
861 )?;
862 fidl::decode!(
863 fidl::encoding::Boxed<SecurityRequirements>,
864 D,
865 &mut self.write,
866 decoder,
867 offset + 8,
868 _depth
869 )?;
870 fidl::decode!(
871 fidl::encoding::Boxed<SecurityRequirements>,
872 D,
873 &mut self.update,
874 decoder,
875 offset + 16,
876 _depth
877 )?;
878 Ok(())
879 }
880 }
881
882 impl fidl::encoding::ValueTypeMarker for Characteristic {
883 type Borrowed<'a> = &'a Self;
884 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
885 value
886 }
887 }
888
889 unsafe impl fidl::encoding::TypeMarker for Characteristic {
890 type Owned = Self;
891
892 #[inline(always)]
893 fn inline_align(_context: fidl::encoding::Context) -> usize {
894 8
895 }
896
897 #[inline(always)]
898 fn inline_size(_context: fidl::encoding::Context) -> usize {
899 56
900 }
901 }
902
903 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Characteristic, D>
904 for &Characteristic
905 {
906 #[inline]
907 unsafe fn encode(
908 self,
909 encoder: &mut fidl::encoding::Encoder<'_, D>,
910 offset: usize,
911 _depth: fidl::encoding::Depth,
912 ) -> fidl::Result<()> {
913 encoder.debug_check_bounds::<Characteristic>(offset);
914 fidl::encoding::Encode::<Characteristic, D>::encode(
916 (
917 <u64 as fidl::encoding::ValueTypeMarker>::borrow(&self.id),
918 <fidl::encoding::BoundedString<36> as fidl::encoding::ValueTypeMarker>::borrow(&self.type_),
919 <u32 as fidl::encoding::ValueTypeMarker>::borrow(&self.properties),
920 <fidl::encoding::Boxed<AttributePermissions> as fidl::encoding::ValueTypeMarker>::borrow(&self.permissions),
921 <fidl::encoding::Optional<fidl::encoding::Vector<Descriptor, 65532>> as fidl::encoding::ValueTypeMarker>::borrow(&self.descriptors),
922 ),
923 encoder, offset, _depth
924 )
925 }
926 }
927 unsafe impl<
928 D: fidl::encoding::ResourceDialect,
929 T0: fidl::encoding::Encode<u64, D>,
930 T1: fidl::encoding::Encode<fidl::encoding::BoundedString<36>, D>,
931 T2: fidl::encoding::Encode<u32, D>,
932 T3: fidl::encoding::Encode<fidl::encoding::Boxed<AttributePermissions>, D>,
933 T4: fidl::encoding::Encode<
934 fidl::encoding::Optional<fidl::encoding::Vector<Descriptor, 65532>>,
935 D,
936 >,
937 > fidl::encoding::Encode<Characteristic, D> for (T0, T1, T2, T3, T4)
938 {
939 #[inline]
940 unsafe fn encode(
941 self,
942 encoder: &mut fidl::encoding::Encoder<'_, D>,
943 offset: usize,
944 depth: fidl::encoding::Depth,
945 ) -> fidl::Result<()> {
946 encoder.debug_check_bounds::<Characteristic>(offset);
947 unsafe {
950 let ptr = encoder.buf.as_mut_ptr().add(offset).offset(24);
951 (ptr as *mut u64).write_unaligned(0);
952 }
953 self.0.encode(encoder, offset + 0, depth)?;
955 self.1.encode(encoder, offset + 8, depth)?;
956 self.2.encode(encoder, offset + 24, depth)?;
957 self.3.encode(encoder, offset + 32, depth)?;
958 self.4.encode(encoder, offset + 40, depth)?;
959 Ok(())
960 }
961 }
962
963 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for Characteristic {
964 #[inline(always)]
965 fn new_empty() -> Self {
966 Self {
967 id: fidl::new_empty!(u64, D),
968 type_: fidl::new_empty!(fidl::encoding::BoundedString<36>, D),
969 properties: fidl::new_empty!(u32, D),
970 permissions: fidl::new_empty!(fidl::encoding::Boxed<AttributePermissions>, D),
971 descriptors: fidl::new_empty!(
972 fidl::encoding::Optional<fidl::encoding::Vector<Descriptor, 65532>>,
973 D
974 ),
975 }
976 }
977
978 #[inline]
979 unsafe fn decode(
980 &mut self,
981 decoder: &mut fidl::encoding::Decoder<'_, D>,
982 offset: usize,
983 _depth: fidl::encoding::Depth,
984 ) -> fidl::Result<()> {
985 decoder.debug_check_bounds::<Self>(offset);
986 let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(24) };
988 let padval = unsafe { (ptr as *const u64).read_unaligned() };
989 let mask = 0xffffffff00000000u64;
990 let maskedval = padval & mask;
991 if maskedval != 0 {
992 return Err(fidl::Error::NonZeroPadding {
993 padding_start: offset + 24 + ((mask as u64).trailing_zeros() / 8) as usize,
994 });
995 }
996 fidl::decode!(u64, D, &mut self.id, decoder, offset + 0, _depth)?;
997 fidl::decode!(
998 fidl::encoding::BoundedString<36>,
999 D,
1000 &mut self.type_,
1001 decoder,
1002 offset + 8,
1003 _depth
1004 )?;
1005 fidl::decode!(u32, D, &mut self.properties, decoder, offset + 24, _depth)?;
1006 fidl::decode!(
1007 fidl::encoding::Boxed<AttributePermissions>,
1008 D,
1009 &mut self.permissions,
1010 decoder,
1011 offset + 32,
1012 _depth
1013 )?;
1014 fidl::decode!(
1015 fidl::encoding::Optional<fidl::encoding::Vector<Descriptor, 65532>>,
1016 D,
1017 &mut self.descriptors,
1018 decoder,
1019 offset + 40,
1020 _depth
1021 )?;
1022 Ok(())
1023 }
1024 }
1025
1026 impl fidl::encoding::ValueTypeMarker for ClientListServicesRequest {
1027 type Borrowed<'a> = &'a Self;
1028 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1029 value
1030 }
1031 }
1032
1033 unsafe impl fidl::encoding::TypeMarker for ClientListServicesRequest {
1034 type Owned = Self;
1035
1036 #[inline(always)]
1037 fn inline_align(_context: fidl::encoding::Context) -> usize {
1038 8
1039 }
1040
1041 #[inline(always)]
1042 fn inline_size(_context: fidl::encoding::Context) -> usize {
1043 16
1044 }
1045 }
1046
1047 unsafe impl<D: fidl::encoding::ResourceDialect>
1048 fidl::encoding::Encode<ClientListServicesRequest, D> for &ClientListServicesRequest
1049 {
1050 #[inline]
1051 unsafe fn encode(
1052 self,
1053 encoder: &mut fidl::encoding::Encoder<'_, D>,
1054 offset: usize,
1055 _depth: fidl::encoding::Depth,
1056 ) -> fidl::Result<()> {
1057 encoder.debug_check_bounds::<ClientListServicesRequest>(offset);
1058 fidl::encoding::Encode::<ClientListServicesRequest, D>::encode(
1060 (<fidl::encoding::Optional<
1061 fidl::encoding::UnboundedVector<fidl::encoding::BoundedString<36>>,
1062 > as fidl::encoding::ValueTypeMarker>::borrow(&self.uuids),),
1063 encoder,
1064 offset,
1065 _depth,
1066 )
1067 }
1068 }
1069 unsafe impl<
1070 D: fidl::encoding::ResourceDialect,
1071 T0: fidl::encoding::Encode<
1072 fidl::encoding::Optional<
1073 fidl::encoding::UnboundedVector<fidl::encoding::BoundedString<36>>,
1074 >,
1075 D,
1076 >,
1077 > fidl::encoding::Encode<ClientListServicesRequest, D> for (T0,)
1078 {
1079 #[inline]
1080 unsafe fn encode(
1081 self,
1082 encoder: &mut fidl::encoding::Encoder<'_, D>,
1083 offset: usize,
1084 depth: fidl::encoding::Depth,
1085 ) -> fidl::Result<()> {
1086 encoder.debug_check_bounds::<ClientListServicesRequest>(offset);
1087 self.0.encode(encoder, offset + 0, depth)?;
1091 Ok(())
1092 }
1093 }
1094
1095 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
1096 for ClientListServicesRequest
1097 {
1098 #[inline(always)]
1099 fn new_empty() -> Self {
1100 Self {
1101 uuids: fidl::new_empty!(
1102 fidl::encoding::Optional<
1103 fidl::encoding::UnboundedVector<fidl::encoding::BoundedString<36>>,
1104 >,
1105 D
1106 ),
1107 }
1108 }
1109
1110 #[inline]
1111 unsafe fn decode(
1112 &mut self,
1113 decoder: &mut fidl::encoding::Decoder<'_, D>,
1114 offset: usize,
1115 _depth: fidl::encoding::Depth,
1116 ) -> fidl::Result<()> {
1117 decoder.debug_check_bounds::<Self>(offset);
1118 fidl::decode!(
1120 fidl::encoding::Optional<
1121 fidl::encoding::UnboundedVector<fidl::encoding::BoundedString<36>>,
1122 >,
1123 D,
1124 &mut self.uuids,
1125 decoder,
1126 offset + 0,
1127 _depth
1128 )?;
1129 Ok(())
1130 }
1131 }
1132
1133 impl fidl::encoding::ValueTypeMarker for ClientListServicesResponse {
1134 type Borrowed<'a> = &'a Self;
1135 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1136 value
1137 }
1138 }
1139
1140 unsafe impl fidl::encoding::TypeMarker for ClientListServicesResponse {
1141 type Owned = Self;
1142
1143 #[inline(always)]
1144 fn inline_align(_context: fidl::encoding::Context) -> usize {
1145 8
1146 }
1147
1148 #[inline(always)]
1149 fn inline_size(_context: fidl::encoding::Context) -> usize {
1150 24
1151 }
1152 }
1153
1154 unsafe impl<D: fidl::encoding::ResourceDialect>
1155 fidl::encoding::Encode<ClientListServicesResponse, D> for &ClientListServicesResponse
1156 {
1157 #[inline]
1158 unsafe fn encode(
1159 self,
1160 encoder: &mut fidl::encoding::Encoder<'_, D>,
1161 offset: usize,
1162 _depth: fidl::encoding::Depth,
1163 ) -> fidl::Result<()> {
1164 encoder.debug_check_bounds::<ClientListServicesResponse>(offset);
1165 fidl::encoding::Encode::<ClientListServicesResponse, D>::encode(
1167 (
1168 <fidl_fuchsia_bluetooth::Status as fidl::encoding::ValueTypeMarker>::borrow(&self.status),
1169 <fidl::encoding::Vector<ServiceInfo, 65535> as fidl::encoding::ValueTypeMarker>::borrow(&self.services),
1170 ),
1171 encoder, offset, _depth
1172 )
1173 }
1174 }
1175 unsafe impl<
1176 D: fidl::encoding::ResourceDialect,
1177 T0: fidl::encoding::Encode<fidl_fuchsia_bluetooth::Status, D>,
1178 T1: fidl::encoding::Encode<fidl::encoding::Vector<ServiceInfo, 65535>, D>,
1179 > fidl::encoding::Encode<ClientListServicesResponse, D> for (T0, T1)
1180 {
1181 #[inline]
1182 unsafe fn encode(
1183 self,
1184 encoder: &mut fidl::encoding::Encoder<'_, D>,
1185 offset: usize,
1186 depth: fidl::encoding::Depth,
1187 ) -> fidl::Result<()> {
1188 encoder.debug_check_bounds::<ClientListServicesResponse>(offset);
1189 self.0.encode(encoder, offset + 0, depth)?;
1193 self.1.encode(encoder, offset + 8, depth)?;
1194 Ok(())
1195 }
1196 }
1197
1198 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
1199 for ClientListServicesResponse
1200 {
1201 #[inline(always)]
1202 fn new_empty() -> Self {
1203 Self {
1204 status: fidl::new_empty!(fidl_fuchsia_bluetooth::Status, D),
1205 services: fidl::new_empty!(fidl::encoding::Vector<ServiceInfo, 65535>, D),
1206 }
1207 }
1208
1209 #[inline]
1210 unsafe fn decode(
1211 &mut self,
1212 decoder: &mut fidl::encoding::Decoder<'_, D>,
1213 offset: usize,
1214 _depth: fidl::encoding::Depth,
1215 ) -> fidl::Result<()> {
1216 decoder.debug_check_bounds::<Self>(offset);
1217 fidl::decode!(
1219 fidl_fuchsia_bluetooth::Status,
1220 D,
1221 &mut self.status,
1222 decoder,
1223 offset + 0,
1224 _depth
1225 )?;
1226 fidl::decode!(fidl::encoding::Vector<ServiceInfo, 65535>, D, &mut self.services, decoder, offset + 8, _depth)?;
1227 Ok(())
1228 }
1229 }
1230
1231 impl fidl::encoding::ValueTypeMarker for Descriptor {
1232 type Borrowed<'a> = &'a Self;
1233 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1234 value
1235 }
1236 }
1237
1238 unsafe impl fidl::encoding::TypeMarker for Descriptor {
1239 type Owned = Self;
1240
1241 #[inline(always)]
1242 fn inline_align(_context: fidl::encoding::Context) -> usize {
1243 8
1244 }
1245
1246 #[inline(always)]
1247 fn inline_size(_context: fidl::encoding::Context) -> usize {
1248 32
1249 }
1250 }
1251
1252 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Descriptor, D>
1253 for &Descriptor
1254 {
1255 #[inline]
1256 unsafe fn encode(
1257 self,
1258 encoder: &mut fidl::encoding::Encoder<'_, D>,
1259 offset: usize,
1260 _depth: fidl::encoding::Depth,
1261 ) -> fidl::Result<()> {
1262 encoder.debug_check_bounds::<Descriptor>(offset);
1263 fidl::encoding::Encode::<Descriptor, D>::encode(
1265 (
1266 <u64 as fidl::encoding::ValueTypeMarker>::borrow(&self.id),
1267 <fidl::encoding::BoundedString<36> as fidl::encoding::ValueTypeMarker>::borrow(&self.type_),
1268 <fidl::encoding::Boxed<AttributePermissions> as fidl::encoding::ValueTypeMarker>::borrow(&self.permissions),
1269 ),
1270 encoder, offset, _depth
1271 )
1272 }
1273 }
1274 unsafe impl<
1275 D: fidl::encoding::ResourceDialect,
1276 T0: fidl::encoding::Encode<u64, D>,
1277 T1: fidl::encoding::Encode<fidl::encoding::BoundedString<36>, D>,
1278 T2: fidl::encoding::Encode<fidl::encoding::Boxed<AttributePermissions>, D>,
1279 > fidl::encoding::Encode<Descriptor, D> for (T0, T1, T2)
1280 {
1281 #[inline]
1282 unsafe fn encode(
1283 self,
1284 encoder: &mut fidl::encoding::Encoder<'_, D>,
1285 offset: usize,
1286 depth: fidl::encoding::Depth,
1287 ) -> fidl::Result<()> {
1288 encoder.debug_check_bounds::<Descriptor>(offset);
1289 self.0.encode(encoder, offset + 0, depth)?;
1293 self.1.encode(encoder, offset + 8, depth)?;
1294 self.2.encode(encoder, offset + 24, depth)?;
1295 Ok(())
1296 }
1297 }
1298
1299 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for Descriptor {
1300 #[inline(always)]
1301 fn new_empty() -> Self {
1302 Self {
1303 id: fidl::new_empty!(u64, D),
1304 type_: fidl::new_empty!(fidl::encoding::BoundedString<36>, D),
1305 permissions: fidl::new_empty!(fidl::encoding::Boxed<AttributePermissions>, D),
1306 }
1307 }
1308
1309 #[inline]
1310 unsafe fn decode(
1311 &mut self,
1312 decoder: &mut fidl::encoding::Decoder<'_, D>,
1313 offset: usize,
1314 _depth: fidl::encoding::Depth,
1315 ) -> fidl::Result<()> {
1316 decoder.debug_check_bounds::<Self>(offset);
1317 fidl::decode!(u64, D, &mut self.id, decoder, offset + 0, _depth)?;
1319 fidl::decode!(
1320 fidl::encoding::BoundedString<36>,
1321 D,
1322 &mut self.type_,
1323 decoder,
1324 offset + 8,
1325 _depth
1326 )?;
1327 fidl::decode!(
1328 fidl::encoding::Boxed<AttributePermissions>,
1329 D,
1330 &mut self.permissions,
1331 decoder,
1332 offset + 24,
1333 _depth
1334 )?;
1335 Ok(())
1336 }
1337 }
1338
1339 impl fidl::encoding::ValueTypeMarker for LocalServiceDelegateOnCharacteristicConfigurationRequest {
1340 type Borrowed<'a> = &'a Self;
1341 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1342 value
1343 }
1344 }
1345
1346 unsafe impl fidl::encoding::TypeMarker
1347 for LocalServiceDelegateOnCharacteristicConfigurationRequest
1348 {
1349 type Owned = Self;
1350
1351 #[inline(always)]
1352 fn inline_align(_context: fidl::encoding::Context) -> usize {
1353 8
1354 }
1355
1356 #[inline(always)]
1357 fn inline_size(_context: fidl::encoding::Context) -> usize {
1358 32
1359 }
1360 }
1361
1362 unsafe impl<D: fidl::encoding::ResourceDialect>
1363 fidl::encoding::Encode<LocalServiceDelegateOnCharacteristicConfigurationRequest, D>
1364 for &LocalServiceDelegateOnCharacteristicConfigurationRequest
1365 {
1366 #[inline]
1367 unsafe fn encode(
1368 self,
1369 encoder: &mut fidl::encoding::Encoder<'_, D>,
1370 offset: usize,
1371 _depth: fidl::encoding::Depth,
1372 ) -> fidl::Result<()> {
1373 encoder.debug_check_bounds::<LocalServiceDelegateOnCharacteristicConfigurationRequest>(
1374 offset,
1375 );
1376 fidl::encoding::Encode::<LocalServiceDelegateOnCharacteristicConfigurationRequest, D>::encode(
1378 (
1379 <u64 as fidl::encoding::ValueTypeMarker>::borrow(&self.characteristic_id),
1380 <fidl::encoding::BoundedString<16> as fidl::encoding::ValueTypeMarker>::borrow(&self.peer_id),
1381 <bool as fidl::encoding::ValueTypeMarker>::borrow(&self.notify),
1382 <bool as fidl::encoding::ValueTypeMarker>::borrow(&self.indicate),
1383 ),
1384 encoder, offset, _depth
1385 )
1386 }
1387 }
1388 unsafe impl<
1389 D: fidl::encoding::ResourceDialect,
1390 T0: fidl::encoding::Encode<u64, D>,
1391 T1: fidl::encoding::Encode<fidl::encoding::BoundedString<16>, D>,
1392 T2: fidl::encoding::Encode<bool, D>,
1393 T3: fidl::encoding::Encode<bool, D>,
1394 > fidl::encoding::Encode<LocalServiceDelegateOnCharacteristicConfigurationRequest, D>
1395 for (T0, T1, T2, T3)
1396 {
1397 #[inline]
1398 unsafe fn encode(
1399 self,
1400 encoder: &mut fidl::encoding::Encoder<'_, D>,
1401 offset: usize,
1402 depth: fidl::encoding::Depth,
1403 ) -> fidl::Result<()> {
1404 encoder.debug_check_bounds::<LocalServiceDelegateOnCharacteristicConfigurationRequest>(
1405 offset,
1406 );
1407 unsafe {
1410 let ptr = encoder.buf.as_mut_ptr().add(offset).offset(24);
1411 (ptr as *mut u64).write_unaligned(0);
1412 }
1413 self.0.encode(encoder, offset + 0, depth)?;
1415 self.1.encode(encoder, offset + 8, depth)?;
1416 self.2.encode(encoder, offset + 24, depth)?;
1417 self.3.encode(encoder, offset + 25, depth)?;
1418 Ok(())
1419 }
1420 }
1421
1422 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
1423 for LocalServiceDelegateOnCharacteristicConfigurationRequest
1424 {
1425 #[inline(always)]
1426 fn new_empty() -> Self {
1427 Self {
1428 characteristic_id: fidl::new_empty!(u64, D),
1429 peer_id: fidl::new_empty!(fidl::encoding::BoundedString<16>, D),
1430 notify: fidl::new_empty!(bool, D),
1431 indicate: fidl::new_empty!(bool, D),
1432 }
1433 }
1434
1435 #[inline]
1436 unsafe fn decode(
1437 &mut self,
1438 decoder: &mut fidl::encoding::Decoder<'_, D>,
1439 offset: usize,
1440 _depth: fidl::encoding::Depth,
1441 ) -> fidl::Result<()> {
1442 decoder.debug_check_bounds::<Self>(offset);
1443 let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(24) };
1445 let padval = unsafe { (ptr as *const u64).read_unaligned() };
1446 let mask = 0xffffffffffff0000u64;
1447 let maskedval = padval & mask;
1448 if maskedval != 0 {
1449 return Err(fidl::Error::NonZeroPadding {
1450 padding_start: offset + 24 + ((mask as u64).trailing_zeros() / 8) as usize,
1451 });
1452 }
1453 fidl::decode!(u64, D, &mut self.characteristic_id, decoder, offset + 0, _depth)?;
1454 fidl::decode!(
1455 fidl::encoding::BoundedString<16>,
1456 D,
1457 &mut self.peer_id,
1458 decoder,
1459 offset + 8,
1460 _depth
1461 )?;
1462 fidl::decode!(bool, D, &mut self.notify, decoder, offset + 24, _depth)?;
1463 fidl::decode!(bool, D, &mut self.indicate, decoder, offset + 25, _depth)?;
1464 Ok(())
1465 }
1466 }
1467
1468 impl fidl::encoding::ValueTypeMarker for LocalServiceDelegateOnReadValueRequest {
1469 type Borrowed<'a> = &'a Self;
1470 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1471 value
1472 }
1473 }
1474
1475 unsafe impl fidl::encoding::TypeMarker for LocalServiceDelegateOnReadValueRequest {
1476 type Owned = Self;
1477
1478 #[inline(always)]
1479 fn inline_align(_context: fidl::encoding::Context) -> usize {
1480 8
1481 }
1482
1483 #[inline(always)]
1484 fn inline_size(_context: fidl::encoding::Context) -> usize {
1485 16
1486 }
1487 }
1488
1489 unsafe impl<D: fidl::encoding::ResourceDialect>
1490 fidl::encoding::Encode<LocalServiceDelegateOnReadValueRequest, D>
1491 for &LocalServiceDelegateOnReadValueRequest
1492 {
1493 #[inline]
1494 unsafe fn encode(
1495 self,
1496 encoder: &mut fidl::encoding::Encoder<'_, D>,
1497 offset: usize,
1498 _depth: fidl::encoding::Depth,
1499 ) -> fidl::Result<()> {
1500 encoder.debug_check_bounds::<LocalServiceDelegateOnReadValueRequest>(offset);
1501 unsafe {
1502 let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
1504 (buf_ptr as *mut LocalServiceDelegateOnReadValueRequest).write_unaligned(
1505 (self as *const LocalServiceDelegateOnReadValueRequest).read(),
1506 );
1507 let padding_ptr = buf_ptr.offset(8) as *mut u64;
1510 let padding_mask = 0xffffffff00000000u64;
1511 padding_ptr.write_unaligned(padding_ptr.read_unaligned() & !padding_mask);
1512 }
1513 Ok(())
1514 }
1515 }
1516 unsafe impl<
1517 D: fidl::encoding::ResourceDialect,
1518 T0: fidl::encoding::Encode<u64, D>,
1519 T1: fidl::encoding::Encode<i32, D>,
1520 > fidl::encoding::Encode<LocalServiceDelegateOnReadValueRequest, D> for (T0, T1)
1521 {
1522 #[inline]
1523 unsafe fn encode(
1524 self,
1525 encoder: &mut fidl::encoding::Encoder<'_, D>,
1526 offset: usize,
1527 depth: fidl::encoding::Depth,
1528 ) -> fidl::Result<()> {
1529 encoder.debug_check_bounds::<LocalServiceDelegateOnReadValueRequest>(offset);
1530 unsafe {
1533 let ptr = encoder.buf.as_mut_ptr().add(offset).offset(8);
1534 (ptr as *mut u64).write_unaligned(0);
1535 }
1536 self.0.encode(encoder, offset + 0, depth)?;
1538 self.1.encode(encoder, offset + 8, depth)?;
1539 Ok(())
1540 }
1541 }
1542
1543 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
1544 for LocalServiceDelegateOnReadValueRequest
1545 {
1546 #[inline(always)]
1547 fn new_empty() -> Self {
1548 Self { id: fidl::new_empty!(u64, D), offset: fidl::new_empty!(i32, D) }
1549 }
1550
1551 #[inline]
1552 unsafe fn decode(
1553 &mut self,
1554 decoder: &mut fidl::encoding::Decoder<'_, D>,
1555 offset: usize,
1556 _depth: fidl::encoding::Depth,
1557 ) -> fidl::Result<()> {
1558 decoder.debug_check_bounds::<Self>(offset);
1559 let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
1560 let ptr = unsafe { buf_ptr.offset(8) };
1562 let padval = unsafe { (ptr as *const u64).read_unaligned() };
1563 let mask = 0xffffffff00000000u64;
1564 let maskedval = padval & mask;
1565 if maskedval != 0 {
1566 return Err(fidl::Error::NonZeroPadding {
1567 padding_start: offset + 8 + ((mask as u64).trailing_zeros() / 8) as usize,
1568 });
1569 }
1570 unsafe {
1572 std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 16);
1573 }
1574 Ok(())
1575 }
1576 }
1577
1578 impl fidl::encoding::ValueTypeMarker for LocalServiceDelegateOnReadValueResponse {
1579 type Borrowed<'a> = &'a Self;
1580 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1581 value
1582 }
1583 }
1584
1585 unsafe impl fidl::encoding::TypeMarker for LocalServiceDelegateOnReadValueResponse {
1586 type Owned = Self;
1587
1588 #[inline(always)]
1589 fn inline_align(_context: fidl::encoding::Context) -> usize {
1590 8
1591 }
1592
1593 #[inline(always)]
1594 fn inline_size(_context: fidl::encoding::Context) -> usize {
1595 24
1596 }
1597 }
1598
1599 unsafe impl<D: fidl::encoding::ResourceDialect>
1600 fidl::encoding::Encode<LocalServiceDelegateOnReadValueResponse, D>
1601 for &LocalServiceDelegateOnReadValueResponse
1602 {
1603 #[inline]
1604 unsafe fn encode(
1605 self,
1606 encoder: &mut fidl::encoding::Encoder<'_, D>,
1607 offset: usize,
1608 _depth: fidl::encoding::Depth,
1609 ) -> fidl::Result<()> {
1610 encoder.debug_check_bounds::<LocalServiceDelegateOnReadValueResponse>(offset);
1611 fidl::encoding::Encode::<LocalServiceDelegateOnReadValueResponse, D>::encode(
1613 (
1614 <fidl::encoding::Optional<fidl::encoding::UnboundedVector<u8>> as fidl::encoding::ValueTypeMarker>::borrow(&self.value),
1615 <ErrorCode as fidl::encoding::ValueTypeMarker>::borrow(&self.status),
1616 ),
1617 encoder, offset, _depth
1618 )
1619 }
1620 }
1621 unsafe impl<
1622 D: fidl::encoding::ResourceDialect,
1623 T0: fidl::encoding::Encode<
1624 fidl::encoding::Optional<fidl::encoding::UnboundedVector<u8>>,
1625 D,
1626 >,
1627 T1: fidl::encoding::Encode<ErrorCode, D>,
1628 > fidl::encoding::Encode<LocalServiceDelegateOnReadValueResponse, D> for (T0, T1)
1629 {
1630 #[inline]
1631 unsafe fn encode(
1632 self,
1633 encoder: &mut fidl::encoding::Encoder<'_, D>,
1634 offset: usize,
1635 depth: fidl::encoding::Depth,
1636 ) -> fidl::Result<()> {
1637 encoder.debug_check_bounds::<LocalServiceDelegateOnReadValueResponse>(offset);
1638 unsafe {
1641 let ptr = encoder.buf.as_mut_ptr().add(offset).offset(16);
1642 (ptr as *mut u64).write_unaligned(0);
1643 }
1644 self.0.encode(encoder, offset + 0, depth)?;
1646 self.1.encode(encoder, offset + 16, depth)?;
1647 Ok(())
1648 }
1649 }
1650
1651 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
1652 for LocalServiceDelegateOnReadValueResponse
1653 {
1654 #[inline(always)]
1655 fn new_empty() -> Self {
1656 Self {
1657 value: fidl::new_empty!(
1658 fidl::encoding::Optional<fidl::encoding::UnboundedVector<u8>>,
1659 D
1660 ),
1661 status: fidl::new_empty!(ErrorCode, D),
1662 }
1663 }
1664
1665 #[inline]
1666 unsafe fn decode(
1667 &mut self,
1668 decoder: &mut fidl::encoding::Decoder<'_, D>,
1669 offset: usize,
1670 _depth: fidl::encoding::Depth,
1671 ) -> fidl::Result<()> {
1672 decoder.debug_check_bounds::<Self>(offset);
1673 let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(16) };
1675 let padval = unsafe { (ptr as *const u64).read_unaligned() };
1676 let mask = 0xffffffff00000000u64;
1677 let maskedval = padval & mask;
1678 if maskedval != 0 {
1679 return Err(fidl::Error::NonZeroPadding {
1680 padding_start: offset + 16 + ((mask as u64).trailing_zeros() / 8) as usize,
1681 });
1682 }
1683 fidl::decode!(
1684 fidl::encoding::Optional<fidl::encoding::UnboundedVector<u8>>,
1685 D,
1686 &mut self.value,
1687 decoder,
1688 offset + 0,
1689 _depth
1690 )?;
1691 fidl::decode!(ErrorCode, D, &mut self.status, decoder, offset + 16, _depth)?;
1692 Ok(())
1693 }
1694 }
1695
1696 impl fidl::encoding::ValueTypeMarker for LocalServiceDelegateOnWriteValueRequest {
1697 type Borrowed<'a> = &'a Self;
1698 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1699 value
1700 }
1701 }
1702
1703 unsafe impl fidl::encoding::TypeMarker for LocalServiceDelegateOnWriteValueRequest {
1704 type Owned = Self;
1705
1706 #[inline(always)]
1707 fn inline_align(_context: fidl::encoding::Context) -> usize {
1708 8
1709 }
1710
1711 #[inline(always)]
1712 fn inline_size(_context: fidl::encoding::Context) -> usize {
1713 32
1714 }
1715 }
1716
1717 unsafe impl<D: fidl::encoding::ResourceDialect>
1718 fidl::encoding::Encode<LocalServiceDelegateOnWriteValueRequest, D>
1719 for &LocalServiceDelegateOnWriteValueRequest
1720 {
1721 #[inline]
1722 unsafe fn encode(
1723 self,
1724 encoder: &mut fidl::encoding::Encoder<'_, D>,
1725 offset: usize,
1726 _depth: fidl::encoding::Depth,
1727 ) -> fidl::Result<()> {
1728 encoder.debug_check_bounds::<LocalServiceDelegateOnWriteValueRequest>(offset);
1729 fidl::encoding::Encode::<LocalServiceDelegateOnWriteValueRequest, D>::encode(
1731 (
1732 <u64 as fidl::encoding::ValueTypeMarker>::borrow(&self.id),
1733 <u16 as fidl::encoding::ValueTypeMarker>::borrow(&self.offset),
1734 <fidl::encoding::UnboundedVector<u8> as fidl::encoding::ValueTypeMarker>::borrow(&self.value),
1735 ),
1736 encoder, offset, _depth
1737 )
1738 }
1739 }
1740 unsafe impl<
1741 D: fidl::encoding::ResourceDialect,
1742 T0: fidl::encoding::Encode<u64, D>,
1743 T1: fidl::encoding::Encode<u16, D>,
1744 T2: fidl::encoding::Encode<fidl::encoding::UnboundedVector<u8>, D>,
1745 > fidl::encoding::Encode<LocalServiceDelegateOnWriteValueRequest, D> for (T0, T1, T2)
1746 {
1747 #[inline]
1748 unsafe fn encode(
1749 self,
1750 encoder: &mut fidl::encoding::Encoder<'_, D>,
1751 offset: usize,
1752 depth: fidl::encoding::Depth,
1753 ) -> fidl::Result<()> {
1754 encoder.debug_check_bounds::<LocalServiceDelegateOnWriteValueRequest>(offset);
1755 unsafe {
1758 let ptr = encoder.buf.as_mut_ptr().add(offset).offset(8);
1759 (ptr as *mut u64).write_unaligned(0);
1760 }
1761 self.0.encode(encoder, offset + 0, depth)?;
1763 self.1.encode(encoder, offset + 8, depth)?;
1764 self.2.encode(encoder, offset + 16, depth)?;
1765 Ok(())
1766 }
1767 }
1768
1769 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
1770 for LocalServiceDelegateOnWriteValueRequest
1771 {
1772 #[inline(always)]
1773 fn new_empty() -> Self {
1774 Self {
1775 id: fidl::new_empty!(u64, D),
1776 offset: fidl::new_empty!(u16, D),
1777 value: fidl::new_empty!(fidl::encoding::UnboundedVector<u8>, D),
1778 }
1779 }
1780
1781 #[inline]
1782 unsafe fn decode(
1783 &mut self,
1784 decoder: &mut fidl::encoding::Decoder<'_, D>,
1785 offset: usize,
1786 _depth: fidl::encoding::Depth,
1787 ) -> fidl::Result<()> {
1788 decoder.debug_check_bounds::<Self>(offset);
1789 let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(8) };
1791 let padval = unsafe { (ptr as *const u64).read_unaligned() };
1792 let mask = 0xffffffffffff0000u64;
1793 let maskedval = padval & mask;
1794 if maskedval != 0 {
1795 return Err(fidl::Error::NonZeroPadding {
1796 padding_start: offset + 8 + ((mask as u64).trailing_zeros() / 8) as usize,
1797 });
1798 }
1799 fidl::decode!(u64, D, &mut self.id, decoder, offset + 0, _depth)?;
1800 fidl::decode!(u16, D, &mut self.offset, decoder, offset + 8, _depth)?;
1801 fidl::decode!(
1802 fidl::encoding::UnboundedVector<u8>,
1803 D,
1804 &mut self.value,
1805 decoder,
1806 offset + 16,
1807 _depth
1808 )?;
1809 Ok(())
1810 }
1811 }
1812
1813 impl fidl::encoding::ValueTypeMarker for LocalServiceDelegateOnWriteValueResponse {
1814 type Borrowed<'a> = &'a Self;
1815 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1816 value
1817 }
1818 }
1819
1820 unsafe impl fidl::encoding::TypeMarker for LocalServiceDelegateOnWriteValueResponse {
1821 type Owned = Self;
1822
1823 #[inline(always)]
1824 fn inline_align(_context: fidl::encoding::Context) -> usize {
1825 4
1826 }
1827
1828 #[inline(always)]
1829 fn inline_size(_context: fidl::encoding::Context) -> usize {
1830 4
1831 }
1832 }
1833
1834 unsafe impl<D: fidl::encoding::ResourceDialect>
1835 fidl::encoding::Encode<LocalServiceDelegateOnWriteValueResponse, D>
1836 for &LocalServiceDelegateOnWriteValueResponse
1837 {
1838 #[inline]
1839 unsafe fn encode(
1840 self,
1841 encoder: &mut fidl::encoding::Encoder<'_, D>,
1842 offset: usize,
1843 _depth: fidl::encoding::Depth,
1844 ) -> fidl::Result<()> {
1845 encoder.debug_check_bounds::<LocalServiceDelegateOnWriteValueResponse>(offset);
1846 fidl::encoding::Encode::<LocalServiceDelegateOnWriteValueResponse, D>::encode(
1848 (<ErrorCode as fidl::encoding::ValueTypeMarker>::borrow(&self.status),),
1849 encoder,
1850 offset,
1851 _depth,
1852 )
1853 }
1854 }
1855 unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<ErrorCode, D>>
1856 fidl::encoding::Encode<LocalServiceDelegateOnWriteValueResponse, D> for (T0,)
1857 {
1858 #[inline]
1859 unsafe fn encode(
1860 self,
1861 encoder: &mut fidl::encoding::Encoder<'_, D>,
1862 offset: usize,
1863 depth: fidl::encoding::Depth,
1864 ) -> fidl::Result<()> {
1865 encoder.debug_check_bounds::<LocalServiceDelegateOnWriteValueResponse>(offset);
1866 self.0.encode(encoder, offset + 0, depth)?;
1870 Ok(())
1871 }
1872 }
1873
1874 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
1875 for LocalServiceDelegateOnWriteValueResponse
1876 {
1877 #[inline(always)]
1878 fn new_empty() -> Self {
1879 Self { status: fidl::new_empty!(ErrorCode, D) }
1880 }
1881
1882 #[inline]
1883 unsafe fn decode(
1884 &mut self,
1885 decoder: &mut fidl::encoding::Decoder<'_, D>,
1886 offset: usize,
1887 _depth: fidl::encoding::Depth,
1888 ) -> fidl::Result<()> {
1889 decoder.debug_check_bounds::<Self>(offset);
1890 fidl::decode!(ErrorCode, D, &mut self.status, decoder, offset + 0, _depth)?;
1892 Ok(())
1893 }
1894 }
1895
1896 impl fidl::encoding::ValueTypeMarker for LocalServiceDelegateOnWriteWithoutResponseRequest {
1897 type Borrowed<'a> = &'a Self;
1898 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1899 value
1900 }
1901 }
1902
1903 unsafe impl fidl::encoding::TypeMarker for LocalServiceDelegateOnWriteWithoutResponseRequest {
1904 type Owned = Self;
1905
1906 #[inline(always)]
1907 fn inline_align(_context: fidl::encoding::Context) -> usize {
1908 8
1909 }
1910
1911 #[inline(always)]
1912 fn inline_size(_context: fidl::encoding::Context) -> usize {
1913 32
1914 }
1915 }
1916
1917 unsafe impl<D: fidl::encoding::ResourceDialect>
1918 fidl::encoding::Encode<LocalServiceDelegateOnWriteWithoutResponseRequest, D>
1919 for &LocalServiceDelegateOnWriteWithoutResponseRequest
1920 {
1921 #[inline]
1922 unsafe fn encode(
1923 self,
1924 encoder: &mut fidl::encoding::Encoder<'_, D>,
1925 offset: usize,
1926 _depth: fidl::encoding::Depth,
1927 ) -> fidl::Result<()> {
1928 encoder.debug_check_bounds::<LocalServiceDelegateOnWriteWithoutResponseRequest>(offset);
1929 fidl::encoding::Encode::<LocalServiceDelegateOnWriteWithoutResponseRequest, D>::encode(
1931 (
1932 <u64 as fidl::encoding::ValueTypeMarker>::borrow(&self.id),
1933 <u16 as fidl::encoding::ValueTypeMarker>::borrow(&self.offset),
1934 <fidl::encoding::UnboundedVector<u8> as fidl::encoding::ValueTypeMarker>::borrow(&self.value),
1935 ),
1936 encoder, offset, _depth
1937 )
1938 }
1939 }
1940 unsafe impl<
1941 D: fidl::encoding::ResourceDialect,
1942 T0: fidl::encoding::Encode<u64, D>,
1943 T1: fidl::encoding::Encode<u16, D>,
1944 T2: fidl::encoding::Encode<fidl::encoding::UnboundedVector<u8>, D>,
1945 > fidl::encoding::Encode<LocalServiceDelegateOnWriteWithoutResponseRequest, D>
1946 for (T0, T1, T2)
1947 {
1948 #[inline]
1949 unsafe fn encode(
1950 self,
1951 encoder: &mut fidl::encoding::Encoder<'_, D>,
1952 offset: usize,
1953 depth: fidl::encoding::Depth,
1954 ) -> fidl::Result<()> {
1955 encoder.debug_check_bounds::<LocalServiceDelegateOnWriteWithoutResponseRequest>(offset);
1956 unsafe {
1959 let ptr = encoder.buf.as_mut_ptr().add(offset).offset(8);
1960 (ptr as *mut u64).write_unaligned(0);
1961 }
1962 self.0.encode(encoder, offset + 0, depth)?;
1964 self.1.encode(encoder, offset + 8, depth)?;
1965 self.2.encode(encoder, offset + 16, depth)?;
1966 Ok(())
1967 }
1968 }
1969
1970 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
1971 for LocalServiceDelegateOnWriteWithoutResponseRequest
1972 {
1973 #[inline(always)]
1974 fn new_empty() -> Self {
1975 Self {
1976 id: fidl::new_empty!(u64, D),
1977 offset: fidl::new_empty!(u16, D),
1978 value: fidl::new_empty!(fidl::encoding::UnboundedVector<u8>, D),
1979 }
1980 }
1981
1982 #[inline]
1983 unsafe fn decode(
1984 &mut self,
1985 decoder: &mut fidl::encoding::Decoder<'_, D>,
1986 offset: usize,
1987 _depth: fidl::encoding::Depth,
1988 ) -> fidl::Result<()> {
1989 decoder.debug_check_bounds::<Self>(offset);
1990 let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(8) };
1992 let padval = unsafe { (ptr as *const u64).read_unaligned() };
1993 let mask = 0xffffffffffff0000u64;
1994 let maskedval = padval & mask;
1995 if maskedval != 0 {
1996 return Err(fidl::Error::NonZeroPadding {
1997 padding_start: offset + 8 + ((mask as u64).trailing_zeros() / 8) as usize,
1998 });
1999 }
2000 fidl::decode!(u64, D, &mut self.id, decoder, offset + 0, _depth)?;
2001 fidl::decode!(u16, D, &mut self.offset, decoder, offset + 8, _depth)?;
2002 fidl::decode!(
2003 fidl::encoding::UnboundedVector<u8>,
2004 D,
2005 &mut self.value,
2006 decoder,
2007 offset + 16,
2008 _depth
2009 )?;
2010 Ok(())
2011 }
2012 }
2013
2014 impl fidl::encoding::ValueTypeMarker for LocalServiceNotifyValueRequest {
2015 type Borrowed<'a> = &'a Self;
2016 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
2017 value
2018 }
2019 }
2020
2021 unsafe impl fidl::encoding::TypeMarker for LocalServiceNotifyValueRequest {
2022 type Owned = Self;
2023
2024 #[inline(always)]
2025 fn inline_align(_context: fidl::encoding::Context) -> usize {
2026 8
2027 }
2028
2029 #[inline(always)]
2030 fn inline_size(_context: fidl::encoding::Context) -> usize {
2031 48
2032 }
2033 }
2034
2035 unsafe impl<D: fidl::encoding::ResourceDialect>
2036 fidl::encoding::Encode<LocalServiceNotifyValueRequest, D>
2037 for &LocalServiceNotifyValueRequest
2038 {
2039 #[inline]
2040 unsafe fn encode(
2041 self,
2042 encoder: &mut fidl::encoding::Encoder<'_, D>,
2043 offset: usize,
2044 _depth: fidl::encoding::Depth,
2045 ) -> fidl::Result<()> {
2046 encoder.debug_check_bounds::<LocalServiceNotifyValueRequest>(offset);
2047 fidl::encoding::Encode::<LocalServiceNotifyValueRequest, D>::encode(
2049 (
2050 <u64 as fidl::encoding::ValueTypeMarker>::borrow(&self.characteristic_id),
2051 <fidl::encoding::BoundedString<16> as fidl::encoding::ValueTypeMarker>::borrow(&self.peer_id),
2052 <fidl::encoding::UnboundedVector<u8> as fidl::encoding::ValueTypeMarker>::borrow(&self.value),
2053 <bool as fidl::encoding::ValueTypeMarker>::borrow(&self.confirm),
2054 ),
2055 encoder, offset, _depth
2056 )
2057 }
2058 }
2059 unsafe impl<
2060 D: fidl::encoding::ResourceDialect,
2061 T0: fidl::encoding::Encode<u64, D>,
2062 T1: fidl::encoding::Encode<fidl::encoding::BoundedString<16>, D>,
2063 T2: fidl::encoding::Encode<fidl::encoding::UnboundedVector<u8>, D>,
2064 T3: fidl::encoding::Encode<bool, D>,
2065 > fidl::encoding::Encode<LocalServiceNotifyValueRequest, D> for (T0, T1, T2, T3)
2066 {
2067 #[inline]
2068 unsafe fn encode(
2069 self,
2070 encoder: &mut fidl::encoding::Encoder<'_, D>,
2071 offset: usize,
2072 depth: fidl::encoding::Depth,
2073 ) -> fidl::Result<()> {
2074 encoder.debug_check_bounds::<LocalServiceNotifyValueRequest>(offset);
2075 unsafe {
2078 let ptr = encoder.buf.as_mut_ptr().add(offset).offset(40);
2079 (ptr as *mut u64).write_unaligned(0);
2080 }
2081 self.0.encode(encoder, offset + 0, depth)?;
2083 self.1.encode(encoder, offset + 8, depth)?;
2084 self.2.encode(encoder, offset + 24, depth)?;
2085 self.3.encode(encoder, offset + 40, depth)?;
2086 Ok(())
2087 }
2088 }
2089
2090 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
2091 for LocalServiceNotifyValueRequest
2092 {
2093 #[inline(always)]
2094 fn new_empty() -> Self {
2095 Self {
2096 characteristic_id: fidl::new_empty!(u64, D),
2097 peer_id: fidl::new_empty!(fidl::encoding::BoundedString<16>, D),
2098 value: fidl::new_empty!(fidl::encoding::UnboundedVector<u8>, D),
2099 confirm: fidl::new_empty!(bool, D),
2100 }
2101 }
2102
2103 #[inline]
2104 unsafe fn decode(
2105 &mut self,
2106 decoder: &mut fidl::encoding::Decoder<'_, D>,
2107 offset: usize,
2108 _depth: fidl::encoding::Depth,
2109 ) -> fidl::Result<()> {
2110 decoder.debug_check_bounds::<Self>(offset);
2111 let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(40) };
2113 let padval = unsafe { (ptr as *const u64).read_unaligned() };
2114 let mask = 0xffffffffffffff00u64;
2115 let maskedval = padval & mask;
2116 if maskedval != 0 {
2117 return Err(fidl::Error::NonZeroPadding {
2118 padding_start: offset + 40 + ((mask as u64).trailing_zeros() / 8) as usize,
2119 });
2120 }
2121 fidl::decode!(u64, D, &mut self.characteristic_id, decoder, offset + 0, _depth)?;
2122 fidl::decode!(
2123 fidl::encoding::BoundedString<16>,
2124 D,
2125 &mut self.peer_id,
2126 decoder,
2127 offset + 8,
2128 _depth
2129 )?;
2130 fidl::decode!(
2131 fidl::encoding::UnboundedVector<u8>,
2132 D,
2133 &mut self.value,
2134 decoder,
2135 offset + 24,
2136 _depth
2137 )?;
2138 fidl::decode!(bool, D, &mut self.confirm, decoder, offset + 40, _depth)?;
2139 Ok(())
2140 }
2141 }
2142
2143 impl fidl::encoding::ValueTypeMarker for RemoteServiceDiscoverCharacteristicsResponse {
2144 type Borrowed<'a> = &'a Self;
2145 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
2146 value
2147 }
2148 }
2149
2150 unsafe impl fidl::encoding::TypeMarker for RemoteServiceDiscoverCharacteristicsResponse {
2151 type Owned = Self;
2152
2153 #[inline(always)]
2154 fn inline_align(_context: fidl::encoding::Context) -> usize {
2155 8
2156 }
2157
2158 #[inline(always)]
2159 fn inline_size(_context: fidl::encoding::Context) -> usize {
2160 24
2161 }
2162 }
2163
2164 unsafe impl<D: fidl::encoding::ResourceDialect>
2165 fidl::encoding::Encode<RemoteServiceDiscoverCharacteristicsResponse, D>
2166 for &RemoteServiceDiscoverCharacteristicsResponse
2167 {
2168 #[inline]
2169 unsafe fn encode(
2170 self,
2171 encoder: &mut fidl::encoding::Encoder<'_, D>,
2172 offset: usize,
2173 _depth: fidl::encoding::Depth,
2174 ) -> fidl::Result<()> {
2175 encoder.debug_check_bounds::<RemoteServiceDiscoverCharacteristicsResponse>(offset);
2176 fidl::encoding::Encode::<RemoteServiceDiscoverCharacteristicsResponse, D>::encode(
2178 (
2179 <fidl_fuchsia_bluetooth::Status as fidl::encoding::ValueTypeMarker>::borrow(&self.status),
2180 <fidl::encoding::Vector<Characteristic, 32767> as fidl::encoding::ValueTypeMarker>::borrow(&self.characteristics),
2181 ),
2182 encoder, offset, _depth
2183 )
2184 }
2185 }
2186 unsafe impl<
2187 D: fidl::encoding::ResourceDialect,
2188 T0: fidl::encoding::Encode<fidl_fuchsia_bluetooth::Status, D>,
2189 T1: fidl::encoding::Encode<fidl::encoding::Vector<Characteristic, 32767>, D>,
2190 > fidl::encoding::Encode<RemoteServiceDiscoverCharacteristicsResponse, D> for (T0, T1)
2191 {
2192 #[inline]
2193 unsafe fn encode(
2194 self,
2195 encoder: &mut fidl::encoding::Encoder<'_, D>,
2196 offset: usize,
2197 depth: fidl::encoding::Depth,
2198 ) -> fidl::Result<()> {
2199 encoder.debug_check_bounds::<RemoteServiceDiscoverCharacteristicsResponse>(offset);
2200 self.0.encode(encoder, offset + 0, depth)?;
2204 self.1.encode(encoder, offset + 8, depth)?;
2205 Ok(())
2206 }
2207 }
2208
2209 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
2210 for RemoteServiceDiscoverCharacteristicsResponse
2211 {
2212 #[inline(always)]
2213 fn new_empty() -> Self {
2214 Self {
2215 status: fidl::new_empty!(fidl_fuchsia_bluetooth::Status, D),
2216 characteristics: fidl::new_empty!(fidl::encoding::Vector<Characteristic, 32767>, D),
2217 }
2218 }
2219
2220 #[inline]
2221 unsafe fn decode(
2222 &mut self,
2223 decoder: &mut fidl::encoding::Decoder<'_, D>,
2224 offset: usize,
2225 _depth: fidl::encoding::Depth,
2226 ) -> fidl::Result<()> {
2227 decoder.debug_check_bounds::<Self>(offset);
2228 fidl::decode!(
2230 fidl_fuchsia_bluetooth::Status,
2231 D,
2232 &mut self.status,
2233 decoder,
2234 offset + 0,
2235 _depth
2236 )?;
2237 fidl::decode!(fidl::encoding::Vector<Characteristic, 32767>, D, &mut self.characteristics, decoder, offset + 8, _depth)?;
2238 Ok(())
2239 }
2240 }
2241
2242 impl fidl::encoding::ValueTypeMarker for RemoteServiceNotifyCharacteristicRequest {
2243 type Borrowed<'a> = &'a Self;
2244 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
2245 value
2246 }
2247 }
2248
2249 unsafe impl fidl::encoding::TypeMarker for RemoteServiceNotifyCharacteristicRequest {
2250 type Owned = Self;
2251
2252 #[inline(always)]
2253 fn inline_align(_context: fidl::encoding::Context) -> usize {
2254 8
2255 }
2256
2257 #[inline(always)]
2258 fn inline_size(_context: fidl::encoding::Context) -> usize {
2259 16
2260 }
2261 }
2262
2263 unsafe impl<D: fidl::encoding::ResourceDialect>
2264 fidl::encoding::Encode<RemoteServiceNotifyCharacteristicRequest, D>
2265 for &RemoteServiceNotifyCharacteristicRequest
2266 {
2267 #[inline]
2268 unsafe fn encode(
2269 self,
2270 encoder: &mut fidl::encoding::Encoder<'_, D>,
2271 offset: usize,
2272 _depth: fidl::encoding::Depth,
2273 ) -> fidl::Result<()> {
2274 encoder.debug_check_bounds::<RemoteServiceNotifyCharacteristicRequest>(offset);
2275 fidl::encoding::Encode::<RemoteServiceNotifyCharacteristicRequest, D>::encode(
2277 (
2278 <u64 as fidl::encoding::ValueTypeMarker>::borrow(&self.id),
2279 <bool as fidl::encoding::ValueTypeMarker>::borrow(&self.enable),
2280 ),
2281 encoder,
2282 offset,
2283 _depth,
2284 )
2285 }
2286 }
2287 unsafe impl<
2288 D: fidl::encoding::ResourceDialect,
2289 T0: fidl::encoding::Encode<u64, D>,
2290 T1: fidl::encoding::Encode<bool, D>,
2291 > fidl::encoding::Encode<RemoteServiceNotifyCharacteristicRequest, D> for (T0, T1)
2292 {
2293 #[inline]
2294 unsafe fn encode(
2295 self,
2296 encoder: &mut fidl::encoding::Encoder<'_, D>,
2297 offset: usize,
2298 depth: fidl::encoding::Depth,
2299 ) -> fidl::Result<()> {
2300 encoder.debug_check_bounds::<RemoteServiceNotifyCharacteristicRequest>(offset);
2301 unsafe {
2304 let ptr = encoder.buf.as_mut_ptr().add(offset).offset(8);
2305 (ptr as *mut u64).write_unaligned(0);
2306 }
2307 self.0.encode(encoder, offset + 0, depth)?;
2309 self.1.encode(encoder, offset + 8, depth)?;
2310 Ok(())
2311 }
2312 }
2313
2314 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
2315 for RemoteServiceNotifyCharacteristicRequest
2316 {
2317 #[inline(always)]
2318 fn new_empty() -> Self {
2319 Self { id: fidl::new_empty!(u64, D), enable: fidl::new_empty!(bool, D) }
2320 }
2321
2322 #[inline]
2323 unsafe fn decode(
2324 &mut self,
2325 decoder: &mut fidl::encoding::Decoder<'_, D>,
2326 offset: usize,
2327 _depth: fidl::encoding::Depth,
2328 ) -> fidl::Result<()> {
2329 decoder.debug_check_bounds::<Self>(offset);
2330 let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(8) };
2332 let padval = unsafe { (ptr as *const u64).read_unaligned() };
2333 let mask = 0xffffffffffffff00u64;
2334 let maskedval = padval & mask;
2335 if maskedval != 0 {
2336 return Err(fidl::Error::NonZeroPadding {
2337 padding_start: offset + 8 + ((mask as u64).trailing_zeros() / 8) as usize,
2338 });
2339 }
2340 fidl::decode!(u64, D, &mut self.id, decoder, offset + 0, _depth)?;
2341 fidl::decode!(bool, D, &mut self.enable, decoder, offset + 8, _depth)?;
2342 Ok(())
2343 }
2344 }
2345
2346 impl fidl::encoding::ValueTypeMarker for RemoteServiceNotifyCharacteristicResponse {
2347 type Borrowed<'a> = &'a Self;
2348 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
2349 value
2350 }
2351 }
2352
2353 unsafe impl fidl::encoding::TypeMarker for RemoteServiceNotifyCharacteristicResponse {
2354 type Owned = Self;
2355
2356 #[inline(always)]
2357 fn inline_align(_context: fidl::encoding::Context) -> usize {
2358 8
2359 }
2360
2361 #[inline(always)]
2362 fn inline_size(_context: fidl::encoding::Context) -> usize {
2363 8
2364 }
2365 }
2366
2367 unsafe impl<D: fidl::encoding::ResourceDialect>
2368 fidl::encoding::Encode<RemoteServiceNotifyCharacteristicResponse, D>
2369 for &RemoteServiceNotifyCharacteristicResponse
2370 {
2371 #[inline]
2372 unsafe fn encode(
2373 self,
2374 encoder: &mut fidl::encoding::Encoder<'_, D>,
2375 offset: usize,
2376 _depth: fidl::encoding::Depth,
2377 ) -> fidl::Result<()> {
2378 encoder.debug_check_bounds::<RemoteServiceNotifyCharacteristicResponse>(offset);
2379 fidl::encoding::Encode::<RemoteServiceNotifyCharacteristicResponse, D>::encode(
2381 (<fidl_fuchsia_bluetooth::Status as fidl::encoding::ValueTypeMarker>::borrow(
2382 &self.status,
2383 ),),
2384 encoder,
2385 offset,
2386 _depth,
2387 )
2388 }
2389 }
2390 unsafe impl<
2391 D: fidl::encoding::ResourceDialect,
2392 T0: fidl::encoding::Encode<fidl_fuchsia_bluetooth::Status, D>,
2393 > fidl::encoding::Encode<RemoteServiceNotifyCharacteristicResponse, D> for (T0,)
2394 {
2395 #[inline]
2396 unsafe fn encode(
2397 self,
2398 encoder: &mut fidl::encoding::Encoder<'_, D>,
2399 offset: usize,
2400 depth: fidl::encoding::Depth,
2401 ) -> fidl::Result<()> {
2402 encoder.debug_check_bounds::<RemoteServiceNotifyCharacteristicResponse>(offset);
2403 self.0.encode(encoder, offset + 0, depth)?;
2407 Ok(())
2408 }
2409 }
2410
2411 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
2412 for RemoteServiceNotifyCharacteristicResponse
2413 {
2414 #[inline(always)]
2415 fn new_empty() -> Self {
2416 Self { status: fidl::new_empty!(fidl_fuchsia_bluetooth::Status, D) }
2417 }
2418
2419 #[inline]
2420 unsafe fn decode(
2421 &mut self,
2422 decoder: &mut fidl::encoding::Decoder<'_, D>,
2423 offset: usize,
2424 _depth: fidl::encoding::Depth,
2425 ) -> fidl::Result<()> {
2426 decoder.debug_check_bounds::<Self>(offset);
2427 fidl::decode!(
2429 fidl_fuchsia_bluetooth::Status,
2430 D,
2431 &mut self.status,
2432 decoder,
2433 offset + 0,
2434 _depth
2435 )?;
2436 Ok(())
2437 }
2438 }
2439
2440 impl fidl::encoding::ValueTypeMarker for RemoteServiceOnCharacteristicValueUpdatedRequest {
2441 type Borrowed<'a> = &'a Self;
2442 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
2443 value
2444 }
2445 }
2446
2447 unsafe impl fidl::encoding::TypeMarker for RemoteServiceOnCharacteristicValueUpdatedRequest {
2448 type Owned = Self;
2449
2450 #[inline(always)]
2451 fn inline_align(_context: fidl::encoding::Context) -> usize {
2452 8
2453 }
2454
2455 #[inline(always)]
2456 fn inline_size(_context: fidl::encoding::Context) -> usize {
2457 24
2458 }
2459 }
2460
2461 unsafe impl<D: fidl::encoding::ResourceDialect>
2462 fidl::encoding::Encode<RemoteServiceOnCharacteristicValueUpdatedRequest, D>
2463 for &RemoteServiceOnCharacteristicValueUpdatedRequest
2464 {
2465 #[inline]
2466 unsafe fn encode(
2467 self,
2468 encoder: &mut fidl::encoding::Encoder<'_, D>,
2469 offset: usize,
2470 _depth: fidl::encoding::Depth,
2471 ) -> fidl::Result<()> {
2472 encoder.debug_check_bounds::<RemoteServiceOnCharacteristicValueUpdatedRequest>(offset);
2473 fidl::encoding::Encode::<RemoteServiceOnCharacteristicValueUpdatedRequest, D>::encode(
2475 (
2476 <u64 as fidl::encoding::ValueTypeMarker>::borrow(&self.id),
2477 <fidl::encoding::UnboundedVector<u8> as fidl::encoding::ValueTypeMarker>::borrow(&self.value),
2478 ),
2479 encoder, offset, _depth
2480 )
2481 }
2482 }
2483 unsafe impl<
2484 D: fidl::encoding::ResourceDialect,
2485 T0: fidl::encoding::Encode<u64, D>,
2486 T1: fidl::encoding::Encode<fidl::encoding::UnboundedVector<u8>, D>,
2487 > fidl::encoding::Encode<RemoteServiceOnCharacteristicValueUpdatedRequest, D> for (T0, T1)
2488 {
2489 #[inline]
2490 unsafe fn encode(
2491 self,
2492 encoder: &mut fidl::encoding::Encoder<'_, D>,
2493 offset: usize,
2494 depth: fidl::encoding::Depth,
2495 ) -> fidl::Result<()> {
2496 encoder.debug_check_bounds::<RemoteServiceOnCharacteristicValueUpdatedRequest>(offset);
2497 self.0.encode(encoder, offset + 0, depth)?;
2501 self.1.encode(encoder, offset + 8, depth)?;
2502 Ok(())
2503 }
2504 }
2505
2506 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
2507 for RemoteServiceOnCharacteristicValueUpdatedRequest
2508 {
2509 #[inline(always)]
2510 fn new_empty() -> Self {
2511 Self {
2512 id: fidl::new_empty!(u64, D),
2513 value: fidl::new_empty!(fidl::encoding::UnboundedVector<u8>, D),
2514 }
2515 }
2516
2517 #[inline]
2518 unsafe fn decode(
2519 &mut self,
2520 decoder: &mut fidl::encoding::Decoder<'_, D>,
2521 offset: usize,
2522 _depth: fidl::encoding::Depth,
2523 ) -> fidl::Result<()> {
2524 decoder.debug_check_bounds::<Self>(offset);
2525 fidl::decode!(u64, D, &mut self.id, decoder, offset + 0, _depth)?;
2527 fidl::decode!(
2528 fidl::encoding::UnboundedVector<u8>,
2529 D,
2530 &mut self.value,
2531 decoder,
2532 offset + 8,
2533 _depth
2534 )?;
2535 Ok(())
2536 }
2537 }
2538
2539 impl fidl::encoding::ValueTypeMarker for RemoteServiceReadByTypeRequest {
2540 type Borrowed<'a> = &'a Self;
2541 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
2542 value
2543 }
2544 }
2545
2546 unsafe impl fidl::encoding::TypeMarker for RemoteServiceReadByTypeRequest {
2547 type Owned = Self;
2548
2549 #[inline(always)]
2550 fn inline_align(_context: fidl::encoding::Context) -> usize {
2551 1
2552 }
2553
2554 #[inline(always)]
2555 fn inline_size(_context: fidl::encoding::Context) -> usize {
2556 16
2557 }
2558 }
2559
2560 unsafe impl<D: fidl::encoding::ResourceDialect>
2561 fidl::encoding::Encode<RemoteServiceReadByTypeRequest, D>
2562 for &RemoteServiceReadByTypeRequest
2563 {
2564 #[inline]
2565 unsafe fn encode(
2566 self,
2567 encoder: &mut fidl::encoding::Encoder<'_, D>,
2568 offset: usize,
2569 _depth: fidl::encoding::Depth,
2570 ) -> fidl::Result<()> {
2571 encoder.debug_check_bounds::<RemoteServiceReadByTypeRequest>(offset);
2572 fidl::encoding::Encode::<RemoteServiceReadByTypeRequest, D>::encode(
2574 (<fidl_fuchsia_bluetooth::Uuid as fidl::encoding::ValueTypeMarker>::borrow(
2575 &self.uuid,
2576 ),),
2577 encoder,
2578 offset,
2579 _depth,
2580 )
2581 }
2582 }
2583 unsafe impl<
2584 D: fidl::encoding::ResourceDialect,
2585 T0: fidl::encoding::Encode<fidl_fuchsia_bluetooth::Uuid, D>,
2586 > fidl::encoding::Encode<RemoteServiceReadByTypeRequest, D> for (T0,)
2587 {
2588 #[inline]
2589 unsafe fn encode(
2590 self,
2591 encoder: &mut fidl::encoding::Encoder<'_, D>,
2592 offset: usize,
2593 depth: fidl::encoding::Depth,
2594 ) -> fidl::Result<()> {
2595 encoder.debug_check_bounds::<RemoteServiceReadByTypeRequest>(offset);
2596 self.0.encode(encoder, offset + 0, depth)?;
2600 Ok(())
2601 }
2602 }
2603
2604 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
2605 for RemoteServiceReadByTypeRequest
2606 {
2607 #[inline(always)]
2608 fn new_empty() -> Self {
2609 Self { uuid: fidl::new_empty!(fidl_fuchsia_bluetooth::Uuid, D) }
2610 }
2611
2612 #[inline]
2613 unsafe fn decode(
2614 &mut self,
2615 decoder: &mut fidl::encoding::Decoder<'_, D>,
2616 offset: usize,
2617 _depth: fidl::encoding::Depth,
2618 ) -> fidl::Result<()> {
2619 decoder.debug_check_bounds::<Self>(offset);
2620 fidl::decode!(
2622 fidl_fuchsia_bluetooth::Uuid,
2623 D,
2624 &mut self.uuid,
2625 decoder,
2626 offset + 0,
2627 _depth
2628 )?;
2629 Ok(())
2630 }
2631 }
2632
2633 impl fidl::encoding::ValueTypeMarker for RemoteServiceReadCharacteristicRequest {
2634 type Borrowed<'a> = &'a Self;
2635 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
2636 value
2637 }
2638 }
2639
2640 unsafe impl fidl::encoding::TypeMarker for RemoteServiceReadCharacteristicRequest {
2641 type Owned = Self;
2642
2643 #[inline(always)]
2644 fn inline_align(_context: fidl::encoding::Context) -> usize {
2645 8
2646 }
2647
2648 #[inline(always)]
2649 fn inline_size(_context: fidl::encoding::Context) -> usize {
2650 8
2651 }
2652 #[inline(always)]
2653 fn encode_is_copy() -> bool {
2654 true
2655 }
2656
2657 #[inline(always)]
2658 fn decode_is_copy() -> bool {
2659 true
2660 }
2661 }
2662
2663 unsafe impl<D: fidl::encoding::ResourceDialect>
2664 fidl::encoding::Encode<RemoteServiceReadCharacteristicRequest, D>
2665 for &RemoteServiceReadCharacteristicRequest
2666 {
2667 #[inline]
2668 unsafe fn encode(
2669 self,
2670 encoder: &mut fidl::encoding::Encoder<'_, D>,
2671 offset: usize,
2672 _depth: fidl::encoding::Depth,
2673 ) -> fidl::Result<()> {
2674 encoder.debug_check_bounds::<RemoteServiceReadCharacteristicRequest>(offset);
2675 unsafe {
2676 let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
2678 (buf_ptr as *mut RemoteServiceReadCharacteristicRequest).write_unaligned(
2679 (self as *const RemoteServiceReadCharacteristicRequest).read(),
2680 );
2681 }
2684 Ok(())
2685 }
2686 }
2687 unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<u64, D>>
2688 fidl::encoding::Encode<RemoteServiceReadCharacteristicRequest, D> for (T0,)
2689 {
2690 #[inline]
2691 unsafe fn encode(
2692 self,
2693 encoder: &mut fidl::encoding::Encoder<'_, D>,
2694 offset: usize,
2695 depth: fidl::encoding::Depth,
2696 ) -> fidl::Result<()> {
2697 encoder.debug_check_bounds::<RemoteServiceReadCharacteristicRequest>(offset);
2698 self.0.encode(encoder, offset + 0, depth)?;
2702 Ok(())
2703 }
2704 }
2705
2706 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
2707 for RemoteServiceReadCharacteristicRequest
2708 {
2709 #[inline(always)]
2710 fn new_empty() -> Self {
2711 Self { id: fidl::new_empty!(u64, D) }
2712 }
2713
2714 #[inline]
2715 unsafe fn decode(
2716 &mut self,
2717 decoder: &mut fidl::encoding::Decoder<'_, D>,
2718 offset: usize,
2719 _depth: fidl::encoding::Depth,
2720 ) -> fidl::Result<()> {
2721 decoder.debug_check_bounds::<Self>(offset);
2722 let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
2723 unsafe {
2726 std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 8);
2727 }
2728 Ok(())
2729 }
2730 }
2731
2732 impl fidl::encoding::ValueTypeMarker for RemoteServiceReadCharacteristicResponse {
2733 type Borrowed<'a> = &'a Self;
2734 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
2735 value
2736 }
2737 }
2738
2739 unsafe impl fidl::encoding::TypeMarker for RemoteServiceReadCharacteristicResponse {
2740 type Owned = Self;
2741
2742 #[inline(always)]
2743 fn inline_align(_context: fidl::encoding::Context) -> usize {
2744 8
2745 }
2746
2747 #[inline(always)]
2748 fn inline_size(_context: fidl::encoding::Context) -> usize {
2749 24
2750 }
2751 }
2752
2753 unsafe impl<D: fidl::encoding::ResourceDialect>
2754 fidl::encoding::Encode<RemoteServiceReadCharacteristicResponse, D>
2755 for &RemoteServiceReadCharacteristicResponse
2756 {
2757 #[inline]
2758 unsafe fn encode(
2759 self,
2760 encoder: &mut fidl::encoding::Encoder<'_, D>,
2761 offset: usize,
2762 _depth: fidl::encoding::Depth,
2763 ) -> fidl::Result<()> {
2764 encoder.debug_check_bounds::<RemoteServiceReadCharacteristicResponse>(offset);
2765 fidl::encoding::Encode::<RemoteServiceReadCharacteristicResponse, D>::encode(
2767 (
2768 <fidl_fuchsia_bluetooth::Status as fidl::encoding::ValueTypeMarker>::borrow(&self.status),
2769 <fidl::encoding::UnboundedVector<u8> as fidl::encoding::ValueTypeMarker>::borrow(&self.value),
2770 ),
2771 encoder, offset, _depth
2772 )
2773 }
2774 }
2775 unsafe impl<
2776 D: fidl::encoding::ResourceDialect,
2777 T0: fidl::encoding::Encode<fidl_fuchsia_bluetooth::Status, D>,
2778 T1: fidl::encoding::Encode<fidl::encoding::UnboundedVector<u8>, D>,
2779 > fidl::encoding::Encode<RemoteServiceReadCharacteristicResponse, D> for (T0, T1)
2780 {
2781 #[inline]
2782 unsafe fn encode(
2783 self,
2784 encoder: &mut fidl::encoding::Encoder<'_, D>,
2785 offset: usize,
2786 depth: fidl::encoding::Depth,
2787 ) -> fidl::Result<()> {
2788 encoder.debug_check_bounds::<RemoteServiceReadCharacteristicResponse>(offset);
2789 self.0.encode(encoder, offset + 0, depth)?;
2793 self.1.encode(encoder, offset + 8, depth)?;
2794 Ok(())
2795 }
2796 }
2797
2798 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
2799 for RemoteServiceReadCharacteristicResponse
2800 {
2801 #[inline(always)]
2802 fn new_empty() -> Self {
2803 Self {
2804 status: fidl::new_empty!(fidl_fuchsia_bluetooth::Status, D),
2805 value: fidl::new_empty!(fidl::encoding::UnboundedVector<u8>, D),
2806 }
2807 }
2808
2809 #[inline]
2810 unsafe fn decode(
2811 &mut self,
2812 decoder: &mut fidl::encoding::Decoder<'_, D>,
2813 offset: usize,
2814 _depth: fidl::encoding::Depth,
2815 ) -> fidl::Result<()> {
2816 decoder.debug_check_bounds::<Self>(offset);
2817 fidl::decode!(
2819 fidl_fuchsia_bluetooth::Status,
2820 D,
2821 &mut self.status,
2822 decoder,
2823 offset + 0,
2824 _depth
2825 )?;
2826 fidl::decode!(
2827 fidl::encoding::UnboundedVector<u8>,
2828 D,
2829 &mut self.value,
2830 decoder,
2831 offset + 8,
2832 _depth
2833 )?;
2834 Ok(())
2835 }
2836 }
2837
2838 impl fidl::encoding::ValueTypeMarker for RemoteServiceReadDescriptorRequest {
2839 type Borrowed<'a> = &'a Self;
2840 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
2841 value
2842 }
2843 }
2844
2845 unsafe impl fidl::encoding::TypeMarker for RemoteServiceReadDescriptorRequest {
2846 type Owned = Self;
2847
2848 #[inline(always)]
2849 fn inline_align(_context: fidl::encoding::Context) -> usize {
2850 8
2851 }
2852
2853 #[inline(always)]
2854 fn inline_size(_context: fidl::encoding::Context) -> usize {
2855 8
2856 }
2857 #[inline(always)]
2858 fn encode_is_copy() -> bool {
2859 true
2860 }
2861
2862 #[inline(always)]
2863 fn decode_is_copy() -> bool {
2864 true
2865 }
2866 }
2867
2868 unsafe impl<D: fidl::encoding::ResourceDialect>
2869 fidl::encoding::Encode<RemoteServiceReadDescriptorRequest, D>
2870 for &RemoteServiceReadDescriptorRequest
2871 {
2872 #[inline]
2873 unsafe fn encode(
2874 self,
2875 encoder: &mut fidl::encoding::Encoder<'_, D>,
2876 offset: usize,
2877 _depth: fidl::encoding::Depth,
2878 ) -> fidl::Result<()> {
2879 encoder.debug_check_bounds::<RemoteServiceReadDescriptorRequest>(offset);
2880 unsafe {
2881 let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
2883 (buf_ptr as *mut RemoteServiceReadDescriptorRequest)
2884 .write_unaligned((self as *const RemoteServiceReadDescriptorRequest).read());
2885 }
2888 Ok(())
2889 }
2890 }
2891 unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<u64, D>>
2892 fidl::encoding::Encode<RemoteServiceReadDescriptorRequest, D> for (T0,)
2893 {
2894 #[inline]
2895 unsafe fn encode(
2896 self,
2897 encoder: &mut fidl::encoding::Encoder<'_, D>,
2898 offset: usize,
2899 depth: fidl::encoding::Depth,
2900 ) -> fidl::Result<()> {
2901 encoder.debug_check_bounds::<RemoteServiceReadDescriptorRequest>(offset);
2902 self.0.encode(encoder, offset + 0, depth)?;
2906 Ok(())
2907 }
2908 }
2909
2910 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
2911 for RemoteServiceReadDescriptorRequest
2912 {
2913 #[inline(always)]
2914 fn new_empty() -> Self {
2915 Self { id: fidl::new_empty!(u64, D) }
2916 }
2917
2918 #[inline]
2919 unsafe fn decode(
2920 &mut self,
2921 decoder: &mut fidl::encoding::Decoder<'_, D>,
2922 offset: usize,
2923 _depth: fidl::encoding::Depth,
2924 ) -> fidl::Result<()> {
2925 decoder.debug_check_bounds::<Self>(offset);
2926 let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
2927 unsafe {
2930 std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 8);
2931 }
2932 Ok(())
2933 }
2934 }
2935
2936 impl fidl::encoding::ValueTypeMarker for RemoteServiceReadDescriptorResponse {
2937 type Borrowed<'a> = &'a Self;
2938 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
2939 value
2940 }
2941 }
2942
2943 unsafe impl fidl::encoding::TypeMarker for RemoteServiceReadDescriptorResponse {
2944 type Owned = Self;
2945
2946 #[inline(always)]
2947 fn inline_align(_context: fidl::encoding::Context) -> usize {
2948 8
2949 }
2950
2951 #[inline(always)]
2952 fn inline_size(_context: fidl::encoding::Context) -> usize {
2953 24
2954 }
2955 }
2956
2957 unsafe impl<D: fidl::encoding::ResourceDialect>
2958 fidl::encoding::Encode<RemoteServiceReadDescriptorResponse, D>
2959 for &RemoteServiceReadDescriptorResponse
2960 {
2961 #[inline]
2962 unsafe fn encode(
2963 self,
2964 encoder: &mut fidl::encoding::Encoder<'_, D>,
2965 offset: usize,
2966 _depth: fidl::encoding::Depth,
2967 ) -> fidl::Result<()> {
2968 encoder.debug_check_bounds::<RemoteServiceReadDescriptorResponse>(offset);
2969 fidl::encoding::Encode::<RemoteServiceReadDescriptorResponse, D>::encode(
2971 (
2972 <fidl_fuchsia_bluetooth::Status as fidl::encoding::ValueTypeMarker>::borrow(&self.status),
2973 <fidl::encoding::UnboundedVector<u8> as fidl::encoding::ValueTypeMarker>::borrow(&self.value),
2974 ),
2975 encoder, offset, _depth
2976 )
2977 }
2978 }
2979 unsafe impl<
2980 D: fidl::encoding::ResourceDialect,
2981 T0: fidl::encoding::Encode<fidl_fuchsia_bluetooth::Status, D>,
2982 T1: fidl::encoding::Encode<fidl::encoding::UnboundedVector<u8>, D>,
2983 > fidl::encoding::Encode<RemoteServiceReadDescriptorResponse, D> for (T0, T1)
2984 {
2985 #[inline]
2986 unsafe fn encode(
2987 self,
2988 encoder: &mut fidl::encoding::Encoder<'_, D>,
2989 offset: usize,
2990 depth: fidl::encoding::Depth,
2991 ) -> fidl::Result<()> {
2992 encoder.debug_check_bounds::<RemoteServiceReadDescriptorResponse>(offset);
2993 self.0.encode(encoder, offset + 0, depth)?;
2997 self.1.encode(encoder, offset + 8, depth)?;
2998 Ok(())
2999 }
3000 }
3001
3002 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
3003 for RemoteServiceReadDescriptorResponse
3004 {
3005 #[inline(always)]
3006 fn new_empty() -> Self {
3007 Self {
3008 status: fidl::new_empty!(fidl_fuchsia_bluetooth::Status, D),
3009 value: fidl::new_empty!(fidl::encoding::UnboundedVector<u8>, D),
3010 }
3011 }
3012
3013 #[inline]
3014 unsafe fn decode(
3015 &mut self,
3016 decoder: &mut fidl::encoding::Decoder<'_, D>,
3017 offset: usize,
3018 _depth: fidl::encoding::Depth,
3019 ) -> fidl::Result<()> {
3020 decoder.debug_check_bounds::<Self>(offset);
3021 fidl::decode!(
3023 fidl_fuchsia_bluetooth::Status,
3024 D,
3025 &mut self.status,
3026 decoder,
3027 offset + 0,
3028 _depth
3029 )?;
3030 fidl::decode!(
3031 fidl::encoding::UnboundedVector<u8>,
3032 D,
3033 &mut self.value,
3034 decoder,
3035 offset + 8,
3036 _depth
3037 )?;
3038 Ok(())
3039 }
3040 }
3041
3042 impl fidl::encoding::ValueTypeMarker for RemoteServiceReadLongCharacteristicRequest {
3043 type Borrowed<'a> = &'a Self;
3044 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
3045 value
3046 }
3047 }
3048
3049 unsafe impl fidl::encoding::TypeMarker for RemoteServiceReadLongCharacteristicRequest {
3050 type Owned = Self;
3051
3052 #[inline(always)]
3053 fn inline_align(_context: fidl::encoding::Context) -> usize {
3054 8
3055 }
3056
3057 #[inline(always)]
3058 fn inline_size(_context: fidl::encoding::Context) -> usize {
3059 16
3060 }
3061 }
3062
3063 unsafe impl<D: fidl::encoding::ResourceDialect>
3064 fidl::encoding::Encode<RemoteServiceReadLongCharacteristicRequest, D>
3065 for &RemoteServiceReadLongCharacteristicRequest
3066 {
3067 #[inline]
3068 unsafe fn encode(
3069 self,
3070 encoder: &mut fidl::encoding::Encoder<'_, D>,
3071 offset: usize,
3072 _depth: fidl::encoding::Depth,
3073 ) -> fidl::Result<()> {
3074 encoder.debug_check_bounds::<RemoteServiceReadLongCharacteristicRequest>(offset);
3075 unsafe {
3076 let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
3078 (buf_ptr as *mut RemoteServiceReadLongCharacteristicRequest).write_unaligned(
3079 (self as *const RemoteServiceReadLongCharacteristicRequest).read(),
3080 );
3081 let padding_ptr = buf_ptr.offset(8) as *mut u64;
3084 let padding_mask = 0xffffffff00000000u64;
3085 padding_ptr.write_unaligned(padding_ptr.read_unaligned() & !padding_mask);
3086 }
3087 Ok(())
3088 }
3089 }
3090 unsafe impl<
3091 D: fidl::encoding::ResourceDialect,
3092 T0: fidl::encoding::Encode<u64, D>,
3093 T1: fidl::encoding::Encode<u16, D>,
3094 T2: fidl::encoding::Encode<u16, D>,
3095 > fidl::encoding::Encode<RemoteServiceReadLongCharacteristicRequest, D> for (T0, T1, T2)
3096 {
3097 #[inline]
3098 unsafe fn encode(
3099 self,
3100 encoder: &mut fidl::encoding::Encoder<'_, D>,
3101 offset: usize,
3102 depth: fidl::encoding::Depth,
3103 ) -> fidl::Result<()> {
3104 encoder.debug_check_bounds::<RemoteServiceReadLongCharacteristicRequest>(offset);
3105 unsafe {
3108 let ptr = encoder.buf.as_mut_ptr().add(offset).offset(8);
3109 (ptr as *mut u64).write_unaligned(0);
3110 }
3111 self.0.encode(encoder, offset + 0, depth)?;
3113 self.1.encode(encoder, offset + 8, depth)?;
3114 self.2.encode(encoder, offset + 10, depth)?;
3115 Ok(())
3116 }
3117 }
3118
3119 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
3120 for RemoteServiceReadLongCharacteristicRequest
3121 {
3122 #[inline(always)]
3123 fn new_empty() -> Self {
3124 Self {
3125 id: fidl::new_empty!(u64, D),
3126 offset: fidl::new_empty!(u16, D),
3127 max_bytes: fidl::new_empty!(u16, D),
3128 }
3129 }
3130
3131 #[inline]
3132 unsafe fn decode(
3133 &mut self,
3134 decoder: &mut fidl::encoding::Decoder<'_, D>,
3135 offset: usize,
3136 _depth: fidl::encoding::Depth,
3137 ) -> fidl::Result<()> {
3138 decoder.debug_check_bounds::<Self>(offset);
3139 let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
3140 let ptr = unsafe { buf_ptr.offset(8) };
3142 let padval = unsafe { (ptr as *const u64).read_unaligned() };
3143 let mask = 0xffffffff00000000u64;
3144 let maskedval = padval & mask;
3145 if maskedval != 0 {
3146 return Err(fidl::Error::NonZeroPadding {
3147 padding_start: offset + 8 + ((mask as u64).trailing_zeros() / 8) as usize,
3148 });
3149 }
3150 unsafe {
3152 std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 16);
3153 }
3154 Ok(())
3155 }
3156 }
3157
3158 impl fidl::encoding::ValueTypeMarker for RemoteServiceReadLongCharacteristicResponse {
3159 type Borrowed<'a> = &'a Self;
3160 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
3161 value
3162 }
3163 }
3164
3165 unsafe impl fidl::encoding::TypeMarker for RemoteServiceReadLongCharacteristicResponse {
3166 type Owned = Self;
3167
3168 #[inline(always)]
3169 fn inline_align(_context: fidl::encoding::Context) -> usize {
3170 8
3171 }
3172
3173 #[inline(always)]
3174 fn inline_size(_context: fidl::encoding::Context) -> usize {
3175 24
3176 }
3177 }
3178
3179 unsafe impl<D: fidl::encoding::ResourceDialect>
3180 fidl::encoding::Encode<RemoteServiceReadLongCharacteristicResponse, D>
3181 for &RemoteServiceReadLongCharacteristicResponse
3182 {
3183 #[inline]
3184 unsafe fn encode(
3185 self,
3186 encoder: &mut fidl::encoding::Encoder<'_, D>,
3187 offset: usize,
3188 _depth: fidl::encoding::Depth,
3189 ) -> fidl::Result<()> {
3190 encoder.debug_check_bounds::<RemoteServiceReadLongCharacteristicResponse>(offset);
3191 fidl::encoding::Encode::<RemoteServiceReadLongCharacteristicResponse, D>::encode(
3193 (
3194 <fidl_fuchsia_bluetooth::Status as fidl::encoding::ValueTypeMarker>::borrow(
3195 &self.status,
3196 ),
3197 <fidl::encoding::Vector<u8, 512> as fidl::encoding::ValueTypeMarker>::borrow(
3198 &self.value,
3199 ),
3200 ),
3201 encoder,
3202 offset,
3203 _depth,
3204 )
3205 }
3206 }
3207 unsafe impl<
3208 D: fidl::encoding::ResourceDialect,
3209 T0: fidl::encoding::Encode<fidl_fuchsia_bluetooth::Status, D>,
3210 T1: fidl::encoding::Encode<fidl::encoding::Vector<u8, 512>, D>,
3211 > fidl::encoding::Encode<RemoteServiceReadLongCharacteristicResponse, D> for (T0, T1)
3212 {
3213 #[inline]
3214 unsafe fn encode(
3215 self,
3216 encoder: &mut fidl::encoding::Encoder<'_, D>,
3217 offset: usize,
3218 depth: fidl::encoding::Depth,
3219 ) -> fidl::Result<()> {
3220 encoder.debug_check_bounds::<RemoteServiceReadLongCharacteristicResponse>(offset);
3221 self.0.encode(encoder, offset + 0, depth)?;
3225 self.1.encode(encoder, offset + 8, depth)?;
3226 Ok(())
3227 }
3228 }
3229
3230 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
3231 for RemoteServiceReadLongCharacteristicResponse
3232 {
3233 #[inline(always)]
3234 fn new_empty() -> Self {
3235 Self {
3236 status: fidl::new_empty!(fidl_fuchsia_bluetooth::Status, D),
3237 value: fidl::new_empty!(fidl::encoding::Vector<u8, 512>, D),
3238 }
3239 }
3240
3241 #[inline]
3242 unsafe fn decode(
3243 &mut self,
3244 decoder: &mut fidl::encoding::Decoder<'_, D>,
3245 offset: usize,
3246 _depth: fidl::encoding::Depth,
3247 ) -> fidl::Result<()> {
3248 decoder.debug_check_bounds::<Self>(offset);
3249 fidl::decode!(
3251 fidl_fuchsia_bluetooth::Status,
3252 D,
3253 &mut self.status,
3254 decoder,
3255 offset + 0,
3256 _depth
3257 )?;
3258 fidl::decode!(fidl::encoding::Vector<u8, 512>, D, &mut self.value, decoder, offset + 8, _depth)?;
3259 Ok(())
3260 }
3261 }
3262
3263 impl fidl::encoding::ValueTypeMarker for RemoteServiceReadLongDescriptorRequest {
3264 type Borrowed<'a> = &'a Self;
3265 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
3266 value
3267 }
3268 }
3269
3270 unsafe impl fidl::encoding::TypeMarker for RemoteServiceReadLongDescriptorRequest {
3271 type Owned = Self;
3272
3273 #[inline(always)]
3274 fn inline_align(_context: fidl::encoding::Context) -> usize {
3275 8
3276 }
3277
3278 #[inline(always)]
3279 fn inline_size(_context: fidl::encoding::Context) -> usize {
3280 16
3281 }
3282 }
3283
3284 unsafe impl<D: fidl::encoding::ResourceDialect>
3285 fidl::encoding::Encode<RemoteServiceReadLongDescriptorRequest, D>
3286 for &RemoteServiceReadLongDescriptorRequest
3287 {
3288 #[inline]
3289 unsafe fn encode(
3290 self,
3291 encoder: &mut fidl::encoding::Encoder<'_, D>,
3292 offset: usize,
3293 _depth: fidl::encoding::Depth,
3294 ) -> fidl::Result<()> {
3295 encoder.debug_check_bounds::<RemoteServiceReadLongDescriptorRequest>(offset);
3296 unsafe {
3297 let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
3299 (buf_ptr as *mut RemoteServiceReadLongDescriptorRequest).write_unaligned(
3300 (self as *const RemoteServiceReadLongDescriptorRequest).read(),
3301 );
3302 let padding_ptr = buf_ptr.offset(8) as *mut u64;
3305 let padding_mask = 0xffffffff00000000u64;
3306 padding_ptr.write_unaligned(padding_ptr.read_unaligned() & !padding_mask);
3307 }
3308 Ok(())
3309 }
3310 }
3311 unsafe impl<
3312 D: fidl::encoding::ResourceDialect,
3313 T0: fidl::encoding::Encode<u64, D>,
3314 T1: fidl::encoding::Encode<u16, D>,
3315 T2: fidl::encoding::Encode<u16, D>,
3316 > fidl::encoding::Encode<RemoteServiceReadLongDescriptorRequest, D> for (T0, T1, T2)
3317 {
3318 #[inline]
3319 unsafe fn encode(
3320 self,
3321 encoder: &mut fidl::encoding::Encoder<'_, D>,
3322 offset: usize,
3323 depth: fidl::encoding::Depth,
3324 ) -> fidl::Result<()> {
3325 encoder.debug_check_bounds::<RemoteServiceReadLongDescriptorRequest>(offset);
3326 unsafe {
3329 let ptr = encoder.buf.as_mut_ptr().add(offset).offset(8);
3330 (ptr as *mut u64).write_unaligned(0);
3331 }
3332 self.0.encode(encoder, offset + 0, depth)?;
3334 self.1.encode(encoder, offset + 8, depth)?;
3335 self.2.encode(encoder, offset + 10, depth)?;
3336 Ok(())
3337 }
3338 }
3339
3340 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
3341 for RemoteServiceReadLongDescriptorRequest
3342 {
3343 #[inline(always)]
3344 fn new_empty() -> Self {
3345 Self {
3346 id: fidl::new_empty!(u64, D),
3347 offset: fidl::new_empty!(u16, D),
3348 max_bytes: fidl::new_empty!(u16, D),
3349 }
3350 }
3351
3352 #[inline]
3353 unsafe fn decode(
3354 &mut self,
3355 decoder: &mut fidl::encoding::Decoder<'_, D>,
3356 offset: usize,
3357 _depth: fidl::encoding::Depth,
3358 ) -> fidl::Result<()> {
3359 decoder.debug_check_bounds::<Self>(offset);
3360 let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
3361 let ptr = unsafe { buf_ptr.offset(8) };
3363 let padval = unsafe { (ptr as *const u64).read_unaligned() };
3364 let mask = 0xffffffff00000000u64;
3365 let maskedval = padval & mask;
3366 if maskedval != 0 {
3367 return Err(fidl::Error::NonZeroPadding {
3368 padding_start: offset + 8 + ((mask as u64).trailing_zeros() / 8) as usize,
3369 });
3370 }
3371 unsafe {
3373 std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 16);
3374 }
3375 Ok(())
3376 }
3377 }
3378
3379 impl fidl::encoding::ValueTypeMarker for RemoteServiceReadLongDescriptorResponse {
3380 type Borrowed<'a> = &'a Self;
3381 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
3382 value
3383 }
3384 }
3385
3386 unsafe impl fidl::encoding::TypeMarker for RemoteServiceReadLongDescriptorResponse {
3387 type Owned = Self;
3388
3389 #[inline(always)]
3390 fn inline_align(_context: fidl::encoding::Context) -> usize {
3391 8
3392 }
3393
3394 #[inline(always)]
3395 fn inline_size(_context: fidl::encoding::Context) -> usize {
3396 24
3397 }
3398 }
3399
3400 unsafe impl<D: fidl::encoding::ResourceDialect>
3401 fidl::encoding::Encode<RemoteServiceReadLongDescriptorResponse, D>
3402 for &RemoteServiceReadLongDescriptorResponse
3403 {
3404 #[inline]
3405 unsafe fn encode(
3406 self,
3407 encoder: &mut fidl::encoding::Encoder<'_, D>,
3408 offset: usize,
3409 _depth: fidl::encoding::Depth,
3410 ) -> fidl::Result<()> {
3411 encoder.debug_check_bounds::<RemoteServiceReadLongDescriptorResponse>(offset);
3412 fidl::encoding::Encode::<RemoteServiceReadLongDescriptorResponse, D>::encode(
3414 (
3415 <fidl_fuchsia_bluetooth::Status as fidl::encoding::ValueTypeMarker>::borrow(&self.status),
3416 <fidl::encoding::UnboundedVector<u8> as fidl::encoding::ValueTypeMarker>::borrow(&self.value),
3417 ),
3418 encoder, offset, _depth
3419 )
3420 }
3421 }
3422 unsafe impl<
3423 D: fidl::encoding::ResourceDialect,
3424 T0: fidl::encoding::Encode<fidl_fuchsia_bluetooth::Status, D>,
3425 T1: fidl::encoding::Encode<fidl::encoding::UnboundedVector<u8>, D>,
3426 > fidl::encoding::Encode<RemoteServiceReadLongDescriptorResponse, D> for (T0, T1)
3427 {
3428 #[inline]
3429 unsafe fn encode(
3430 self,
3431 encoder: &mut fidl::encoding::Encoder<'_, D>,
3432 offset: usize,
3433 depth: fidl::encoding::Depth,
3434 ) -> fidl::Result<()> {
3435 encoder.debug_check_bounds::<RemoteServiceReadLongDescriptorResponse>(offset);
3436 self.0.encode(encoder, offset + 0, depth)?;
3440 self.1.encode(encoder, offset + 8, depth)?;
3441 Ok(())
3442 }
3443 }
3444
3445 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
3446 for RemoteServiceReadLongDescriptorResponse
3447 {
3448 #[inline(always)]
3449 fn new_empty() -> Self {
3450 Self {
3451 status: fidl::new_empty!(fidl_fuchsia_bluetooth::Status, D),
3452 value: fidl::new_empty!(fidl::encoding::UnboundedVector<u8>, D),
3453 }
3454 }
3455
3456 #[inline]
3457 unsafe fn decode(
3458 &mut self,
3459 decoder: &mut fidl::encoding::Decoder<'_, D>,
3460 offset: usize,
3461 _depth: fidl::encoding::Depth,
3462 ) -> fidl::Result<()> {
3463 decoder.debug_check_bounds::<Self>(offset);
3464 fidl::decode!(
3466 fidl_fuchsia_bluetooth::Status,
3467 D,
3468 &mut self.status,
3469 decoder,
3470 offset + 0,
3471 _depth
3472 )?;
3473 fidl::decode!(
3474 fidl::encoding::UnboundedVector<u8>,
3475 D,
3476 &mut self.value,
3477 decoder,
3478 offset + 8,
3479 _depth
3480 )?;
3481 Ok(())
3482 }
3483 }
3484
3485 impl fidl::encoding::ValueTypeMarker for RemoteServiceWriteCharacteristicRequest {
3486 type Borrowed<'a> = &'a Self;
3487 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
3488 value
3489 }
3490 }
3491
3492 unsafe impl fidl::encoding::TypeMarker for RemoteServiceWriteCharacteristicRequest {
3493 type Owned = Self;
3494
3495 #[inline(always)]
3496 fn inline_align(_context: fidl::encoding::Context) -> usize {
3497 8
3498 }
3499
3500 #[inline(always)]
3501 fn inline_size(_context: fidl::encoding::Context) -> usize {
3502 24
3503 }
3504 }
3505
3506 unsafe impl<D: fidl::encoding::ResourceDialect>
3507 fidl::encoding::Encode<RemoteServiceWriteCharacteristicRequest, D>
3508 for &RemoteServiceWriteCharacteristicRequest
3509 {
3510 #[inline]
3511 unsafe fn encode(
3512 self,
3513 encoder: &mut fidl::encoding::Encoder<'_, D>,
3514 offset: usize,
3515 _depth: fidl::encoding::Depth,
3516 ) -> fidl::Result<()> {
3517 encoder.debug_check_bounds::<RemoteServiceWriteCharacteristicRequest>(offset);
3518 fidl::encoding::Encode::<RemoteServiceWriteCharacteristicRequest, D>::encode(
3520 (
3521 <u64 as fidl::encoding::ValueTypeMarker>::borrow(&self.id),
3522 <fidl::encoding::UnboundedVector<u8> as fidl::encoding::ValueTypeMarker>::borrow(&self.value),
3523 ),
3524 encoder, offset, _depth
3525 )
3526 }
3527 }
3528 unsafe impl<
3529 D: fidl::encoding::ResourceDialect,
3530 T0: fidl::encoding::Encode<u64, D>,
3531 T1: fidl::encoding::Encode<fidl::encoding::UnboundedVector<u8>, D>,
3532 > fidl::encoding::Encode<RemoteServiceWriteCharacteristicRequest, D> for (T0, T1)
3533 {
3534 #[inline]
3535 unsafe fn encode(
3536 self,
3537 encoder: &mut fidl::encoding::Encoder<'_, D>,
3538 offset: usize,
3539 depth: fidl::encoding::Depth,
3540 ) -> fidl::Result<()> {
3541 encoder.debug_check_bounds::<RemoteServiceWriteCharacteristicRequest>(offset);
3542 self.0.encode(encoder, offset + 0, depth)?;
3546 self.1.encode(encoder, offset + 8, depth)?;
3547 Ok(())
3548 }
3549 }
3550
3551 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
3552 for RemoteServiceWriteCharacteristicRequest
3553 {
3554 #[inline(always)]
3555 fn new_empty() -> Self {
3556 Self {
3557 id: fidl::new_empty!(u64, D),
3558 value: fidl::new_empty!(fidl::encoding::UnboundedVector<u8>, D),
3559 }
3560 }
3561
3562 #[inline]
3563 unsafe fn decode(
3564 &mut self,
3565 decoder: &mut fidl::encoding::Decoder<'_, D>,
3566 offset: usize,
3567 _depth: fidl::encoding::Depth,
3568 ) -> fidl::Result<()> {
3569 decoder.debug_check_bounds::<Self>(offset);
3570 fidl::decode!(u64, D, &mut self.id, decoder, offset + 0, _depth)?;
3572 fidl::decode!(
3573 fidl::encoding::UnboundedVector<u8>,
3574 D,
3575 &mut self.value,
3576 decoder,
3577 offset + 8,
3578 _depth
3579 )?;
3580 Ok(())
3581 }
3582 }
3583
3584 impl fidl::encoding::ValueTypeMarker for RemoteServiceWriteCharacteristicResponse {
3585 type Borrowed<'a> = &'a Self;
3586 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
3587 value
3588 }
3589 }
3590
3591 unsafe impl fidl::encoding::TypeMarker for RemoteServiceWriteCharacteristicResponse {
3592 type Owned = Self;
3593
3594 #[inline(always)]
3595 fn inline_align(_context: fidl::encoding::Context) -> usize {
3596 8
3597 }
3598
3599 #[inline(always)]
3600 fn inline_size(_context: fidl::encoding::Context) -> usize {
3601 8
3602 }
3603 }
3604
3605 unsafe impl<D: fidl::encoding::ResourceDialect>
3606 fidl::encoding::Encode<RemoteServiceWriteCharacteristicResponse, D>
3607 for &RemoteServiceWriteCharacteristicResponse
3608 {
3609 #[inline]
3610 unsafe fn encode(
3611 self,
3612 encoder: &mut fidl::encoding::Encoder<'_, D>,
3613 offset: usize,
3614 _depth: fidl::encoding::Depth,
3615 ) -> fidl::Result<()> {
3616 encoder.debug_check_bounds::<RemoteServiceWriteCharacteristicResponse>(offset);
3617 fidl::encoding::Encode::<RemoteServiceWriteCharacteristicResponse, D>::encode(
3619 (<fidl_fuchsia_bluetooth::Status as fidl::encoding::ValueTypeMarker>::borrow(
3620 &self.status,
3621 ),),
3622 encoder,
3623 offset,
3624 _depth,
3625 )
3626 }
3627 }
3628 unsafe impl<
3629 D: fidl::encoding::ResourceDialect,
3630 T0: fidl::encoding::Encode<fidl_fuchsia_bluetooth::Status, D>,
3631 > fidl::encoding::Encode<RemoteServiceWriteCharacteristicResponse, D> for (T0,)
3632 {
3633 #[inline]
3634 unsafe fn encode(
3635 self,
3636 encoder: &mut fidl::encoding::Encoder<'_, D>,
3637 offset: usize,
3638 depth: fidl::encoding::Depth,
3639 ) -> fidl::Result<()> {
3640 encoder.debug_check_bounds::<RemoteServiceWriteCharacteristicResponse>(offset);
3641 self.0.encode(encoder, offset + 0, depth)?;
3645 Ok(())
3646 }
3647 }
3648
3649 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
3650 for RemoteServiceWriteCharacteristicResponse
3651 {
3652 #[inline(always)]
3653 fn new_empty() -> Self {
3654 Self { status: fidl::new_empty!(fidl_fuchsia_bluetooth::Status, D) }
3655 }
3656
3657 #[inline]
3658 unsafe fn decode(
3659 &mut self,
3660 decoder: &mut fidl::encoding::Decoder<'_, D>,
3661 offset: usize,
3662 _depth: fidl::encoding::Depth,
3663 ) -> fidl::Result<()> {
3664 decoder.debug_check_bounds::<Self>(offset);
3665 fidl::decode!(
3667 fidl_fuchsia_bluetooth::Status,
3668 D,
3669 &mut self.status,
3670 decoder,
3671 offset + 0,
3672 _depth
3673 )?;
3674 Ok(())
3675 }
3676 }
3677
3678 impl fidl::encoding::ValueTypeMarker for RemoteServiceWriteCharacteristicWithoutResponseRequest {
3679 type Borrowed<'a> = &'a Self;
3680 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
3681 value
3682 }
3683 }
3684
3685 unsafe impl fidl::encoding::TypeMarker for RemoteServiceWriteCharacteristicWithoutResponseRequest {
3686 type Owned = Self;
3687
3688 #[inline(always)]
3689 fn inline_align(_context: fidl::encoding::Context) -> usize {
3690 8
3691 }
3692
3693 #[inline(always)]
3694 fn inline_size(_context: fidl::encoding::Context) -> usize {
3695 24
3696 }
3697 }
3698
3699 unsafe impl<D: fidl::encoding::ResourceDialect>
3700 fidl::encoding::Encode<RemoteServiceWriteCharacteristicWithoutResponseRequest, D>
3701 for &RemoteServiceWriteCharacteristicWithoutResponseRequest
3702 {
3703 #[inline]
3704 unsafe fn encode(
3705 self,
3706 encoder: &mut fidl::encoding::Encoder<'_, D>,
3707 offset: usize,
3708 _depth: fidl::encoding::Depth,
3709 ) -> fidl::Result<()> {
3710 encoder.debug_check_bounds::<RemoteServiceWriteCharacteristicWithoutResponseRequest>(
3711 offset,
3712 );
3713 fidl::encoding::Encode::<RemoteServiceWriteCharacteristicWithoutResponseRequest, D>::encode(
3715 (
3716 <u64 as fidl::encoding::ValueTypeMarker>::borrow(&self.id),
3717 <fidl::encoding::UnboundedVector<u8> as fidl::encoding::ValueTypeMarker>::borrow(&self.value),
3718 ),
3719 encoder, offset, _depth
3720 )
3721 }
3722 }
3723 unsafe impl<
3724 D: fidl::encoding::ResourceDialect,
3725 T0: fidl::encoding::Encode<u64, D>,
3726 T1: fidl::encoding::Encode<fidl::encoding::UnboundedVector<u8>, D>,
3727 > fidl::encoding::Encode<RemoteServiceWriteCharacteristicWithoutResponseRequest, D>
3728 for (T0, T1)
3729 {
3730 #[inline]
3731 unsafe fn encode(
3732 self,
3733 encoder: &mut fidl::encoding::Encoder<'_, D>,
3734 offset: usize,
3735 depth: fidl::encoding::Depth,
3736 ) -> fidl::Result<()> {
3737 encoder.debug_check_bounds::<RemoteServiceWriteCharacteristicWithoutResponseRequest>(
3738 offset,
3739 );
3740 self.0.encode(encoder, offset + 0, depth)?;
3744 self.1.encode(encoder, offset + 8, depth)?;
3745 Ok(())
3746 }
3747 }
3748
3749 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
3750 for RemoteServiceWriteCharacteristicWithoutResponseRequest
3751 {
3752 #[inline(always)]
3753 fn new_empty() -> Self {
3754 Self {
3755 id: fidl::new_empty!(u64, D),
3756 value: fidl::new_empty!(fidl::encoding::UnboundedVector<u8>, D),
3757 }
3758 }
3759
3760 #[inline]
3761 unsafe fn decode(
3762 &mut self,
3763 decoder: &mut fidl::encoding::Decoder<'_, D>,
3764 offset: usize,
3765 _depth: fidl::encoding::Depth,
3766 ) -> fidl::Result<()> {
3767 decoder.debug_check_bounds::<Self>(offset);
3768 fidl::decode!(u64, D, &mut self.id, decoder, offset + 0, _depth)?;
3770 fidl::decode!(
3771 fidl::encoding::UnboundedVector<u8>,
3772 D,
3773 &mut self.value,
3774 decoder,
3775 offset + 8,
3776 _depth
3777 )?;
3778 Ok(())
3779 }
3780 }
3781
3782 impl fidl::encoding::ValueTypeMarker for RemoteServiceWriteDescriptorRequest {
3783 type Borrowed<'a> = &'a Self;
3784 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
3785 value
3786 }
3787 }
3788
3789 unsafe impl fidl::encoding::TypeMarker for RemoteServiceWriteDescriptorRequest {
3790 type Owned = Self;
3791
3792 #[inline(always)]
3793 fn inline_align(_context: fidl::encoding::Context) -> usize {
3794 8
3795 }
3796
3797 #[inline(always)]
3798 fn inline_size(_context: fidl::encoding::Context) -> usize {
3799 24
3800 }
3801 }
3802
3803 unsafe impl<D: fidl::encoding::ResourceDialect>
3804 fidl::encoding::Encode<RemoteServiceWriteDescriptorRequest, D>
3805 for &RemoteServiceWriteDescriptorRequest
3806 {
3807 #[inline]
3808 unsafe fn encode(
3809 self,
3810 encoder: &mut fidl::encoding::Encoder<'_, D>,
3811 offset: usize,
3812 _depth: fidl::encoding::Depth,
3813 ) -> fidl::Result<()> {
3814 encoder.debug_check_bounds::<RemoteServiceWriteDescriptorRequest>(offset);
3815 fidl::encoding::Encode::<RemoteServiceWriteDescriptorRequest, D>::encode(
3817 (
3818 <u64 as fidl::encoding::ValueTypeMarker>::borrow(&self.id),
3819 <fidl::encoding::UnboundedVector<u8> as fidl::encoding::ValueTypeMarker>::borrow(&self.value),
3820 ),
3821 encoder, offset, _depth
3822 )
3823 }
3824 }
3825 unsafe impl<
3826 D: fidl::encoding::ResourceDialect,
3827 T0: fidl::encoding::Encode<u64, D>,
3828 T1: fidl::encoding::Encode<fidl::encoding::UnboundedVector<u8>, D>,
3829 > fidl::encoding::Encode<RemoteServiceWriteDescriptorRequest, D> for (T0, T1)
3830 {
3831 #[inline]
3832 unsafe fn encode(
3833 self,
3834 encoder: &mut fidl::encoding::Encoder<'_, D>,
3835 offset: usize,
3836 depth: fidl::encoding::Depth,
3837 ) -> fidl::Result<()> {
3838 encoder.debug_check_bounds::<RemoteServiceWriteDescriptorRequest>(offset);
3839 self.0.encode(encoder, offset + 0, depth)?;
3843 self.1.encode(encoder, offset + 8, depth)?;
3844 Ok(())
3845 }
3846 }
3847
3848 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
3849 for RemoteServiceWriteDescriptorRequest
3850 {
3851 #[inline(always)]
3852 fn new_empty() -> Self {
3853 Self {
3854 id: fidl::new_empty!(u64, D),
3855 value: fidl::new_empty!(fidl::encoding::UnboundedVector<u8>, D),
3856 }
3857 }
3858
3859 #[inline]
3860 unsafe fn decode(
3861 &mut self,
3862 decoder: &mut fidl::encoding::Decoder<'_, D>,
3863 offset: usize,
3864 _depth: fidl::encoding::Depth,
3865 ) -> fidl::Result<()> {
3866 decoder.debug_check_bounds::<Self>(offset);
3867 fidl::decode!(u64, D, &mut self.id, decoder, offset + 0, _depth)?;
3869 fidl::decode!(
3870 fidl::encoding::UnboundedVector<u8>,
3871 D,
3872 &mut self.value,
3873 decoder,
3874 offset + 8,
3875 _depth
3876 )?;
3877 Ok(())
3878 }
3879 }
3880
3881 impl fidl::encoding::ValueTypeMarker for RemoteServiceWriteDescriptorResponse {
3882 type Borrowed<'a> = &'a Self;
3883 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
3884 value
3885 }
3886 }
3887
3888 unsafe impl fidl::encoding::TypeMarker for RemoteServiceWriteDescriptorResponse {
3889 type Owned = Self;
3890
3891 #[inline(always)]
3892 fn inline_align(_context: fidl::encoding::Context) -> usize {
3893 8
3894 }
3895
3896 #[inline(always)]
3897 fn inline_size(_context: fidl::encoding::Context) -> usize {
3898 8
3899 }
3900 }
3901
3902 unsafe impl<D: fidl::encoding::ResourceDialect>
3903 fidl::encoding::Encode<RemoteServiceWriteDescriptorResponse, D>
3904 for &RemoteServiceWriteDescriptorResponse
3905 {
3906 #[inline]
3907 unsafe fn encode(
3908 self,
3909 encoder: &mut fidl::encoding::Encoder<'_, D>,
3910 offset: usize,
3911 _depth: fidl::encoding::Depth,
3912 ) -> fidl::Result<()> {
3913 encoder.debug_check_bounds::<RemoteServiceWriteDescriptorResponse>(offset);
3914 fidl::encoding::Encode::<RemoteServiceWriteDescriptorResponse, D>::encode(
3916 (<fidl_fuchsia_bluetooth::Status as fidl::encoding::ValueTypeMarker>::borrow(
3917 &self.status,
3918 ),),
3919 encoder,
3920 offset,
3921 _depth,
3922 )
3923 }
3924 }
3925 unsafe impl<
3926 D: fidl::encoding::ResourceDialect,
3927 T0: fidl::encoding::Encode<fidl_fuchsia_bluetooth::Status, D>,
3928 > fidl::encoding::Encode<RemoteServiceWriteDescriptorResponse, D> for (T0,)
3929 {
3930 #[inline]
3931 unsafe fn encode(
3932 self,
3933 encoder: &mut fidl::encoding::Encoder<'_, D>,
3934 offset: usize,
3935 depth: fidl::encoding::Depth,
3936 ) -> fidl::Result<()> {
3937 encoder.debug_check_bounds::<RemoteServiceWriteDescriptorResponse>(offset);
3938 self.0.encode(encoder, offset + 0, depth)?;
3942 Ok(())
3943 }
3944 }
3945
3946 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
3947 for RemoteServiceWriteDescriptorResponse
3948 {
3949 #[inline(always)]
3950 fn new_empty() -> Self {
3951 Self { status: fidl::new_empty!(fidl_fuchsia_bluetooth::Status, D) }
3952 }
3953
3954 #[inline]
3955 unsafe fn decode(
3956 &mut self,
3957 decoder: &mut fidl::encoding::Decoder<'_, D>,
3958 offset: usize,
3959 _depth: fidl::encoding::Depth,
3960 ) -> fidl::Result<()> {
3961 decoder.debug_check_bounds::<Self>(offset);
3962 fidl::decode!(
3964 fidl_fuchsia_bluetooth::Status,
3965 D,
3966 &mut self.status,
3967 decoder,
3968 offset + 0,
3969 _depth
3970 )?;
3971 Ok(())
3972 }
3973 }
3974
3975 impl fidl::encoding::ValueTypeMarker for RemoteServiceWriteLongCharacteristicRequest {
3976 type Borrowed<'a> = &'a Self;
3977 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
3978 value
3979 }
3980 }
3981
3982 unsafe impl fidl::encoding::TypeMarker for RemoteServiceWriteLongCharacteristicRequest {
3983 type Owned = Self;
3984
3985 #[inline(always)]
3986 fn inline_align(_context: fidl::encoding::Context) -> usize {
3987 8
3988 }
3989
3990 #[inline(always)]
3991 fn inline_size(_context: fidl::encoding::Context) -> usize {
3992 48
3993 }
3994 }
3995
3996 unsafe impl<D: fidl::encoding::ResourceDialect>
3997 fidl::encoding::Encode<RemoteServiceWriteLongCharacteristicRequest, D>
3998 for &RemoteServiceWriteLongCharacteristicRequest
3999 {
4000 #[inline]
4001 unsafe fn encode(
4002 self,
4003 encoder: &mut fidl::encoding::Encoder<'_, D>,
4004 offset: usize,
4005 _depth: fidl::encoding::Depth,
4006 ) -> fidl::Result<()> {
4007 encoder.debug_check_bounds::<RemoteServiceWriteLongCharacteristicRequest>(offset);
4008 fidl::encoding::Encode::<RemoteServiceWriteLongCharacteristicRequest, D>::encode(
4010 (
4011 <u64 as fidl::encoding::ValueTypeMarker>::borrow(&self.id),
4012 <u16 as fidl::encoding::ValueTypeMarker>::borrow(&self.offset),
4013 <fidl::encoding::Vector<u8, 512> as fidl::encoding::ValueTypeMarker>::borrow(
4014 &self.value,
4015 ),
4016 <WriteOptions as fidl::encoding::ValueTypeMarker>::borrow(&self.write_options),
4017 ),
4018 encoder,
4019 offset,
4020 _depth,
4021 )
4022 }
4023 }
4024 unsafe impl<
4025 D: fidl::encoding::ResourceDialect,
4026 T0: fidl::encoding::Encode<u64, D>,
4027 T1: fidl::encoding::Encode<u16, D>,
4028 T2: fidl::encoding::Encode<fidl::encoding::Vector<u8, 512>, D>,
4029 T3: fidl::encoding::Encode<WriteOptions, D>,
4030 > fidl::encoding::Encode<RemoteServiceWriteLongCharacteristicRequest, D>
4031 for (T0, T1, T2, T3)
4032 {
4033 #[inline]
4034 unsafe fn encode(
4035 self,
4036 encoder: &mut fidl::encoding::Encoder<'_, D>,
4037 offset: usize,
4038 depth: fidl::encoding::Depth,
4039 ) -> fidl::Result<()> {
4040 encoder.debug_check_bounds::<RemoteServiceWriteLongCharacteristicRequest>(offset);
4041 unsafe {
4044 let ptr = encoder.buf.as_mut_ptr().add(offset).offset(8);
4045 (ptr as *mut u64).write_unaligned(0);
4046 }
4047 self.0.encode(encoder, offset + 0, depth)?;
4049 self.1.encode(encoder, offset + 8, depth)?;
4050 self.2.encode(encoder, offset + 16, depth)?;
4051 self.3.encode(encoder, offset + 32, depth)?;
4052 Ok(())
4053 }
4054 }
4055
4056 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
4057 for RemoteServiceWriteLongCharacteristicRequest
4058 {
4059 #[inline(always)]
4060 fn new_empty() -> Self {
4061 Self {
4062 id: fidl::new_empty!(u64, D),
4063 offset: fidl::new_empty!(u16, D),
4064 value: fidl::new_empty!(fidl::encoding::Vector<u8, 512>, D),
4065 write_options: fidl::new_empty!(WriteOptions, D),
4066 }
4067 }
4068
4069 #[inline]
4070 unsafe fn decode(
4071 &mut self,
4072 decoder: &mut fidl::encoding::Decoder<'_, D>,
4073 offset: usize,
4074 _depth: fidl::encoding::Depth,
4075 ) -> fidl::Result<()> {
4076 decoder.debug_check_bounds::<Self>(offset);
4077 let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(8) };
4079 let padval = unsafe { (ptr as *const u64).read_unaligned() };
4080 let mask = 0xffffffffffff0000u64;
4081 let maskedval = padval & mask;
4082 if maskedval != 0 {
4083 return Err(fidl::Error::NonZeroPadding {
4084 padding_start: offset + 8 + ((mask as u64).trailing_zeros() / 8) as usize,
4085 });
4086 }
4087 fidl::decode!(u64, D, &mut self.id, decoder, offset + 0, _depth)?;
4088 fidl::decode!(u16, D, &mut self.offset, decoder, offset + 8, _depth)?;
4089 fidl::decode!(fidl::encoding::Vector<u8, 512>, D, &mut self.value, decoder, offset + 16, _depth)?;
4090 fidl::decode!(WriteOptions, D, &mut self.write_options, decoder, offset + 32, _depth)?;
4091 Ok(())
4092 }
4093 }
4094
4095 impl fidl::encoding::ValueTypeMarker for RemoteServiceWriteLongCharacteristicResponse {
4096 type Borrowed<'a> = &'a Self;
4097 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
4098 value
4099 }
4100 }
4101
4102 unsafe impl fidl::encoding::TypeMarker for RemoteServiceWriteLongCharacteristicResponse {
4103 type Owned = Self;
4104
4105 #[inline(always)]
4106 fn inline_align(_context: fidl::encoding::Context) -> usize {
4107 8
4108 }
4109
4110 #[inline(always)]
4111 fn inline_size(_context: fidl::encoding::Context) -> usize {
4112 8
4113 }
4114 }
4115
4116 unsafe impl<D: fidl::encoding::ResourceDialect>
4117 fidl::encoding::Encode<RemoteServiceWriteLongCharacteristicResponse, D>
4118 for &RemoteServiceWriteLongCharacteristicResponse
4119 {
4120 #[inline]
4121 unsafe fn encode(
4122 self,
4123 encoder: &mut fidl::encoding::Encoder<'_, D>,
4124 offset: usize,
4125 _depth: fidl::encoding::Depth,
4126 ) -> fidl::Result<()> {
4127 encoder.debug_check_bounds::<RemoteServiceWriteLongCharacteristicResponse>(offset);
4128 fidl::encoding::Encode::<RemoteServiceWriteLongCharacteristicResponse, D>::encode(
4130 (<fidl_fuchsia_bluetooth::Status as fidl::encoding::ValueTypeMarker>::borrow(
4131 &self.status,
4132 ),),
4133 encoder,
4134 offset,
4135 _depth,
4136 )
4137 }
4138 }
4139 unsafe impl<
4140 D: fidl::encoding::ResourceDialect,
4141 T0: fidl::encoding::Encode<fidl_fuchsia_bluetooth::Status, D>,
4142 > fidl::encoding::Encode<RemoteServiceWriteLongCharacteristicResponse, D> for (T0,)
4143 {
4144 #[inline]
4145 unsafe fn encode(
4146 self,
4147 encoder: &mut fidl::encoding::Encoder<'_, D>,
4148 offset: usize,
4149 depth: fidl::encoding::Depth,
4150 ) -> fidl::Result<()> {
4151 encoder.debug_check_bounds::<RemoteServiceWriteLongCharacteristicResponse>(offset);
4152 self.0.encode(encoder, offset + 0, depth)?;
4156 Ok(())
4157 }
4158 }
4159
4160 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
4161 for RemoteServiceWriteLongCharacteristicResponse
4162 {
4163 #[inline(always)]
4164 fn new_empty() -> Self {
4165 Self { status: fidl::new_empty!(fidl_fuchsia_bluetooth::Status, D) }
4166 }
4167
4168 #[inline]
4169 unsafe fn decode(
4170 &mut self,
4171 decoder: &mut fidl::encoding::Decoder<'_, D>,
4172 offset: usize,
4173 _depth: fidl::encoding::Depth,
4174 ) -> fidl::Result<()> {
4175 decoder.debug_check_bounds::<Self>(offset);
4176 fidl::decode!(
4178 fidl_fuchsia_bluetooth::Status,
4179 D,
4180 &mut self.status,
4181 decoder,
4182 offset + 0,
4183 _depth
4184 )?;
4185 Ok(())
4186 }
4187 }
4188
4189 impl fidl::encoding::ValueTypeMarker for RemoteServiceWriteLongDescriptorRequest {
4190 type Borrowed<'a> = &'a Self;
4191 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
4192 value
4193 }
4194 }
4195
4196 unsafe impl fidl::encoding::TypeMarker for RemoteServiceWriteLongDescriptorRequest {
4197 type Owned = Self;
4198
4199 #[inline(always)]
4200 fn inline_align(_context: fidl::encoding::Context) -> usize {
4201 8
4202 }
4203
4204 #[inline(always)]
4205 fn inline_size(_context: fidl::encoding::Context) -> usize {
4206 32
4207 }
4208 }
4209
4210 unsafe impl<D: fidl::encoding::ResourceDialect>
4211 fidl::encoding::Encode<RemoteServiceWriteLongDescriptorRequest, D>
4212 for &RemoteServiceWriteLongDescriptorRequest
4213 {
4214 #[inline]
4215 unsafe fn encode(
4216 self,
4217 encoder: &mut fidl::encoding::Encoder<'_, D>,
4218 offset: usize,
4219 _depth: fidl::encoding::Depth,
4220 ) -> fidl::Result<()> {
4221 encoder.debug_check_bounds::<RemoteServiceWriteLongDescriptorRequest>(offset);
4222 fidl::encoding::Encode::<RemoteServiceWriteLongDescriptorRequest, D>::encode(
4224 (
4225 <u64 as fidl::encoding::ValueTypeMarker>::borrow(&self.id),
4226 <u16 as fidl::encoding::ValueTypeMarker>::borrow(&self.offset),
4227 <fidl::encoding::Vector<u8, 512> as fidl::encoding::ValueTypeMarker>::borrow(
4228 &self.value,
4229 ),
4230 ),
4231 encoder,
4232 offset,
4233 _depth,
4234 )
4235 }
4236 }
4237 unsafe impl<
4238 D: fidl::encoding::ResourceDialect,
4239 T0: fidl::encoding::Encode<u64, D>,
4240 T1: fidl::encoding::Encode<u16, D>,
4241 T2: fidl::encoding::Encode<fidl::encoding::Vector<u8, 512>, D>,
4242 > fidl::encoding::Encode<RemoteServiceWriteLongDescriptorRequest, D> for (T0, T1, T2)
4243 {
4244 #[inline]
4245 unsafe fn encode(
4246 self,
4247 encoder: &mut fidl::encoding::Encoder<'_, D>,
4248 offset: usize,
4249 depth: fidl::encoding::Depth,
4250 ) -> fidl::Result<()> {
4251 encoder.debug_check_bounds::<RemoteServiceWriteLongDescriptorRequest>(offset);
4252 unsafe {
4255 let ptr = encoder.buf.as_mut_ptr().add(offset).offset(8);
4256 (ptr as *mut u64).write_unaligned(0);
4257 }
4258 self.0.encode(encoder, offset + 0, depth)?;
4260 self.1.encode(encoder, offset + 8, depth)?;
4261 self.2.encode(encoder, offset + 16, depth)?;
4262 Ok(())
4263 }
4264 }
4265
4266 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
4267 for RemoteServiceWriteLongDescriptorRequest
4268 {
4269 #[inline(always)]
4270 fn new_empty() -> Self {
4271 Self {
4272 id: fidl::new_empty!(u64, D),
4273 offset: fidl::new_empty!(u16, D),
4274 value: fidl::new_empty!(fidl::encoding::Vector<u8, 512>, D),
4275 }
4276 }
4277
4278 #[inline]
4279 unsafe fn decode(
4280 &mut self,
4281 decoder: &mut fidl::encoding::Decoder<'_, D>,
4282 offset: usize,
4283 _depth: fidl::encoding::Depth,
4284 ) -> fidl::Result<()> {
4285 decoder.debug_check_bounds::<Self>(offset);
4286 let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(8) };
4288 let padval = unsafe { (ptr as *const u64).read_unaligned() };
4289 let mask = 0xffffffffffff0000u64;
4290 let maskedval = padval & mask;
4291 if maskedval != 0 {
4292 return Err(fidl::Error::NonZeroPadding {
4293 padding_start: offset + 8 + ((mask as u64).trailing_zeros() / 8) as usize,
4294 });
4295 }
4296 fidl::decode!(u64, D, &mut self.id, decoder, offset + 0, _depth)?;
4297 fidl::decode!(u16, D, &mut self.offset, decoder, offset + 8, _depth)?;
4298 fidl::decode!(fidl::encoding::Vector<u8, 512>, D, &mut self.value, decoder, offset + 16, _depth)?;
4299 Ok(())
4300 }
4301 }
4302
4303 impl fidl::encoding::ValueTypeMarker for RemoteServiceWriteLongDescriptorResponse {
4304 type Borrowed<'a> = &'a Self;
4305 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
4306 value
4307 }
4308 }
4309
4310 unsafe impl fidl::encoding::TypeMarker for RemoteServiceWriteLongDescriptorResponse {
4311 type Owned = Self;
4312
4313 #[inline(always)]
4314 fn inline_align(_context: fidl::encoding::Context) -> usize {
4315 8
4316 }
4317
4318 #[inline(always)]
4319 fn inline_size(_context: fidl::encoding::Context) -> usize {
4320 8
4321 }
4322 }
4323
4324 unsafe impl<D: fidl::encoding::ResourceDialect>
4325 fidl::encoding::Encode<RemoteServiceWriteLongDescriptorResponse, D>
4326 for &RemoteServiceWriteLongDescriptorResponse
4327 {
4328 #[inline]
4329 unsafe fn encode(
4330 self,
4331 encoder: &mut fidl::encoding::Encoder<'_, D>,
4332 offset: usize,
4333 _depth: fidl::encoding::Depth,
4334 ) -> fidl::Result<()> {
4335 encoder.debug_check_bounds::<RemoteServiceWriteLongDescriptorResponse>(offset);
4336 fidl::encoding::Encode::<RemoteServiceWriteLongDescriptorResponse, D>::encode(
4338 (<fidl_fuchsia_bluetooth::Status as fidl::encoding::ValueTypeMarker>::borrow(
4339 &self.status,
4340 ),),
4341 encoder,
4342 offset,
4343 _depth,
4344 )
4345 }
4346 }
4347 unsafe impl<
4348 D: fidl::encoding::ResourceDialect,
4349 T0: fidl::encoding::Encode<fidl_fuchsia_bluetooth::Status, D>,
4350 > fidl::encoding::Encode<RemoteServiceWriteLongDescriptorResponse, D> for (T0,)
4351 {
4352 #[inline]
4353 unsafe fn encode(
4354 self,
4355 encoder: &mut fidl::encoding::Encoder<'_, D>,
4356 offset: usize,
4357 depth: fidl::encoding::Depth,
4358 ) -> fidl::Result<()> {
4359 encoder.debug_check_bounds::<RemoteServiceWriteLongDescriptorResponse>(offset);
4360 self.0.encode(encoder, offset + 0, depth)?;
4364 Ok(())
4365 }
4366 }
4367
4368 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
4369 for RemoteServiceWriteLongDescriptorResponse
4370 {
4371 #[inline(always)]
4372 fn new_empty() -> Self {
4373 Self { status: fidl::new_empty!(fidl_fuchsia_bluetooth::Status, D) }
4374 }
4375
4376 #[inline]
4377 unsafe fn decode(
4378 &mut self,
4379 decoder: &mut fidl::encoding::Decoder<'_, D>,
4380 offset: usize,
4381 _depth: fidl::encoding::Depth,
4382 ) -> fidl::Result<()> {
4383 decoder.debug_check_bounds::<Self>(offset);
4384 fidl::decode!(
4386 fidl_fuchsia_bluetooth::Status,
4387 D,
4388 &mut self.status,
4389 decoder,
4390 offset + 0,
4391 _depth
4392 )?;
4393 Ok(())
4394 }
4395 }
4396
4397 impl fidl::encoding::ValueTypeMarker for RemoteServiceReadByTypeResponse {
4398 type Borrowed<'a> = &'a Self;
4399 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
4400 value
4401 }
4402 }
4403
4404 unsafe impl fidl::encoding::TypeMarker for RemoteServiceReadByTypeResponse {
4405 type Owned = Self;
4406
4407 #[inline(always)]
4408 fn inline_align(_context: fidl::encoding::Context) -> usize {
4409 8
4410 }
4411
4412 #[inline(always)]
4413 fn inline_size(_context: fidl::encoding::Context) -> usize {
4414 16
4415 }
4416 }
4417
4418 unsafe impl<D: fidl::encoding::ResourceDialect>
4419 fidl::encoding::Encode<RemoteServiceReadByTypeResponse, D>
4420 for &RemoteServiceReadByTypeResponse
4421 {
4422 #[inline]
4423 unsafe fn encode(
4424 self,
4425 encoder: &mut fidl::encoding::Encoder<'_, D>,
4426 offset: usize,
4427 _depth: fidl::encoding::Depth,
4428 ) -> fidl::Result<()> {
4429 encoder.debug_check_bounds::<RemoteServiceReadByTypeResponse>(offset);
4430 fidl::encoding::Encode::<RemoteServiceReadByTypeResponse, D>::encode(
4432 (
4433 <fidl::encoding::Vector<ReadByTypeResult, 189> as fidl::encoding::ValueTypeMarker>::borrow(&self.results),
4434 ),
4435 encoder, offset, _depth
4436 )
4437 }
4438 }
4439 unsafe impl<
4440 D: fidl::encoding::ResourceDialect,
4441 T0: fidl::encoding::Encode<fidl::encoding::Vector<ReadByTypeResult, 189>, D>,
4442 > fidl::encoding::Encode<RemoteServiceReadByTypeResponse, D> for (T0,)
4443 {
4444 #[inline]
4445 unsafe fn encode(
4446 self,
4447 encoder: &mut fidl::encoding::Encoder<'_, D>,
4448 offset: usize,
4449 depth: fidl::encoding::Depth,
4450 ) -> fidl::Result<()> {
4451 encoder.debug_check_bounds::<RemoteServiceReadByTypeResponse>(offset);
4452 self.0.encode(encoder, offset + 0, depth)?;
4456 Ok(())
4457 }
4458 }
4459
4460 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
4461 for RemoteServiceReadByTypeResponse
4462 {
4463 #[inline(always)]
4464 fn new_empty() -> Self {
4465 Self { results: fidl::new_empty!(fidl::encoding::Vector<ReadByTypeResult, 189>, D) }
4466 }
4467
4468 #[inline]
4469 unsafe fn decode(
4470 &mut self,
4471 decoder: &mut fidl::encoding::Decoder<'_, D>,
4472 offset: usize,
4473 _depth: fidl::encoding::Depth,
4474 ) -> fidl::Result<()> {
4475 decoder.debug_check_bounds::<Self>(offset);
4476 fidl::decode!(fidl::encoding::Vector<ReadByTypeResult, 189>, D, &mut self.results, decoder, offset + 0, _depth)?;
4478 Ok(())
4479 }
4480 }
4481
4482 impl fidl::encoding::ValueTypeMarker for SecurityRequirements {
4483 type Borrowed<'a> = &'a Self;
4484 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
4485 value
4486 }
4487 }
4488
4489 unsafe impl fidl::encoding::TypeMarker for SecurityRequirements {
4490 type Owned = Self;
4491
4492 #[inline(always)]
4493 fn inline_align(_context: fidl::encoding::Context) -> usize {
4494 1
4495 }
4496
4497 #[inline(always)]
4498 fn inline_size(_context: fidl::encoding::Context) -> usize {
4499 3
4500 }
4501 }
4502
4503 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<SecurityRequirements, D>
4504 for &SecurityRequirements
4505 {
4506 #[inline]
4507 unsafe fn encode(
4508 self,
4509 encoder: &mut fidl::encoding::Encoder<'_, D>,
4510 offset: usize,
4511 _depth: fidl::encoding::Depth,
4512 ) -> fidl::Result<()> {
4513 encoder.debug_check_bounds::<SecurityRequirements>(offset);
4514 fidl::encoding::Encode::<SecurityRequirements, D>::encode(
4516 (
4517 <bool as fidl::encoding::ValueTypeMarker>::borrow(&self.encryption_required),
4518 <bool as fidl::encoding::ValueTypeMarker>::borrow(
4519 &self.authentication_required,
4520 ),
4521 <bool as fidl::encoding::ValueTypeMarker>::borrow(&self.authorization_required),
4522 ),
4523 encoder,
4524 offset,
4525 _depth,
4526 )
4527 }
4528 }
4529 unsafe impl<
4530 D: fidl::encoding::ResourceDialect,
4531 T0: fidl::encoding::Encode<bool, D>,
4532 T1: fidl::encoding::Encode<bool, D>,
4533 T2: fidl::encoding::Encode<bool, D>,
4534 > fidl::encoding::Encode<SecurityRequirements, D> for (T0, T1, T2)
4535 {
4536 #[inline]
4537 unsafe fn encode(
4538 self,
4539 encoder: &mut fidl::encoding::Encoder<'_, D>,
4540 offset: usize,
4541 depth: fidl::encoding::Depth,
4542 ) -> fidl::Result<()> {
4543 encoder.debug_check_bounds::<SecurityRequirements>(offset);
4544 self.0.encode(encoder, offset + 0, depth)?;
4548 self.1.encode(encoder, offset + 1, depth)?;
4549 self.2.encode(encoder, offset + 2, depth)?;
4550 Ok(())
4551 }
4552 }
4553
4554 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for SecurityRequirements {
4555 #[inline(always)]
4556 fn new_empty() -> Self {
4557 Self {
4558 encryption_required: fidl::new_empty!(bool, D),
4559 authentication_required: fidl::new_empty!(bool, D),
4560 authorization_required: fidl::new_empty!(bool, D),
4561 }
4562 }
4563
4564 #[inline]
4565 unsafe fn decode(
4566 &mut self,
4567 decoder: &mut fidl::encoding::Decoder<'_, D>,
4568 offset: usize,
4569 _depth: fidl::encoding::Depth,
4570 ) -> fidl::Result<()> {
4571 decoder.debug_check_bounds::<Self>(offset);
4572 fidl::decode!(bool, D, &mut self.encryption_required, decoder, offset + 0, _depth)?;
4574 fidl::decode!(bool, D, &mut self.authentication_required, decoder, offset + 1, _depth)?;
4575 fidl::decode!(bool, D, &mut self.authorization_required, decoder, offset + 2, _depth)?;
4576 Ok(())
4577 }
4578 }
4579
4580 impl fidl::encoding::ValueTypeMarker for ServerPublishServiceResponse {
4581 type Borrowed<'a> = &'a Self;
4582 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
4583 value
4584 }
4585 }
4586
4587 unsafe impl fidl::encoding::TypeMarker for ServerPublishServiceResponse {
4588 type Owned = Self;
4589
4590 #[inline(always)]
4591 fn inline_align(_context: fidl::encoding::Context) -> usize {
4592 8
4593 }
4594
4595 #[inline(always)]
4596 fn inline_size(_context: fidl::encoding::Context) -> usize {
4597 8
4598 }
4599 }
4600
4601 unsafe impl<D: fidl::encoding::ResourceDialect>
4602 fidl::encoding::Encode<ServerPublishServiceResponse, D> for &ServerPublishServiceResponse
4603 {
4604 #[inline]
4605 unsafe fn encode(
4606 self,
4607 encoder: &mut fidl::encoding::Encoder<'_, D>,
4608 offset: usize,
4609 _depth: fidl::encoding::Depth,
4610 ) -> fidl::Result<()> {
4611 encoder.debug_check_bounds::<ServerPublishServiceResponse>(offset);
4612 fidl::encoding::Encode::<ServerPublishServiceResponse, D>::encode(
4614 (<fidl_fuchsia_bluetooth::Status as fidl::encoding::ValueTypeMarker>::borrow(
4615 &self.status,
4616 ),),
4617 encoder,
4618 offset,
4619 _depth,
4620 )
4621 }
4622 }
4623 unsafe impl<
4624 D: fidl::encoding::ResourceDialect,
4625 T0: fidl::encoding::Encode<fidl_fuchsia_bluetooth::Status, D>,
4626 > fidl::encoding::Encode<ServerPublishServiceResponse, D> for (T0,)
4627 {
4628 #[inline]
4629 unsafe fn encode(
4630 self,
4631 encoder: &mut fidl::encoding::Encoder<'_, D>,
4632 offset: usize,
4633 depth: fidl::encoding::Depth,
4634 ) -> fidl::Result<()> {
4635 encoder.debug_check_bounds::<ServerPublishServiceResponse>(offset);
4636 self.0.encode(encoder, offset + 0, depth)?;
4640 Ok(())
4641 }
4642 }
4643
4644 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
4645 for ServerPublishServiceResponse
4646 {
4647 #[inline(always)]
4648 fn new_empty() -> Self {
4649 Self { status: fidl::new_empty!(fidl_fuchsia_bluetooth::Status, D) }
4650 }
4651
4652 #[inline]
4653 unsafe fn decode(
4654 &mut self,
4655 decoder: &mut fidl::encoding::Decoder<'_, D>,
4656 offset: usize,
4657 _depth: fidl::encoding::Depth,
4658 ) -> fidl::Result<()> {
4659 decoder.debug_check_bounds::<Self>(offset);
4660 fidl::decode!(
4662 fidl_fuchsia_bluetooth::Status,
4663 D,
4664 &mut self.status,
4665 decoder,
4666 offset + 0,
4667 _depth
4668 )?;
4669 Ok(())
4670 }
4671 }
4672
4673 impl fidl::encoding::ValueTypeMarker for ServiceInfo {
4674 type Borrowed<'a> = &'a Self;
4675 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
4676 value
4677 }
4678 }
4679
4680 unsafe impl fidl::encoding::TypeMarker for ServiceInfo {
4681 type Owned = Self;
4682
4683 #[inline(always)]
4684 fn inline_align(_context: fidl::encoding::Context) -> usize {
4685 8
4686 }
4687
4688 #[inline(always)]
4689 fn inline_size(_context: fidl::encoding::Context) -> usize {
4690 64
4691 }
4692 }
4693
4694 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<ServiceInfo, D>
4695 for &ServiceInfo
4696 {
4697 #[inline]
4698 unsafe fn encode(
4699 self,
4700 encoder: &mut fidl::encoding::Encoder<'_, D>,
4701 offset: usize,
4702 _depth: fidl::encoding::Depth,
4703 ) -> fidl::Result<()> {
4704 encoder.debug_check_bounds::<ServiceInfo>(offset);
4705 fidl::encoding::Encode::<ServiceInfo, D>::encode(
4707 (
4708 <u64 as fidl::encoding::ValueTypeMarker>::borrow(&self.id),
4709 <bool as fidl::encoding::ValueTypeMarker>::borrow(&self.primary),
4710 <fidl::encoding::BoundedString<36> as fidl::encoding::ValueTypeMarker>::borrow(&self.type_),
4711 <fidl::encoding::Optional<fidl::encoding::Vector<Characteristic, 32767>> as fidl::encoding::ValueTypeMarker>::borrow(&self.characteristics),
4712 <fidl::encoding::Optional<fidl::encoding::Vector<u64, 65535>> as fidl::encoding::ValueTypeMarker>::borrow(&self.includes),
4713 ),
4714 encoder, offset, _depth
4715 )
4716 }
4717 }
4718 unsafe impl<
4719 D: fidl::encoding::ResourceDialect,
4720 T0: fidl::encoding::Encode<u64, D>,
4721 T1: fidl::encoding::Encode<bool, D>,
4722 T2: fidl::encoding::Encode<fidl::encoding::BoundedString<36>, D>,
4723 T3: fidl::encoding::Encode<
4724 fidl::encoding::Optional<fidl::encoding::Vector<Characteristic, 32767>>,
4725 D,
4726 >,
4727 T4: fidl::encoding::Encode<fidl::encoding::Optional<fidl::encoding::Vector<u64, 65535>>, D>,
4728 > fidl::encoding::Encode<ServiceInfo, D> for (T0, T1, T2, T3, T4)
4729 {
4730 #[inline]
4731 unsafe fn encode(
4732 self,
4733 encoder: &mut fidl::encoding::Encoder<'_, D>,
4734 offset: usize,
4735 depth: fidl::encoding::Depth,
4736 ) -> fidl::Result<()> {
4737 encoder.debug_check_bounds::<ServiceInfo>(offset);
4738 unsafe {
4741 let ptr = encoder.buf.as_mut_ptr().add(offset).offset(8);
4742 (ptr as *mut u64).write_unaligned(0);
4743 }
4744 self.0.encode(encoder, offset + 0, depth)?;
4746 self.1.encode(encoder, offset + 8, depth)?;
4747 self.2.encode(encoder, offset + 16, depth)?;
4748 self.3.encode(encoder, offset + 32, depth)?;
4749 self.4.encode(encoder, offset + 48, depth)?;
4750 Ok(())
4751 }
4752 }
4753
4754 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for ServiceInfo {
4755 #[inline(always)]
4756 fn new_empty() -> Self {
4757 Self {
4758 id: fidl::new_empty!(u64, D),
4759 primary: fidl::new_empty!(bool, D),
4760 type_: fidl::new_empty!(fidl::encoding::BoundedString<36>, D),
4761 characteristics: fidl::new_empty!(
4762 fidl::encoding::Optional<fidl::encoding::Vector<Characteristic, 32767>>,
4763 D
4764 ),
4765 includes: fidl::new_empty!(
4766 fidl::encoding::Optional<fidl::encoding::Vector<u64, 65535>>,
4767 D
4768 ),
4769 }
4770 }
4771
4772 #[inline]
4773 unsafe fn decode(
4774 &mut self,
4775 decoder: &mut fidl::encoding::Decoder<'_, D>,
4776 offset: usize,
4777 _depth: fidl::encoding::Depth,
4778 ) -> fidl::Result<()> {
4779 decoder.debug_check_bounds::<Self>(offset);
4780 let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(8) };
4782 let padval = unsafe { (ptr as *const u64).read_unaligned() };
4783 let mask = 0xffffffffffffff00u64;
4784 let maskedval = padval & mask;
4785 if maskedval != 0 {
4786 return Err(fidl::Error::NonZeroPadding {
4787 padding_start: offset + 8 + ((mask as u64).trailing_zeros() / 8) as usize,
4788 });
4789 }
4790 fidl::decode!(u64, D, &mut self.id, decoder, offset + 0, _depth)?;
4791 fidl::decode!(bool, D, &mut self.primary, decoder, offset + 8, _depth)?;
4792 fidl::decode!(
4793 fidl::encoding::BoundedString<36>,
4794 D,
4795 &mut self.type_,
4796 decoder,
4797 offset + 16,
4798 _depth
4799 )?;
4800 fidl::decode!(
4801 fidl::encoding::Optional<fidl::encoding::Vector<Characteristic, 32767>>,
4802 D,
4803 &mut self.characteristics,
4804 decoder,
4805 offset + 32,
4806 _depth
4807 )?;
4808 fidl::decode!(
4809 fidl::encoding::Optional<fidl::encoding::Vector<u64, 65535>>,
4810 D,
4811 &mut self.includes,
4812 decoder,
4813 offset + 48,
4814 _depth
4815 )?;
4816 Ok(())
4817 }
4818 }
4819
4820 impl ReadByTypeResult {
4821 #[inline(always)]
4822 fn max_ordinal_present(&self) -> u64 {
4823 if let Some(_) = self.error {
4824 return 3;
4825 }
4826 if let Some(_) = self.value {
4827 return 2;
4828 }
4829 if let Some(_) = self.id {
4830 return 1;
4831 }
4832 0
4833 }
4834 }
4835
4836 impl fidl::encoding::ValueTypeMarker for ReadByTypeResult {
4837 type Borrowed<'a> = &'a Self;
4838 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
4839 value
4840 }
4841 }
4842
4843 unsafe impl fidl::encoding::TypeMarker for ReadByTypeResult {
4844 type Owned = Self;
4845
4846 #[inline(always)]
4847 fn inline_align(_context: fidl::encoding::Context) -> usize {
4848 8
4849 }
4850
4851 #[inline(always)]
4852 fn inline_size(_context: fidl::encoding::Context) -> usize {
4853 16
4854 }
4855 }
4856
4857 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<ReadByTypeResult, D>
4858 for &ReadByTypeResult
4859 {
4860 unsafe fn encode(
4861 self,
4862 encoder: &mut fidl::encoding::Encoder<'_, D>,
4863 offset: usize,
4864 mut depth: fidl::encoding::Depth,
4865 ) -> fidl::Result<()> {
4866 encoder.debug_check_bounds::<ReadByTypeResult>(offset);
4867 let max_ordinal: u64 = self.max_ordinal_present();
4869 encoder.write_num(max_ordinal, offset);
4870 encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
4871 if max_ordinal == 0 {
4873 return Ok(());
4874 }
4875 depth.increment()?;
4876 let envelope_size = 8;
4877 let bytes_len = max_ordinal as usize * envelope_size;
4878 #[allow(unused_variables)]
4879 let offset = encoder.out_of_line_offset(bytes_len);
4880 let mut _prev_end_offset: usize = 0;
4881 if 1 > max_ordinal {
4882 return Ok(());
4883 }
4884
4885 let cur_offset: usize = (1 - 1) * envelope_size;
4888
4889 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
4891
4892 fidl::encoding::encode_in_envelope_optional::<u64, D>(
4897 self.id.as_ref().map(<u64 as fidl::encoding::ValueTypeMarker>::borrow),
4898 encoder,
4899 offset + cur_offset,
4900 depth,
4901 )?;
4902
4903 _prev_end_offset = cur_offset + envelope_size;
4904 if 2 > max_ordinal {
4905 return Ok(());
4906 }
4907
4908 let cur_offset: usize = (2 - 1) * envelope_size;
4911
4912 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
4914
4915 fidl::encoding::encode_in_envelope_optional::<fidl::encoding::Vector<u8, 253>, D>(
4920 self.value.as_ref().map(
4921 <fidl::encoding::Vector<u8, 253> as fidl::encoding::ValueTypeMarker>::borrow,
4922 ),
4923 encoder,
4924 offset + cur_offset,
4925 depth,
4926 )?;
4927
4928 _prev_end_offset = cur_offset + envelope_size;
4929 if 3 > max_ordinal {
4930 return Ok(());
4931 }
4932
4933 let cur_offset: usize = (3 - 1) * envelope_size;
4936
4937 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
4939
4940 fidl::encoding::encode_in_envelope_optional::<Error, D>(
4945 self.error.as_ref().map(<Error as fidl::encoding::ValueTypeMarker>::borrow),
4946 encoder,
4947 offset + cur_offset,
4948 depth,
4949 )?;
4950
4951 _prev_end_offset = cur_offset + envelope_size;
4952
4953 Ok(())
4954 }
4955 }
4956
4957 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for ReadByTypeResult {
4958 #[inline(always)]
4959 fn new_empty() -> Self {
4960 Self::default()
4961 }
4962
4963 unsafe fn decode(
4964 &mut self,
4965 decoder: &mut fidl::encoding::Decoder<'_, D>,
4966 offset: usize,
4967 mut depth: fidl::encoding::Depth,
4968 ) -> fidl::Result<()> {
4969 decoder.debug_check_bounds::<Self>(offset);
4970 let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
4971 None => return Err(fidl::Error::NotNullable),
4972 Some(len) => len,
4973 };
4974 if len == 0 {
4976 return Ok(());
4977 };
4978 depth.increment()?;
4979 let envelope_size = 8;
4980 let bytes_len = len * envelope_size;
4981 let offset = decoder.out_of_line_offset(bytes_len)?;
4982 let mut _next_ordinal_to_read = 0;
4984 let mut next_offset = offset;
4985 let end_offset = offset + bytes_len;
4986 _next_ordinal_to_read += 1;
4987 if next_offset >= end_offset {
4988 return Ok(());
4989 }
4990
4991 while _next_ordinal_to_read < 1 {
4993 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
4994 _next_ordinal_to_read += 1;
4995 next_offset += envelope_size;
4996 }
4997
4998 let next_out_of_line = decoder.next_out_of_line();
4999 let handles_before = decoder.remaining_handles();
5000 if let Some((inlined, num_bytes, num_handles)) =
5001 fidl::encoding::decode_envelope_header(decoder, next_offset)?
5002 {
5003 let member_inline_size =
5004 <u64 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
5005 if inlined != (member_inline_size <= 4) {
5006 return Err(fidl::Error::InvalidInlineBitInEnvelope);
5007 }
5008 let inner_offset;
5009 let mut inner_depth = depth.clone();
5010 if inlined {
5011 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
5012 inner_offset = next_offset;
5013 } else {
5014 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
5015 inner_depth.increment()?;
5016 }
5017 let val_ref = self.id.get_or_insert_with(|| fidl::new_empty!(u64, D));
5018 fidl::decode!(u64, D, val_ref, decoder, inner_offset, inner_depth)?;
5019 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
5020 {
5021 return Err(fidl::Error::InvalidNumBytesInEnvelope);
5022 }
5023 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
5024 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
5025 }
5026 }
5027
5028 next_offset += envelope_size;
5029 _next_ordinal_to_read += 1;
5030 if next_offset >= end_offset {
5031 return Ok(());
5032 }
5033
5034 while _next_ordinal_to_read < 2 {
5036 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
5037 _next_ordinal_to_read += 1;
5038 next_offset += envelope_size;
5039 }
5040
5041 let next_out_of_line = decoder.next_out_of_line();
5042 let handles_before = decoder.remaining_handles();
5043 if let Some((inlined, num_bytes, num_handles)) =
5044 fidl::encoding::decode_envelope_header(decoder, next_offset)?
5045 {
5046 let member_inline_size =
5047 <fidl::encoding::Vector<u8, 253> as fidl::encoding::TypeMarker>::inline_size(
5048 decoder.context,
5049 );
5050 if inlined != (member_inline_size <= 4) {
5051 return Err(fidl::Error::InvalidInlineBitInEnvelope);
5052 }
5053 let inner_offset;
5054 let mut inner_depth = depth.clone();
5055 if inlined {
5056 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
5057 inner_offset = next_offset;
5058 } else {
5059 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
5060 inner_depth.increment()?;
5061 }
5062 let val_ref = self
5063 .value
5064 .get_or_insert_with(|| fidl::new_empty!(fidl::encoding::Vector<u8, 253>, D));
5065 fidl::decode!(fidl::encoding::Vector<u8, 253>, D, val_ref, decoder, inner_offset, inner_depth)?;
5066 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
5067 {
5068 return Err(fidl::Error::InvalidNumBytesInEnvelope);
5069 }
5070 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
5071 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
5072 }
5073 }
5074
5075 next_offset += envelope_size;
5076 _next_ordinal_to_read += 1;
5077 if next_offset >= end_offset {
5078 return Ok(());
5079 }
5080
5081 while _next_ordinal_to_read < 3 {
5083 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
5084 _next_ordinal_to_read += 1;
5085 next_offset += envelope_size;
5086 }
5087
5088 let next_out_of_line = decoder.next_out_of_line();
5089 let handles_before = decoder.remaining_handles();
5090 if let Some((inlined, num_bytes, num_handles)) =
5091 fidl::encoding::decode_envelope_header(decoder, next_offset)?
5092 {
5093 let member_inline_size =
5094 <Error as fidl::encoding::TypeMarker>::inline_size(decoder.context);
5095 if inlined != (member_inline_size <= 4) {
5096 return Err(fidl::Error::InvalidInlineBitInEnvelope);
5097 }
5098 let inner_offset;
5099 let mut inner_depth = depth.clone();
5100 if inlined {
5101 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
5102 inner_offset = next_offset;
5103 } else {
5104 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
5105 inner_depth.increment()?;
5106 }
5107 let val_ref = self.error.get_or_insert_with(|| fidl::new_empty!(Error, D));
5108 fidl::decode!(Error, D, val_ref, decoder, inner_offset, inner_depth)?;
5109 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
5110 {
5111 return Err(fidl::Error::InvalidNumBytesInEnvelope);
5112 }
5113 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
5114 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
5115 }
5116 }
5117
5118 next_offset += envelope_size;
5119
5120 while next_offset < end_offset {
5122 _next_ordinal_to_read += 1;
5123 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
5124 next_offset += envelope_size;
5125 }
5126
5127 Ok(())
5128 }
5129 }
5130
5131 impl WriteOptions {
5132 #[inline(always)]
5133 fn max_ordinal_present(&self) -> u64 {
5134 if let Some(_) = self.reliable_mode {
5135 return 1;
5136 }
5137 0
5138 }
5139 }
5140
5141 impl fidl::encoding::ValueTypeMarker for WriteOptions {
5142 type Borrowed<'a> = &'a Self;
5143 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
5144 value
5145 }
5146 }
5147
5148 unsafe impl fidl::encoding::TypeMarker for WriteOptions {
5149 type Owned = Self;
5150
5151 #[inline(always)]
5152 fn inline_align(_context: fidl::encoding::Context) -> usize {
5153 8
5154 }
5155
5156 #[inline(always)]
5157 fn inline_size(_context: fidl::encoding::Context) -> usize {
5158 16
5159 }
5160 }
5161
5162 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<WriteOptions, D>
5163 for &WriteOptions
5164 {
5165 unsafe fn encode(
5166 self,
5167 encoder: &mut fidl::encoding::Encoder<'_, D>,
5168 offset: usize,
5169 mut depth: fidl::encoding::Depth,
5170 ) -> fidl::Result<()> {
5171 encoder.debug_check_bounds::<WriteOptions>(offset);
5172 let max_ordinal: u64 = self.max_ordinal_present();
5174 encoder.write_num(max_ordinal, offset);
5175 encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
5176 if max_ordinal == 0 {
5178 return Ok(());
5179 }
5180 depth.increment()?;
5181 let envelope_size = 8;
5182 let bytes_len = max_ordinal as usize * envelope_size;
5183 #[allow(unused_variables)]
5184 let offset = encoder.out_of_line_offset(bytes_len);
5185 let mut _prev_end_offset: usize = 0;
5186 if 1 > max_ordinal {
5187 return Ok(());
5188 }
5189
5190 let cur_offset: usize = (1 - 1) * envelope_size;
5193
5194 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
5196
5197 fidl::encoding::encode_in_envelope_optional::<ReliableMode, D>(
5202 self.reliable_mode
5203 .as_ref()
5204 .map(<ReliableMode as fidl::encoding::ValueTypeMarker>::borrow),
5205 encoder,
5206 offset + cur_offset,
5207 depth,
5208 )?;
5209
5210 _prev_end_offset = cur_offset + envelope_size;
5211
5212 Ok(())
5213 }
5214 }
5215
5216 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for WriteOptions {
5217 #[inline(always)]
5218 fn new_empty() -> Self {
5219 Self::default()
5220 }
5221
5222 unsafe fn decode(
5223 &mut self,
5224 decoder: &mut fidl::encoding::Decoder<'_, D>,
5225 offset: usize,
5226 mut depth: fidl::encoding::Depth,
5227 ) -> fidl::Result<()> {
5228 decoder.debug_check_bounds::<Self>(offset);
5229 let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
5230 None => return Err(fidl::Error::NotNullable),
5231 Some(len) => len,
5232 };
5233 if len == 0 {
5235 return Ok(());
5236 };
5237 depth.increment()?;
5238 let envelope_size = 8;
5239 let bytes_len = len * envelope_size;
5240 let offset = decoder.out_of_line_offset(bytes_len)?;
5241 let mut _next_ordinal_to_read = 0;
5243 let mut next_offset = offset;
5244 let end_offset = offset + bytes_len;
5245 _next_ordinal_to_read += 1;
5246 if next_offset >= end_offset {
5247 return Ok(());
5248 }
5249
5250 while _next_ordinal_to_read < 1 {
5252 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
5253 _next_ordinal_to_read += 1;
5254 next_offset += envelope_size;
5255 }
5256
5257 let next_out_of_line = decoder.next_out_of_line();
5258 let handles_before = decoder.remaining_handles();
5259 if let Some((inlined, num_bytes, num_handles)) =
5260 fidl::encoding::decode_envelope_header(decoder, next_offset)?
5261 {
5262 let member_inline_size =
5263 <ReliableMode as fidl::encoding::TypeMarker>::inline_size(decoder.context);
5264 if inlined != (member_inline_size <= 4) {
5265 return Err(fidl::Error::InvalidInlineBitInEnvelope);
5266 }
5267 let inner_offset;
5268 let mut inner_depth = depth.clone();
5269 if inlined {
5270 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
5271 inner_offset = next_offset;
5272 } else {
5273 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
5274 inner_depth.increment()?;
5275 }
5276 let val_ref =
5277 self.reliable_mode.get_or_insert_with(|| fidl::new_empty!(ReliableMode, D));
5278 fidl::decode!(ReliableMode, D, val_ref, decoder, inner_offset, inner_depth)?;
5279 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
5280 {
5281 return Err(fidl::Error::InvalidNumBytesInEnvelope);
5282 }
5283 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
5284 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
5285 }
5286 }
5287
5288 next_offset += envelope_size;
5289
5290 while next_offset < end_offset {
5292 _next_ordinal_to_read += 1;
5293 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
5294 next_offset += envelope_size;
5295 }
5296
5297 Ok(())
5298 }
5299 }
5300}