Skip to main content

pw_bluetooth_hci_common_emb/
hci_common.rs

1#![allow(dead_code, unused_imports, unused_variables, non_camel_case_types, unused_parens)]
2
3use emboss_runtime::prelude::*;
4pub use emboss_runtime::{BitFlag, Error, Flag, InfallibleRead, Int, MutStorage, Storage, TryRead, TryWrite, UInt, View, VirtualField};
5
6
7
8#[derive(Copy, Clone, Debug, Eq, PartialEq)]
9#[repr(u64)]
10pub enum StatusCode {
11    SUCCESS = 0,
12    UNKNOWN_COMMAND = 1,
13    UNKNOWN_CONNECTION_ID = 2,
14    HARDWARE_FAILURE = 3,
15    PAGE_TIMEOUT = 4,
16    AUTHENTICATION_FAILURE = 5,
17    PIN_OR_KEY_MISSING = 6,
18    MEMORY_CAPACITY_EXCEEDED = 7,
19    CONNECTION_TIMEOUT = 8,
20    CONNECTION_LIMIT_EXCEEDED = 9,
21    SYNCHRONOUS_CONNECTION_LIMIT_EXCEEDED = 10,
22    CONNECTION_ALREADY_EXISTS = 11,
23    COMMAND_DISALLOWED = 12,
24    CONNECTION_REJECTED_LIMITED_RESOURCES = 13,
25    CONNECTION_REJECTED_SECURITY = 14,
26    CONNECTION_REJECTED_BAD_BD_ADDR = 15,
27    CONNECTION_ACCEPT_TIMEOUT_EXCEEDED = 16,
28    UNSUPPORTED_FEATURE_OR_PARAMETER = 17,
29    INVALID_HCI_COMMAND_PARAMETERS = 18,
30    REMOTE_USER_TERMINATED_CONNECTION = 19,
31    REMOTE_DEVICE_TERMINATED_CONNECTION_LOW_RESOURCES = 20,
32    REMOTE_DEVICE_TERMINATED_CONNECTION_POWER_OFF = 21,
33    CONNECTION_TERMINATED_BY_LOCAL_HOST = 22,
34    REPEATED_ATTEMPTS = 23,
35    PAIRING_NOT_ALLOWED = 24,
36    UNKNOWN_LMP_PDU = 25,
37    UNSUPPORTED_REMOTE_FEATURE = 26,
38    SCO_OFFSET_REJECTED = 27,
39    SCO_INTERVAL_REJECTED = 28,
40    SCO_AIRMODE_REJECTED = 29,
41    INVALID_LMP_OR_LL_PARAMETERS = 30,
42    UNSPECIFIED_ERROR = 31,
43    UNSUPPORTED_LMP_OR_LL_PARAMETER_VALUE = 32,
44    ROLE_CHANGE_NOT_ALLOWED = 33,
45    LMP_OR_LL_RESPONSE_TIMEOUT = 34,
46    LMP_ERROR_TRANSACTION_COLLISION = 35,
47    LMP_PDU_NOT_ALLOWED = 36,
48    ENCRYPTION_MODE_NOT_ACCEPTABLE = 37,
49    LINK_KEY_CANNOT_BE_CHANGED = 38,
50    REQUESTED_QOS_NOT_SUPPORTED = 39,
51    INSTANT_PASSED = 40,
52    PAIRING_WITH_UNIT_KEY_NOT_SUPPORTED = 41,
53    DIFFERENT_TRANSACTION_COLLISION = 42,
54    RESERVED_0 = 43,
55    QOS_UNACCEPTABLE_PARAMETER = 44,
56    QOS_REJECTED = 45,
57    CHANNEL_CLASSIFICATION_NOT_SUPPORTED = 46,
58    INSUFFICIENT_SECURITY = 47,
59    PARAMETER_OUT_OF_MANDATORY_RANGE = 48,
60    RESERVED_1 = 49,
61    ROLE_SWITCH_PENDING = 50,
62    RESERVED_2 = 51,
63    RESERVED_SLOT_VIOLATION = 52,
64    ROLE_SWITCH_FAILED = 53,
65    EXTENDED_INQUIRY_RESPONSE_TOO_LARGE = 54,
66    SECURE_SIMPLE_PAIRING_NOT_SUPPORTED_BY_HOST = 55,
67    HOST_BUSY_PAIRING = 56,
68    CONNECTION_REJECTED_NO_SUITABLE_CHANNEL_FOUND = 57,
69    CONTROLLER_BUSY = 58,
70    UNACCEPTABLE_CONNECTION_PARAMETERS = 59,
71    DIRECTED_ADVERTISING_TIMEOUT = 60,
72    CONNECTION_TERMINATED_MIC_FAILURE = 61,
73    CONNECTION_FAILED_TO_BE_ESTABLISHED = 62,
74    MAC_CONNECTION_FAILED = 63,
75    COARSE_CLOCK_ADJUSTMENT_REJECTED = 64,
76    TYPE_0_SUBMAP_NOT_DEFINED = 65,
77    UNKNOWN_ADVERTISING_IDENTIFIER = 66,
78    LIMIT_REACHED = 67,
79    OPERATION_CANCELLED_BY_HOST = 68,
80    PACKET_TOO_LONG = 69,
81    TOO_LATE = 70,
82    TOO_EARLY = 71,
83
84}
85
86impl core::convert::From<StatusCode> for u8 { fn from(val: StatusCode) -> Self { val as u8 } }
87impl core::convert::From<StatusCode> for u16 { fn from(val: StatusCode) -> Self { val as u16 } }
88impl core::convert::From<StatusCode> for u32 { fn from(val: StatusCode) -> Self { val as u32 } }
89impl core::convert::From<StatusCode> for u64 { fn from(val: StatusCode) -> Self { val as u64 } }
90impl core::convert::From<StatusCode> for i8 { fn from(val: StatusCode) -> Self { val as i8 } }
91impl core::convert::From<StatusCode> for i16 { fn from(val: StatusCode) -> Self { val as i16 } }
92impl core::convert::From<StatusCode> for i32 { fn from(val: StatusCode) -> Self { val as i32 } }
93impl core::convert::From<StatusCode> for i64 { fn from(val: StatusCode) -> Self { val as i64 } }
94
95impl emboss_runtime::SafeCmp<StatusCode> for StatusCode {
96    fn safe_eq(&self, other: Self) -> bool { *self == other }
97    fn safe_less(&self, other: Self) -> bool { (*self as u64) < (other as u64) }
98}
99
100impl emboss_runtime::SafeCmp<u64> for StatusCode {
101    fn safe_eq(&self, other: u64) -> bool { emboss_runtime::SafeCmp::safe_eq(&(*self as u64), other) }
102    fn safe_less(&self, other: u64) -> bool { emboss_runtime::SafeCmp::safe_less(&(*self as u64), other) }
103}
104
105impl emboss_runtime::SafeCmp<i64> for StatusCode {
106    fn safe_eq(&self, other: i64) -> bool { emboss_runtime::SafeCmp::safe_eq(&(*self as u64), other) }
107    fn safe_less(&self, other: i64) -> bool { emboss_runtime::SafeCmp::safe_less(&(*self as u64), other) }
108}
109
110impl emboss_runtime::SafeCmp<i32> for StatusCode {
111    fn safe_eq(&self, other: i32) -> bool { emboss_runtime::SafeCmp::safe_eq(&(*self as u64), other as i64) }
112    fn safe_less(&self, other: i32) -> bool { emboss_runtime::SafeCmp::safe_less(&(*self as u64), other as i64) }
113}
114
115impl emboss_runtime::SafeCmp<u32> for StatusCode {
116    fn safe_eq(&self, other: u32) -> bool { emboss_runtime::SafeCmp::safe_eq(&(*self as u64), other as u64) }
117    fn safe_less(&self, other: u32) -> bool { emboss_runtime::SafeCmp::safe_less(&(*self as u64), other as u64) }
118}
119
120impl emboss_runtime::SafeCmp<StatusCode> for u64 {
121    fn safe_eq(&self, other: StatusCode) -> bool { emboss_runtime::SafeCmp::safe_eq(self, other as u64) }
122    fn safe_less(&self, other: StatusCode) -> bool { emboss_runtime::SafeCmp::safe_less(self, other as u64) }
123}
124
125impl emboss_runtime::SafeCmp<StatusCode> for i64 {
126    fn safe_eq(&self, other: StatusCode) -> bool { emboss_runtime::SafeCmp::safe_eq(self, other as u64) }
127    fn safe_less(&self, other: StatusCode) -> bool { emboss_runtime::SafeCmp::safe_less(self, other as u64) }
128}
129
130impl<V: core::convert::Into<u64> + core::marker::Copy> emboss_runtime::TryFromRaw<V> for StatusCode {
131    fn try_from_raw(val: V) -> core::result::Result<Self, emboss_runtime::Error<V>> {
132        let v_raw: u64 = val.into();
133        match v_raw {
134            0 => Ok(StatusCode::SUCCESS),
135            1 => Ok(StatusCode::UNKNOWN_COMMAND),
136            2 => Ok(StatusCode::UNKNOWN_CONNECTION_ID),
137            3 => Ok(StatusCode::HARDWARE_FAILURE),
138            4 => Ok(StatusCode::PAGE_TIMEOUT),
139            5 => Ok(StatusCode::AUTHENTICATION_FAILURE),
140            6 => Ok(StatusCode::PIN_OR_KEY_MISSING),
141            7 => Ok(StatusCode::MEMORY_CAPACITY_EXCEEDED),
142            8 => Ok(StatusCode::CONNECTION_TIMEOUT),
143            9 => Ok(StatusCode::CONNECTION_LIMIT_EXCEEDED),
144            10 => Ok(StatusCode::SYNCHRONOUS_CONNECTION_LIMIT_EXCEEDED),
145            11 => Ok(StatusCode::CONNECTION_ALREADY_EXISTS),
146            12 => Ok(StatusCode::COMMAND_DISALLOWED),
147            13 => Ok(StatusCode::CONNECTION_REJECTED_LIMITED_RESOURCES),
148            14 => Ok(StatusCode::CONNECTION_REJECTED_SECURITY),
149            15 => Ok(StatusCode::CONNECTION_REJECTED_BAD_BD_ADDR),
150            16 => Ok(StatusCode::CONNECTION_ACCEPT_TIMEOUT_EXCEEDED),
151            17 => Ok(StatusCode::UNSUPPORTED_FEATURE_OR_PARAMETER),
152            18 => Ok(StatusCode::INVALID_HCI_COMMAND_PARAMETERS),
153            19 => Ok(StatusCode::REMOTE_USER_TERMINATED_CONNECTION),
154            20 => Ok(StatusCode::REMOTE_DEVICE_TERMINATED_CONNECTION_LOW_RESOURCES),
155            21 => Ok(StatusCode::REMOTE_DEVICE_TERMINATED_CONNECTION_POWER_OFF),
156            22 => Ok(StatusCode::CONNECTION_TERMINATED_BY_LOCAL_HOST),
157            23 => Ok(StatusCode::REPEATED_ATTEMPTS),
158            24 => Ok(StatusCode::PAIRING_NOT_ALLOWED),
159            25 => Ok(StatusCode::UNKNOWN_LMP_PDU),
160            26 => Ok(StatusCode::UNSUPPORTED_REMOTE_FEATURE),
161            27 => Ok(StatusCode::SCO_OFFSET_REJECTED),
162            28 => Ok(StatusCode::SCO_INTERVAL_REJECTED),
163            29 => Ok(StatusCode::SCO_AIRMODE_REJECTED),
164            30 => Ok(StatusCode::INVALID_LMP_OR_LL_PARAMETERS),
165            31 => Ok(StatusCode::UNSPECIFIED_ERROR),
166            32 => Ok(StatusCode::UNSUPPORTED_LMP_OR_LL_PARAMETER_VALUE),
167            33 => Ok(StatusCode::ROLE_CHANGE_NOT_ALLOWED),
168            34 => Ok(StatusCode::LMP_OR_LL_RESPONSE_TIMEOUT),
169            35 => Ok(StatusCode::LMP_ERROR_TRANSACTION_COLLISION),
170            36 => Ok(StatusCode::LMP_PDU_NOT_ALLOWED),
171            37 => Ok(StatusCode::ENCRYPTION_MODE_NOT_ACCEPTABLE),
172            38 => Ok(StatusCode::LINK_KEY_CANNOT_BE_CHANGED),
173            39 => Ok(StatusCode::REQUESTED_QOS_NOT_SUPPORTED),
174            40 => Ok(StatusCode::INSTANT_PASSED),
175            41 => Ok(StatusCode::PAIRING_WITH_UNIT_KEY_NOT_SUPPORTED),
176            42 => Ok(StatusCode::DIFFERENT_TRANSACTION_COLLISION),
177            43 => Ok(StatusCode::RESERVED_0),
178            44 => Ok(StatusCode::QOS_UNACCEPTABLE_PARAMETER),
179            45 => Ok(StatusCode::QOS_REJECTED),
180            46 => Ok(StatusCode::CHANNEL_CLASSIFICATION_NOT_SUPPORTED),
181            47 => Ok(StatusCode::INSUFFICIENT_SECURITY),
182            48 => Ok(StatusCode::PARAMETER_OUT_OF_MANDATORY_RANGE),
183            49 => Ok(StatusCode::RESERVED_1),
184            50 => Ok(StatusCode::ROLE_SWITCH_PENDING),
185            51 => Ok(StatusCode::RESERVED_2),
186            52 => Ok(StatusCode::RESERVED_SLOT_VIOLATION),
187            53 => Ok(StatusCode::ROLE_SWITCH_FAILED),
188            54 => Ok(StatusCode::EXTENDED_INQUIRY_RESPONSE_TOO_LARGE),
189            55 => Ok(StatusCode::SECURE_SIMPLE_PAIRING_NOT_SUPPORTED_BY_HOST),
190            56 => Ok(StatusCode::HOST_BUSY_PAIRING),
191            57 => Ok(StatusCode::CONNECTION_REJECTED_NO_SUITABLE_CHANNEL_FOUND),
192            58 => Ok(StatusCode::CONTROLLER_BUSY),
193            59 => Ok(StatusCode::UNACCEPTABLE_CONNECTION_PARAMETERS),
194            60 => Ok(StatusCode::DIRECTED_ADVERTISING_TIMEOUT),
195            61 => Ok(StatusCode::CONNECTION_TERMINATED_MIC_FAILURE),
196            62 => Ok(StatusCode::CONNECTION_FAILED_TO_BE_ESTABLISHED),
197            63 => Ok(StatusCode::MAC_CONNECTION_FAILED),
198            64 => Ok(StatusCode::COARSE_CLOCK_ADJUSTMENT_REJECTED),
199            65 => Ok(StatusCode::TYPE_0_SUBMAP_NOT_DEFINED),
200            66 => Ok(StatusCode::UNKNOWN_ADVERTISING_IDENTIFIER),
201            67 => Ok(StatusCode::LIMIT_REACHED),
202            68 => Ok(StatusCode::OPERATION_CANCELLED_BY_HOST),
203            69 => Ok(StatusCode::PACKET_TOO_LONG),
204            70 => Ok(StatusCode::TOO_LATE),
205            71 => Ok(StatusCode::TOO_EARLY),
206
207            _ => Err(emboss_runtime::Error::UnknownEnum(val)),
208        }
209    }
210}
211
212impl StatusCode {
213
214}
215#[derive(Copy, Clone, Debug, Eq, PartialEq)]
216#[repr(u64)]
217pub enum OpCode {
218    UNSPECIFIED = 0,
219    INQUIRY = 1025,
220    INQUIRY_CANCEL = 1026,
221    CREATE_CONNECTION = 1029,
222    DISCONNECT = 1030,
223    CREATE_CONNECTION_CANCEL = 1032,
224    ACCEPT_CONNECTION_REQUEST = 1033,
225    REJECT_CONNECTION_REQUEST = 1034,
226    LINK_KEY_REQUEST_REPLY = 1035,
227    LINK_KEY_REQUEST_NEGATIVE_REPLY = 1036,
228    CHANGE_CONNECTION_PACKET_TYPE = 1039,
229    AUTHENTICATION_REQUESTED = 1041,
230    SET_CONNECTION_ENCRYPTION = 1043,
231    REMOTE_NAME_REQUEST = 1049,
232    READ_REMOTE_SUPPORTED_FEATURES = 1051,
233    READ_REMOTE_EXTENDED_FEATURES = 1052,
234    READ_REMOTE_VERSION_INFO = 1053,
235    IO_CAPABILITY_REQUEST_REPLY = 1067,
236    USER_CONFIRMATION_REQUEST_REPLY = 1068,
237    USER_CONFIRMATION_REQUEST_NEGATIVE_REPLY = 1069,
238    USER_PASSKEY_REQUEST_REPLY = 1070,
239    USER_PASSKEY_REQUEST_NEGATIVE_REPLY = 1071,
240    IO_CAPABILITY_REQUEST_NEGATIVE_REPLY = 1076,
241    ENHANCED_SETUP_SYNCHRONOUS_CONNECTION = 1085,
242    ENHANCED_ACCEPT_SYNCHRONOUS_CONNECTION_REQUEST = 1086,
243    TRUNCATED_PAGE = 1087,
244    TRUNCATED_PAGE_CANCEL = 1088,
245    SET_CONNECTIONLESS_PERIPHERAL_BROADCAST = 1089,
246    SET_CONNECTIONLESS_PERIPHERAL_BROADCAST_RECEIVE = 1090,
247    START_SYNCHRONIZATION_TRAIN = 1091,
248    RECEIVE_SYNCHRONIZATION_TRAIN = 1092,
249    REMOTE_OOB_EXTENDED_DATA_REQUEST_REPLY = 1093,
250    SNIFF_MODE = 2051,
251    EXIT_SNIFF_MODE = 2052,
252    SNIFF_SUBRATING = 2065,
253    SET_EVENT_MASK = 3073,
254    RESET = 3075,
255    WRITE_LOCAL_NAME = 3091,
256    READ_LOCAL_NAME = 3092,
257    WRITE_PAGE_TIMEOUT = 3096,
258    READ_SCAN_ENABLE = 3097,
259    WRITE_SCAN_ENABLE = 3098,
260    READ_PAGE_SCAN_ACTIVITY = 3099,
261    WRITE_PAGE_SCAN_ACTIVITY = 3100,
262    READ_INQUIRY_SCAN_ACTIVITY = 3101,
263    READ_CLASS_OF_DEVICE = 3107,
264    WRITE_CLASS_OF_DEVICE = 3108,
265    READ_TRANSMIT_POWER_LEVEL = 3117,
266    READ_SYNCHRONOUS_FLOW_CONTROL_ENABLE = 3118,
267    WRITE_SYNCHRONOUS_FLOW_CONTROL_ENABLE = 3119,
268    SET_CONTROLLER_TO_HOST_FLOW_CONTROL = 3121,
269    HOST_BUFFER_SIZE = 3123,
270    HOST_NUMBER_OF_COMPLETED_PACKETS = 3125,
271    READ_LINK_SUPERVISION_TIMEOUT = 3126,
272    WRITE_LINK_SUPERVISION_TIMEOUT = 3127,
273    READ_NUMBER_OF_SUPPORTED_IAC = 3128,
274    READ_CURRENT_IAC_LAP = 3129,
275    WRITE_CURRENT_IAC_LAP = 3130,
276    SET_AFH_HOST_CHANNEL_CLASSIFICATION = 3135,
277    READ_INQUIRY_SCAN_TYPE = 3138,
278    WRITE_INQUIRY_SCAN_TYPE = 3139,
279    READ_INQUIRY_MODE = 3140,
280    WRITE_INQUIRY_MODE = 3141,
281    READ_PAGE_SCAN_TYPE = 3142,
282    WRITE_PAGE_SCAN_TYPE = 3143,
283    READ_EXTENDED_INQUIRY_RESPONSE = 3153,
284    WRITE_EXTENDED_INQUIRY_RESPONSE = 3154,
285    READ_SIMPLE_PAIRING_MODE = 3157,
286    WRITE_SIMPLE_PAIRING_MODE = 3158,
287    SET_EVENT_MASK_PAGE2 = 3171,
288    READ_FLOW_CONTROL_MODE = 3174,
289    WRITE_FLOW_CONTROL_MODE = 3175,
290    READ_LE_HOST_SUPPORT = 3180,
291    WRITE_LE_HOST_SUPPORT = 3181,
292    SET_MWS_CHANNEL_PARAMETERS = 3182,
293    SET_EXTERNAL_FRAME_CONFIGURATION = 3183,
294    SET_MWS_SIGNALING = 3184,
295    SET_MWS_TRANSPORT_LAYER = 3185,
296    SET_MWS_SCAN_FREQUENCY_TABLE = 3186,
297    SET_MWS_PATTERN_CONFIGURATION = 3187,
298    SET_RESERVED_LT_ADDR = 3188,
299    DELETE_RESERVED_LT_ADDR = 3189,
300    SET_CONNECTIONLESS_PERIPHERAL_BROADCAST_DATA = 3190,
301    READ_SYNCHRONIZATION_TRAIN_PARAMETERS = 3191,
302    WRITE_SYNCHRONIZATION_TRAIN_PARAMETERS = 3192,
303    READ_SECURE_CONNECTIONS_HOST_SUPPORT = 3193,
304    WRITE_SECURE_CONNECTIONS_HOST_SUPPORT = 3194,
305    READ_LOCAL_VERSION_INFO = 4097,
306    READ_LOCAL_SUPPORTED_COMMANDS = 4098,
307    READ_LOCAL_SUPPORTED_FEATURES = 4099,
308    READ_LOCAL_EXTENDED_FEATURES = 4100,
309    READ_BUFFER_SIZE = 4101,
310    READ_BD_ADDR = 4105,
311    READ_DATA_BLOCK_SIZE = 4106,
312    READ_LOCAL_SUPPORTED_CODECS_V1 = 4107,
313    READ_LOCAL_SIMPLE_PAIRING_OPTIONS = 4108,
314    READ_LOCAL_SUPPORTED_CODECS_V2 = 4109,
315    READ_LOCAL_SUPPORTED_CODEC_CAPABILITIES = 4110,
316    READ_LOCAL_SUPPORTED_CONTROLLER_DELAY = 4111,
317    READ_RSSI = 5125,
318    READ_ENCRYPTION_KEY_SIZE = 5128,
319    WRITE_SIMPLE_PAIRING_DEBUG_MODE = 6148,
320    LE_SET_EVENT_MASK = 8193,
321    LE_READ_BUFFER_SIZE_V1 = 8194,
322    LE_READ_LOCAL_SUPPORTED_FEATURES = 8195,
323    LE_SET_RANDOM_ADDRESS = 8197,
324    LE_SET_ADVERTISING_PARAMETERS = 8198,
325    LE_READ_ADVERTISING_CHANNEL_TX_POWER = 8199,
326    LE_SET_ADVERTISING_DATA = 8200,
327    LE_SET_SCAN_RESPONSE_DATA = 8201,
328    LE_SET_ADVERTISING_ENABLE = 8202,
329    LE_SET_SCAN_PARAMETERS = 8203,
330    LE_SET_SCAN_ENABLE = 8204,
331    LE_CREATE_CONNECTION = 8205,
332    LE_CREATE_CONNECTION_CANCEL = 8206,
333    LE_CLEAR_FILTER_ACCEPT_LIST = 8208,
334    LE_CONNECTION_UPDATE = 8211,
335    LE_READ_CHANNEL_MAP = 8213,
336    LE_READ_REMOTE_FEATURES = 8214,
337    LE_ENCRYPT = 8215,
338    LE_RAND = 8216,
339    LE_START_ENCRYPTION = 8217,
340    LE_LONG_TERM_KEY_REQUEST_REPLY = 8218,
341    LE_READ_SUPPORTED_STATES = 8220,
342    LE_RECEIVER_TEST = 8221,
343    LE_TRANSMITTER_TEST = 8222,
344    LE_TEST_END = 8223,
345    LE_SET_DATA_LENGTH = 8226,
346    LE_READ_LOCAL_P256_PUBLIC_KEY = 8229,
347    LE_GENERATE_DH_KEY = 8230,
348    LE_CLEAR_RESOLVING_LIST = 8233,
349    LE_READ_RESOLVING_LIST_SIZE = 8234,
350    LE_READ_MAXIMUM_DATA_LENGTH = 8239,
351    LE_READ_PHY = 8240,
352    LE_SET_DEFAULT_PHY = 8241,
353    LE_SET_PHY = 8242,
354    LE_ENHANCED_RECEIVER_TEXT = 8243,
355    LE_ENHANCED_TRANSMITTER_TEST = 8244,
356    LE_SET_ADVERTISING_SET_RANDOM_ADDRESS = 8245,
357    LE_SET_EXTENDED_ADVERTISING_PARAMETERS_V1 = 8246,
358    LE_SET_EXTENDED_ADVERTISING_DATA = 8247,
359    LE_SET_EXTENDED_SCAN_RESPONSE_DATA = 8248,
360    LE_SET_EXTENDED_ADVERTISING_ENABLE = 8249,
361    LE_READ_MAXIMUM_ADVERTISING_DATA_LENGTH = 8250,
362    LE_READ_NUMBER_OF_SUPPORTED_ADVERTISING_SETS = 8251,
363    LE_REMOVE_ADVERTISING_SET = 8252,
364    LE_CLEAR_ADVERTISING_SETS = 8253,
365    LE_SET_PERIODIC_ADVERTISING_PARAMETERS_V1 = 8254,
366    LE_SET_PERIODIC_ADVERTISING_DATA = 8255,
367    LE_SET_PERIODIC_ADVERTISING_ENABLE = 8256,
368    LE_SET_EXTENDED_SCAN_PARAMETERS = 8257,
369    LE_SET_EXTENDED_SCAN_ENABLE = 8258,
370    LE_EXTENDED_CREATE_CONNECTION_V1 = 8259,
371    LE_PERIODIC_ADVERTISING_CREATE_SYNC = 8260,
372    LE_PERIODIC_ADVERTISING_CREATE_SYNC_CANCEL = 8261,
373    LE_PERIODIC_ADVERTISING_TERMINATE_SYNC = 8262,
374    LE_ADD_DEVICE_TO_PERIODIC_ADVERTISER_LIST = 8263,
375    LE_REMOVE_DEVICE_FROM_PERIODIC_ADVERTISER_LIST = 8264,
376    LE_CLEAR_PERIODIC_ADVERTISER_LIST = 8265,
377    LE_READ_TRANSMIT_POWER = 8267,
378    LE_READ_RF_PATH_COMPENSATION = 8268,
379    LE_WRITE_RF_PATH_COMPENSATION = 8269,
380    LE_SET_PRIVACY_MODE = 8270,
381    LE_SET_PERIODIC_ADVERTISING_RECEIVE_ENABLE = 8281,
382    LE_PERIODIC_ADVERTISING_SYNC_TRANSFER = 8282,
383    LE_PERIODIC_ADVERTISING_SET_INFO_TRANSFER = 8283,
384    LE_SET_PERIODIC_ADVERTISING_SYNC_TRANSFER_PARAMETERS = 8284,
385    LE_SET_DEFAULT_PERIODIC_ADVERTISING_SYNC_TRANSFER_PARAMETERS = 8285,
386    LE_MODIFY_SLEEP_CLOCK_ACCURACY = 8287,
387    LE_READ_BUFFER_SIZE_V2 = 8288,
388    LE_READ_ISO_TX_SYNC = 8289,
389    LE_SET_CIG_PARAMETERS = 8290,
390    LE_SET_CIG_PARAMETERS_TEST = 8291,
391    LE_CREATE_CIS = 8292,
392    LE_REMOVE_CIG = 8293,
393    LE_ACCEPT_CIS_REQUEST = 8294,
394    LE_REJECT_CIS_REQUEST = 8295,
395    LE_CREATE_BIG = 8296,
396    LE_CREATE_BIG_TEST = 8297,
397    LE_TERMINATE_BIG = 8298,
398    LE_BIG_CREATE_SYNC = 8299,
399    LE_BIG_TERMINATE_SYNC = 8300,
400    LE_REQUEST_PEER_SCA = 8301,
401    LE_SETUP_ISO_DATA_PATH = 8302,
402    LE_REMOVE_ISO_DATA_PATH = 8303,
403    LE_ISO_TRANSMIT_TEST = 8304,
404    LE_ISO_RECEIVE_TEST = 8305,
405    LE_ISO_READ_TEST_COUNTERS = 8306,
406    LE_ISO_TEST_END = 8307,
407    LE_SET_HOST_FEATURE = 8308,
408    LE_READ_ISO_LINK_QUALITY = 8309,
409    LE_SET_EXTENDED_ADVERTISING_PARAMETERS_V2 = 8319,
410    LE_SET_PERIODIC_SYNC_SUBEVENT = 8324,
411    LE_EXTENDED_CREATE_CONNECTION_V2 = 8325,
412    LE_SET_PERIODIC_ADVERTISING_PARAMETERS_V2 = 8326,
413    ANDROID_LE_GET_VENDOR_CAPABILITIES = 64851,
414    ANDROID_LE_MULTI_ADVT = 64852,
415    ANDROID_LE_BATCH_SCAN = 64854,
416    ANDROID_APCF = 64855,
417    ANDROID_LE_GET_CONTROLLER_ACTIVITY_ENERGY_INFO = 64857,
418    ANDROID_LE_EXTENDED_SET_SCAN_PARAMETERS = 64858,
419    ANDROID_GET_CONTROLLER_DEBUG_INFO = 64859,
420    ANDROID_A2DP_HARDWARE_OFFLOAD = 64861,
421    ANDROID_BLUETOOTH_QUALITY_REPORT = 64862,
422    ANDROID_DYNAMIC_AUDIO_BUFFER = 64863,
423    ANDROID_WRITE_SNIFF_OFFLOAD_ENABLE = 65296,
424    ANDROID_WRITE_SNIFF_OFFLOAD_PARAMETERS = 65297,
425
426}
427
428impl core::convert::From<OpCode> for u8 { fn from(val: OpCode) -> Self { val as u8 } }
429impl core::convert::From<OpCode> for u16 { fn from(val: OpCode) -> Self { val as u16 } }
430impl core::convert::From<OpCode> for u32 { fn from(val: OpCode) -> Self { val as u32 } }
431impl core::convert::From<OpCode> for u64 { fn from(val: OpCode) -> Self { val as u64 } }
432impl core::convert::From<OpCode> for i8 { fn from(val: OpCode) -> Self { val as i8 } }
433impl core::convert::From<OpCode> for i16 { fn from(val: OpCode) -> Self { val as i16 } }
434impl core::convert::From<OpCode> for i32 { fn from(val: OpCode) -> Self { val as i32 } }
435impl core::convert::From<OpCode> for i64 { fn from(val: OpCode) -> Self { val as i64 } }
436
437impl emboss_runtime::SafeCmp<OpCode> for OpCode {
438    fn safe_eq(&self, other: Self) -> bool { *self == other }
439    fn safe_less(&self, other: Self) -> bool { (*self as u64) < (other as u64) }
440}
441
442impl emboss_runtime::SafeCmp<u64> for OpCode {
443    fn safe_eq(&self, other: u64) -> bool { emboss_runtime::SafeCmp::safe_eq(&(*self as u64), other) }
444    fn safe_less(&self, other: u64) -> bool { emboss_runtime::SafeCmp::safe_less(&(*self as u64), other) }
445}
446
447impl emboss_runtime::SafeCmp<i64> for OpCode {
448    fn safe_eq(&self, other: i64) -> bool { emboss_runtime::SafeCmp::safe_eq(&(*self as u64), other) }
449    fn safe_less(&self, other: i64) -> bool { emboss_runtime::SafeCmp::safe_less(&(*self as u64), other) }
450}
451
452impl emboss_runtime::SafeCmp<i32> for OpCode {
453    fn safe_eq(&self, other: i32) -> bool { emboss_runtime::SafeCmp::safe_eq(&(*self as u64), other as i64) }
454    fn safe_less(&self, other: i32) -> bool { emboss_runtime::SafeCmp::safe_less(&(*self as u64), other as i64) }
455}
456
457impl emboss_runtime::SafeCmp<u32> for OpCode {
458    fn safe_eq(&self, other: u32) -> bool { emboss_runtime::SafeCmp::safe_eq(&(*self as u64), other as u64) }
459    fn safe_less(&self, other: u32) -> bool { emboss_runtime::SafeCmp::safe_less(&(*self as u64), other as u64) }
460}
461
462impl emboss_runtime::SafeCmp<OpCode> for u64 {
463    fn safe_eq(&self, other: OpCode) -> bool { emboss_runtime::SafeCmp::safe_eq(self, other as u64) }
464    fn safe_less(&self, other: OpCode) -> bool { emboss_runtime::SafeCmp::safe_less(self, other as u64) }
465}
466
467impl emboss_runtime::SafeCmp<OpCode> for i64 {
468    fn safe_eq(&self, other: OpCode) -> bool { emboss_runtime::SafeCmp::safe_eq(self, other as u64) }
469    fn safe_less(&self, other: OpCode) -> bool { emboss_runtime::SafeCmp::safe_less(self, other as u64) }
470}
471
472impl<V: core::convert::Into<u64> + core::marker::Copy> emboss_runtime::TryFromRaw<V> for OpCode {
473    fn try_from_raw(val: V) -> core::result::Result<Self, emboss_runtime::Error<V>> {
474        let v_raw: u64 = val.into();
475        match v_raw {
476            0 => Ok(OpCode::UNSPECIFIED),
477            1025 => Ok(OpCode::INQUIRY),
478            1026 => Ok(OpCode::INQUIRY_CANCEL),
479            1029 => Ok(OpCode::CREATE_CONNECTION),
480            1030 => Ok(OpCode::DISCONNECT),
481            1032 => Ok(OpCode::CREATE_CONNECTION_CANCEL),
482            1033 => Ok(OpCode::ACCEPT_CONNECTION_REQUEST),
483            1034 => Ok(OpCode::REJECT_CONNECTION_REQUEST),
484            1035 => Ok(OpCode::LINK_KEY_REQUEST_REPLY),
485            1036 => Ok(OpCode::LINK_KEY_REQUEST_NEGATIVE_REPLY),
486            1039 => Ok(OpCode::CHANGE_CONNECTION_PACKET_TYPE),
487            1041 => Ok(OpCode::AUTHENTICATION_REQUESTED),
488            1043 => Ok(OpCode::SET_CONNECTION_ENCRYPTION),
489            1049 => Ok(OpCode::REMOTE_NAME_REQUEST),
490            1051 => Ok(OpCode::READ_REMOTE_SUPPORTED_FEATURES),
491            1052 => Ok(OpCode::READ_REMOTE_EXTENDED_FEATURES),
492            1053 => Ok(OpCode::READ_REMOTE_VERSION_INFO),
493            1067 => Ok(OpCode::IO_CAPABILITY_REQUEST_REPLY),
494            1068 => Ok(OpCode::USER_CONFIRMATION_REQUEST_REPLY),
495            1069 => Ok(OpCode::USER_CONFIRMATION_REQUEST_NEGATIVE_REPLY),
496            1070 => Ok(OpCode::USER_PASSKEY_REQUEST_REPLY),
497            1071 => Ok(OpCode::USER_PASSKEY_REQUEST_NEGATIVE_REPLY),
498            1076 => Ok(OpCode::IO_CAPABILITY_REQUEST_NEGATIVE_REPLY),
499            1085 => Ok(OpCode::ENHANCED_SETUP_SYNCHRONOUS_CONNECTION),
500            1086 => Ok(OpCode::ENHANCED_ACCEPT_SYNCHRONOUS_CONNECTION_REQUEST),
501            1087 => Ok(OpCode::TRUNCATED_PAGE),
502            1088 => Ok(OpCode::TRUNCATED_PAGE_CANCEL),
503            1089 => Ok(OpCode::SET_CONNECTIONLESS_PERIPHERAL_BROADCAST),
504            1090 => Ok(OpCode::SET_CONNECTIONLESS_PERIPHERAL_BROADCAST_RECEIVE),
505            1091 => Ok(OpCode::START_SYNCHRONIZATION_TRAIN),
506            1092 => Ok(OpCode::RECEIVE_SYNCHRONIZATION_TRAIN),
507            1093 => Ok(OpCode::REMOTE_OOB_EXTENDED_DATA_REQUEST_REPLY),
508            2051 => Ok(OpCode::SNIFF_MODE),
509            2052 => Ok(OpCode::EXIT_SNIFF_MODE),
510            2065 => Ok(OpCode::SNIFF_SUBRATING),
511            3073 => Ok(OpCode::SET_EVENT_MASK),
512            3075 => Ok(OpCode::RESET),
513            3091 => Ok(OpCode::WRITE_LOCAL_NAME),
514            3092 => Ok(OpCode::READ_LOCAL_NAME),
515            3096 => Ok(OpCode::WRITE_PAGE_TIMEOUT),
516            3097 => Ok(OpCode::READ_SCAN_ENABLE),
517            3098 => Ok(OpCode::WRITE_SCAN_ENABLE),
518            3099 => Ok(OpCode::READ_PAGE_SCAN_ACTIVITY),
519            3100 => Ok(OpCode::WRITE_PAGE_SCAN_ACTIVITY),
520            3101 => Ok(OpCode::READ_INQUIRY_SCAN_ACTIVITY),
521            3107 => Ok(OpCode::READ_CLASS_OF_DEVICE),
522            3108 => Ok(OpCode::WRITE_CLASS_OF_DEVICE),
523            3117 => Ok(OpCode::READ_TRANSMIT_POWER_LEVEL),
524            3118 => Ok(OpCode::READ_SYNCHRONOUS_FLOW_CONTROL_ENABLE),
525            3119 => Ok(OpCode::WRITE_SYNCHRONOUS_FLOW_CONTROL_ENABLE),
526            3121 => Ok(OpCode::SET_CONTROLLER_TO_HOST_FLOW_CONTROL),
527            3123 => Ok(OpCode::HOST_BUFFER_SIZE),
528            3125 => Ok(OpCode::HOST_NUMBER_OF_COMPLETED_PACKETS),
529            3126 => Ok(OpCode::READ_LINK_SUPERVISION_TIMEOUT),
530            3127 => Ok(OpCode::WRITE_LINK_SUPERVISION_TIMEOUT),
531            3128 => Ok(OpCode::READ_NUMBER_OF_SUPPORTED_IAC),
532            3129 => Ok(OpCode::READ_CURRENT_IAC_LAP),
533            3130 => Ok(OpCode::WRITE_CURRENT_IAC_LAP),
534            3135 => Ok(OpCode::SET_AFH_HOST_CHANNEL_CLASSIFICATION),
535            3138 => Ok(OpCode::READ_INQUIRY_SCAN_TYPE),
536            3139 => Ok(OpCode::WRITE_INQUIRY_SCAN_TYPE),
537            3140 => Ok(OpCode::READ_INQUIRY_MODE),
538            3141 => Ok(OpCode::WRITE_INQUIRY_MODE),
539            3142 => Ok(OpCode::READ_PAGE_SCAN_TYPE),
540            3143 => Ok(OpCode::WRITE_PAGE_SCAN_TYPE),
541            3153 => Ok(OpCode::READ_EXTENDED_INQUIRY_RESPONSE),
542            3154 => Ok(OpCode::WRITE_EXTENDED_INQUIRY_RESPONSE),
543            3157 => Ok(OpCode::READ_SIMPLE_PAIRING_MODE),
544            3158 => Ok(OpCode::WRITE_SIMPLE_PAIRING_MODE),
545            3171 => Ok(OpCode::SET_EVENT_MASK_PAGE2),
546            3174 => Ok(OpCode::READ_FLOW_CONTROL_MODE),
547            3175 => Ok(OpCode::WRITE_FLOW_CONTROL_MODE),
548            3180 => Ok(OpCode::READ_LE_HOST_SUPPORT),
549            3181 => Ok(OpCode::WRITE_LE_HOST_SUPPORT),
550            3182 => Ok(OpCode::SET_MWS_CHANNEL_PARAMETERS),
551            3183 => Ok(OpCode::SET_EXTERNAL_FRAME_CONFIGURATION),
552            3184 => Ok(OpCode::SET_MWS_SIGNALING),
553            3185 => Ok(OpCode::SET_MWS_TRANSPORT_LAYER),
554            3186 => Ok(OpCode::SET_MWS_SCAN_FREQUENCY_TABLE),
555            3187 => Ok(OpCode::SET_MWS_PATTERN_CONFIGURATION),
556            3188 => Ok(OpCode::SET_RESERVED_LT_ADDR),
557            3189 => Ok(OpCode::DELETE_RESERVED_LT_ADDR),
558            3190 => Ok(OpCode::SET_CONNECTIONLESS_PERIPHERAL_BROADCAST_DATA),
559            3191 => Ok(OpCode::READ_SYNCHRONIZATION_TRAIN_PARAMETERS),
560            3192 => Ok(OpCode::WRITE_SYNCHRONIZATION_TRAIN_PARAMETERS),
561            3193 => Ok(OpCode::READ_SECURE_CONNECTIONS_HOST_SUPPORT),
562            3194 => Ok(OpCode::WRITE_SECURE_CONNECTIONS_HOST_SUPPORT),
563            4097 => Ok(OpCode::READ_LOCAL_VERSION_INFO),
564            4098 => Ok(OpCode::READ_LOCAL_SUPPORTED_COMMANDS),
565            4099 => Ok(OpCode::READ_LOCAL_SUPPORTED_FEATURES),
566            4100 => Ok(OpCode::READ_LOCAL_EXTENDED_FEATURES),
567            4101 => Ok(OpCode::READ_BUFFER_SIZE),
568            4105 => Ok(OpCode::READ_BD_ADDR),
569            4106 => Ok(OpCode::READ_DATA_BLOCK_SIZE),
570            4107 => Ok(OpCode::READ_LOCAL_SUPPORTED_CODECS_V1),
571            4108 => Ok(OpCode::READ_LOCAL_SIMPLE_PAIRING_OPTIONS),
572            4109 => Ok(OpCode::READ_LOCAL_SUPPORTED_CODECS_V2),
573            4110 => Ok(OpCode::READ_LOCAL_SUPPORTED_CODEC_CAPABILITIES),
574            4111 => Ok(OpCode::READ_LOCAL_SUPPORTED_CONTROLLER_DELAY),
575            5125 => Ok(OpCode::READ_RSSI),
576            5128 => Ok(OpCode::READ_ENCRYPTION_KEY_SIZE),
577            6148 => Ok(OpCode::WRITE_SIMPLE_PAIRING_DEBUG_MODE),
578            8193 => Ok(OpCode::LE_SET_EVENT_MASK),
579            8194 => Ok(OpCode::LE_READ_BUFFER_SIZE_V1),
580            8195 => Ok(OpCode::LE_READ_LOCAL_SUPPORTED_FEATURES),
581            8197 => Ok(OpCode::LE_SET_RANDOM_ADDRESS),
582            8198 => Ok(OpCode::LE_SET_ADVERTISING_PARAMETERS),
583            8199 => Ok(OpCode::LE_READ_ADVERTISING_CHANNEL_TX_POWER),
584            8200 => Ok(OpCode::LE_SET_ADVERTISING_DATA),
585            8201 => Ok(OpCode::LE_SET_SCAN_RESPONSE_DATA),
586            8202 => Ok(OpCode::LE_SET_ADVERTISING_ENABLE),
587            8203 => Ok(OpCode::LE_SET_SCAN_PARAMETERS),
588            8204 => Ok(OpCode::LE_SET_SCAN_ENABLE),
589            8205 => Ok(OpCode::LE_CREATE_CONNECTION),
590            8206 => Ok(OpCode::LE_CREATE_CONNECTION_CANCEL),
591            8208 => Ok(OpCode::LE_CLEAR_FILTER_ACCEPT_LIST),
592            8211 => Ok(OpCode::LE_CONNECTION_UPDATE),
593            8213 => Ok(OpCode::LE_READ_CHANNEL_MAP),
594            8214 => Ok(OpCode::LE_READ_REMOTE_FEATURES),
595            8215 => Ok(OpCode::LE_ENCRYPT),
596            8216 => Ok(OpCode::LE_RAND),
597            8217 => Ok(OpCode::LE_START_ENCRYPTION),
598            8218 => Ok(OpCode::LE_LONG_TERM_KEY_REQUEST_REPLY),
599            8220 => Ok(OpCode::LE_READ_SUPPORTED_STATES),
600            8221 => Ok(OpCode::LE_RECEIVER_TEST),
601            8222 => Ok(OpCode::LE_TRANSMITTER_TEST),
602            8223 => Ok(OpCode::LE_TEST_END),
603            8226 => Ok(OpCode::LE_SET_DATA_LENGTH),
604            8229 => Ok(OpCode::LE_READ_LOCAL_P256_PUBLIC_KEY),
605            8230 => Ok(OpCode::LE_GENERATE_DH_KEY),
606            8233 => Ok(OpCode::LE_CLEAR_RESOLVING_LIST),
607            8234 => Ok(OpCode::LE_READ_RESOLVING_LIST_SIZE),
608            8239 => Ok(OpCode::LE_READ_MAXIMUM_DATA_LENGTH),
609            8240 => Ok(OpCode::LE_READ_PHY),
610            8241 => Ok(OpCode::LE_SET_DEFAULT_PHY),
611            8242 => Ok(OpCode::LE_SET_PHY),
612            8243 => Ok(OpCode::LE_ENHANCED_RECEIVER_TEXT),
613            8244 => Ok(OpCode::LE_ENHANCED_TRANSMITTER_TEST),
614            8245 => Ok(OpCode::LE_SET_ADVERTISING_SET_RANDOM_ADDRESS),
615            8246 => Ok(OpCode::LE_SET_EXTENDED_ADVERTISING_PARAMETERS_V1),
616            8247 => Ok(OpCode::LE_SET_EXTENDED_ADVERTISING_DATA),
617            8248 => Ok(OpCode::LE_SET_EXTENDED_SCAN_RESPONSE_DATA),
618            8249 => Ok(OpCode::LE_SET_EXTENDED_ADVERTISING_ENABLE),
619            8250 => Ok(OpCode::LE_READ_MAXIMUM_ADVERTISING_DATA_LENGTH),
620            8251 => Ok(OpCode::LE_READ_NUMBER_OF_SUPPORTED_ADVERTISING_SETS),
621            8252 => Ok(OpCode::LE_REMOVE_ADVERTISING_SET),
622            8253 => Ok(OpCode::LE_CLEAR_ADVERTISING_SETS),
623            8254 => Ok(OpCode::LE_SET_PERIODIC_ADVERTISING_PARAMETERS_V1),
624            8255 => Ok(OpCode::LE_SET_PERIODIC_ADVERTISING_DATA),
625            8256 => Ok(OpCode::LE_SET_PERIODIC_ADVERTISING_ENABLE),
626            8257 => Ok(OpCode::LE_SET_EXTENDED_SCAN_PARAMETERS),
627            8258 => Ok(OpCode::LE_SET_EXTENDED_SCAN_ENABLE),
628            8259 => Ok(OpCode::LE_EXTENDED_CREATE_CONNECTION_V1),
629            8260 => Ok(OpCode::LE_PERIODIC_ADVERTISING_CREATE_SYNC),
630            8261 => Ok(OpCode::LE_PERIODIC_ADVERTISING_CREATE_SYNC_CANCEL),
631            8262 => Ok(OpCode::LE_PERIODIC_ADVERTISING_TERMINATE_SYNC),
632            8263 => Ok(OpCode::LE_ADD_DEVICE_TO_PERIODIC_ADVERTISER_LIST),
633            8264 => Ok(OpCode::LE_REMOVE_DEVICE_FROM_PERIODIC_ADVERTISER_LIST),
634            8265 => Ok(OpCode::LE_CLEAR_PERIODIC_ADVERTISER_LIST),
635            8267 => Ok(OpCode::LE_READ_TRANSMIT_POWER),
636            8268 => Ok(OpCode::LE_READ_RF_PATH_COMPENSATION),
637            8269 => Ok(OpCode::LE_WRITE_RF_PATH_COMPENSATION),
638            8270 => Ok(OpCode::LE_SET_PRIVACY_MODE),
639            8281 => Ok(OpCode::LE_SET_PERIODIC_ADVERTISING_RECEIVE_ENABLE),
640            8282 => Ok(OpCode::LE_PERIODIC_ADVERTISING_SYNC_TRANSFER),
641            8283 => Ok(OpCode::LE_PERIODIC_ADVERTISING_SET_INFO_TRANSFER),
642            8284 => Ok(OpCode::LE_SET_PERIODIC_ADVERTISING_SYNC_TRANSFER_PARAMETERS),
643            8285 => Ok(OpCode::LE_SET_DEFAULT_PERIODIC_ADVERTISING_SYNC_TRANSFER_PARAMETERS),
644            8287 => Ok(OpCode::LE_MODIFY_SLEEP_CLOCK_ACCURACY),
645            8288 => Ok(OpCode::LE_READ_BUFFER_SIZE_V2),
646            8289 => Ok(OpCode::LE_READ_ISO_TX_SYNC),
647            8290 => Ok(OpCode::LE_SET_CIG_PARAMETERS),
648            8291 => Ok(OpCode::LE_SET_CIG_PARAMETERS_TEST),
649            8292 => Ok(OpCode::LE_CREATE_CIS),
650            8293 => Ok(OpCode::LE_REMOVE_CIG),
651            8294 => Ok(OpCode::LE_ACCEPT_CIS_REQUEST),
652            8295 => Ok(OpCode::LE_REJECT_CIS_REQUEST),
653            8296 => Ok(OpCode::LE_CREATE_BIG),
654            8297 => Ok(OpCode::LE_CREATE_BIG_TEST),
655            8298 => Ok(OpCode::LE_TERMINATE_BIG),
656            8299 => Ok(OpCode::LE_BIG_CREATE_SYNC),
657            8300 => Ok(OpCode::LE_BIG_TERMINATE_SYNC),
658            8301 => Ok(OpCode::LE_REQUEST_PEER_SCA),
659            8302 => Ok(OpCode::LE_SETUP_ISO_DATA_PATH),
660            8303 => Ok(OpCode::LE_REMOVE_ISO_DATA_PATH),
661            8304 => Ok(OpCode::LE_ISO_TRANSMIT_TEST),
662            8305 => Ok(OpCode::LE_ISO_RECEIVE_TEST),
663            8306 => Ok(OpCode::LE_ISO_READ_TEST_COUNTERS),
664            8307 => Ok(OpCode::LE_ISO_TEST_END),
665            8308 => Ok(OpCode::LE_SET_HOST_FEATURE),
666            8309 => Ok(OpCode::LE_READ_ISO_LINK_QUALITY),
667            8319 => Ok(OpCode::LE_SET_EXTENDED_ADVERTISING_PARAMETERS_V2),
668            8324 => Ok(OpCode::LE_SET_PERIODIC_SYNC_SUBEVENT),
669            8325 => Ok(OpCode::LE_EXTENDED_CREATE_CONNECTION_V2),
670            8326 => Ok(OpCode::LE_SET_PERIODIC_ADVERTISING_PARAMETERS_V2),
671            64851 => Ok(OpCode::ANDROID_LE_GET_VENDOR_CAPABILITIES),
672            64852 => Ok(OpCode::ANDROID_LE_MULTI_ADVT),
673            64854 => Ok(OpCode::ANDROID_LE_BATCH_SCAN),
674            64855 => Ok(OpCode::ANDROID_APCF),
675            64857 => Ok(OpCode::ANDROID_LE_GET_CONTROLLER_ACTIVITY_ENERGY_INFO),
676            64858 => Ok(OpCode::ANDROID_LE_EXTENDED_SET_SCAN_PARAMETERS),
677            64859 => Ok(OpCode::ANDROID_GET_CONTROLLER_DEBUG_INFO),
678            64861 => Ok(OpCode::ANDROID_A2DP_HARDWARE_OFFLOAD),
679            64862 => Ok(OpCode::ANDROID_BLUETOOTH_QUALITY_REPORT),
680            64863 => Ok(OpCode::ANDROID_DYNAMIC_AUDIO_BUFFER),
681            65296 => Ok(OpCode::ANDROID_WRITE_SNIFF_OFFLOAD_ENABLE),
682            65297 => Ok(OpCode::ANDROID_WRITE_SNIFF_OFFLOAD_PARAMETERS),
683
684            _ => Err(emboss_runtime::Error::UnknownEnum(val)),
685        }
686    }
687}
688
689impl OpCode {
690
691}
692#[derive(Copy, Clone, Debug, Eq, PartialEq)]
693#[repr(u64)]
694pub enum EventCode {
695    INQUIRY_COMPLETE = 1,
696    INQUIRY_RESULT = 2,
697    CONNECTION_COMPLETE = 3,
698    CONNECTION_REQUEST = 4,
699    DISCONNECTION_COMPLETE = 5,
700    AUTHENTICATION_COMPLETE = 6,
701    REMOTE_NAME_REQUEST_COMPLETE = 7,
702    ENCRYPTION_CHANGE = 8,
703    CHANGE_CONNECTION_LINK_KEY_COMPLETE = 9,
704    CENTRAL_LINK_KEY_COMPLETE = 10,
705    READ_REMOTE_SUPPORTED_FEATURES_COMPLETE = 11,
706    READ_REMOTE_VERSION_INFORMATION_COMPLETE = 12,
707    QOS_SETUP_COMPLETE = 13,
708    COMMAND_COMPLETE = 14,
709    COMMAND_STATUS = 15,
710    HARDWARE_ERROR = 16,
711    FLUSH_OCCURRED = 17,
712    ROLE_CHANGE = 18,
713    NUMBER_OF_COMPLETED_PACKETS = 19,
714    MODE_CHANGE = 20,
715    RETURN_LINK_KEYS = 21,
716    PIN_CODE_REQUEST = 22,
717    LINK_KEY_REQUEST = 23,
718    LINK_KEY_NOTIFICATION = 24,
719    LOOPBACK_COMMAND = 25,
720    DATA_BUFFER_OVERFLOW = 26,
721    MAX_SLOTS_CHANGE = 27,
722    READ_CLOCK_OFFSET_COMPLETE = 28,
723    CONNECTION_PACKET_TYPE_CHANGED = 29,
724    QOS_VIOLATION = 30,
725    PAGE_SCAN_REPETITION_MODE_CHANGE = 32,
726    FLOW_SPECIFICATION_COMPLETE = 33,
727    INQUIRY_RESULT_WITH_RSSI = 34,
728    READ_REMOTE_EXTENDED_FEATURES_COMPLETE = 35,
729    SYNCHRONOUS_CONNECTION_COMPLETE = 44,
730    SYNCHRONOUS_CONNECTION_CHANGED = 45,
731    SNIFF_SUBRATING = 46,
732    EXTENDED_INQUIRY_RESULT = 47,
733    ENCRYPTION_KEY_REFRESH_COMPLETE = 48,
734    IO_CAPABILITY_REQUEST = 49,
735    IO_CAPABILITY_RESPONSE = 50,
736    USER_CONFIRMATION_REQUEST = 51,
737    USER_PASSKEY_REQUEST = 52,
738    REMOTE_OOB_DATA_REQUEST = 53,
739    SIMPLE_PAIRING_COMPLETE = 54,
740    LINK_SUPERVISION_TIMEOUT_CHANGED = 56,
741    ENHANCED_FLUSH_COMPLETE = 57,
742    USER_PASSKEY_NOTIFICATION = 59,
743    KEYPRESS_NOTIFICATION = 60,
744    REMOTE_HOST_SUPPORTED_FEATURES_NOTIFICATION = 61,
745    LE_META_EVENT = 62,
746    NUMBER_OF_COMPLETED_DATA_BLOCKS = 72,
747    VENDOR_DEBUG = 255,
748
749}
750
751impl core::convert::From<EventCode> for u8 { fn from(val: EventCode) -> Self { val as u8 } }
752impl core::convert::From<EventCode> for u16 { fn from(val: EventCode) -> Self { val as u16 } }
753impl core::convert::From<EventCode> for u32 { fn from(val: EventCode) -> Self { val as u32 } }
754impl core::convert::From<EventCode> for u64 { fn from(val: EventCode) -> Self { val as u64 } }
755impl core::convert::From<EventCode> for i8 { fn from(val: EventCode) -> Self { val as i8 } }
756impl core::convert::From<EventCode> for i16 { fn from(val: EventCode) -> Self { val as i16 } }
757impl core::convert::From<EventCode> for i32 { fn from(val: EventCode) -> Self { val as i32 } }
758impl core::convert::From<EventCode> for i64 { fn from(val: EventCode) -> Self { val as i64 } }
759
760impl emboss_runtime::SafeCmp<EventCode> for EventCode {
761    fn safe_eq(&self, other: Self) -> bool { *self == other }
762    fn safe_less(&self, other: Self) -> bool { (*self as u64) < (other as u64) }
763}
764
765impl emboss_runtime::SafeCmp<u64> for EventCode {
766    fn safe_eq(&self, other: u64) -> bool { emboss_runtime::SafeCmp::safe_eq(&(*self as u64), other) }
767    fn safe_less(&self, other: u64) -> bool { emboss_runtime::SafeCmp::safe_less(&(*self as u64), other) }
768}
769
770impl emboss_runtime::SafeCmp<i64> for EventCode {
771    fn safe_eq(&self, other: i64) -> bool { emboss_runtime::SafeCmp::safe_eq(&(*self as u64), other) }
772    fn safe_less(&self, other: i64) -> bool { emboss_runtime::SafeCmp::safe_less(&(*self as u64), other) }
773}
774
775impl emboss_runtime::SafeCmp<i32> for EventCode {
776    fn safe_eq(&self, other: i32) -> bool { emboss_runtime::SafeCmp::safe_eq(&(*self as u64), other as i64) }
777    fn safe_less(&self, other: i32) -> bool { emboss_runtime::SafeCmp::safe_less(&(*self as u64), other as i64) }
778}
779
780impl emboss_runtime::SafeCmp<u32> for EventCode {
781    fn safe_eq(&self, other: u32) -> bool { emboss_runtime::SafeCmp::safe_eq(&(*self as u64), other as u64) }
782    fn safe_less(&self, other: u32) -> bool { emboss_runtime::SafeCmp::safe_less(&(*self as u64), other as u64) }
783}
784
785impl emboss_runtime::SafeCmp<EventCode> for u64 {
786    fn safe_eq(&self, other: EventCode) -> bool { emboss_runtime::SafeCmp::safe_eq(self, other as u64) }
787    fn safe_less(&self, other: EventCode) -> bool { emboss_runtime::SafeCmp::safe_less(self, other as u64) }
788}
789
790impl emboss_runtime::SafeCmp<EventCode> for i64 {
791    fn safe_eq(&self, other: EventCode) -> bool { emboss_runtime::SafeCmp::safe_eq(self, other as u64) }
792    fn safe_less(&self, other: EventCode) -> bool { emboss_runtime::SafeCmp::safe_less(self, other as u64) }
793}
794
795impl<V: core::convert::Into<u64> + core::marker::Copy> emboss_runtime::TryFromRaw<V> for EventCode {
796    fn try_from_raw(val: V) -> core::result::Result<Self, emboss_runtime::Error<V>> {
797        let v_raw: u64 = val.into();
798        match v_raw {
799            1 => Ok(EventCode::INQUIRY_COMPLETE),
800            2 => Ok(EventCode::INQUIRY_RESULT),
801            3 => Ok(EventCode::CONNECTION_COMPLETE),
802            4 => Ok(EventCode::CONNECTION_REQUEST),
803            5 => Ok(EventCode::DISCONNECTION_COMPLETE),
804            6 => Ok(EventCode::AUTHENTICATION_COMPLETE),
805            7 => Ok(EventCode::REMOTE_NAME_REQUEST_COMPLETE),
806            8 => Ok(EventCode::ENCRYPTION_CHANGE),
807            9 => Ok(EventCode::CHANGE_CONNECTION_LINK_KEY_COMPLETE),
808            10 => Ok(EventCode::CENTRAL_LINK_KEY_COMPLETE),
809            11 => Ok(EventCode::READ_REMOTE_SUPPORTED_FEATURES_COMPLETE),
810            12 => Ok(EventCode::READ_REMOTE_VERSION_INFORMATION_COMPLETE),
811            13 => Ok(EventCode::QOS_SETUP_COMPLETE),
812            14 => Ok(EventCode::COMMAND_COMPLETE),
813            15 => Ok(EventCode::COMMAND_STATUS),
814            16 => Ok(EventCode::HARDWARE_ERROR),
815            17 => Ok(EventCode::FLUSH_OCCURRED),
816            18 => Ok(EventCode::ROLE_CHANGE),
817            19 => Ok(EventCode::NUMBER_OF_COMPLETED_PACKETS),
818            20 => Ok(EventCode::MODE_CHANGE),
819            21 => Ok(EventCode::RETURN_LINK_KEYS),
820            22 => Ok(EventCode::PIN_CODE_REQUEST),
821            23 => Ok(EventCode::LINK_KEY_REQUEST),
822            24 => Ok(EventCode::LINK_KEY_NOTIFICATION),
823            25 => Ok(EventCode::LOOPBACK_COMMAND),
824            26 => Ok(EventCode::DATA_BUFFER_OVERFLOW),
825            27 => Ok(EventCode::MAX_SLOTS_CHANGE),
826            28 => Ok(EventCode::READ_CLOCK_OFFSET_COMPLETE),
827            29 => Ok(EventCode::CONNECTION_PACKET_TYPE_CHANGED),
828            30 => Ok(EventCode::QOS_VIOLATION),
829            32 => Ok(EventCode::PAGE_SCAN_REPETITION_MODE_CHANGE),
830            33 => Ok(EventCode::FLOW_SPECIFICATION_COMPLETE),
831            34 => Ok(EventCode::INQUIRY_RESULT_WITH_RSSI),
832            35 => Ok(EventCode::READ_REMOTE_EXTENDED_FEATURES_COMPLETE),
833            44 => Ok(EventCode::SYNCHRONOUS_CONNECTION_COMPLETE),
834            45 => Ok(EventCode::SYNCHRONOUS_CONNECTION_CHANGED),
835            46 => Ok(EventCode::SNIFF_SUBRATING),
836            47 => Ok(EventCode::EXTENDED_INQUIRY_RESULT),
837            48 => Ok(EventCode::ENCRYPTION_KEY_REFRESH_COMPLETE),
838            49 => Ok(EventCode::IO_CAPABILITY_REQUEST),
839            50 => Ok(EventCode::IO_CAPABILITY_RESPONSE),
840            51 => Ok(EventCode::USER_CONFIRMATION_REQUEST),
841            52 => Ok(EventCode::USER_PASSKEY_REQUEST),
842            53 => Ok(EventCode::REMOTE_OOB_DATA_REQUEST),
843            54 => Ok(EventCode::SIMPLE_PAIRING_COMPLETE),
844            56 => Ok(EventCode::LINK_SUPERVISION_TIMEOUT_CHANGED),
845            57 => Ok(EventCode::ENHANCED_FLUSH_COMPLETE),
846            59 => Ok(EventCode::USER_PASSKEY_NOTIFICATION),
847            60 => Ok(EventCode::KEYPRESS_NOTIFICATION),
848            61 => Ok(EventCode::REMOTE_HOST_SUPPORTED_FEATURES_NOTIFICATION),
849            62 => Ok(EventCode::LE_META_EVENT),
850            72 => Ok(EventCode::NUMBER_OF_COMPLETED_DATA_BLOCKS),
851            255 => Ok(EventCode::VENDOR_DEBUG),
852
853            _ => Err(emboss_runtime::Error::UnknownEnum(val)),
854        }
855    }
856}
857
858impl EventCode {
859
860}
861#[derive(Copy, Clone, Debug, Eq, PartialEq)]
862#[repr(u64)]
863pub enum LeSubEventCode {
864    CONNECTION_COMPLETE = 1,
865    ADVERTISING_REPORT = 2,
866    CONNECTION_UPDATE_COMPLETE = 3,
867    READ_REMOTE_FEATURES_COMPLETE = 4,
868    LONG_TERM_KEY_REQUEST = 5,
869    REMOTE_CONNECTION_PARAMETER_REQUEST = 6,
870    DATA_LENGTH_CHANGE = 7,
871    READ_LOCAL_P256_PUBLIC_KEY_COMPLETE = 8,
872    GENERATE_DH_KEY_COMPLETE = 9,
873    ENHANCED_CONNECTION_COMPLETE_V1 = 10,
874    DIRECTED_ADVERTISING_REPORT = 11,
875    PHY_UPDATE_COMPLETE = 12,
876    EXTENDED_ADVERTISING_REPORT = 13,
877    PERIODIC_ADVERTISING_SYNC_ESTABLISHED = 14,
878    PERIODIC_ADVERTISING_REPORT = 15,
879    PERIODIC_ADVERTISING_SYNC_LOST = 16,
880    SCAN_TIMEOUT = 17,
881    ADVERTISING_SET_TERMINATED = 18,
882    SCAN_REQUEST_RECEIVED = 19,
883    CHANNEL_SELECTION_ALGORITHM = 20,
884    PERIODIC_ADVERTISING_SYNC_TRANSFER_RECEIVED = 24,
885    CIS_ESTABLISHED = 25,
886    CIS_REQUEST = 26,
887    REQUEST_PEER_SCA_COMPLETE = 31,
888    BIG_INFO_ADVERTISING_REPORT = 34,
889    SUBRATE_CHANGE = 35,
890    PERIODIC_ADVERTISING_SYNC_ESTABLISHED_V2 = 36,
891    PERIODIC_ADVERTISING_REPORT_V2 = 37,
892    PERIODIC_ADVERTISING_SYNC_TRANSFER_RECEIVED_V2 = 38,
893    ENHANCED_CONNECTION_COMPLETE_V2 = 41,
894
895}
896
897impl core::convert::From<LeSubEventCode> for u8 { fn from(val: LeSubEventCode) -> Self { val as u8 } }
898impl core::convert::From<LeSubEventCode> for u16 { fn from(val: LeSubEventCode) -> Self { val as u16 } }
899impl core::convert::From<LeSubEventCode> for u32 { fn from(val: LeSubEventCode) -> Self { val as u32 } }
900impl core::convert::From<LeSubEventCode> for u64 { fn from(val: LeSubEventCode) -> Self { val as u64 } }
901impl core::convert::From<LeSubEventCode> for i8 { fn from(val: LeSubEventCode) -> Self { val as i8 } }
902impl core::convert::From<LeSubEventCode> for i16 { fn from(val: LeSubEventCode) -> Self { val as i16 } }
903impl core::convert::From<LeSubEventCode> for i32 { fn from(val: LeSubEventCode) -> Self { val as i32 } }
904impl core::convert::From<LeSubEventCode> for i64 { fn from(val: LeSubEventCode) -> Self { val as i64 } }
905
906impl emboss_runtime::SafeCmp<LeSubEventCode> for LeSubEventCode {
907    fn safe_eq(&self, other: Self) -> bool { *self == other }
908    fn safe_less(&self, other: Self) -> bool { (*self as u64) < (other as u64) }
909}
910
911impl emboss_runtime::SafeCmp<u64> for LeSubEventCode {
912    fn safe_eq(&self, other: u64) -> bool { emboss_runtime::SafeCmp::safe_eq(&(*self as u64), other) }
913    fn safe_less(&self, other: u64) -> bool { emboss_runtime::SafeCmp::safe_less(&(*self as u64), other) }
914}
915
916impl emboss_runtime::SafeCmp<i64> for LeSubEventCode {
917    fn safe_eq(&self, other: i64) -> bool { emboss_runtime::SafeCmp::safe_eq(&(*self as u64), other) }
918    fn safe_less(&self, other: i64) -> bool { emboss_runtime::SafeCmp::safe_less(&(*self as u64), other) }
919}
920
921impl emboss_runtime::SafeCmp<i32> for LeSubEventCode {
922    fn safe_eq(&self, other: i32) -> bool { emboss_runtime::SafeCmp::safe_eq(&(*self as u64), other as i64) }
923    fn safe_less(&self, other: i32) -> bool { emboss_runtime::SafeCmp::safe_less(&(*self as u64), other as i64) }
924}
925
926impl emboss_runtime::SafeCmp<u32> for LeSubEventCode {
927    fn safe_eq(&self, other: u32) -> bool { emboss_runtime::SafeCmp::safe_eq(&(*self as u64), other as u64) }
928    fn safe_less(&self, other: u32) -> bool { emboss_runtime::SafeCmp::safe_less(&(*self as u64), other as u64) }
929}
930
931impl emboss_runtime::SafeCmp<LeSubEventCode> for u64 {
932    fn safe_eq(&self, other: LeSubEventCode) -> bool { emboss_runtime::SafeCmp::safe_eq(self, other as u64) }
933    fn safe_less(&self, other: LeSubEventCode) -> bool { emboss_runtime::SafeCmp::safe_less(self, other as u64) }
934}
935
936impl emboss_runtime::SafeCmp<LeSubEventCode> for i64 {
937    fn safe_eq(&self, other: LeSubEventCode) -> bool { emboss_runtime::SafeCmp::safe_eq(self, other as u64) }
938    fn safe_less(&self, other: LeSubEventCode) -> bool { emboss_runtime::SafeCmp::safe_less(self, other as u64) }
939}
940
941impl<V: core::convert::Into<u64> + core::marker::Copy> emboss_runtime::TryFromRaw<V> for LeSubEventCode {
942    fn try_from_raw(val: V) -> core::result::Result<Self, emboss_runtime::Error<V>> {
943        let v_raw: u64 = val.into();
944        match v_raw {
945            1 => Ok(LeSubEventCode::CONNECTION_COMPLETE),
946            2 => Ok(LeSubEventCode::ADVERTISING_REPORT),
947            3 => Ok(LeSubEventCode::CONNECTION_UPDATE_COMPLETE),
948            4 => Ok(LeSubEventCode::READ_REMOTE_FEATURES_COMPLETE),
949            5 => Ok(LeSubEventCode::LONG_TERM_KEY_REQUEST),
950            6 => Ok(LeSubEventCode::REMOTE_CONNECTION_PARAMETER_REQUEST),
951            7 => Ok(LeSubEventCode::DATA_LENGTH_CHANGE),
952            8 => Ok(LeSubEventCode::READ_LOCAL_P256_PUBLIC_KEY_COMPLETE),
953            9 => Ok(LeSubEventCode::GENERATE_DH_KEY_COMPLETE),
954            10 => Ok(LeSubEventCode::ENHANCED_CONNECTION_COMPLETE_V1),
955            11 => Ok(LeSubEventCode::DIRECTED_ADVERTISING_REPORT),
956            12 => Ok(LeSubEventCode::PHY_UPDATE_COMPLETE),
957            13 => Ok(LeSubEventCode::EXTENDED_ADVERTISING_REPORT),
958            14 => Ok(LeSubEventCode::PERIODIC_ADVERTISING_SYNC_ESTABLISHED),
959            15 => Ok(LeSubEventCode::PERIODIC_ADVERTISING_REPORT),
960            16 => Ok(LeSubEventCode::PERIODIC_ADVERTISING_SYNC_LOST),
961            17 => Ok(LeSubEventCode::SCAN_TIMEOUT),
962            18 => Ok(LeSubEventCode::ADVERTISING_SET_TERMINATED),
963            19 => Ok(LeSubEventCode::SCAN_REQUEST_RECEIVED),
964            20 => Ok(LeSubEventCode::CHANNEL_SELECTION_ALGORITHM),
965            24 => Ok(LeSubEventCode::PERIODIC_ADVERTISING_SYNC_TRANSFER_RECEIVED),
966            25 => Ok(LeSubEventCode::CIS_ESTABLISHED),
967            26 => Ok(LeSubEventCode::CIS_REQUEST),
968            31 => Ok(LeSubEventCode::REQUEST_PEER_SCA_COMPLETE),
969            34 => Ok(LeSubEventCode::BIG_INFO_ADVERTISING_REPORT),
970            35 => Ok(LeSubEventCode::SUBRATE_CHANGE),
971            36 => Ok(LeSubEventCode::PERIODIC_ADVERTISING_SYNC_ESTABLISHED_V2),
972            37 => Ok(LeSubEventCode::PERIODIC_ADVERTISING_REPORT_V2),
973            38 => Ok(LeSubEventCode::PERIODIC_ADVERTISING_SYNC_TRANSFER_RECEIVED_V2),
974            41 => Ok(LeSubEventCode::ENHANCED_CONNECTION_COMPLETE_V2),
975
976            _ => Err(emboss_runtime::Error::UnknownEnum(val)),
977        }
978    }
979}
980
981impl LeSubEventCode {
982
983}
984#[derive(Copy, Clone, Debug, Eq, PartialEq)]
985#[repr(u64)]
986pub enum MajorDeviceClass {
987    MISCELLANEOUS = 0,
988    COMPUTER = 1,
989    PHONE = 2,
990    LAN = 3,
991    AUDIO_VIDEO = 4,
992    PERIPHERAL = 5,
993    IMAGING = 6,
994    WEARABLE = 7,
995    TOY = 8,
996    HEALTH = 9,
997    UNCATEGORIZED = 31,
998
999}
1000
1001impl core::convert::From<MajorDeviceClass> for u8 { fn from(val: MajorDeviceClass) -> Self { val as u8 } }
1002impl core::convert::From<MajorDeviceClass> for u16 { fn from(val: MajorDeviceClass) -> Self { val as u16 } }
1003impl core::convert::From<MajorDeviceClass> for u32 { fn from(val: MajorDeviceClass) -> Self { val as u32 } }
1004impl core::convert::From<MajorDeviceClass> for u64 { fn from(val: MajorDeviceClass) -> Self { val as u64 } }
1005impl core::convert::From<MajorDeviceClass> for i8 { fn from(val: MajorDeviceClass) -> Self { val as i8 } }
1006impl core::convert::From<MajorDeviceClass> for i16 { fn from(val: MajorDeviceClass) -> Self { val as i16 } }
1007impl core::convert::From<MajorDeviceClass> for i32 { fn from(val: MajorDeviceClass) -> Self { val as i32 } }
1008impl core::convert::From<MajorDeviceClass> for i64 { fn from(val: MajorDeviceClass) -> Self { val as i64 } }
1009
1010impl emboss_runtime::SafeCmp<MajorDeviceClass> for MajorDeviceClass {
1011    fn safe_eq(&self, other: Self) -> bool { *self == other }
1012    fn safe_less(&self, other: Self) -> bool { (*self as u64) < (other as u64) }
1013}
1014
1015impl emboss_runtime::SafeCmp<u64> for MajorDeviceClass {
1016    fn safe_eq(&self, other: u64) -> bool { emboss_runtime::SafeCmp::safe_eq(&(*self as u64), other) }
1017    fn safe_less(&self, other: u64) -> bool { emboss_runtime::SafeCmp::safe_less(&(*self as u64), other) }
1018}
1019
1020impl emboss_runtime::SafeCmp<i64> for MajorDeviceClass {
1021    fn safe_eq(&self, other: i64) -> bool { emboss_runtime::SafeCmp::safe_eq(&(*self as u64), other) }
1022    fn safe_less(&self, other: i64) -> bool { emboss_runtime::SafeCmp::safe_less(&(*self as u64), other) }
1023}
1024
1025impl emboss_runtime::SafeCmp<i32> for MajorDeviceClass {
1026    fn safe_eq(&self, other: i32) -> bool { emboss_runtime::SafeCmp::safe_eq(&(*self as u64), other as i64) }
1027    fn safe_less(&self, other: i32) -> bool { emboss_runtime::SafeCmp::safe_less(&(*self as u64), other as i64) }
1028}
1029
1030impl emboss_runtime::SafeCmp<u32> for MajorDeviceClass {
1031    fn safe_eq(&self, other: u32) -> bool { emboss_runtime::SafeCmp::safe_eq(&(*self as u64), other as u64) }
1032    fn safe_less(&self, other: u32) -> bool { emboss_runtime::SafeCmp::safe_less(&(*self as u64), other as u64) }
1033}
1034
1035impl emboss_runtime::SafeCmp<MajorDeviceClass> for u64 {
1036    fn safe_eq(&self, other: MajorDeviceClass) -> bool { emboss_runtime::SafeCmp::safe_eq(self, other as u64) }
1037    fn safe_less(&self, other: MajorDeviceClass) -> bool { emboss_runtime::SafeCmp::safe_less(self, other as u64) }
1038}
1039
1040impl emboss_runtime::SafeCmp<MajorDeviceClass> for i64 {
1041    fn safe_eq(&self, other: MajorDeviceClass) -> bool { emboss_runtime::SafeCmp::safe_eq(self, other as u64) }
1042    fn safe_less(&self, other: MajorDeviceClass) -> bool { emboss_runtime::SafeCmp::safe_less(self, other as u64) }
1043}
1044
1045impl<V: core::convert::Into<u64> + core::marker::Copy> emboss_runtime::TryFromRaw<V> for MajorDeviceClass {
1046    fn try_from_raw(val: V) -> core::result::Result<Self, emboss_runtime::Error<V>> {
1047        let v_raw: u64 = val.into();
1048        match v_raw {
1049            0 => Ok(MajorDeviceClass::MISCELLANEOUS),
1050            1 => Ok(MajorDeviceClass::COMPUTER),
1051            2 => Ok(MajorDeviceClass::PHONE),
1052            3 => Ok(MajorDeviceClass::LAN),
1053            4 => Ok(MajorDeviceClass::AUDIO_VIDEO),
1054            5 => Ok(MajorDeviceClass::PERIPHERAL),
1055            6 => Ok(MajorDeviceClass::IMAGING),
1056            7 => Ok(MajorDeviceClass::WEARABLE),
1057            8 => Ok(MajorDeviceClass::TOY),
1058            9 => Ok(MajorDeviceClass::HEALTH),
1059            31 => Ok(MajorDeviceClass::UNCATEGORIZED),
1060
1061            _ => Err(emboss_runtime::Error::UnknownEnum(val)),
1062        }
1063    }
1064}
1065
1066impl MajorDeviceClass {
1067
1068}
1069pub struct MajorServiceClasses<S: emboss_runtime::Storage, ST: emboss_runtime::State = emboss_runtime::UncheckedState> {
1070    storage: S,
1071    _marker: core::marker::PhantomData<ST>,
1072}
1073
1074impl<S: emboss_runtime::Storage> MajorServiceClasses<S, emboss_runtime::UncheckedState> {
1075    pub fn new(storage: S) -> Self {
1076        Self {
1077            storage,
1078            _marker: core::marker::PhantomData,
1079        }
1080    }
1081}
1082
1083impl<S: emboss_runtime::Storage + core::clone::Clone, ST: emboss_runtime::State> core::clone::Clone for MajorServiceClasses<S, ST> {
1084    fn clone(&self) -> Self {
1085        Self {
1086            storage: self.storage.clone(),
1087            _marker: core::marker::PhantomData,
1088        }
1089    }
1090}
1091
1092impl<S: emboss_runtime::Storage, ST: emboss_runtime::State> MajorServiceClasses<S, ST> {
1093    /**
1094     * Constructs a view in a specific typestate.
1095     *
1096     * # Safety
1097     *
1098     * The caller must ensure that `storage` satisfies the layout invariants for `ST`.
1099     */
1100    pub unsafe fn new_in_state(storage: S) -> Self {
1101        Self {
1102            storage,
1103            _marker: core::marker::PhantomData,
1104        }
1105    }
1106    pub fn into_storage(self) -> S {
1107        self.storage
1108    }
1109    pub fn limited_discoverable_mode(&self) -> emboss_runtime::BitFlag<1, 0, emboss_runtime::Null, S::Sliced<'_>, ST> {
1110        let len = (1) as usize; // Total struct size in bytes
1111        let storage = self.storage.slice(0, len);
1112        emboss_runtime::BitFlag::<1, 0, emboss_runtime::Null, S::Sliced<'_>, ST>::new(storage)
1113    }
1114    pub fn le_audio(&self) -> emboss_runtime::BitFlag<1, 1, emboss_runtime::Null, S::Sliced<'_>, ST> {
1115        let len = (1) as usize; // Total struct size in bytes
1116        let storage = self.storage.slice(0, len);
1117        emboss_runtime::BitFlag::<1, 1, emboss_runtime::Null, S::Sliced<'_>, ST>::new(storage)
1118    }
1119    pub fn reserved(&self) -> emboss_runtime::BitFlag<1, 2, emboss_runtime::Null, S::Sliced<'_>, ST> {
1120        let len = (1) as usize; // Total struct size in bytes
1121        let storage = self.storage.slice(0, len);
1122        emboss_runtime::BitFlag::<1, 2, emboss_runtime::Null, S::Sliced<'_>, ST>::new(storage)
1123    }
1124    pub fn positioning(&self) -> emboss_runtime::BitFlag<1, 3, emboss_runtime::Null, S::Sliced<'_>, ST> {
1125        let len = (1) as usize; // Total struct size in bytes
1126        let storage = self.storage.slice(0, len);
1127        emboss_runtime::BitFlag::<1, 3, emboss_runtime::Null, S::Sliced<'_>, ST>::new(storage)
1128    }
1129    pub fn networking(&self) -> emboss_runtime::BitFlag<1, 4, emboss_runtime::Null, S::Sliced<'_>, ST> {
1130        let len = (1) as usize; // Total struct size in bytes
1131        let storage = self.storage.slice(0, len);
1132        emboss_runtime::BitFlag::<1, 4, emboss_runtime::Null, S::Sliced<'_>, ST>::new(storage)
1133    }
1134    pub fn rendering(&self) -> emboss_runtime::BitFlag<1, 5, emboss_runtime::Null, S::Sliced<'_>, ST> {
1135        let len = (1) as usize; // Total struct size in bytes
1136        let storage = self.storage.slice(0, len);
1137        emboss_runtime::BitFlag::<1, 5, emboss_runtime::Null, S::Sliced<'_>, ST>::new(storage)
1138    }
1139    pub fn capturing(&self) -> emboss_runtime::BitFlag<1, 6, emboss_runtime::Null, S::Sliced<'_>, ST> {
1140        let len = (1) as usize; // Total struct size in bytes
1141        let storage = self.storage.slice(0, len);
1142        emboss_runtime::BitFlag::<1, 6, emboss_runtime::Null, S::Sliced<'_>, ST>::new(storage)
1143    }
1144    pub fn object_transfer(&self) -> emboss_runtime::BitFlag<1, 7, emboss_runtime::Null, S::Sliced<'_>, ST> {
1145        let len = (1) as usize; // Total struct size in bytes
1146        let storage = self.storage.slice(0, len);
1147        emboss_runtime::BitFlag::<1, 7, emboss_runtime::Null, S::Sliced<'_>, ST>::new(storage)
1148    }
1149    pub fn audio(&self) -> emboss_runtime::BitFlag<1, 8, emboss_runtime::Null, S::Sliced<'_>, ST> {
1150        let len = (2) as usize; // Total struct size in bytes
1151        let storage = self.storage.slice(0, len);
1152        emboss_runtime::BitFlag::<1, 8, emboss_runtime::Null, S::Sliced<'_>, ST>::new(storage)
1153    }
1154    pub fn telephony(&self) -> emboss_runtime::BitFlag<1, 9, emboss_runtime::Null, S::Sliced<'_>, ST> {
1155        let len = (2) as usize; // Total struct size in bytes
1156        let storage = self.storage.slice(0, len);
1157        emboss_runtime::BitFlag::<1, 9, emboss_runtime::Null, S::Sliced<'_>, ST>::new(storage)
1158    }
1159    pub fn information(&self) -> emboss_runtime::BitFlag<1, 10, emboss_runtime::Null, S::Sliced<'_>, ST> {
1160        let len = (2) as usize; // Total struct size in bytes
1161        let storage = self.storage.slice(0, len);
1162        emboss_runtime::BitFlag::<1, 10, emboss_runtime::Null, S::Sliced<'_>, ST>::new(storage)
1163    }
1164
1165}
1166
1167pub struct MajorServiceClassesMut<S: emboss_runtime::MutStorage> {
1168    storage: S,
1169}
1170
1171impl<S: emboss_runtime::MutStorage> MajorServiceClassesMut<S> {
1172    pub fn new(storage: S) -> Self {
1173        Self {
1174            storage,
1175        }
1176    }
1177    pub fn into_writer(self) -> MajorServiceClassesWriter<S, emboss_runtime::UncheckedState> {
1178        MajorServiceClassesWriter::new(self.storage)
1179    }
1180    /** Borrows the mutable view as an immutable view in UncheckedState. */
1181    pub fn as_view(&self) -> MajorServiceClasses<S::Sliced<'_>, emboss_runtime::UncheckedState> {
1182        unsafe { MajorServiceClasses::new_in_state(self.storage.slice(0, self.storage.len())) }
1183    }
1184    pub fn limited_discoverable_mode(&mut self) -> emboss_runtime::BitFlag<1, 0, emboss_runtime::Null, S::SlicedMut<'_>, emboss_runtime::UncheckedState> {
1185        let len = (1) as usize;
1186        let storage = self.storage.slice_mut(0, len);
1187        emboss_runtime::BitFlag::<1, 0, emboss_runtime::Null, S::SlicedMut<'_>, emboss_runtime::UncheckedState>::new(storage)
1188    }
1189    pub fn le_audio(&mut self) -> emboss_runtime::BitFlag<1, 1, emboss_runtime::Null, S::SlicedMut<'_>, emboss_runtime::UncheckedState> {
1190        let len = (1) as usize;
1191        let storage = self.storage.slice_mut(0, len);
1192        emboss_runtime::BitFlag::<1, 1, emboss_runtime::Null, S::SlicedMut<'_>, emboss_runtime::UncheckedState>::new(storage)
1193    }
1194    pub fn reserved(&mut self) -> emboss_runtime::BitFlag<1, 2, emboss_runtime::Null, S::SlicedMut<'_>, emboss_runtime::UncheckedState> {
1195        let len = (1) as usize;
1196        let storage = self.storage.slice_mut(0, len);
1197        emboss_runtime::BitFlag::<1, 2, emboss_runtime::Null, S::SlicedMut<'_>, emboss_runtime::UncheckedState>::new(storage)
1198    }
1199    pub fn positioning(&mut self) -> emboss_runtime::BitFlag<1, 3, emboss_runtime::Null, S::SlicedMut<'_>, emboss_runtime::UncheckedState> {
1200        let len = (1) as usize;
1201        let storage = self.storage.slice_mut(0, len);
1202        emboss_runtime::BitFlag::<1, 3, emboss_runtime::Null, S::SlicedMut<'_>, emboss_runtime::UncheckedState>::new(storage)
1203    }
1204    pub fn networking(&mut self) -> emboss_runtime::BitFlag<1, 4, emboss_runtime::Null, S::SlicedMut<'_>, emboss_runtime::UncheckedState> {
1205        let len = (1) as usize;
1206        let storage = self.storage.slice_mut(0, len);
1207        emboss_runtime::BitFlag::<1, 4, emboss_runtime::Null, S::SlicedMut<'_>, emboss_runtime::UncheckedState>::new(storage)
1208    }
1209    pub fn rendering(&mut self) -> emboss_runtime::BitFlag<1, 5, emboss_runtime::Null, S::SlicedMut<'_>, emboss_runtime::UncheckedState> {
1210        let len = (1) as usize;
1211        let storage = self.storage.slice_mut(0, len);
1212        emboss_runtime::BitFlag::<1, 5, emboss_runtime::Null, S::SlicedMut<'_>, emboss_runtime::UncheckedState>::new(storage)
1213    }
1214    pub fn capturing(&mut self) -> emboss_runtime::BitFlag<1, 6, emboss_runtime::Null, S::SlicedMut<'_>, emboss_runtime::UncheckedState> {
1215        let len = (1) as usize;
1216        let storage = self.storage.slice_mut(0, len);
1217        emboss_runtime::BitFlag::<1, 6, emboss_runtime::Null, S::SlicedMut<'_>, emboss_runtime::UncheckedState>::new(storage)
1218    }
1219    pub fn object_transfer(&mut self) -> emboss_runtime::BitFlag<1, 7, emboss_runtime::Null, S::SlicedMut<'_>, emboss_runtime::UncheckedState> {
1220        let len = (1) as usize;
1221        let storage = self.storage.slice_mut(0, len);
1222        emboss_runtime::BitFlag::<1, 7, emboss_runtime::Null, S::SlicedMut<'_>, emboss_runtime::UncheckedState>::new(storage)
1223    }
1224    pub fn audio(&mut self) -> emboss_runtime::BitFlag<1, 8, emboss_runtime::Null, S::SlicedMut<'_>, emboss_runtime::UncheckedState> {
1225        let len = (2) as usize;
1226        let storage = self.storage.slice_mut(0, len);
1227        emboss_runtime::BitFlag::<1, 8, emboss_runtime::Null, S::SlicedMut<'_>, emboss_runtime::UncheckedState>::new(storage)
1228    }
1229    pub fn telephony(&mut self) -> emboss_runtime::BitFlag<1, 9, emboss_runtime::Null, S::SlicedMut<'_>, emboss_runtime::UncheckedState> {
1230        let len = (2) as usize;
1231        let storage = self.storage.slice_mut(0, len);
1232        emboss_runtime::BitFlag::<1, 9, emboss_runtime::Null, S::SlicedMut<'_>, emboss_runtime::UncheckedState>::new(storage)
1233    }
1234    pub fn information(&mut self) -> emboss_runtime::BitFlag<1, 10, emboss_runtime::Null, S::SlicedMut<'_>, emboss_runtime::UncheckedState> {
1235        let len = (2) as usize;
1236        let storage = self.storage.slice_mut(0, len);
1237        emboss_runtime::BitFlag::<1, 10, emboss_runtime::Null, S::SlicedMut<'_>, emboss_runtime::UncheckedState>::new(storage)
1238    }
1239
1240}
1241
1242impl<S: emboss_runtime::MutStorage> emboss_runtime::IntoWriter for MajorServiceClassesMut<S> {
1243    type Writer = MajorServiceClassesWriter<S, emboss_runtime::UncheckedState>;
1244    fn into_writer(self) -> Self::Writer {
1245        MajorServiceClassesWriter::new(self.storage)
1246    }
1247}
1248
1249pub struct MajorServiceClassesWriter<S: emboss_runtime::MutStorage, ST: emboss_runtime::State = emboss_runtime::UncheckedState> {
1250    storage: S,
1251    _marker: core::marker::PhantomData<ST>,
1252}
1253
1254impl<S: emboss_runtime::MutStorage> MajorServiceClassesWriter<S, emboss_runtime::UncheckedState> {
1255    pub fn new(storage: S) -> Self {
1256        Self {
1257            storage,
1258            _marker: core::marker::PhantomData,
1259        }
1260    }
1261}
1262
1263impl<S: emboss_runtime::MutStorage, ST: emboss_runtime::State> MajorServiceClassesWriter<S, ST> {
1264    /**
1265     * Constructs a writer in a specific typestate.
1266     *
1267     * # Safety
1268     *
1269     * The caller must ensure that `storage` satisfies the layout invariants for `ST`.
1270     */
1271    pub unsafe fn new_in_state(storage: S) -> Self {
1272        Self {
1273            storage,
1274            _marker: core::marker::PhantomData,
1275        }
1276    }
1277    pub fn into_storage(self) -> S {
1278        self.storage
1279    }
1280    /** Converts the writer into an immutable view in the same typestate. */
1281    pub fn into_view(self) -> MajorServiceClasses<S, ST> {
1282        unsafe { MajorServiceClasses::new_in_state(self.storage) }
1283    }
1284    /** Borrows the writer as an immutable view in the same typestate. */
1285    pub fn as_view(&self) -> MajorServiceClasses<S::Sliced<'_>, ST> {
1286        unsafe { MajorServiceClasses::new_in_state(self.storage.slice(0, self.storage.len())) }
1287    }
1288
1289}
1290
1291impl<S: emboss_runtime::Storage, ST: emboss_runtime::State> emboss_runtime::View for MajorServiceClasses<S, ST> {
1292    fn size_in_bytes(&self) -> core::result::Result<usize, emboss_runtime::Error> {
1293        let view = self;
1294        core::result::Result::Ok((((11) + 7) / 8) as usize)
1295    }
1296}
1297
1298impl<S: emboss_runtime::MutStorage> emboss_runtime::View for MajorServiceClassesMut<S> {
1299    fn size_in_bytes(&self) -> core::result::Result<usize, emboss_runtime::Error> {
1300        let view = self.as_view();
1301        <MajorServiceClasses<S::Sliced<'_>, emboss_runtime::UncheckedState> as emboss_runtime::View>::size_in_bytes(&view)
1302    }
1303}
1304
1305impl<S: emboss_runtime::MutStorage, ST: emboss_runtime::State> emboss_runtime::View for MajorServiceClassesWriter<S, ST> {
1306    fn size_in_bytes(&self) -> core::result::Result<usize, emboss_runtime::Error> {
1307        let view = self.as_view();
1308        <MajorServiceClasses<S::Sliced<'_>, ST> as emboss_runtime::View>::size_in_bytes(&view)
1309    }
1310}
1311
1312impl<S: emboss_runtime::Storage> emboss_runtime::CheckComplete for MajorServiceClasses<S, emboss_runtime::UncheckedState> {
1313    type Completed = MajorServiceClasses<S, emboss_runtime::CompleteState>;
1314    fn check_complete(self) -> core::result::Result<Self::Completed, emboss_runtime::Error> {
1315        let required_size = <Self as emboss_runtime::View>::size_in_bytes(&self)?;
1316        if self.storage.len() < required_size {
1317            return core::result::Result::Err(emboss_runtime::Error::OutOfBounds);
1318        }
1319        core::result::Result::Ok(unsafe { MajorServiceClasses::new_in_state(self.storage) })
1320    }
1321}
1322
1323impl<S: emboss_runtime::MutStorage> emboss_runtime::CheckComplete for MajorServiceClassesWriter<S, emboss_runtime::UncheckedState> {
1324    type Completed = MajorServiceClassesWriter<S, emboss_runtime::CompleteState>;
1325    fn check_complete(self) -> core::result::Result<Self::Completed, emboss_runtime::Error> {
1326        let required_size = <Self as emboss_runtime::View>::size_in_bytes(&self)?;
1327        if self.storage.len() < required_size {
1328            return core::result::Result::Err(emboss_runtime::Error::OutOfBounds);
1329        }
1330        core::result::Result::Ok(unsafe { MajorServiceClassesWriter::new_in_state(self.storage) })
1331    }
1332}
1333
1334impl<S: emboss_runtime::Storage> emboss_runtime::CheckOk for MajorServiceClasses<S, emboss_runtime::UncheckedState> {
1335    type Ok = MajorServiceClasses<S, emboss_runtime::OkState>;
1336    fn check_ok(self) -> core::result::Result<Self::Ok, emboss_runtime::Error> {
1337        let completed = emboss_runtime::CheckComplete::check_complete(self)?;
1338        core::result::Result::Ok(unsafe { MajorServiceClasses::new_in_state(completed.into_storage()) })
1339    }
1340}
1341
1342impl<S: emboss_runtime::Storage> emboss_runtime::CheckOk for MajorServiceClasses<S, emboss_runtime::CompleteState> {
1343    type Ok = MajorServiceClasses<S, emboss_runtime::OkState>;
1344    fn check_ok(self) -> core::result::Result<Self::Ok, emboss_runtime::Error> {
1345        core::result::Result::Ok(unsafe { MajorServiceClasses::new_in_state(self.into_storage()) })
1346    }
1347}
1348
1349impl<S: emboss_runtime::Storage> emboss_runtime::CheckOk for MajorServiceClasses<S, emboss_runtime::OkState> {
1350    type Ok = MajorServiceClasses<S, emboss_runtime::OkState>;
1351    fn check_ok(self) -> core::result::Result<Self::Ok, emboss_runtime::Error> {
1352        core::result::Result::Ok(self)
1353    }
1354}
1355
1356impl<S: emboss_runtime::MutStorage> emboss_runtime::CheckOk for MajorServiceClassesWriter<S, emboss_runtime::UncheckedState> {
1357    type Ok = MajorServiceClassesWriter<S, emboss_runtime::OkState>;
1358    fn check_ok(self) -> core::result::Result<Self::Ok, emboss_runtime::Error> {
1359        let completed = emboss_runtime::CheckComplete::check_complete(self)?;
1360        core::result::Result::Ok(unsafe { MajorServiceClassesWriter::new_in_state(completed.into_storage()) })
1361    }
1362}
1363
1364impl<S: emboss_runtime::MutStorage> emboss_runtime::CheckOk for MajorServiceClassesWriter<S, emboss_runtime::CompleteState> {
1365    type Ok = MajorServiceClassesWriter<S, emboss_runtime::OkState>;
1366    fn check_ok(self) -> core::result::Result<Self::Ok, emboss_runtime::Error> {
1367        core::result::Result::Ok(unsafe { MajorServiceClassesWriter::new_in_state(self.into_storage()) })
1368    }
1369}
1370
1371impl<S: emboss_runtime::MutStorage> emboss_runtime::CheckOk for MajorServiceClassesWriter<S, emboss_runtime::OkState> {
1372    type Ok = MajorServiceClassesWriter<S, emboss_runtime::OkState>;
1373    fn check_ok(self) -> core::result::Result<Self::Ok, emboss_runtime::Error> {
1374        core::result::Result::Ok(self)
1375    }
1376}
1377
1378pub mod major_service_classes {
1379    pub type View<S, ST = emboss_runtime::UncheckedState> = super::MajorServiceClasses<S, ST>;
1380    pub type ViewMut<S> = super::MajorServiceClassesMut<S>;
1381    pub type Writer<S, ST = emboss_runtime::UncheckedState> = super::MajorServiceClassesWriter<S, ST>;
1382
1383    pub const MIN_SIZE_IN_BYTES: usize = 2;
1384    pub const MAX_SIZE_IN_BYTES: usize = 2;
1385    pub const SIZE_IN_BYTES: usize = 2;
1386}#[derive(Copy, Clone, Debug, Eq, PartialEq)]
1387#[repr(u64)]
1388pub enum ComputerMinorDeviceClass {
1389    UNCATEGORIZED = 0,
1390    DESKTOP_WORKSTATION = 1,
1391    SERVER_CLASS = 2,
1392    LAPTOP = 3,
1393    HANDHELD_PC = 4,
1394    PALM_SIZE_PC = 5,
1395    WEARABLE = 6,
1396    TABLET = 7,
1397
1398}
1399
1400impl core::convert::From<ComputerMinorDeviceClass> for u8 { fn from(val: ComputerMinorDeviceClass) -> Self { val as u8 } }
1401impl core::convert::From<ComputerMinorDeviceClass> for u16 { fn from(val: ComputerMinorDeviceClass) -> Self { val as u16 } }
1402impl core::convert::From<ComputerMinorDeviceClass> for u32 { fn from(val: ComputerMinorDeviceClass) -> Self { val as u32 } }
1403impl core::convert::From<ComputerMinorDeviceClass> for u64 { fn from(val: ComputerMinorDeviceClass) -> Self { val as u64 } }
1404impl core::convert::From<ComputerMinorDeviceClass> for i8 { fn from(val: ComputerMinorDeviceClass) -> Self { val as i8 } }
1405impl core::convert::From<ComputerMinorDeviceClass> for i16 { fn from(val: ComputerMinorDeviceClass) -> Self { val as i16 } }
1406impl core::convert::From<ComputerMinorDeviceClass> for i32 { fn from(val: ComputerMinorDeviceClass) -> Self { val as i32 } }
1407impl core::convert::From<ComputerMinorDeviceClass> for i64 { fn from(val: ComputerMinorDeviceClass) -> Self { val as i64 } }
1408
1409impl emboss_runtime::SafeCmp<ComputerMinorDeviceClass> for ComputerMinorDeviceClass {
1410    fn safe_eq(&self, other: Self) -> bool { *self == other }
1411    fn safe_less(&self, other: Self) -> bool { (*self as u64) < (other as u64) }
1412}
1413
1414impl emboss_runtime::SafeCmp<u64> for ComputerMinorDeviceClass {
1415    fn safe_eq(&self, other: u64) -> bool { emboss_runtime::SafeCmp::safe_eq(&(*self as u64), other) }
1416    fn safe_less(&self, other: u64) -> bool { emboss_runtime::SafeCmp::safe_less(&(*self as u64), other) }
1417}
1418
1419impl emboss_runtime::SafeCmp<i64> for ComputerMinorDeviceClass {
1420    fn safe_eq(&self, other: i64) -> bool { emboss_runtime::SafeCmp::safe_eq(&(*self as u64), other) }
1421    fn safe_less(&self, other: i64) -> bool { emboss_runtime::SafeCmp::safe_less(&(*self as u64), other) }
1422}
1423
1424impl emboss_runtime::SafeCmp<i32> for ComputerMinorDeviceClass {
1425    fn safe_eq(&self, other: i32) -> bool { emboss_runtime::SafeCmp::safe_eq(&(*self as u64), other as i64) }
1426    fn safe_less(&self, other: i32) -> bool { emboss_runtime::SafeCmp::safe_less(&(*self as u64), other as i64) }
1427}
1428
1429impl emboss_runtime::SafeCmp<u32> for ComputerMinorDeviceClass {
1430    fn safe_eq(&self, other: u32) -> bool { emboss_runtime::SafeCmp::safe_eq(&(*self as u64), other as u64) }
1431    fn safe_less(&self, other: u32) -> bool { emboss_runtime::SafeCmp::safe_less(&(*self as u64), other as u64) }
1432}
1433
1434impl emboss_runtime::SafeCmp<ComputerMinorDeviceClass> for u64 {
1435    fn safe_eq(&self, other: ComputerMinorDeviceClass) -> bool { emboss_runtime::SafeCmp::safe_eq(self, other as u64) }
1436    fn safe_less(&self, other: ComputerMinorDeviceClass) -> bool { emboss_runtime::SafeCmp::safe_less(self, other as u64) }
1437}
1438
1439impl emboss_runtime::SafeCmp<ComputerMinorDeviceClass> for i64 {
1440    fn safe_eq(&self, other: ComputerMinorDeviceClass) -> bool { emboss_runtime::SafeCmp::safe_eq(self, other as u64) }
1441    fn safe_less(&self, other: ComputerMinorDeviceClass) -> bool { emboss_runtime::SafeCmp::safe_less(self, other as u64) }
1442}
1443
1444impl<V: core::convert::Into<u64> + core::marker::Copy> emboss_runtime::TryFromRaw<V> for ComputerMinorDeviceClass {
1445    fn try_from_raw(val: V) -> core::result::Result<Self, emboss_runtime::Error<V>> {
1446        let v_raw: u64 = val.into();
1447        match v_raw {
1448            0 => Ok(ComputerMinorDeviceClass::UNCATEGORIZED),
1449            1 => Ok(ComputerMinorDeviceClass::DESKTOP_WORKSTATION),
1450            2 => Ok(ComputerMinorDeviceClass::SERVER_CLASS),
1451            3 => Ok(ComputerMinorDeviceClass::LAPTOP),
1452            4 => Ok(ComputerMinorDeviceClass::HANDHELD_PC),
1453            5 => Ok(ComputerMinorDeviceClass::PALM_SIZE_PC),
1454            6 => Ok(ComputerMinorDeviceClass::WEARABLE),
1455            7 => Ok(ComputerMinorDeviceClass::TABLET),
1456
1457            _ => Err(emboss_runtime::Error::UnknownEnum(val)),
1458        }
1459    }
1460}
1461
1462impl ComputerMinorDeviceClass {
1463
1464}
1465#[derive(Copy, Clone, Debug, Eq, PartialEq)]
1466#[repr(u64)]
1467pub enum PhoneMinorDeviceClass {
1468    UNCATEGORIZED = 0,
1469    CELLULAR = 1,
1470    CORDLESS = 2,
1471    SMARTPHONE = 3,
1472    WIRED_MODEM_OR_VOID_GATEWAY = 4,
1473    COMMON_ISDN_ACCESS = 5,
1474
1475}
1476
1477impl core::convert::From<PhoneMinorDeviceClass> for u8 { fn from(val: PhoneMinorDeviceClass) -> Self { val as u8 } }
1478impl core::convert::From<PhoneMinorDeviceClass> for u16 { fn from(val: PhoneMinorDeviceClass) -> Self { val as u16 } }
1479impl core::convert::From<PhoneMinorDeviceClass> for u32 { fn from(val: PhoneMinorDeviceClass) -> Self { val as u32 } }
1480impl core::convert::From<PhoneMinorDeviceClass> for u64 { fn from(val: PhoneMinorDeviceClass) -> Self { val as u64 } }
1481impl core::convert::From<PhoneMinorDeviceClass> for i8 { fn from(val: PhoneMinorDeviceClass) -> Self { val as i8 } }
1482impl core::convert::From<PhoneMinorDeviceClass> for i16 { fn from(val: PhoneMinorDeviceClass) -> Self { val as i16 } }
1483impl core::convert::From<PhoneMinorDeviceClass> for i32 { fn from(val: PhoneMinorDeviceClass) -> Self { val as i32 } }
1484impl core::convert::From<PhoneMinorDeviceClass> for i64 { fn from(val: PhoneMinorDeviceClass) -> Self { val as i64 } }
1485
1486impl emboss_runtime::SafeCmp<PhoneMinorDeviceClass> for PhoneMinorDeviceClass {
1487    fn safe_eq(&self, other: Self) -> bool { *self == other }
1488    fn safe_less(&self, other: Self) -> bool { (*self as u64) < (other as u64) }
1489}
1490
1491impl emboss_runtime::SafeCmp<u64> for PhoneMinorDeviceClass {
1492    fn safe_eq(&self, other: u64) -> bool { emboss_runtime::SafeCmp::safe_eq(&(*self as u64), other) }
1493    fn safe_less(&self, other: u64) -> bool { emboss_runtime::SafeCmp::safe_less(&(*self as u64), other) }
1494}
1495
1496impl emboss_runtime::SafeCmp<i64> for PhoneMinorDeviceClass {
1497    fn safe_eq(&self, other: i64) -> bool { emboss_runtime::SafeCmp::safe_eq(&(*self as u64), other) }
1498    fn safe_less(&self, other: i64) -> bool { emboss_runtime::SafeCmp::safe_less(&(*self as u64), other) }
1499}
1500
1501impl emboss_runtime::SafeCmp<i32> for PhoneMinorDeviceClass {
1502    fn safe_eq(&self, other: i32) -> bool { emboss_runtime::SafeCmp::safe_eq(&(*self as u64), other as i64) }
1503    fn safe_less(&self, other: i32) -> bool { emboss_runtime::SafeCmp::safe_less(&(*self as u64), other as i64) }
1504}
1505
1506impl emboss_runtime::SafeCmp<u32> for PhoneMinorDeviceClass {
1507    fn safe_eq(&self, other: u32) -> bool { emboss_runtime::SafeCmp::safe_eq(&(*self as u64), other as u64) }
1508    fn safe_less(&self, other: u32) -> bool { emboss_runtime::SafeCmp::safe_less(&(*self as u64), other as u64) }
1509}
1510
1511impl emboss_runtime::SafeCmp<PhoneMinorDeviceClass> for u64 {
1512    fn safe_eq(&self, other: PhoneMinorDeviceClass) -> bool { emboss_runtime::SafeCmp::safe_eq(self, other as u64) }
1513    fn safe_less(&self, other: PhoneMinorDeviceClass) -> bool { emboss_runtime::SafeCmp::safe_less(self, other as u64) }
1514}
1515
1516impl emboss_runtime::SafeCmp<PhoneMinorDeviceClass> for i64 {
1517    fn safe_eq(&self, other: PhoneMinorDeviceClass) -> bool { emboss_runtime::SafeCmp::safe_eq(self, other as u64) }
1518    fn safe_less(&self, other: PhoneMinorDeviceClass) -> bool { emboss_runtime::SafeCmp::safe_less(self, other as u64) }
1519}
1520
1521impl<V: core::convert::Into<u64> + core::marker::Copy> emboss_runtime::TryFromRaw<V> for PhoneMinorDeviceClass {
1522    fn try_from_raw(val: V) -> core::result::Result<Self, emboss_runtime::Error<V>> {
1523        let v_raw: u64 = val.into();
1524        match v_raw {
1525            0 => Ok(PhoneMinorDeviceClass::UNCATEGORIZED),
1526            1 => Ok(PhoneMinorDeviceClass::CELLULAR),
1527            2 => Ok(PhoneMinorDeviceClass::CORDLESS),
1528            3 => Ok(PhoneMinorDeviceClass::SMARTPHONE),
1529            4 => Ok(PhoneMinorDeviceClass::WIRED_MODEM_OR_VOID_GATEWAY),
1530            5 => Ok(PhoneMinorDeviceClass::COMMON_ISDN_ACCESS),
1531
1532            _ => Err(emboss_runtime::Error::UnknownEnum(val)),
1533        }
1534    }
1535}
1536
1537impl PhoneMinorDeviceClass {
1538
1539}
1540#[derive(Copy, Clone, Debug, Eq, PartialEq)]
1541#[repr(u64)]
1542pub enum LANMinorDeviceClass {
1543    FULLY_AVAILABLE = 0,
1544    UTILIZED_1_TO_17 = 8,
1545    UTILIZED_17_TO_33 = 16,
1546    UTILIZED_33_TO_50 = 24,
1547    UTILIZED_50_TO_67 = 32,
1548    UTILIZED_67_TO_83 = 40,
1549    UTILIZED_83_TO_99 = 48,
1550    NO_SERVICE_AVAILABLE = 56,
1551
1552}
1553
1554impl core::convert::From<LANMinorDeviceClass> for u8 { fn from(val: LANMinorDeviceClass) -> Self { val as u8 } }
1555impl core::convert::From<LANMinorDeviceClass> for u16 { fn from(val: LANMinorDeviceClass) -> Self { val as u16 } }
1556impl core::convert::From<LANMinorDeviceClass> for u32 { fn from(val: LANMinorDeviceClass) -> Self { val as u32 } }
1557impl core::convert::From<LANMinorDeviceClass> for u64 { fn from(val: LANMinorDeviceClass) -> Self { val as u64 } }
1558impl core::convert::From<LANMinorDeviceClass> for i8 { fn from(val: LANMinorDeviceClass) -> Self { val as i8 } }
1559impl core::convert::From<LANMinorDeviceClass> for i16 { fn from(val: LANMinorDeviceClass) -> Self { val as i16 } }
1560impl core::convert::From<LANMinorDeviceClass> for i32 { fn from(val: LANMinorDeviceClass) -> Self { val as i32 } }
1561impl core::convert::From<LANMinorDeviceClass> for i64 { fn from(val: LANMinorDeviceClass) -> Self { val as i64 } }
1562
1563impl emboss_runtime::SafeCmp<LANMinorDeviceClass> for LANMinorDeviceClass {
1564    fn safe_eq(&self, other: Self) -> bool { *self == other }
1565    fn safe_less(&self, other: Self) -> bool { (*self as u64) < (other as u64) }
1566}
1567
1568impl emboss_runtime::SafeCmp<u64> for LANMinorDeviceClass {
1569    fn safe_eq(&self, other: u64) -> bool { emboss_runtime::SafeCmp::safe_eq(&(*self as u64), other) }
1570    fn safe_less(&self, other: u64) -> bool { emboss_runtime::SafeCmp::safe_less(&(*self as u64), other) }
1571}
1572
1573impl emboss_runtime::SafeCmp<i64> for LANMinorDeviceClass {
1574    fn safe_eq(&self, other: i64) -> bool { emboss_runtime::SafeCmp::safe_eq(&(*self as u64), other) }
1575    fn safe_less(&self, other: i64) -> bool { emboss_runtime::SafeCmp::safe_less(&(*self as u64), other) }
1576}
1577
1578impl emboss_runtime::SafeCmp<i32> for LANMinorDeviceClass {
1579    fn safe_eq(&self, other: i32) -> bool { emboss_runtime::SafeCmp::safe_eq(&(*self as u64), other as i64) }
1580    fn safe_less(&self, other: i32) -> bool { emboss_runtime::SafeCmp::safe_less(&(*self as u64), other as i64) }
1581}
1582
1583impl emboss_runtime::SafeCmp<u32> for LANMinorDeviceClass {
1584    fn safe_eq(&self, other: u32) -> bool { emboss_runtime::SafeCmp::safe_eq(&(*self as u64), other as u64) }
1585    fn safe_less(&self, other: u32) -> bool { emboss_runtime::SafeCmp::safe_less(&(*self as u64), other as u64) }
1586}
1587
1588impl emboss_runtime::SafeCmp<LANMinorDeviceClass> for u64 {
1589    fn safe_eq(&self, other: LANMinorDeviceClass) -> bool { emboss_runtime::SafeCmp::safe_eq(self, other as u64) }
1590    fn safe_less(&self, other: LANMinorDeviceClass) -> bool { emboss_runtime::SafeCmp::safe_less(self, other as u64) }
1591}
1592
1593impl emboss_runtime::SafeCmp<LANMinorDeviceClass> for i64 {
1594    fn safe_eq(&self, other: LANMinorDeviceClass) -> bool { emboss_runtime::SafeCmp::safe_eq(self, other as u64) }
1595    fn safe_less(&self, other: LANMinorDeviceClass) -> bool { emboss_runtime::SafeCmp::safe_less(self, other as u64) }
1596}
1597
1598impl<V: core::convert::Into<u64> + core::marker::Copy> emboss_runtime::TryFromRaw<V> for LANMinorDeviceClass {
1599    fn try_from_raw(val: V) -> core::result::Result<Self, emboss_runtime::Error<V>> {
1600        let v_raw: u64 = val.into();
1601        match v_raw {
1602            0 => Ok(LANMinorDeviceClass::FULLY_AVAILABLE),
1603            8 => Ok(LANMinorDeviceClass::UTILIZED_1_TO_17),
1604            16 => Ok(LANMinorDeviceClass::UTILIZED_17_TO_33),
1605            24 => Ok(LANMinorDeviceClass::UTILIZED_33_TO_50),
1606            32 => Ok(LANMinorDeviceClass::UTILIZED_50_TO_67),
1607            40 => Ok(LANMinorDeviceClass::UTILIZED_67_TO_83),
1608            48 => Ok(LANMinorDeviceClass::UTILIZED_83_TO_99),
1609            56 => Ok(LANMinorDeviceClass::NO_SERVICE_AVAILABLE),
1610
1611            _ => Err(emboss_runtime::Error::UnknownEnum(val)),
1612        }
1613    }
1614}
1615
1616impl LANMinorDeviceClass {
1617
1618}
1619#[derive(Copy, Clone, Debug, Eq, PartialEq)]
1620#[repr(u64)]
1621pub enum AudioVideoMinorDeviceClass {
1622    UNCATEGORIZED = 0,
1623    WEARABLE_HEADSET_DEVICE = 1,
1624    HANDS_FREE_DEVICE = 2,
1625    RESERVED_0 = 3,
1626    MICROPHONE = 4,
1627    LOUDSPEAKER = 5,
1628    HEADPHONES = 6,
1629    PORTABLE_AUDIO = 7,
1630    CAR_AUDIO = 8,
1631    SET_TOP_BOX = 9,
1632    HIFI_AUDIO_DEVICE = 10,
1633    VCR = 11,
1634    VIDEO_CAMERA = 12,
1635    CAMCORDER = 13,
1636    VIDEO_MONITOR = 14,
1637    VIDEO_DISPLAY_AND_LOUDSPEAKER = 15,
1638    VIDEO_CONFERENCING = 16,
1639    RESERVED_1 = 17,
1640    GAMING_TOY = 18,
1641
1642}
1643
1644impl core::convert::From<AudioVideoMinorDeviceClass> for u8 { fn from(val: AudioVideoMinorDeviceClass) -> Self { val as u8 } }
1645impl core::convert::From<AudioVideoMinorDeviceClass> for u16 { fn from(val: AudioVideoMinorDeviceClass) -> Self { val as u16 } }
1646impl core::convert::From<AudioVideoMinorDeviceClass> for u32 { fn from(val: AudioVideoMinorDeviceClass) -> Self { val as u32 } }
1647impl core::convert::From<AudioVideoMinorDeviceClass> for u64 { fn from(val: AudioVideoMinorDeviceClass) -> Self { val as u64 } }
1648impl core::convert::From<AudioVideoMinorDeviceClass> for i8 { fn from(val: AudioVideoMinorDeviceClass) -> Self { val as i8 } }
1649impl core::convert::From<AudioVideoMinorDeviceClass> for i16 { fn from(val: AudioVideoMinorDeviceClass) -> Self { val as i16 } }
1650impl core::convert::From<AudioVideoMinorDeviceClass> for i32 { fn from(val: AudioVideoMinorDeviceClass) -> Self { val as i32 } }
1651impl core::convert::From<AudioVideoMinorDeviceClass> for i64 { fn from(val: AudioVideoMinorDeviceClass) -> Self { val as i64 } }
1652
1653impl emboss_runtime::SafeCmp<AudioVideoMinorDeviceClass> for AudioVideoMinorDeviceClass {
1654    fn safe_eq(&self, other: Self) -> bool { *self == other }
1655    fn safe_less(&self, other: Self) -> bool { (*self as u64) < (other as u64) }
1656}
1657
1658impl emboss_runtime::SafeCmp<u64> for AudioVideoMinorDeviceClass {
1659    fn safe_eq(&self, other: u64) -> bool { emboss_runtime::SafeCmp::safe_eq(&(*self as u64), other) }
1660    fn safe_less(&self, other: u64) -> bool { emboss_runtime::SafeCmp::safe_less(&(*self as u64), other) }
1661}
1662
1663impl emboss_runtime::SafeCmp<i64> for AudioVideoMinorDeviceClass {
1664    fn safe_eq(&self, other: i64) -> bool { emboss_runtime::SafeCmp::safe_eq(&(*self as u64), other) }
1665    fn safe_less(&self, other: i64) -> bool { emboss_runtime::SafeCmp::safe_less(&(*self as u64), other) }
1666}
1667
1668impl emboss_runtime::SafeCmp<i32> for AudioVideoMinorDeviceClass {
1669    fn safe_eq(&self, other: i32) -> bool { emboss_runtime::SafeCmp::safe_eq(&(*self as u64), other as i64) }
1670    fn safe_less(&self, other: i32) -> bool { emboss_runtime::SafeCmp::safe_less(&(*self as u64), other as i64) }
1671}
1672
1673impl emboss_runtime::SafeCmp<u32> for AudioVideoMinorDeviceClass {
1674    fn safe_eq(&self, other: u32) -> bool { emboss_runtime::SafeCmp::safe_eq(&(*self as u64), other as u64) }
1675    fn safe_less(&self, other: u32) -> bool { emboss_runtime::SafeCmp::safe_less(&(*self as u64), other as u64) }
1676}
1677
1678impl emboss_runtime::SafeCmp<AudioVideoMinorDeviceClass> for u64 {
1679    fn safe_eq(&self, other: AudioVideoMinorDeviceClass) -> bool { emboss_runtime::SafeCmp::safe_eq(self, other as u64) }
1680    fn safe_less(&self, other: AudioVideoMinorDeviceClass) -> bool { emboss_runtime::SafeCmp::safe_less(self, other as u64) }
1681}
1682
1683impl emboss_runtime::SafeCmp<AudioVideoMinorDeviceClass> for i64 {
1684    fn safe_eq(&self, other: AudioVideoMinorDeviceClass) -> bool { emboss_runtime::SafeCmp::safe_eq(self, other as u64) }
1685    fn safe_less(&self, other: AudioVideoMinorDeviceClass) -> bool { emboss_runtime::SafeCmp::safe_less(self, other as u64) }
1686}
1687
1688impl<V: core::convert::Into<u64> + core::marker::Copy> emboss_runtime::TryFromRaw<V> for AudioVideoMinorDeviceClass {
1689    fn try_from_raw(val: V) -> core::result::Result<Self, emboss_runtime::Error<V>> {
1690        let v_raw: u64 = val.into();
1691        match v_raw {
1692            0 => Ok(AudioVideoMinorDeviceClass::UNCATEGORIZED),
1693            1 => Ok(AudioVideoMinorDeviceClass::WEARABLE_HEADSET_DEVICE),
1694            2 => Ok(AudioVideoMinorDeviceClass::HANDS_FREE_DEVICE),
1695            3 => Ok(AudioVideoMinorDeviceClass::RESERVED_0),
1696            4 => Ok(AudioVideoMinorDeviceClass::MICROPHONE),
1697            5 => Ok(AudioVideoMinorDeviceClass::LOUDSPEAKER),
1698            6 => Ok(AudioVideoMinorDeviceClass::HEADPHONES),
1699            7 => Ok(AudioVideoMinorDeviceClass::PORTABLE_AUDIO),
1700            8 => Ok(AudioVideoMinorDeviceClass::CAR_AUDIO),
1701            9 => Ok(AudioVideoMinorDeviceClass::SET_TOP_BOX),
1702            10 => Ok(AudioVideoMinorDeviceClass::HIFI_AUDIO_DEVICE),
1703            11 => Ok(AudioVideoMinorDeviceClass::VCR),
1704            12 => Ok(AudioVideoMinorDeviceClass::VIDEO_CAMERA),
1705            13 => Ok(AudioVideoMinorDeviceClass::CAMCORDER),
1706            14 => Ok(AudioVideoMinorDeviceClass::VIDEO_MONITOR),
1707            15 => Ok(AudioVideoMinorDeviceClass::VIDEO_DISPLAY_AND_LOUDSPEAKER),
1708            16 => Ok(AudioVideoMinorDeviceClass::VIDEO_CONFERENCING),
1709            17 => Ok(AudioVideoMinorDeviceClass::RESERVED_1),
1710            18 => Ok(AudioVideoMinorDeviceClass::GAMING_TOY),
1711
1712            _ => Err(emboss_runtime::Error::UnknownEnum(val)),
1713        }
1714    }
1715}
1716
1717impl AudioVideoMinorDeviceClass {
1718
1719}
1720#[derive(Copy, Clone, Debug, Eq, PartialEq)]
1721#[repr(u64)]
1722pub enum PeripheralMinorDeviceClass0 {
1723    UNCATEGORIZED = 0,
1724    JOYSTICK = 1,
1725    GAMEPAD = 2,
1726    REMOTE_CONTROL = 3,
1727    SENSING_DEVICE = 4,
1728    DIGITIZER_TABLET = 5,
1729    CARD_READER = 6,
1730    DIGITAL_PEN = 7,
1731    HANDHELD_SCANNER = 8,
1732    HANDHELD_GESTURAL_INPUT_DEVICE = 9,
1733
1734}
1735
1736impl core::convert::From<PeripheralMinorDeviceClass0> for u8 { fn from(val: PeripheralMinorDeviceClass0) -> Self { val as u8 } }
1737impl core::convert::From<PeripheralMinorDeviceClass0> for u16 { fn from(val: PeripheralMinorDeviceClass0) -> Self { val as u16 } }
1738impl core::convert::From<PeripheralMinorDeviceClass0> for u32 { fn from(val: PeripheralMinorDeviceClass0) -> Self { val as u32 } }
1739impl core::convert::From<PeripheralMinorDeviceClass0> for u64 { fn from(val: PeripheralMinorDeviceClass0) -> Self { val as u64 } }
1740impl core::convert::From<PeripheralMinorDeviceClass0> for i8 { fn from(val: PeripheralMinorDeviceClass0) -> Self { val as i8 } }
1741impl core::convert::From<PeripheralMinorDeviceClass0> for i16 { fn from(val: PeripheralMinorDeviceClass0) -> Self { val as i16 } }
1742impl core::convert::From<PeripheralMinorDeviceClass0> for i32 { fn from(val: PeripheralMinorDeviceClass0) -> Self { val as i32 } }
1743impl core::convert::From<PeripheralMinorDeviceClass0> for i64 { fn from(val: PeripheralMinorDeviceClass0) -> Self { val as i64 } }
1744
1745impl emboss_runtime::SafeCmp<PeripheralMinorDeviceClass0> for PeripheralMinorDeviceClass0 {
1746    fn safe_eq(&self, other: Self) -> bool { *self == other }
1747    fn safe_less(&self, other: Self) -> bool { (*self as u64) < (other as u64) }
1748}
1749
1750impl emboss_runtime::SafeCmp<u64> for PeripheralMinorDeviceClass0 {
1751    fn safe_eq(&self, other: u64) -> bool { emboss_runtime::SafeCmp::safe_eq(&(*self as u64), other) }
1752    fn safe_less(&self, other: u64) -> bool { emboss_runtime::SafeCmp::safe_less(&(*self as u64), other) }
1753}
1754
1755impl emboss_runtime::SafeCmp<i64> for PeripheralMinorDeviceClass0 {
1756    fn safe_eq(&self, other: i64) -> bool { emboss_runtime::SafeCmp::safe_eq(&(*self as u64), other) }
1757    fn safe_less(&self, other: i64) -> bool { emboss_runtime::SafeCmp::safe_less(&(*self as u64), other) }
1758}
1759
1760impl emboss_runtime::SafeCmp<i32> for PeripheralMinorDeviceClass0 {
1761    fn safe_eq(&self, other: i32) -> bool { emboss_runtime::SafeCmp::safe_eq(&(*self as u64), other as i64) }
1762    fn safe_less(&self, other: i32) -> bool { emboss_runtime::SafeCmp::safe_less(&(*self as u64), other as i64) }
1763}
1764
1765impl emboss_runtime::SafeCmp<u32> for PeripheralMinorDeviceClass0 {
1766    fn safe_eq(&self, other: u32) -> bool { emboss_runtime::SafeCmp::safe_eq(&(*self as u64), other as u64) }
1767    fn safe_less(&self, other: u32) -> bool { emboss_runtime::SafeCmp::safe_less(&(*self as u64), other as u64) }
1768}
1769
1770impl emboss_runtime::SafeCmp<PeripheralMinorDeviceClass0> for u64 {
1771    fn safe_eq(&self, other: PeripheralMinorDeviceClass0) -> bool { emboss_runtime::SafeCmp::safe_eq(self, other as u64) }
1772    fn safe_less(&self, other: PeripheralMinorDeviceClass0) -> bool { emboss_runtime::SafeCmp::safe_less(self, other as u64) }
1773}
1774
1775impl emboss_runtime::SafeCmp<PeripheralMinorDeviceClass0> for i64 {
1776    fn safe_eq(&self, other: PeripheralMinorDeviceClass0) -> bool { emboss_runtime::SafeCmp::safe_eq(self, other as u64) }
1777    fn safe_less(&self, other: PeripheralMinorDeviceClass0) -> bool { emboss_runtime::SafeCmp::safe_less(self, other as u64) }
1778}
1779
1780impl<V: core::convert::Into<u64> + core::marker::Copy> emboss_runtime::TryFromRaw<V> for PeripheralMinorDeviceClass0 {
1781    fn try_from_raw(val: V) -> core::result::Result<Self, emboss_runtime::Error<V>> {
1782        let v_raw: u64 = val.into();
1783        match v_raw {
1784            0 => Ok(PeripheralMinorDeviceClass0::UNCATEGORIZED),
1785            1 => Ok(PeripheralMinorDeviceClass0::JOYSTICK),
1786            2 => Ok(PeripheralMinorDeviceClass0::GAMEPAD),
1787            3 => Ok(PeripheralMinorDeviceClass0::REMOTE_CONTROL),
1788            4 => Ok(PeripheralMinorDeviceClass0::SENSING_DEVICE),
1789            5 => Ok(PeripheralMinorDeviceClass0::DIGITIZER_TABLET),
1790            6 => Ok(PeripheralMinorDeviceClass0::CARD_READER),
1791            7 => Ok(PeripheralMinorDeviceClass0::DIGITAL_PEN),
1792            8 => Ok(PeripheralMinorDeviceClass0::HANDHELD_SCANNER),
1793            9 => Ok(PeripheralMinorDeviceClass0::HANDHELD_GESTURAL_INPUT_DEVICE),
1794
1795            _ => Err(emboss_runtime::Error::UnknownEnum(val)),
1796        }
1797    }
1798}
1799
1800impl PeripheralMinorDeviceClass0 {
1801
1802}
1803#[derive(Copy, Clone, Debug, Eq, PartialEq)]
1804#[repr(u64)]
1805pub enum PeripheralMinorDeviceClass1 {
1806    UNCATEGORIZED = 0,
1807    KEYBOARD = 1,
1808    POINTING_DEVICE = 2,
1809    COMBO_KEYBOARD_POINTING_DEVICE = 3,
1810
1811}
1812
1813impl core::convert::From<PeripheralMinorDeviceClass1> for u8 { fn from(val: PeripheralMinorDeviceClass1) -> Self { val as u8 } }
1814impl core::convert::From<PeripheralMinorDeviceClass1> for u16 { fn from(val: PeripheralMinorDeviceClass1) -> Self { val as u16 } }
1815impl core::convert::From<PeripheralMinorDeviceClass1> for u32 { fn from(val: PeripheralMinorDeviceClass1) -> Self { val as u32 } }
1816impl core::convert::From<PeripheralMinorDeviceClass1> for u64 { fn from(val: PeripheralMinorDeviceClass1) -> Self { val as u64 } }
1817impl core::convert::From<PeripheralMinorDeviceClass1> for i8 { fn from(val: PeripheralMinorDeviceClass1) -> Self { val as i8 } }
1818impl core::convert::From<PeripheralMinorDeviceClass1> for i16 { fn from(val: PeripheralMinorDeviceClass1) -> Self { val as i16 } }
1819impl core::convert::From<PeripheralMinorDeviceClass1> for i32 { fn from(val: PeripheralMinorDeviceClass1) -> Self { val as i32 } }
1820impl core::convert::From<PeripheralMinorDeviceClass1> for i64 { fn from(val: PeripheralMinorDeviceClass1) -> Self { val as i64 } }
1821
1822impl emboss_runtime::SafeCmp<PeripheralMinorDeviceClass1> for PeripheralMinorDeviceClass1 {
1823    fn safe_eq(&self, other: Self) -> bool { *self == other }
1824    fn safe_less(&self, other: Self) -> bool { (*self as u64) < (other as u64) }
1825}
1826
1827impl emboss_runtime::SafeCmp<u64> for PeripheralMinorDeviceClass1 {
1828    fn safe_eq(&self, other: u64) -> bool { emboss_runtime::SafeCmp::safe_eq(&(*self as u64), other) }
1829    fn safe_less(&self, other: u64) -> bool { emboss_runtime::SafeCmp::safe_less(&(*self as u64), other) }
1830}
1831
1832impl emboss_runtime::SafeCmp<i64> for PeripheralMinorDeviceClass1 {
1833    fn safe_eq(&self, other: i64) -> bool { emboss_runtime::SafeCmp::safe_eq(&(*self as u64), other) }
1834    fn safe_less(&self, other: i64) -> bool { emboss_runtime::SafeCmp::safe_less(&(*self as u64), other) }
1835}
1836
1837impl emboss_runtime::SafeCmp<i32> for PeripheralMinorDeviceClass1 {
1838    fn safe_eq(&self, other: i32) -> bool { emboss_runtime::SafeCmp::safe_eq(&(*self as u64), other as i64) }
1839    fn safe_less(&self, other: i32) -> bool { emboss_runtime::SafeCmp::safe_less(&(*self as u64), other as i64) }
1840}
1841
1842impl emboss_runtime::SafeCmp<u32> for PeripheralMinorDeviceClass1 {
1843    fn safe_eq(&self, other: u32) -> bool { emboss_runtime::SafeCmp::safe_eq(&(*self as u64), other as u64) }
1844    fn safe_less(&self, other: u32) -> bool { emboss_runtime::SafeCmp::safe_less(&(*self as u64), other as u64) }
1845}
1846
1847impl emboss_runtime::SafeCmp<PeripheralMinorDeviceClass1> for u64 {
1848    fn safe_eq(&self, other: PeripheralMinorDeviceClass1) -> bool { emboss_runtime::SafeCmp::safe_eq(self, other as u64) }
1849    fn safe_less(&self, other: PeripheralMinorDeviceClass1) -> bool { emboss_runtime::SafeCmp::safe_less(self, other as u64) }
1850}
1851
1852impl emboss_runtime::SafeCmp<PeripheralMinorDeviceClass1> for i64 {
1853    fn safe_eq(&self, other: PeripheralMinorDeviceClass1) -> bool { emboss_runtime::SafeCmp::safe_eq(self, other as u64) }
1854    fn safe_less(&self, other: PeripheralMinorDeviceClass1) -> bool { emboss_runtime::SafeCmp::safe_less(self, other as u64) }
1855}
1856
1857impl<V: core::convert::Into<u64> + core::marker::Copy> emboss_runtime::TryFromRaw<V> for PeripheralMinorDeviceClass1 {
1858    fn try_from_raw(val: V) -> core::result::Result<Self, emboss_runtime::Error<V>> {
1859        let v_raw: u64 = val.into();
1860        match v_raw {
1861            0 => Ok(PeripheralMinorDeviceClass1::UNCATEGORIZED),
1862            1 => Ok(PeripheralMinorDeviceClass1::KEYBOARD),
1863            2 => Ok(PeripheralMinorDeviceClass1::POINTING_DEVICE),
1864            3 => Ok(PeripheralMinorDeviceClass1::COMBO_KEYBOARD_POINTING_DEVICE),
1865
1866            _ => Err(emboss_runtime::Error::UnknownEnum(val)),
1867        }
1868    }
1869}
1870
1871impl PeripheralMinorDeviceClass1 {
1872
1873}
1874pub struct PeripheralMinorDeviceClass<S: emboss_runtime::Storage, ST: emboss_runtime::State = emboss_runtime::UncheckedState> {
1875    storage: S,
1876    _marker: core::marker::PhantomData<ST>,
1877}
1878
1879impl<S: emboss_runtime::Storage> PeripheralMinorDeviceClass<S, emboss_runtime::UncheckedState> {
1880    pub fn new(storage: S) -> Self {
1881        Self {
1882            storage,
1883            _marker: core::marker::PhantomData,
1884        }
1885    }
1886}
1887
1888impl<S: emboss_runtime::Storage + core::clone::Clone, ST: emboss_runtime::State> core::clone::Clone for PeripheralMinorDeviceClass<S, ST> {
1889    fn clone(&self) -> Self {
1890        Self {
1891            storage: self.storage.clone(),
1892            _marker: core::marker::PhantomData,
1893        }
1894    }
1895}
1896
1897impl<S: emboss_runtime::Storage, ST: emboss_runtime::State> PeripheralMinorDeviceClass<S, ST> {
1898    /**
1899     * Constructs a view in a specific typestate.
1900     *
1901     * # Safety
1902     *
1903     * The caller must ensure that `storage` satisfies the layout invariants for `ST`.
1904     */
1905    pub unsafe fn new_in_state(storage: S) -> Self {
1906        Self {
1907            storage,
1908            _marker: core::marker::PhantomData,
1909        }
1910    }
1911    pub fn into_storage(self) -> S {
1912        self.storage
1913    }
1914    pub fn device_class_0(&self) -> emboss_runtime::EnumView<PeripheralMinorDeviceClass0, emboss_runtime::BitUInt<4, 0, emboss_runtime::Null, S::Sliced<'_>, ST>> {
1915        let len = (1) as usize;
1916        let storage = self.storage.slice(0, len);
1917        emboss_runtime::EnumView::new(emboss_runtime::BitUInt::new(storage))
1918    }
1919    pub fn device_class_1(&self) -> emboss_runtime::EnumView<PeripheralMinorDeviceClass1, emboss_runtime::BitUInt<2, 4, emboss_runtime::Null, S::Sliced<'_>, ST>> {
1920        let len = (1) as usize;
1921        let storage = self.storage.slice(0, len);
1922        emboss_runtime::EnumView::new(emboss_runtime::BitUInt::new(storage))
1923    }
1924
1925}
1926
1927pub struct PeripheralMinorDeviceClassMut<S: emboss_runtime::MutStorage> {
1928    storage: S,
1929}
1930
1931impl<S: emboss_runtime::MutStorage> PeripheralMinorDeviceClassMut<S> {
1932    pub fn new(storage: S) -> Self {
1933        Self {
1934            storage,
1935        }
1936    }
1937    pub fn into_writer(self) -> PeripheralMinorDeviceClassWriter<S, emboss_runtime::UncheckedState> {
1938        PeripheralMinorDeviceClassWriter::new(self.storage)
1939    }
1940    /** Borrows the mutable view as an immutable view in UncheckedState. */
1941    pub fn as_view(&self) -> PeripheralMinorDeviceClass<S::Sliced<'_>, emboss_runtime::UncheckedState> {
1942        unsafe { PeripheralMinorDeviceClass::new_in_state(self.storage.slice(0, self.storage.len())) }
1943    }
1944    pub fn device_class_0(&mut self) -> emboss_runtime::EnumViewMut<PeripheralMinorDeviceClass0, emboss_runtime::BitUInt<4, 0, emboss_runtime::Null, S::SlicedMut<'_>, emboss_runtime::UncheckedState>> {
1945        let len = (1) as usize;
1946        let storage = self.storage.slice_mut(0, len);
1947        emboss_runtime::EnumViewMut::new(emboss_runtime::BitUInt::new(storage))
1948    }
1949    pub fn device_class_1(&mut self) -> emboss_runtime::EnumViewMut<PeripheralMinorDeviceClass1, emboss_runtime::BitUInt<2, 4, emboss_runtime::Null, S::SlicedMut<'_>, emboss_runtime::UncheckedState>> {
1950        let len = (1) as usize;
1951        let storage = self.storage.slice_mut(0, len);
1952        emboss_runtime::EnumViewMut::new(emboss_runtime::BitUInt::new(storage))
1953    }
1954
1955}
1956
1957impl<S: emboss_runtime::MutStorage> emboss_runtime::IntoWriter for PeripheralMinorDeviceClassMut<S> {
1958    type Writer = PeripheralMinorDeviceClassWriter<S, emboss_runtime::UncheckedState>;
1959    fn into_writer(self) -> Self::Writer {
1960        PeripheralMinorDeviceClassWriter::new(self.storage)
1961    }
1962}
1963
1964pub struct PeripheralMinorDeviceClassWriter<S: emboss_runtime::MutStorage, ST: emboss_runtime::State = emboss_runtime::UncheckedState> {
1965    storage: S,
1966    _marker: core::marker::PhantomData<ST>,
1967}
1968
1969impl<S: emboss_runtime::MutStorage> PeripheralMinorDeviceClassWriter<S, emboss_runtime::UncheckedState> {
1970    pub fn new(storage: S) -> Self {
1971        Self {
1972            storage,
1973            _marker: core::marker::PhantomData,
1974        }
1975    }
1976}
1977
1978impl<S: emboss_runtime::MutStorage, ST: emboss_runtime::State> PeripheralMinorDeviceClassWriter<S, ST> {
1979    /**
1980     * Constructs a writer in a specific typestate.
1981     *
1982     * # Safety
1983     *
1984     * The caller must ensure that `storage` satisfies the layout invariants for `ST`.
1985     */
1986    pub unsafe fn new_in_state(storage: S) -> Self {
1987        Self {
1988            storage,
1989            _marker: core::marker::PhantomData,
1990        }
1991    }
1992    pub fn into_storage(self) -> S {
1993        self.storage
1994    }
1995    /** Converts the writer into an immutable view in the same typestate. */
1996    pub fn into_view(self) -> PeripheralMinorDeviceClass<S, ST> {
1997        unsafe { PeripheralMinorDeviceClass::new_in_state(self.storage) }
1998    }
1999    /** Borrows the writer as an immutable view in the same typestate. */
2000    pub fn as_view(&self) -> PeripheralMinorDeviceClass<S::Sliced<'_>, ST> {
2001        unsafe { PeripheralMinorDeviceClass::new_in_state(self.storage.slice(0, self.storage.len())) }
2002    }
2003
2004}
2005
2006impl<S: emboss_runtime::Storage, ST: emboss_runtime::State> emboss_runtime::View for PeripheralMinorDeviceClass<S, ST> {
2007    fn size_in_bytes(&self) -> core::result::Result<usize, emboss_runtime::Error> {
2008        let view = self;
2009        core::result::Result::Ok((((6) + 7) / 8) as usize)
2010    }
2011}
2012
2013impl<S: emboss_runtime::MutStorage> emboss_runtime::View for PeripheralMinorDeviceClassMut<S> {
2014    fn size_in_bytes(&self) -> core::result::Result<usize, emboss_runtime::Error> {
2015        let view = self.as_view();
2016        <PeripheralMinorDeviceClass<S::Sliced<'_>, emboss_runtime::UncheckedState> as emboss_runtime::View>::size_in_bytes(&view)
2017    }
2018}
2019
2020impl<S: emboss_runtime::MutStorage, ST: emboss_runtime::State> emboss_runtime::View for PeripheralMinorDeviceClassWriter<S, ST> {
2021    fn size_in_bytes(&self) -> core::result::Result<usize, emboss_runtime::Error> {
2022        let view = self.as_view();
2023        <PeripheralMinorDeviceClass<S::Sliced<'_>, ST> as emboss_runtime::View>::size_in_bytes(&view)
2024    }
2025}
2026
2027impl<S: emboss_runtime::Storage> emboss_runtime::CheckComplete for PeripheralMinorDeviceClass<S, emboss_runtime::UncheckedState> {
2028    type Completed = PeripheralMinorDeviceClass<S, emboss_runtime::CompleteState>;
2029    fn check_complete(self) -> core::result::Result<Self::Completed, emboss_runtime::Error> {
2030        let required_size = <Self as emboss_runtime::View>::size_in_bytes(&self)?;
2031        if self.storage.len() < required_size {
2032            return core::result::Result::Err(emboss_runtime::Error::OutOfBounds);
2033        }
2034        core::result::Result::Ok(unsafe { PeripheralMinorDeviceClass::new_in_state(self.storage) })
2035    }
2036}
2037
2038impl<S: emboss_runtime::MutStorage> emboss_runtime::CheckComplete for PeripheralMinorDeviceClassWriter<S, emboss_runtime::UncheckedState> {
2039    type Completed = PeripheralMinorDeviceClassWriter<S, emboss_runtime::CompleteState>;
2040    fn check_complete(self) -> core::result::Result<Self::Completed, emboss_runtime::Error> {
2041        let required_size = <Self as emboss_runtime::View>::size_in_bytes(&self)?;
2042        if self.storage.len() < required_size {
2043            return core::result::Result::Err(emboss_runtime::Error::OutOfBounds);
2044        }
2045        core::result::Result::Ok(unsafe { PeripheralMinorDeviceClassWriter::new_in_state(self.storage) })
2046    }
2047}
2048
2049impl<S: emboss_runtime::Storage> emboss_runtime::CheckOk for PeripheralMinorDeviceClass<S, emboss_runtime::UncheckedState> {
2050    type Ok = PeripheralMinorDeviceClass<S, emboss_runtime::OkState>;
2051    fn check_ok(self) -> core::result::Result<Self::Ok, emboss_runtime::Error> {
2052        let completed = emboss_runtime::CheckComplete::check_complete(self)?;
2053        core::result::Result::Ok(unsafe { PeripheralMinorDeviceClass::new_in_state(completed.into_storage()) })
2054    }
2055}
2056
2057impl<S: emboss_runtime::Storage> emboss_runtime::CheckOk for PeripheralMinorDeviceClass<S, emboss_runtime::CompleteState> {
2058    type Ok = PeripheralMinorDeviceClass<S, emboss_runtime::OkState>;
2059    fn check_ok(self) -> core::result::Result<Self::Ok, emboss_runtime::Error> {
2060        core::result::Result::Ok(unsafe { PeripheralMinorDeviceClass::new_in_state(self.into_storage()) })
2061    }
2062}
2063
2064impl<S: emboss_runtime::Storage> emboss_runtime::CheckOk for PeripheralMinorDeviceClass<S, emboss_runtime::OkState> {
2065    type Ok = PeripheralMinorDeviceClass<S, emboss_runtime::OkState>;
2066    fn check_ok(self) -> core::result::Result<Self::Ok, emboss_runtime::Error> {
2067        core::result::Result::Ok(self)
2068    }
2069}
2070
2071impl<S: emboss_runtime::MutStorage> emboss_runtime::CheckOk for PeripheralMinorDeviceClassWriter<S, emboss_runtime::UncheckedState> {
2072    type Ok = PeripheralMinorDeviceClassWriter<S, emboss_runtime::OkState>;
2073    fn check_ok(self) -> core::result::Result<Self::Ok, emboss_runtime::Error> {
2074        let completed = emboss_runtime::CheckComplete::check_complete(self)?;
2075        core::result::Result::Ok(unsafe { PeripheralMinorDeviceClassWriter::new_in_state(completed.into_storage()) })
2076    }
2077}
2078
2079impl<S: emboss_runtime::MutStorage> emboss_runtime::CheckOk for PeripheralMinorDeviceClassWriter<S, emboss_runtime::CompleteState> {
2080    type Ok = PeripheralMinorDeviceClassWriter<S, emboss_runtime::OkState>;
2081    fn check_ok(self) -> core::result::Result<Self::Ok, emboss_runtime::Error> {
2082        core::result::Result::Ok(unsafe { PeripheralMinorDeviceClassWriter::new_in_state(self.into_storage()) })
2083    }
2084}
2085
2086impl<S: emboss_runtime::MutStorage> emboss_runtime::CheckOk for PeripheralMinorDeviceClassWriter<S, emboss_runtime::OkState> {
2087    type Ok = PeripheralMinorDeviceClassWriter<S, emboss_runtime::OkState>;
2088    fn check_ok(self) -> core::result::Result<Self::Ok, emboss_runtime::Error> {
2089        core::result::Result::Ok(self)
2090    }
2091}
2092
2093pub mod peripheral_minor_device_class {
2094    pub type View<S, ST = emboss_runtime::UncheckedState> = super::PeripheralMinorDeviceClass<S, ST>;
2095    pub type ViewMut<S> = super::PeripheralMinorDeviceClassMut<S>;
2096    pub type Writer<S, ST = emboss_runtime::UncheckedState> = super::PeripheralMinorDeviceClassWriter<S, ST>;
2097
2098    pub const MIN_SIZE_IN_BYTES: usize = 1;
2099    pub const MAX_SIZE_IN_BYTES: usize = 1;
2100    pub const SIZE_IN_BYTES: usize = 1;
2101}#[derive(Copy, Clone, Debug, Eq, PartialEq)]
2102#[repr(u64)]
2103pub enum ImagingMinorDeviceClass {
2104    UNCATEGORIZED = 0,
2105
2106}
2107
2108impl core::convert::From<ImagingMinorDeviceClass> for u8 { fn from(val: ImagingMinorDeviceClass) -> Self { val as u8 } }
2109impl core::convert::From<ImagingMinorDeviceClass> for u16 { fn from(val: ImagingMinorDeviceClass) -> Self { val as u16 } }
2110impl core::convert::From<ImagingMinorDeviceClass> for u32 { fn from(val: ImagingMinorDeviceClass) -> Self { val as u32 } }
2111impl core::convert::From<ImagingMinorDeviceClass> for u64 { fn from(val: ImagingMinorDeviceClass) -> Self { val as u64 } }
2112impl core::convert::From<ImagingMinorDeviceClass> for i8 { fn from(val: ImagingMinorDeviceClass) -> Self { val as i8 } }
2113impl core::convert::From<ImagingMinorDeviceClass> for i16 { fn from(val: ImagingMinorDeviceClass) -> Self { val as i16 } }
2114impl core::convert::From<ImagingMinorDeviceClass> for i32 { fn from(val: ImagingMinorDeviceClass) -> Self { val as i32 } }
2115impl core::convert::From<ImagingMinorDeviceClass> for i64 { fn from(val: ImagingMinorDeviceClass) -> Self { val as i64 } }
2116
2117impl emboss_runtime::SafeCmp<ImagingMinorDeviceClass> for ImagingMinorDeviceClass {
2118    fn safe_eq(&self, other: Self) -> bool { *self == other }
2119    fn safe_less(&self, other: Self) -> bool { (*self as u64) < (other as u64) }
2120}
2121
2122impl emboss_runtime::SafeCmp<u64> for ImagingMinorDeviceClass {
2123    fn safe_eq(&self, other: u64) -> bool { emboss_runtime::SafeCmp::safe_eq(&(*self as u64), other) }
2124    fn safe_less(&self, other: u64) -> bool { emboss_runtime::SafeCmp::safe_less(&(*self as u64), other) }
2125}
2126
2127impl emboss_runtime::SafeCmp<i64> for ImagingMinorDeviceClass {
2128    fn safe_eq(&self, other: i64) -> bool { emboss_runtime::SafeCmp::safe_eq(&(*self as u64), other) }
2129    fn safe_less(&self, other: i64) -> bool { emboss_runtime::SafeCmp::safe_less(&(*self as u64), other) }
2130}
2131
2132impl emboss_runtime::SafeCmp<i32> for ImagingMinorDeviceClass {
2133    fn safe_eq(&self, other: i32) -> bool { emboss_runtime::SafeCmp::safe_eq(&(*self as u64), other as i64) }
2134    fn safe_less(&self, other: i32) -> bool { emboss_runtime::SafeCmp::safe_less(&(*self as u64), other as i64) }
2135}
2136
2137impl emboss_runtime::SafeCmp<u32> for ImagingMinorDeviceClass {
2138    fn safe_eq(&self, other: u32) -> bool { emboss_runtime::SafeCmp::safe_eq(&(*self as u64), other as u64) }
2139    fn safe_less(&self, other: u32) -> bool { emboss_runtime::SafeCmp::safe_less(&(*self as u64), other as u64) }
2140}
2141
2142impl emboss_runtime::SafeCmp<ImagingMinorDeviceClass> for u64 {
2143    fn safe_eq(&self, other: ImagingMinorDeviceClass) -> bool { emboss_runtime::SafeCmp::safe_eq(self, other as u64) }
2144    fn safe_less(&self, other: ImagingMinorDeviceClass) -> bool { emboss_runtime::SafeCmp::safe_less(self, other as u64) }
2145}
2146
2147impl emboss_runtime::SafeCmp<ImagingMinorDeviceClass> for i64 {
2148    fn safe_eq(&self, other: ImagingMinorDeviceClass) -> bool { emboss_runtime::SafeCmp::safe_eq(self, other as u64) }
2149    fn safe_less(&self, other: ImagingMinorDeviceClass) -> bool { emboss_runtime::SafeCmp::safe_less(self, other as u64) }
2150}
2151
2152impl<V: core::convert::Into<u64> + core::marker::Copy> emboss_runtime::TryFromRaw<V> for ImagingMinorDeviceClass {
2153    fn try_from_raw(val: V) -> core::result::Result<Self, emboss_runtime::Error<V>> {
2154        let v_raw: u64 = val.into();
2155        match v_raw {
2156            0 => Ok(ImagingMinorDeviceClass::UNCATEGORIZED),
2157
2158            _ => Err(emboss_runtime::Error::UnknownEnum(val)),
2159        }
2160    }
2161}
2162
2163impl ImagingMinorDeviceClass {
2164
2165}
2166pub struct ImagingMinorDeviceClassBits<S: emboss_runtime::Storage, ST: emboss_runtime::State = emboss_runtime::UncheckedState> {
2167    storage: S,
2168    _marker: core::marker::PhantomData<ST>,
2169}
2170
2171impl<S: emboss_runtime::Storage> ImagingMinorDeviceClassBits<S, emboss_runtime::UncheckedState> {
2172    pub fn new(storage: S) -> Self {
2173        Self {
2174            storage,
2175            _marker: core::marker::PhantomData,
2176        }
2177    }
2178}
2179
2180impl<S: emboss_runtime::Storage + core::clone::Clone, ST: emboss_runtime::State> core::clone::Clone for ImagingMinorDeviceClassBits<S, ST> {
2181    fn clone(&self) -> Self {
2182        Self {
2183            storage: self.storage.clone(),
2184            _marker: core::marker::PhantomData,
2185        }
2186    }
2187}
2188
2189impl<S: emboss_runtime::Storage, ST: emboss_runtime::State> ImagingMinorDeviceClassBits<S, ST> {
2190    /**
2191     * Constructs a view in a specific typestate.
2192     *
2193     * # Safety
2194     *
2195     * The caller must ensure that `storage` satisfies the layout invariants for `ST`.
2196     */
2197    pub unsafe fn new_in_state(storage: S) -> Self {
2198        Self {
2199            storage,
2200            _marker: core::marker::PhantomData,
2201        }
2202    }
2203    pub fn into_storage(self) -> S {
2204        self.storage
2205    }
2206    pub fn device_class(&self) -> emboss_runtime::EnumView<ImagingMinorDeviceClass, emboss_runtime::BitUInt<2, 0, emboss_runtime::Null, S::Sliced<'_>, ST>> {
2207        let len = (1) as usize;
2208        let storage = self.storage.slice(0, len);
2209        emboss_runtime::EnumView::new(emboss_runtime::BitUInt::new(storage))
2210    }
2211    pub fn display(&self) -> emboss_runtime::BitFlag<1, 2, emboss_runtime::Null, S::Sliced<'_>, ST> {
2212        let len = (1) as usize; // Total struct size in bytes
2213        let storage = self.storage.slice(0, len);
2214        emboss_runtime::BitFlag::<1, 2, emboss_runtime::Null, S::Sliced<'_>, ST>::new(storage)
2215    }
2216    pub fn camera(&self) -> emboss_runtime::BitFlag<1, 3, emboss_runtime::Null, S::Sliced<'_>, ST> {
2217        let len = (1) as usize; // Total struct size in bytes
2218        let storage = self.storage.slice(0, len);
2219        emboss_runtime::BitFlag::<1, 3, emboss_runtime::Null, S::Sliced<'_>, ST>::new(storage)
2220    }
2221    pub fn scanner(&self) -> emboss_runtime::BitFlag<1, 4, emboss_runtime::Null, S::Sliced<'_>, ST> {
2222        let len = (1) as usize; // Total struct size in bytes
2223        let storage = self.storage.slice(0, len);
2224        emboss_runtime::BitFlag::<1, 4, emboss_runtime::Null, S::Sliced<'_>, ST>::new(storage)
2225    }
2226    pub fn printer(&self) -> emboss_runtime::BitFlag<1, 5, emboss_runtime::Null, S::Sliced<'_>, ST> {
2227        let len = (1) as usize; // Total struct size in bytes
2228        let storage = self.storage.slice(0, len);
2229        emboss_runtime::BitFlag::<1, 5, emboss_runtime::Null, S::Sliced<'_>, ST>::new(storage)
2230    }
2231
2232}
2233
2234pub struct ImagingMinorDeviceClassBitsMut<S: emboss_runtime::MutStorage> {
2235    storage: S,
2236}
2237
2238impl<S: emboss_runtime::MutStorage> ImagingMinorDeviceClassBitsMut<S> {
2239    pub fn new(storage: S) -> Self {
2240        Self {
2241            storage,
2242        }
2243    }
2244    pub fn into_writer(self) -> ImagingMinorDeviceClassBitsWriter<S, emboss_runtime::UncheckedState> {
2245        ImagingMinorDeviceClassBitsWriter::new(self.storage)
2246    }
2247    /** Borrows the mutable view as an immutable view in UncheckedState. */
2248    pub fn as_view(&self) -> ImagingMinorDeviceClassBits<S::Sliced<'_>, emboss_runtime::UncheckedState> {
2249        unsafe { ImagingMinorDeviceClassBits::new_in_state(self.storage.slice(0, self.storage.len())) }
2250    }
2251    pub fn device_class(&mut self) -> emboss_runtime::EnumViewMut<ImagingMinorDeviceClass, emboss_runtime::BitUInt<2, 0, emboss_runtime::Null, S::SlicedMut<'_>, emboss_runtime::UncheckedState>> {
2252        let len = (1) as usize;
2253        let storage = self.storage.slice_mut(0, len);
2254        emboss_runtime::EnumViewMut::new(emboss_runtime::BitUInt::new(storage))
2255    }
2256    pub fn display(&mut self) -> emboss_runtime::BitFlag<1, 2, emboss_runtime::Null, S::SlicedMut<'_>, emboss_runtime::UncheckedState> {
2257        let len = (1) as usize;
2258        let storage = self.storage.slice_mut(0, len);
2259        emboss_runtime::BitFlag::<1, 2, emboss_runtime::Null, S::SlicedMut<'_>, emboss_runtime::UncheckedState>::new(storage)
2260    }
2261    pub fn camera(&mut self) -> emboss_runtime::BitFlag<1, 3, emboss_runtime::Null, S::SlicedMut<'_>, emboss_runtime::UncheckedState> {
2262        let len = (1) as usize;
2263        let storage = self.storage.slice_mut(0, len);
2264        emboss_runtime::BitFlag::<1, 3, emboss_runtime::Null, S::SlicedMut<'_>, emboss_runtime::UncheckedState>::new(storage)
2265    }
2266    pub fn scanner(&mut self) -> emboss_runtime::BitFlag<1, 4, emboss_runtime::Null, S::SlicedMut<'_>, emboss_runtime::UncheckedState> {
2267        let len = (1) as usize;
2268        let storage = self.storage.slice_mut(0, len);
2269        emboss_runtime::BitFlag::<1, 4, emboss_runtime::Null, S::SlicedMut<'_>, emboss_runtime::UncheckedState>::new(storage)
2270    }
2271    pub fn printer(&mut self) -> emboss_runtime::BitFlag<1, 5, emboss_runtime::Null, S::SlicedMut<'_>, emboss_runtime::UncheckedState> {
2272        let len = (1) as usize;
2273        let storage = self.storage.slice_mut(0, len);
2274        emboss_runtime::BitFlag::<1, 5, emboss_runtime::Null, S::SlicedMut<'_>, emboss_runtime::UncheckedState>::new(storage)
2275    }
2276
2277}
2278
2279impl<S: emboss_runtime::MutStorage> emboss_runtime::IntoWriter for ImagingMinorDeviceClassBitsMut<S> {
2280    type Writer = ImagingMinorDeviceClassBitsWriter<S, emboss_runtime::UncheckedState>;
2281    fn into_writer(self) -> Self::Writer {
2282        ImagingMinorDeviceClassBitsWriter::new(self.storage)
2283    }
2284}
2285
2286pub struct ImagingMinorDeviceClassBitsWriter<S: emboss_runtime::MutStorage, ST: emboss_runtime::State = emboss_runtime::UncheckedState> {
2287    storage: S,
2288    _marker: core::marker::PhantomData<ST>,
2289}
2290
2291impl<S: emboss_runtime::MutStorage> ImagingMinorDeviceClassBitsWriter<S, emboss_runtime::UncheckedState> {
2292    pub fn new(storage: S) -> Self {
2293        Self {
2294            storage,
2295            _marker: core::marker::PhantomData,
2296        }
2297    }
2298}
2299
2300impl<S: emboss_runtime::MutStorage, ST: emboss_runtime::State> ImagingMinorDeviceClassBitsWriter<S, ST> {
2301    /**
2302     * Constructs a writer in a specific typestate.
2303     *
2304     * # Safety
2305     *
2306     * The caller must ensure that `storage` satisfies the layout invariants for `ST`.
2307     */
2308    pub unsafe fn new_in_state(storage: S) -> Self {
2309        Self {
2310            storage,
2311            _marker: core::marker::PhantomData,
2312        }
2313    }
2314    pub fn into_storage(self) -> S {
2315        self.storage
2316    }
2317    /** Converts the writer into an immutable view in the same typestate. */
2318    pub fn into_view(self) -> ImagingMinorDeviceClassBits<S, ST> {
2319        unsafe { ImagingMinorDeviceClassBits::new_in_state(self.storage) }
2320    }
2321    /** Borrows the writer as an immutable view in the same typestate. */
2322    pub fn as_view(&self) -> ImagingMinorDeviceClassBits<S::Sliced<'_>, ST> {
2323        unsafe { ImagingMinorDeviceClassBits::new_in_state(self.storage.slice(0, self.storage.len())) }
2324    }
2325
2326}
2327
2328impl<S: emboss_runtime::Storage, ST: emboss_runtime::State> emboss_runtime::View for ImagingMinorDeviceClassBits<S, ST> {
2329    fn size_in_bytes(&self) -> core::result::Result<usize, emboss_runtime::Error> {
2330        let view = self;
2331        core::result::Result::Ok((((6) + 7) / 8) as usize)
2332    }
2333}
2334
2335impl<S: emboss_runtime::MutStorage> emboss_runtime::View for ImagingMinorDeviceClassBitsMut<S> {
2336    fn size_in_bytes(&self) -> core::result::Result<usize, emboss_runtime::Error> {
2337        let view = self.as_view();
2338        <ImagingMinorDeviceClassBits<S::Sliced<'_>, emboss_runtime::UncheckedState> as emboss_runtime::View>::size_in_bytes(&view)
2339    }
2340}
2341
2342impl<S: emboss_runtime::MutStorage, ST: emboss_runtime::State> emboss_runtime::View for ImagingMinorDeviceClassBitsWriter<S, ST> {
2343    fn size_in_bytes(&self) -> core::result::Result<usize, emboss_runtime::Error> {
2344        let view = self.as_view();
2345        <ImagingMinorDeviceClassBits<S::Sliced<'_>, ST> as emboss_runtime::View>::size_in_bytes(&view)
2346    }
2347}
2348
2349impl<S: emboss_runtime::Storage> emboss_runtime::CheckComplete for ImagingMinorDeviceClassBits<S, emboss_runtime::UncheckedState> {
2350    type Completed = ImagingMinorDeviceClassBits<S, emboss_runtime::CompleteState>;
2351    fn check_complete(self) -> core::result::Result<Self::Completed, emboss_runtime::Error> {
2352        let required_size = <Self as emboss_runtime::View>::size_in_bytes(&self)?;
2353        if self.storage.len() < required_size {
2354            return core::result::Result::Err(emboss_runtime::Error::OutOfBounds);
2355        }
2356        core::result::Result::Ok(unsafe { ImagingMinorDeviceClassBits::new_in_state(self.storage) })
2357    }
2358}
2359
2360impl<S: emboss_runtime::MutStorage> emboss_runtime::CheckComplete for ImagingMinorDeviceClassBitsWriter<S, emboss_runtime::UncheckedState> {
2361    type Completed = ImagingMinorDeviceClassBitsWriter<S, emboss_runtime::CompleteState>;
2362    fn check_complete(self) -> core::result::Result<Self::Completed, emboss_runtime::Error> {
2363        let required_size = <Self as emboss_runtime::View>::size_in_bytes(&self)?;
2364        if self.storage.len() < required_size {
2365            return core::result::Result::Err(emboss_runtime::Error::OutOfBounds);
2366        }
2367        core::result::Result::Ok(unsafe { ImagingMinorDeviceClassBitsWriter::new_in_state(self.storage) })
2368    }
2369}
2370
2371impl<S: emboss_runtime::Storage> emboss_runtime::CheckOk for ImagingMinorDeviceClassBits<S, emboss_runtime::UncheckedState> {
2372    type Ok = ImagingMinorDeviceClassBits<S, emboss_runtime::OkState>;
2373    fn check_ok(self) -> core::result::Result<Self::Ok, emboss_runtime::Error> {
2374        let completed = emboss_runtime::CheckComplete::check_complete(self)?;
2375        core::result::Result::Ok(unsafe { ImagingMinorDeviceClassBits::new_in_state(completed.into_storage()) })
2376    }
2377}
2378
2379impl<S: emboss_runtime::Storage> emboss_runtime::CheckOk for ImagingMinorDeviceClassBits<S, emboss_runtime::CompleteState> {
2380    type Ok = ImagingMinorDeviceClassBits<S, emboss_runtime::OkState>;
2381    fn check_ok(self) -> core::result::Result<Self::Ok, emboss_runtime::Error> {
2382        core::result::Result::Ok(unsafe { ImagingMinorDeviceClassBits::new_in_state(self.into_storage()) })
2383    }
2384}
2385
2386impl<S: emboss_runtime::Storage> emboss_runtime::CheckOk for ImagingMinorDeviceClassBits<S, emboss_runtime::OkState> {
2387    type Ok = ImagingMinorDeviceClassBits<S, emboss_runtime::OkState>;
2388    fn check_ok(self) -> core::result::Result<Self::Ok, emboss_runtime::Error> {
2389        core::result::Result::Ok(self)
2390    }
2391}
2392
2393impl<S: emboss_runtime::MutStorage> emboss_runtime::CheckOk for ImagingMinorDeviceClassBitsWriter<S, emboss_runtime::UncheckedState> {
2394    type Ok = ImagingMinorDeviceClassBitsWriter<S, emboss_runtime::OkState>;
2395    fn check_ok(self) -> core::result::Result<Self::Ok, emboss_runtime::Error> {
2396        let completed = emboss_runtime::CheckComplete::check_complete(self)?;
2397        core::result::Result::Ok(unsafe { ImagingMinorDeviceClassBitsWriter::new_in_state(completed.into_storage()) })
2398    }
2399}
2400
2401impl<S: emboss_runtime::MutStorage> emboss_runtime::CheckOk for ImagingMinorDeviceClassBitsWriter<S, emboss_runtime::CompleteState> {
2402    type Ok = ImagingMinorDeviceClassBitsWriter<S, emboss_runtime::OkState>;
2403    fn check_ok(self) -> core::result::Result<Self::Ok, emboss_runtime::Error> {
2404        core::result::Result::Ok(unsafe { ImagingMinorDeviceClassBitsWriter::new_in_state(self.into_storage()) })
2405    }
2406}
2407
2408impl<S: emboss_runtime::MutStorage> emboss_runtime::CheckOk for ImagingMinorDeviceClassBitsWriter<S, emboss_runtime::OkState> {
2409    type Ok = ImagingMinorDeviceClassBitsWriter<S, emboss_runtime::OkState>;
2410    fn check_ok(self) -> core::result::Result<Self::Ok, emboss_runtime::Error> {
2411        core::result::Result::Ok(self)
2412    }
2413}
2414
2415pub mod imaging_minor_device_class_bits {
2416    pub type View<S, ST = emboss_runtime::UncheckedState> = super::ImagingMinorDeviceClassBits<S, ST>;
2417    pub type ViewMut<S> = super::ImagingMinorDeviceClassBitsMut<S>;
2418    pub type Writer<S, ST = emboss_runtime::UncheckedState> = super::ImagingMinorDeviceClassBitsWriter<S, ST>;
2419
2420    pub const MIN_SIZE_IN_BYTES: usize = 1;
2421    pub const MAX_SIZE_IN_BYTES: usize = 1;
2422    pub const SIZE_IN_BYTES: usize = 1;
2423}#[derive(Copy, Clone, Debug, Eq, PartialEq)]
2424#[repr(u64)]
2425pub enum WearableMinorDeviceClass {
2426    WRISTWATCH = 1,
2427    PAGER = 2,
2428    JACKET = 3,
2429    HELMET = 4,
2430    GLASSES = 5,
2431
2432}
2433
2434impl core::convert::From<WearableMinorDeviceClass> for u8 { fn from(val: WearableMinorDeviceClass) -> Self { val as u8 } }
2435impl core::convert::From<WearableMinorDeviceClass> for u16 { fn from(val: WearableMinorDeviceClass) -> Self { val as u16 } }
2436impl core::convert::From<WearableMinorDeviceClass> for u32 { fn from(val: WearableMinorDeviceClass) -> Self { val as u32 } }
2437impl core::convert::From<WearableMinorDeviceClass> for u64 { fn from(val: WearableMinorDeviceClass) -> Self { val as u64 } }
2438impl core::convert::From<WearableMinorDeviceClass> for i8 { fn from(val: WearableMinorDeviceClass) -> Self { val as i8 } }
2439impl core::convert::From<WearableMinorDeviceClass> for i16 { fn from(val: WearableMinorDeviceClass) -> Self { val as i16 } }
2440impl core::convert::From<WearableMinorDeviceClass> for i32 { fn from(val: WearableMinorDeviceClass) -> Self { val as i32 } }
2441impl core::convert::From<WearableMinorDeviceClass> for i64 { fn from(val: WearableMinorDeviceClass) -> Self { val as i64 } }
2442
2443impl emboss_runtime::SafeCmp<WearableMinorDeviceClass> for WearableMinorDeviceClass {
2444    fn safe_eq(&self, other: Self) -> bool { *self == other }
2445    fn safe_less(&self, other: Self) -> bool { (*self as u64) < (other as u64) }
2446}
2447
2448impl emboss_runtime::SafeCmp<u64> for WearableMinorDeviceClass {
2449    fn safe_eq(&self, other: u64) -> bool { emboss_runtime::SafeCmp::safe_eq(&(*self as u64), other) }
2450    fn safe_less(&self, other: u64) -> bool { emboss_runtime::SafeCmp::safe_less(&(*self as u64), other) }
2451}
2452
2453impl emboss_runtime::SafeCmp<i64> for WearableMinorDeviceClass {
2454    fn safe_eq(&self, other: i64) -> bool { emboss_runtime::SafeCmp::safe_eq(&(*self as u64), other) }
2455    fn safe_less(&self, other: i64) -> bool { emboss_runtime::SafeCmp::safe_less(&(*self as u64), other) }
2456}
2457
2458impl emboss_runtime::SafeCmp<i32> for WearableMinorDeviceClass {
2459    fn safe_eq(&self, other: i32) -> bool { emboss_runtime::SafeCmp::safe_eq(&(*self as u64), other as i64) }
2460    fn safe_less(&self, other: i32) -> bool { emboss_runtime::SafeCmp::safe_less(&(*self as u64), other as i64) }
2461}
2462
2463impl emboss_runtime::SafeCmp<u32> for WearableMinorDeviceClass {
2464    fn safe_eq(&self, other: u32) -> bool { emboss_runtime::SafeCmp::safe_eq(&(*self as u64), other as u64) }
2465    fn safe_less(&self, other: u32) -> bool { emboss_runtime::SafeCmp::safe_less(&(*self as u64), other as u64) }
2466}
2467
2468impl emboss_runtime::SafeCmp<WearableMinorDeviceClass> for u64 {
2469    fn safe_eq(&self, other: WearableMinorDeviceClass) -> bool { emboss_runtime::SafeCmp::safe_eq(self, other as u64) }
2470    fn safe_less(&self, other: WearableMinorDeviceClass) -> bool { emboss_runtime::SafeCmp::safe_less(self, other as u64) }
2471}
2472
2473impl emboss_runtime::SafeCmp<WearableMinorDeviceClass> for i64 {
2474    fn safe_eq(&self, other: WearableMinorDeviceClass) -> bool { emboss_runtime::SafeCmp::safe_eq(self, other as u64) }
2475    fn safe_less(&self, other: WearableMinorDeviceClass) -> bool { emboss_runtime::SafeCmp::safe_less(self, other as u64) }
2476}
2477
2478impl<V: core::convert::Into<u64> + core::marker::Copy> emboss_runtime::TryFromRaw<V> for WearableMinorDeviceClass {
2479    fn try_from_raw(val: V) -> core::result::Result<Self, emboss_runtime::Error<V>> {
2480        let v_raw: u64 = val.into();
2481        match v_raw {
2482            1 => Ok(WearableMinorDeviceClass::WRISTWATCH),
2483            2 => Ok(WearableMinorDeviceClass::PAGER),
2484            3 => Ok(WearableMinorDeviceClass::JACKET),
2485            4 => Ok(WearableMinorDeviceClass::HELMET),
2486            5 => Ok(WearableMinorDeviceClass::GLASSES),
2487
2488            _ => Err(emboss_runtime::Error::UnknownEnum(val)),
2489        }
2490    }
2491}
2492
2493impl WearableMinorDeviceClass {
2494
2495}
2496#[derive(Copy, Clone, Debug, Eq, PartialEq)]
2497#[repr(u64)]
2498pub enum ToyMinorDeviceClass {
2499    ROBOT = 1,
2500    VEHICLE = 2,
2501    DOLL = 3,
2502    CONTROLLER = 4,
2503    GAME = 5,
2504
2505}
2506
2507impl core::convert::From<ToyMinorDeviceClass> for u8 { fn from(val: ToyMinorDeviceClass) -> Self { val as u8 } }
2508impl core::convert::From<ToyMinorDeviceClass> for u16 { fn from(val: ToyMinorDeviceClass) -> Self { val as u16 } }
2509impl core::convert::From<ToyMinorDeviceClass> for u32 { fn from(val: ToyMinorDeviceClass) -> Self { val as u32 } }
2510impl core::convert::From<ToyMinorDeviceClass> for u64 { fn from(val: ToyMinorDeviceClass) -> Self { val as u64 } }
2511impl core::convert::From<ToyMinorDeviceClass> for i8 { fn from(val: ToyMinorDeviceClass) -> Self { val as i8 } }
2512impl core::convert::From<ToyMinorDeviceClass> for i16 { fn from(val: ToyMinorDeviceClass) -> Self { val as i16 } }
2513impl core::convert::From<ToyMinorDeviceClass> for i32 { fn from(val: ToyMinorDeviceClass) -> Self { val as i32 } }
2514impl core::convert::From<ToyMinorDeviceClass> for i64 { fn from(val: ToyMinorDeviceClass) -> Self { val as i64 } }
2515
2516impl emboss_runtime::SafeCmp<ToyMinorDeviceClass> for ToyMinorDeviceClass {
2517    fn safe_eq(&self, other: Self) -> bool { *self == other }
2518    fn safe_less(&self, other: Self) -> bool { (*self as u64) < (other as u64) }
2519}
2520
2521impl emboss_runtime::SafeCmp<u64> for ToyMinorDeviceClass {
2522    fn safe_eq(&self, other: u64) -> bool { emboss_runtime::SafeCmp::safe_eq(&(*self as u64), other) }
2523    fn safe_less(&self, other: u64) -> bool { emboss_runtime::SafeCmp::safe_less(&(*self as u64), other) }
2524}
2525
2526impl emboss_runtime::SafeCmp<i64> for ToyMinorDeviceClass {
2527    fn safe_eq(&self, other: i64) -> bool { emboss_runtime::SafeCmp::safe_eq(&(*self as u64), other) }
2528    fn safe_less(&self, other: i64) -> bool { emboss_runtime::SafeCmp::safe_less(&(*self as u64), other) }
2529}
2530
2531impl emboss_runtime::SafeCmp<i32> for ToyMinorDeviceClass {
2532    fn safe_eq(&self, other: i32) -> bool { emboss_runtime::SafeCmp::safe_eq(&(*self as u64), other as i64) }
2533    fn safe_less(&self, other: i32) -> bool { emboss_runtime::SafeCmp::safe_less(&(*self as u64), other as i64) }
2534}
2535
2536impl emboss_runtime::SafeCmp<u32> for ToyMinorDeviceClass {
2537    fn safe_eq(&self, other: u32) -> bool { emboss_runtime::SafeCmp::safe_eq(&(*self as u64), other as u64) }
2538    fn safe_less(&self, other: u32) -> bool { emboss_runtime::SafeCmp::safe_less(&(*self as u64), other as u64) }
2539}
2540
2541impl emboss_runtime::SafeCmp<ToyMinorDeviceClass> for u64 {
2542    fn safe_eq(&self, other: ToyMinorDeviceClass) -> bool { emboss_runtime::SafeCmp::safe_eq(self, other as u64) }
2543    fn safe_less(&self, other: ToyMinorDeviceClass) -> bool { emboss_runtime::SafeCmp::safe_less(self, other as u64) }
2544}
2545
2546impl emboss_runtime::SafeCmp<ToyMinorDeviceClass> for i64 {
2547    fn safe_eq(&self, other: ToyMinorDeviceClass) -> bool { emboss_runtime::SafeCmp::safe_eq(self, other as u64) }
2548    fn safe_less(&self, other: ToyMinorDeviceClass) -> bool { emboss_runtime::SafeCmp::safe_less(self, other as u64) }
2549}
2550
2551impl<V: core::convert::Into<u64> + core::marker::Copy> emboss_runtime::TryFromRaw<V> for ToyMinorDeviceClass {
2552    fn try_from_raw(val: V) -> core::result::Result<Self, emboss_runtime::Error<V>> {
2553        let v_raw: u64 = val.into();
2554        match v_raw {
2555            1 => Ok(ToyMinorDeviceClass::ROBOT),
2556            2 => Ok(ToyMinorDeviceClass::VEHICLE),
2557            3 => Ok(ToyMinorDeviceClass::DOLL),
2558            4 => Ok(ToyMinorDeviceClass::CONTROLLER),
2559            5 => Ok(ToyMinorDeviceClass::GAME),
2560
2561            _ => Err(emboss_runtime::Error::UnknownEnum(val)),
2562        }
2563    }
2564}
2565
2566impl ToyMinorDeviceClass {
2567
2568}
2569#[derive(Copy, Clone, Debug, Eq, PartialEq)]
2570#[repr(u64)]
2571pub enum HealthMinorDeviceClass {
2572    UNDEFINED = 0,
2573    BLOOD_PRESSURE_MONITOR = 1,
2574    THERMOMETER = 2,
2575    WEIGHING_SCALE = 3,
2576    GLUCOSE_METER = 4,
2577    PULSE_OXIMETER = 5,
2578    HEART_PULSE_RATE_MONITOR = 6,
2579    HEALTH_DATA_DISPLAY = 7,
2580    STEP_COUNTER = 8,
2581    BODY_COMPOSITION_ANALYZER = 9,
2582    PEAK_FLOW_MONITOR = 10,
2583    MEDICATION_MONITOR = 11,
2584    KNEE_PROSTHESIS = 12,
2585    ANKLE_PROSTHESIS = 13,
2586    GENERIC_HEALTH_MANAGER = 14,
2587    PERSONAL_MOBILITY_DEVICE = 15,
2588
2589}
2590
2591impl core::convert::From<HealthMinorDeviceClass> for u8 { fn from(val: HealthMinorDeviceClass) -> Self { val as u8 } }
2592impl core::convert::From<HealthMinorDeviceClass> for u16 { fn from(val: HealthMinorDeviceClass) -> Self { val as u16 } }
2593impl core::convert::From<HealthMinorDeviceClass> for u32 { fn from(val: HealthMinorDeviceClass) -> Self { val as u32 } }
2594impl core::convert::From<HealthMinorDeviceClass> for u64 { fn from(val: HealthMinorDeviceClass) -> Self { val as u64 } }
2595impl core::convert::From<HealthMinorDeviceClass> for i8 { fn from(val: HealthMinorDeviceClass) -> Self { val as i8 } }
2596impl core::convert::From<HealthMinorDeviceClass> for i16 { fn from(val: HealthMinorDeviceClass) -> Self { val as i16 } }
2597impl core::convert::From<HealthMinorDeviceClass> for i32 { fn from(val: HealthMinorDeviceClass) -> Self { val as i32 } }
2598impl core::convert::From<HealthMinorDeviceClass> for i64 { fn from(val: HealthMinorDeviceClass) -> Self { val as i64 } }
2599
2600impl emboss_runtime::SafeCmp<HealthMinorDeviceClass> for HealthMinorDeviceClass {
2601    fn safe_eq(&self, other: Self) -> bool { *self == other }
2602    fn safe_less(&self, other: Self) -> bool { (*self as u64) < (other as u64) }
2603}
2604
2605impl emboss_runtime::SafeCmp<u64> for HealthMinorDeviceClass {
2606    fn safe_eq(&self, other: u64) -> bool { emboss_runtime::SafeCmp::safe_eq(&(*self as u64), other) }
2607    fn safe_less(&self, other: u64) -> bool { emboss_runtime::SafeCmp::safe_less(&(*self as u64), other) }
2608}
2609
2610impl emboss_runtime::SafeCmp<i64> for HealthMinorDeviceClass {
2611    fn safe_eq(&self, other: i64) -> bool { emboss_runtime::SafeCmp::safe_eq(&(*self as u64), other) }
2612    fn safe_less(&self, other: i64) -> bool { emboss_runtime::SafeCmp::safe_less(&(*self as u64), other) }
2613}
2614
2615impl emboss_runtime::SafeCmp<i32> for HealthMinorDeviceClass {
2616    fn safe_eq(&self, other: i32) -> bool { emboss_runtime::SafeCmp::safe_eq(&(*self as u64), other as i64) }
2617    fn safe_less(&self, other: i32) -> bool { emboss_runtime::SafeCmp::safe_less(&(*self as u64), other as i64) }
2618}
2619
2620impl emboss_runtime::SafeCmp<u32> for HealthMinorDeviceClass {
2621    fn safe_eq(&self, other: u32) -> bool { emboss_runtime::SafeCmp::safe_eq(&(*self as u64), other as u64) }
2622    fn safe_less(&self, other: u32) -> bool { emboss_runtime::SafeCmp::safe_less(&(*self as u64), other as u64) }
2623}
2624
2625impl emboss_runtime::SafeCmp<HealthMinorDeviceClass> for u64 {
2626    fn safe_eq(&self, other: HealthMinorDeviceClass) -> bool { emboss_runtime::SafeCmp::safe_eq(self, other as u64) }
2627    fn safe_less(&self, other: HealthMinorDeviceClass) -> bool { emboss_runtime::SafeCmp::safe_less(self, other as u64) }
2628}
2629
2630impl emboss_runtime::SafeCmp<HealthMinorDeviceClass> for i64 {
2631    fn safe_eq(&self, other: HealthMinorDeviceClass) -> bool { emboss_runtime::SafeCmp::safe_eq(self, other as u64) }
2632    fn safe_less(&self, other: HealthMinorDeviceClass) -> bool { emboss_runtime::SafeCmp::safe_less(self, other as u64) }
2633}
2634
2635impl<V: core::convert::Into<u64> + core::marker::Copy> emboss_runtime::TryFromRaw<V> for HealthMinorDeviceClass {
2636    fn try_from_raw(val: V) -> core::result::Result<Self, emboss_runtime::Error<V>> {
2637        let v_raw: u64 = val.into();
2638        match v_raw {
2639            0 => Ok(HealthMinorDeviceClass::UNDEFINED),
2640            1 => Ok(HealthMinorDeviceClass::BLOOD_PRESSURE_MONITOR),
2641            2 => Ok(HealthMinorDeviceClass::THERMOMETER),
2642            3 => Ok(HealthMinorDeviceClass::WEIGHING_SCALE),
2643            4 => Ok(HealthMinorDeviceClass::GLUCOSE_METER),
2644            5 => Ok(HealthMinorDeviceClass::PULSE_OXIMETER),
2645            6 => Ok(HealthMinorDeviceClass::HEART_PULSE_RATE_MONITOR),
2646            7 => Ok(HealthMinorDeviceClass::HEALTH_DATA_DISPLAY),
2647            8 => Ok(HealthMinorDeviceClass::STEP_COUNTER),
2648            9 => Ok(HealthMinorDeviceClass::BODY_COMPOSITION_ANALYZER),
2649            10 => Ok(HealthMinorDeviceClass::PEAK_FLOW_MONITOR),
2650            11 => Ok(HealthMinorDeviceClass::MEDICATION_MONITOR),
2651            12 => Ok(HealthMinorDeviceClass::KNEE_PROSTHESIS),
2652            13 => Ok(HealthMinorDeviceClass::ANKLE_PROSTHESIS),
2653            14 => Ok(HealthMinorDeviceClass::GENERIC_HEALTH_MANAGER),
2654            15 => Ok(HealthMinorDeviceClass::PERSONAL_MOBILITY_DEVICE),
2655
2656            _ => Err(emboss_runtime::Error::UnknownEnum(val)),
2657        }
2658    }
2659}
2660
2661impl HealthMinorDeviceClass {
2662
2663}
2664#[derive(Copy, Clone, Debug, Eq, PartialEq)]
2665#[repr(u64)]
2666pub enum GenericEnableParam {
2667    DISABLE = 0,
2668    ENABLE = 1,
2669
2670}
2671
2672impl core::convert::From<GenericEnableParam> for u8 { fn from(val: GenericEnableParam) -> Self { val as u8 } }
2673impl core::convert::From<GenericEnableParam> for u16 { fn from(val: GenericEnableParam) -> Self { val as u16 } }
2674impl core::convert::From<GenericEnableParam> for u32 { fn from(val: GenericEnableParam) -> Self { val as u32 } }
2675impl core::convert::From<GenericEnableParam> for u64 { fn from(val: GenericEnableParam) -> Self { val as u64 } }
2676impl core::convert::From<GenericEnableParam> for i8 { fn from(val: GenericEnableParam) -> Self { val as i8 } }
2677impl core::convert::From<GenericEnableParam> for i16 { fn from(val: GenericEnableParam) -> Self { val as i16 } }
2678impl core::convert::From<GenericEnableParam> for i32 { fn from(val: GenericEnableParam) -> Self { val as i32 } }
2679impl core::convert::From<GenericEnableParam> for i64 { fn from(val: GenericEnableParam) -> Self { val as i64 } }
2680
2681impl emboss_runtime::SafeCmp<GenericEnableParam> for GenericEnableParam {
2682    fn safe_eq(&self, other: Self) -> bool { *self == other }
2683    fn safe_less(&self, other: Self) -> bool { (*self as u64) < (other as u64) }
2684}
2685
2686impl emboss_runtime::SafeCmp<u64> for GenericEnableParam {
2687    fn safe_eq(&self, other: u64) -> bool { emboss_runtime::SafeCmp::safe_eq(&(*self as u64), other) }
2688    fn safe_less(&self, other: u64) -> bool { emboss_runtime::SafeCmp::safe_less(&(*self as u64), other) }
2689}
2690
2691impl emboss_runtime::SafeCmp<i64> for GenericEnableParam {
2692    fn safe_eq(&self, other: i64) -> bool { emboss_runtime::SafeCmp::safe_eq(&(*self as u64), other) }
2693    fn safe_less(&self, other: i64) -> bool { emboss_runtime::SafeCmp::safe_less(&(*self as u64), other) }
2694}
2695
2696impl emboss_runtime::SafeCmp<i32> for GenericEnableParam {
2697    fn safe_eq(&self, other: i32) -> bool { emboss_runtime::SafeCmp::safe_eq(&(*self as u64), other as i64) }
2698    fn safe_less(&self, other: i32) -> bool { emboss_runtime::SafeCmp::safe_less(&(*self as u64), other as i64) }
2699}
2700
2701impl emboss_runtime::SafeCmp<u32> for GenericEnableParam {
2702    fn safe_eq(&self, other: u32) -> bool { emboss_runtime::SafeCmp::safe_eq(&(*self as u64), other as u64) }
2703    fn safe_less(&self, other: u32) -> bool { emboss_runtime::SafeCmp::safe_less(&(*self as u64), other as u64) }
2704}
2705
2706impl emboss_runtime::SafeCmp<GenericEnableParam> for u64 {
2707    fn safe_eq(&self, other: GenericEnableParam) -> bool { emboss_runtime::SafeCmp::safe_eq(self, other as u64) }
2708    fn safe_less(&self, other: GenericEnableParam) -> bool { emboss_runtime::SafeCmp::safe_less(self, other as u64) }
2709}
2710
2711impl emboss_runtime::SafeCmp<GenericEnableParam> for i64 {
2712    fn safe_eq(&self, other: GenericEnableParam) -> bool { emboss_runtime::SafeCmp::safe_eq(self, other as u64) }
2713    fn safe_less(&self, other: GenericEnableParam) -> bool { emboss_runtime::SafeCmp::safe_less(self, other as u64) }
2714}
2715
2716impl<V: core::convert::Into<u64> + core::marker::Copy> emboss_runtime::TryFromRaw<V> for GenericEnableParam {
2717    fn try_from_raw(val: V) -> core::result::Result<Self, emboss_runtime::Error<V>> {
2718        let v_raw: u64 = val.into();
2719        match v_raw {
2720            0 => Ok(GenericEnableParam::DISABLE),
2721            1 => Ok(GenericEnableParam::ENABLE),
2722
2723            _ => Err(emboss_runtime::Error::UnknownEnum(val)),
2724        }
2725    }
2726}
2727
2728impl GenericEnableParam {
2729
2730}
2731#[derive(Copy, Clone, Debug, Eq, PartialEq)]
2732#[repr(u64)]
2733pub enum GenericPresenceParam {
2734    NOT_PRESENT = 0,
2735    PRESENT = 1,
2736
2737}
2738
2739impl core::convert::From<GenericPresenceParam> for u8 { fn from(val: GenericPresenceParam) -> Self { val as u8 } }
2740impl core::convert::From<GenericPresenceParam> for u16 { fn from(val: GenericPresenceParam) -> Self { val as u16 } }
2741impl core::convert::From<GenericPresenceParam> for u32 { fn from(val: GenericPresenceParam) -> Self { val as u32 } }
2742impl core::convert::From<GenericPresenceParam> for u64 { fn from(val: GenericPresenceParam) -> Self { val as u64 } }
2743impl core::convert::From<GenericPresenceParam> for i8 { fn from(val: GenericPresenceParam) -> Self { val as i8 } }
2744impl core::convert::From<GenericPresenceParam> for i16 { fn from(val: GenericPresenceParam) -> Self { val as i16 } }
2745impl core::convert::From<GenericPresenceParam> for i32 { fn from(val: GenericPresenceParam) -> Self { val as i32 } }
2746impl core::convert::From<GenericPresenceParam> for i64 { fn from(val: GenericPresenceParam) -> Self { val as i64 } }
2747
2748impl emboss_runtime::SafeCmp<GenericPresenceParam> for GenericPresenceParam {
2749    fn safe_eq(&self, other: Self) -> bool { *self == other }
2750    fn safe_less(&self, other: Self) -> bool { (*self as u64) < (other as u64) }
2751}
2752
2753impl emboss_runtime::SafeCmp<u64> for GenericPresenceParam {
2754    fn safe_eq(&self, other: u64) -> bool { emboss_runtime::SafeCmp::safe_eq(&(*self as u64), other) }
2755    fn safe_less(&self, other: u64) -> bool { emboss_runtime::SafeCmp::safe_less(&(*self as u64), other) }
2756}
2757
2758impl emboss_runtime::SafeCmp<i64> for GenericPresenceParam {
2759    fn safe_eq(&self, other: i64) -> bool { emboss_runtime::SafeCmp::safe_eq(&(*self as u64), other) }
2760    fn safe_less(&self, other: i64) -> bool { emboss_runtime::SafeCmp::safe_less(&(*self as u64), other) }
2761}
2762
2763impl emboss_runtime::SafeCmp<i32> for GenericPresenceParam {
2764    fn safe_eq(&self, other: i32) -> bool { emboss_runtime::SafeCmp::safe_eq(&(*self as u64), other as i64) }
2765    fn safe_less(&self, other: i32) -> bool { emboss_runtime::SafeCmp::safe_less(&(*self as u64), other as i64) }
2766}
2767
2768impl emboss_runtime::SafeCmp<u32> for GenericPresenceParam {
2769    fn safe_eq(&self, other: u32) -> bool { emboss_runtime::SafeCmp::safe_eq(&(*self as u64), other as u64) }
2770    fn safe_less(&self, other: u32) -> bool { emboss_runtime::SafeCmp::safe_less(&(*self as u64), other as u64) }
2771}
2772
2773impl emboss_runtime::SafeCmp<GenericPresenceParam> for u64 {
2774    fn safe_eq(&self, other: GenericPresenceParam) -> bool { emboss_runtime::SafeCmp::safe_eq(self, other as u64) }
2775    fn safe_less(&self, other: GenericPresenceParam) -> bool { emboss_runtime::SafeCmp::safe_less(self, other as u64) }
2776}
2777
2778impl emboss_runtime::SafeCmp<GenericPresenceParam> for i64 {
2779    fn safe_eq(&self, other: GenericPresenceParam) -> bool { emboss_runtime::SafeCmp::safe_eq(self, other as u64) }
2780    fn safe_less(&self, other: GenericPresenceParam) -> bool { emboss_runtime::SafeCmp::safe_less(self, other as u64) }
2781}
2782
2783impl<V: core::convert::Into<u64> + core::marker::Copy> emboss_runtime::TryFromRaw<V> for GenericPresenceParam {
2784    fn try_from_raw(val: V) -> core::result::Result<Self, emboss_runtime::Error<V>> {
2785        let v_raw: u64 = val.into();
2786        match v_raw {
2787            0 => Ok(GenericPresenceParam::NOT_PRESENT),
2788            1 => Ok(GenericPresenceParam::PRESENT),
2789
2790            _ => Err(emboss_runtime::Error::UnknownEnum(val)),
2791        }
2792    }
2793}
2794
2795impl GenericPresenceParam {
2796
2797}
2798pub struct BdAddr<S: emboss_runtime::Storage, ST: emboss_runtime::State = emboss_runtime::UncheckedState> {
2799    storage: S,
2800    _marker: core::marker::PhantomData<ST>,
2801}
2802
2803impl<S: emboss_runtime::Storage> BdAddr<S, emboss_runtime::UncheckedState> {
2804    pub fn new(storage: S) -> Self {
2805        Self {
2806            storage,
2807            _marker: core::marker::PhantomData,
2808        }
2809    }
2810}
2811
2812impl<S: emboss_runtime::Storage + core::clone::Clone, ST: emboss_runtime::State> core::clone::Clone for BdAddr<S, ST> {
2813    fn clone(&self) -> Self {
2814        Self {
2815            storage: self.storage.clone(),
2816            _marker: core::marker::PhantomData,
2817        }
2818    }
2819}
2820
2821impl<S: emboss_runtime::Storage, ST: emboss_runtime::State> BdAddr<S, ST> {
2822    /**
2823     * Constructs a view in a specific typestate.
2824     *
2825     * # Safety
2826     *
2827     * The caller must ensure that `storage` satisfies the layout invariants for `ST`.
2828     */
2829    pub unsafe fn new_in_state(storage: S) -> Self {
2830        Self {
2831            storage,
2832            _marker: core::marker::PhantomData,
2833        }
2834    }
2835    pub fn into_storage(self) -> S {
2836        self.storage
2837    }
2838    pub fn bd_addr(&self) -> UInt<48, emboss_runtime::LittleEndian, S::Sliced<'_>, ST> {
2839        let (offset, len) = (|| -> core::result::Result<(usize, usize), emboss_runtime::Error> {
2840            let offset = (0) as usize;
2841            let len = (6) as usize;
2842            core::result::Result::Ok((offset, len))
2843        })().unwrap_or((usize::MAX, 0));
2844        let storage = self.storage.slice(offset, len);
2845        UInt::<48, emboss_runtime::LittleEndian, S::Sliced<'_>, ST>::new(storage)
2846    }
2847
2848}
2849
2850pub struct BdAddrMut<S: emboss_runtime::MutStorage> {
2851    storage: S,
2852}
2853
2854impl<S: emboss_runtime::MutStorage> BdAddrMut<S> {
2855    pub fn new(storage: S) -> Self {
2856        Self {
2857            storage,
2858        }
2859    }
2860    pub fn into_writer(self) -> BdAddrWriter<S, emboss_runtime::UncheckedState> {
2861        BdAddrWriter::new(self.storage)
2862    }
2863    /** Borrows the mutable view as an immutable view in UncheckedState. */
2864    pub fn as_view(&self) -> BdAddr<S::Sliced<'_>, emboss_runtime::UncheckedState> {
2865        unsafe { BdAddr::new_in_state(self.storage.slice(0, self.storage.len())) }
2866    }
2867    pub fn bd_addr(&mut self) -> UInt<48, emboss_runtime::LittleEndian, S::SlicedMut<'_>, emboss_runtime::UncheckedState> {
2868        let (offset, len) = (|| -> core::result::Result<(usize, usize), emboss_runtime::Error> {
2869            let offset = (0) as usize;
2870            let len = (6) as usize;
2871            core::result::Result::Ok((offset, len))
2872        })().unwrap_or((usize::MAX, 0));
2873        let storage = self.storage.slice_mut(offset, len);
2874        UInt::<48, emboss_runtime::LittleEndian, S::SlicedMut<'_>, emboss_runtime::UncheckedState>::new(storage)
2875    }
2876
2877}
2878
2879impl<S: emboss_runtime::MutStorage> emboss_runtime::IntoWriter for BdAddrMut<S> {
2880    type Writer = BdAddrWriter<S, emboss_runtime::UncheckedState>;
2881    fn into_writer(self) -> Self::Writer {
2882        BdAddrWriter::new(self.storage)
2883    }
2884}
2885
2886pub struct BdAddrWriter<S: emboss_runtime::MutStorage, ST: emboss_runtime::State = emboss_runtime::UncheckedState> {
2887    storage: S,
2888    _marker: core::marker::PhantomData<ST>,
2889}
2890
2891impl<S: emboss_runtime::MutStorage> BdAddrWriter<S, emboss_runtime::UncheckedState> {
2892    pub fn new(storage: S) -> Self {
2893        Self {
2894            storage,
2895            _marker: core::marker::PhantomData,
2896        }
2897    }
2898}
2899
2900impl<S: emboss_runtime::MutStorage, ST: emboss_runtime::State> BdAddrWriter<S, ST> {
2901    /**
2902     * Constructs a writer in a specific typestate.
2903     *
2904     * # Safety
2905     *
2906     * The caller must ensure that `storage` satisfies the layout invariants for `ST`.
2907     */
2908    pub unsafe fn new_in_state(storage: S) -> Self {
2909        Self {
2910            storage,
2911            _marker: core::marker::PhantomData,
2912        }
2913    }
2914    pub fn into_storage(self) -> S {
2915        self.storage
2916    }
2917    /** Converts the writer into an immutable view in the same typestate. */
2918    pub fn into_view(self) -> BdAddr<S, ST> {
2919        unsafe { BdAddr::new_in_state(self.storage) }
2920    }
2921    /** Borrows the writer as an immutable view in the same typestate. */
2922    pub fn as_view(&self) -> BdAddr<S::Sliced<'_>, ST> {
2923        unsafe { BdAddr::new_in_state(self.storage.slice(0, self.storage.len())) }
2924    }
2925    pub fn write_bd_addr(self, val: <emboss_runtime::SizeSelector<48> as emboss_runtime::SmallestUInt>::T) -> BdAddrWriter<S, ST::OnValidMutation> {
2926        let view = self.into_view();
2927        let (offset, len) = (|| -> core::result::Result<(usize, usize), emboss_runtime::Error> {
2928            let offset = (0) as usize;
2929            let len = (6) as usize;
2930            core::result::Result::Ok((offset, len))
2931        })().expect("valid layout in complete state");
2932        let mut storage = view.into_storage();
2933        {
2934            let slice = storage.slice_mut(offset, len);
2935            let mut field_view = emboss_runtime::UInt::<48, emboss_runtime::LittleEndian, _>::new(slice);
2936            field_view.try_write(val).expect("valid write in complete state");
2937        }
2938        unsafe { BdAddrWriter::new_in_state(storage) }
2939    }
2940
2941}
2942
2943impl<S: emboss_runtime::Storage, ST: emboss_runtime::State> emboss_runtime::View for BdAddr<S, ST> {
2944    fn size_in_bytes(&self) -> core::result::Result<usize, emboss_runtime::Error> {
2945        let view = self;
2946        core::result::Result::Ok((6) as usize)
2947    }
2948}
2949
2950impl<S: emboss_runtime::MutStorage> emboss_runtime::View for BdAddrMut<S> {
2951    fn size_in_bytes(&self) -> core::result::Result<usize, emboss_runtime::Error> {
2952        let view = self.as_view();
2953        <BdAddr<S::Sliced<'_>, emboss_runtime::UncheckedState> as emboss_runtime::View>::size_in_bytes(&view)
2954    }
2955}
2956
2957impl<S: emboss_runtime::MutStorage, ST: emboss_runtime::State> emboss_runtime::View for BdAddrWriter<S, ST> {
2958    fn size_in_bytes(&self) -> core::result::Result<usize, emboss_runtime::Error> {
2959        let view = self.as_view();
2960        <BdAddr<S::Sliced<'_>, ST> as emboss_runtime::View>::size_in_bytes(&view)
2961    }
2962}
2963
2964impl<S: emboss_runtime::Storage> emboss_runtime::CheckComplete for BdAddr<S, emboss_runtime::UncheckedState> {
2965    type Completed = BdAddr<S, emboss_runtime::CompleteState>;
2966    fn check_complete(self) -> core::result::Result<Self::Completed, emboss_runtime::Error> {
2967        let required_size = <Self as emboss_runtime::View>::size_in_bytes(&self)?;
2968        if self.storage.len() < required_size {
2969            return core::result::Result::Err(emboss_runtime::Error::OutOfBounds);
2970        }
2971        core::result::Result::Ok(unsafe { BdAddr::new_in_state(self.storage) })
2972    }
2973}
2974
2975impl<S: emboss_runtime::MutStorage> emboss_runtime::CheckComplete for BdAddrWriter<S, emboss_runtime::UncheckedState> {
2976    type Completed = BdAddrWriter<S, emboss_runtime::CompleteState>;
2977    fn check_complete(self) -> core::result::Result<Self::Completed, emboss_runtime::Error> {
2978        let required_size = <Self as emboss_runtime::View>::size_in_bytes(&self)?;
2979        if self.storage.len() < required_size {
2980            return core::result::Result::Err(emboss_runtime::Error::OutOfBounds);
2981        }
2982        core::result::Result::Ok(unsafe { BdAddrWriter::new_in_state(self.storage) })
2983    }
2984}
2985
2986impl<S: emboss_runtime::Storage> emboss_runtime::CheckOk for BdAddr<S, emboss_runtime::UncheckedState> {
2987    type Ok = BdAddr<S, emboss_runtime::OkState>;
2988    fn check_ok(self) -> core::result::Result<Self::Ok, emboss_runtime::Error> {
2989        let completed = emboss_runtime::CheckComplete::check_complete(self)?;
2990        core::result::Result::Ok(unsafe { BdAddr::new_in_state(completed.into_storage()) })
2991    }
2992}
2993
2994impl<S: emboss_runtime::Storage> emboss_runtime::CheckOk for BdAddr<S, emboss_runtime::CompleteState> {
2995    type Ok = BdAddr<S, emboss_runtime::OkState>;
2996    fn check_ok(self) -> core::result::Result<Self::Ok, emboss_runtime::Error> {
2997        core::result::Result::Ok(unsafe { BdAddr::new_in_state(self.into_storage()) })
2998    }
2999}
3000
3001impl<S: emboss_runtime::Storage> emboss_runtime::CheckOk for BdAddr<S, emboss_runtime::OkState> {
3002    type Ok = BdAddr<S, emboss_runtime::OkState>;
3003    fn check_ok(self) -> core::result::Result<Self::Ok, emboss_runtime::Error> {
3004        core::result::Result::Ok(self)
3005    }
3006}
3007
3008impl<S: emboss_runtime::MutStorage> emboss_runtime::CheckOk for BdAddrWriter<S, emboss_runtime::UncheckedState> {
3009    type Ok = BdAddrWriter<S, emboss_runtime::OkState>;
3010    fn check_ok(self) -> core::result::Result<Self::Ok, emboss_runtime::Error> {
3011        let completed = emboss_runtime::CheckComplete::check_complete(self)?;
3012        core::result::Result::Ok(unsafe { BdAddrWriter::new_in_state(completed.into_storage()) })
3013    }
3014}
3015
3016impl<S: emboss_runtime::MutStorage> emboss_runtime::CheckOk for BdAddrWriter<S, emboss_runtime::CompleteState> {
3017    type Ok = BdAddrWriter<S, emboss_runtime::OkState>;
3018    fn check_ok(self) -> core::result::Result<Self::Ok, emboss_runtime::Error> {
3019        core::result::Result::Ok(unsafe { BdAddrWriter::new_in_state(self.into_storage()) })
3020    }
3021}
3022
3023impl<S: emboss_runtime::MutStorage> emboss_runtime::CheckOk for BdAddrWriter<S, emboss_runtime::OkState> {
3024    type Ok = BdAddrWriter<S, emboss_runtime::OkState>;
3025    fn check_ok(self) -> core::result::Result<Self::Ok, emboss_runtime::Error> {
3026        core::result::Result::Ok(self)
3027    }
3028}
3029
3030pub mod bd_addr {
3031    pub type View<S, ST = emboss_runtime::UncheckedState> = super::BdAddr<S, ST>;
3032    pub type ViewMut<S> = super::BdAddrMut<S>;
3033    pub type Writer<S, ST = emboss_runtime::UncheckedState> = super::BdAddrWriter<S, ST>;
3034
3035    pub const MIN_SIZE_IN_BYTES: usize = 6;
3036    pub const MAX_SIZE_IN_BYTES: usize = 6;
3037    pub const SIZE_IN_BYTES: usize = 6;
3038}#[derive(Copy, Clone, Debug, Eq, PartialEq)]
3039#[repr(u64)]
3040pub enum CommonDataType {
3041    FLAGS = 1,
3042    INCOMPLETE_LIST_16_BIT_SERVICE_CLASS_UUIDS = 2,
3043    COMPLETE_LIST_16_BIT_SERVICE_CLASS_UUIDS = 3,
3044    INCOMPLETE_LIST_32_BIT_SERVICE_CLASS_UUIDS = 4,
3045    COMPLETE_LIST_32_BIT_SERVICE_CLASS_UUIDS = 5,
3046    INCOMPLETE_LIST_128_BIT_SERVICE_CLASS_UUIDS = 6,
3047    COMPLETE_LIST_128_BIT_SERVICE_CLASS_UUIDS = 7,
3048    SHORTENED_LOCAL_NAME = 8,
3049    COMPLETE_LOCAL_NAME = 9,
3050    TX_POWER_LEVEL = 10,
3051    CLASS_OF_DEVICE = 13,
3052    SIMPLE_PAIRING_HASH_C_192 = 14,
3053    SIMPLE_PAIRING_RANDOMIZER_R_192 = 15,
3054    DEVICE_ID = 16,
3055    SECURITY_MANAGER_OUT_OF_BAND_FLAGS = 17,
3056    PERIPHERAL_CONNECTION_INTERVAL_RANGE = 18,
3057    LIST_16_BIT_SERVICE_SOLICITATION_UUIDS = 20,
3058    LIST_128_BIT_SERVICE_SOLICITATION_UUIDS = 21,
3059    SERVICE_DATA_16_BIT_UUID = 22,
3060    PUBLIC_TARGET_ADDRESS = 23,
3061    RANDOM_TARGET_ADDRESS = 24,
3062    APPEARANCE = 25,
3063    ADVERTISING_INTERVAL = 26,
3064    LE_BLUETOOTH_DEVICE_ADDRESS = 27,
3065    LE_ROLE = 28,
3066    SIMPLE_PAIRING_HASH_C_256 = 29,
3067    SIMPLE_PAIRING_RANDOMIZER_R_256 = 30,
3068    LIST_32_BIT_SERVICE_SOLICITATION_UUIDS = 31,
3069    SERVICE_DATA_32_BIT_UUID = 32,
3070    SERVICE_DATA_128_BIT_UUID = 33,
3071    LE_SECURE_CONNECTIONS_CONFIRMATION_VALUE = 34,
3072    LE_SECURE_CONNECTIONS_RANDOM_VALUE = 35,
3073    URI = 36,
3074    INDOOR_POSITIONING = 37,
3075    TRANSPORT_DISCOVERY_DATA = 38,
3076    LE_SUPPORTED_FEATURES = 39,
3077    CHANNEL_MAP_UPDATE_INFORMATION = 40,
3078    PB_ADV = 41,
3079    MESH_MESSAGE = 42,
3080    MESH_BEACON = 43,
3081    BIG_INFO = 44,
3082    BROADCAST_CODE = 45,
3083    RESOLVABLE_IDENTIFIER = 46,
3084    ADVERTISING_INTERVAL_LONG = 47,
3085    BROADCAST_NAME = 48,
3086    ENCRYPTED_ADVERTISING_DATA = 49,
3087    PERIODIC_ADVERTISING_RESPONSE_TIMING_INFORMATION = 50,
3088    ELECTRONIC_SHELF_LABEL = 52,
3089    INFORMATION_DATA_3D = 61,
3090    MANUFACTURER_SPECIFIC_DATA = 255,
3091
3092}
3093
3094impl core::convert::From<CommonDataType> for u8 { fn from(val: CommonDataType) -> Self { val as u8 } }
3095impl core::convert::From<CommonDataType> for u16 { fn from(val: CommonDataType) -> Self { val as u16 } }
3096impl core::convert::From<CommonDataType> for u32 { fn from(val: CommonDataType) -> Self { val as u32 } }
3097impl core::convert::From<CommonDataType> for u64 { fn from(val: CommonDataType) -> Self { val as u64 } }
3098impl core::convert::From<CommonDataType> for i8 { fn from(val: CommonDataType) -> Self { val as i8 } }
3099impl core::convert::From<CommonDataType> for i16 { fn from(val: CommonDataType) -> Self { val as i16 } }
3100impl core::convert::From<CommonDataType> for i32 { fn from(val: CommonDataType) -> Self { val as i32 } }
3101impl core::convert::From<CommonDataType> for i64 { fn from(val: CommonDataType) -> Self { val as i64 } }
3102
3103impl emboss_runtime::SafeCmp<CommonDataType> for CommonDataType {
3104    fn safe_eq(&self, other: Self) -> bool { *self == other }
3105    fn safe_less(&self, other: Self) -> bool { (*self as u64) < (other as u64) }
3106}
3107
3108impl emboss_runtime::SafeCmp<u64> for CommonDataType {
3109    fn safe_eq(&self, other: u64) -> bool { emboss_runtime::SafeCmp::safe_eq(&(*self as u64), other) }
3110    fn safe_less(&self, other: u64) -> bool { emboss_runtime::SafeCmp::safe_less(&(*self as u64), other) }
3111}
3112
3113impl emboss_runtime::SafeCmp<i64> for CommonDataType {
3114    fn safe_eq(&self, other: i64) -> bool { emboss_runtime::SafeCmp::safe_eq(&(*self as u64), other) }
3115    fn safe_less(&self, other: i64) -> bool { emboss_runtime::SafeCmp::safe_less(&(*self as u64), other) }
3116}
3117
3118impl emboss_runtime::SafeCmp<i32> for CommonDataType {
3119    fn safe_eq(&self, other: i32) -> bool { emboss_runtime::SafeCmp::safe_eq(&(*self as u64), other as i64) }
3120    fn safe_less(&self, other: i32) -> bool { emboss_runtime::SafeCmp::safe_less(&(*self as u64), other as i64) }
3121}
3122
3123impl emboss_runtime::SafeCmp<u32> for CommonDataType {
3124    fn safe_eq(&self, other: u32) -> bool { emboss_runtime::SafeCmp::safe_eq(&(*self as u64), other as u64) }
3125    fn safe_less(&self, other: u32) -> bool { emboss_runtime::SafeCmp::safe_less(&(*self as u64), other as u64) }
3126}
3127
3128impl emboss_runtime::SafeCmp<CommonDataType> for u64 {
3129    fn safe_eq(&self, other: CommonDataType) -> bool { emboss_runtime::SafeCmp::safe_eq(self, other as u64) }
3130    fn safe_less(&self, other: CommonDataType) -> bool { emboss_runtime::SafeCmp::safe_less(self, other as u64) }
3131}
3132
3133impl emboss_runtime::SafeCmp<CommonDataType> for i64 {
3134    fn safe_eq(&self, other: CommonDataType) -> bool { emboss_runtime::SafeCmp::safe_eq(self, other as u64) }
3135    fn safe_less(&self, other: CommonDataType) -> bool { emboss_runtime::SafeCmp::safe_less(self, other as u64) }
3136}
3137
3138impl<V: core::convert::Into<u64> + core::marker::Copy> emboss_runtime::TryFromRaw<V> for CommonDataType {
3139    fn try_from_raw(val: V) -> core::result::Result<Self, emboss_runtime::Error<V>> {
3140        let v_raw: u64 = val.into();
3141        match v_raw {
3142            1 => Ok(CommonDataType::FLAGS),
3143            2 => Ok(CommonDataType::INCOMPLETE_LIST_16_BIT_SERVICE_CLASS_UUIDS),
3144            3 => Ok(CommonDataType::COMPLETE_LIST_16_BIT_SERVICE_CLASS_UUIDS),
3145            4 => Ok(CommonDataType::INCOMPLETE_LIST_32_BIT_SERVICE_CLASS_UUIDS),
3146            5 => Ok(CommonDataType::COMPLETE_LIST_32_BIT_SERVICE_CLASS_UUIDS),
3147            6 => Ok(CommonDataType::INCOMPLETE_LIST_128_BIT_SERVICE_CLASS_UUIDS),
3148            7 => Ok(CommonDataType::COMPLETE_LIST_128_BIT_SERVICE_CLASS_UUIDS),
3149            8 => Ok(CommonDataType::SHORTENED_LOCAL_NAME),
3150            9 => Ok(CommonDataType::COMPLETE_LOCAL_NAME),
3151            10 => Ok(CommonDataType::TX_POWER_LEVEL),
3152            13 => Ok(CommonDataType::CLASS_OF_DEVICE),
3153            14 => Ok(CommonDataType::SIMPLE_PAIRING_HASH_C_192),
3154            15 => Ok(CommonDataType::SIMPLE_PAIRING_RANDOMIZER_R_192),
3155            16 => Ok(CommonDataType::DEVICE_ID),
3156            17 => Ok(CommonDataType::SECURITY_MANAGER_OUT_OF_BAND_FLAGS),
3157            18 => Ok(CommonDataType::PERIPHERAL_CONNECTION_INTERVAL_RANGE),
3158            20 => Ok(CommonDataType::LIST_16_BIT_SERVICE_SOLICITATION_UUIDS),
3159            21 => Ok(CommonDataType::LIST_128_BIT_SERVICE_SOLICITATION_UUIDS),
3160            22 => Ok(CommonDataType::SERVICE_DATA_16_BIT_UUID),
3161            23 => Ok(CommonDataType::PUBLIC_TARGET_ADDRESS),
3162            24 => Ok(CommonDataType::RANDOM_TARGET_ADDRESS),
3163            25 => Ok(CommonDataType::APPEARANCE),
3164            26 => Ok(CommonDataType::ADVERTISING_INTERVAL),
3165            27 => Ok(CommonDataType::LE_BLUETOOTH_DEVICE_ADDRESS),
3166            28 => Ok(CommonDataType::LE_ROLE),
3167            29 => Ok(CommonDataType::SIMPLE_PAIRING_HASH_C_256),
3168            30 => Ok(CommonDataType::SIMPLE_PAIRING_RANDOMIZER_R_256),
3169            31 => Ok(CommonDataType::LIST_32_BIT_SERVICE_SOLICITATION_UUIDS),
3170            32 => Ok(CommonDataType::SERVICE_DATA_32_BIT_UUID),
3171            33 => Ok(CommonDataType::SERVICE_DATA_128_BIT_UUID),
3172            34 => Ok(CommonDataType::LE_SECURE_CONNECTIONS_CONFIRMATION_VALUE),
3173            35 => Ok(CommonDataType::LE_SECURE_CONNECTIONS_RANDOM_VALUE),
3174            36 => Ok(CommonDataType::URI),
3175            37 => Ok(CommonDataType::INDOOR_POSITIONING),
3176            38 => Ok(CommonDataType::TRANSPORT_DISCOVERY_DATA),
3177            39 => Ok(CommonDataType::LE_SUPPORTED_FEATURES),
3178            40 => Ok(CommonDataType::CHANNEL_MAP_UPDATE_INFORMATION),
3179            41 => Ok(CommonDataType::PB_ADV),
3180            42 => Ok(CommonDataType::MESH_MESSAGE),
3181            43 => Ok(CommonDataType::MESH_BEACON),
3182            44 => Ok(CommonDataType::BIG_INFO),
3183            45 => Ok(CommonDataType::BROADCAST_CODE),
3184            46 => Ok(CommonDataType::RESOLVABLE_IDENTIFIER),
3185            47 => Ok(CommonDataType::ADVERTISING_INTERVAL_LONG),
3186            48 => Ok(CommonDataType::BROADCAST_NAME),
3187            49 => Ok(CommonDataType::ENCRYPTED_ADVERTISING_DATA),
3188            50 => Ok(CommonDataType::PERIODIC_ADVERTISING_RESPONSE_TIMING_INFORMATION),
3189            52 => Ok(CommonDataType::ELECTRONIC_SHELF_LABEL),
3190            61 => Ok(CommonDataType::INFORMATION_DATA_3D),
3191            255 => Ok(CommonDataType::MANUFACTURER_SPECIFIC_DATA),
3192
3193            _ => Err(emboss_runtime::Error::UnknownEnum(val)),
3194        }
3195    }
3196}
3197
3198impl CommonDataType {
3199
3200}
3201pub struct ClassOfDevice<S: emboss_runtime::Storage, ST: emboss_runtime::State = emboss_runtime::UncheckedState> {
3202    storage: S,
3203    _marker: core::marker::PhantomData<ST>,
3204}
3205
3206impl<S: emboss_runtime::Storage> ClassOfDevice<S, emboss_runtime::UncheckedState> {
3207    pub fn new(storage: S) -> Self {
3208        Self {
3209            storage,
3210            _marker: core::marker::PhantomData,
3211        }
3212    }
3213}
3214
3215impl<S: emboss_runtime::Storage + core::clone::Clone, ST: emboss_runtime::State> core::clone::Clone for ClassOfDevice<S, ST> {
3216    fn clone(&self) -> Self {
3217        Self {
3218            storage: self.storage.clone(),
3219            _marker: core::marker::PhantomData,
3220        }
3221    }
3222}
3223
3224impl<S: emboss_runtime::Storage, ST: emboss_runtime::State> ClassOfDevice<S, ST> {
3225    /**
3226     * Constructs a view in a specific typestate.
3227     *
3228     * # Safety
3229     *
3230     * The caller must ensure that `storage` satisfies the layout invariants for `ST`.
3231     */
3232    pub unsafe fn new_in_state(storage: S) -> Self {
3233        Self {
3234            storage,
3235            _marker: core::marker::PhantomData,
3236        }
3237    }
3238    pub fn into_storage(self) -> S {
3239        self.storage
3240    }
3241    pub fn zero(&self) -> emboss_runtime::BitUInt<2, 0, emboss_runtime::Null, S::Sliced<'_>, ST> {
3242        let len = (1) as usize; // Total struct size in bytes
3243        let storage = self.storage.slice(0, len);
3244        emboss_runtime::BitUInt::<2, 0, emboss_runtime::Null, S::Sliced<'_>, ST>::new(storage)
3245    }
3246    pub fn major_device_class(&self) -> emboss_runtime::EnumView<MajorDeviceClass, emboss_runtime::BitUInt<5, 8, emboss_runtime::Null, S::Sliced<'_>, ST>> {
3247        let len = (2) as usize;
3248        let storage = self.storage.slice(0, len);
3249        emboss_runtime::EnumView::new(emboss_runtime::BitUInt::new(storage))
3250    }
3251    pub fn major_service_classes(&self) -> MajorServiceClasses<S::Sliced<'_>, emboss_runtime::UncheckedState> {
3252        let (offset, len) = (|| -> core::result::Result<(usize, usize), emboss_runtime::Error> {
3253            let offset = (13) as usize;
3254            let len = (11) as usize;
3255            core::result::Result::Ok((offset, len))
3256        })().unwrap_or((usize::MAX, 0));
3257        let storage = self.storage.slice(offset, len);
3258        unsafe { MajorServiceClasses::<S::Sliced<'_>, emboss_runtime::UncheckedState>::new_in_state(storage) }
3259    }
3260
3261}
3262
3263pub struct ClassOfDeviceMut<S: emboss_runtime::MutStorage> {
3264    storage: S,
3265}
3266
3267impl<S: emboss_runtime::MutStorage> ClassOfDeviceMut<S> {
3268    pub fn new(storage: S) -> Self {
3269        Self {
3270            storage,
3271        }
3272    }
3273    pub fn into_writer(self) -> ClassOfDeviceWriter<S, emboss_runtime::UncheckedState> {
3274        ClassOfDeviceWriter::new(self.storage)
3275    }
3276    /** Borrows the mutable view as an immutable view in UncheckedState. */
3277    pub fn as_view(&self) -> ClassOfDevice<S::Sliced<'_>, emboss_runtime::UncheckedState> {
3278        unsafe { ClassOfDevice::new_in_state(self.storage.slice(0, self.storage.len())) }
3279    }
3280    pub fn zero(&mut self) -> emboss_runtime::BitUInt<2, 0, emboss_runtime::Null, S::SlicedMut<'_>, emboss_runtime::UncheckedState> {
3281        let len = (1) as usize;
3282        let storage = self.storage.slice_mut(0, len);
3283        emboss_runtime::BitUInt::<2, 0, emboss_runtime::Null, S::SlicedMut<'_>, emboss_runtime::UncheckedState>::new(storage)
3284    }
3285    pub fn major_device_class(&mut self) -> emboss_runtime::EnumViewMut<MajorDeviceClass, emboss_runtime::BitUInt<5, 8, emboss_runtime::Null, S::SlicedMut<'_>, emboss_runtime::UncheckedState>> {
3286        let len = (2) as usize;
3287        let storage = self.storage.slice_mut(0, len);
3288        emboss_runtime::EnumViewMut::new(emboss_runtime::BitUInt::new(storage))
3289    }
3290    pub fn major_service_classes(&mut self) -> MajorServiceClassesMut<S::SlicedMut<'_>> {
3291        let (offset, len) = (|| -> core::result::Result<(usize, usize), emboss_runtime::Error> {
3292            let offset = (13) as usize;
3293            let len = (11) as usize;
3294            core::result::Result::Ok((offset, len))
3295        })().unwrap_or((usize::MAX, 0));
3296        let storage = self.storage.slice_mut(offset, len);
3297        MajorServiceClassesMut::<S::SlicedMut<'_>>::new(storage)
3298    }
3299
3300}
3301
3302impl<S: emboss_runtime::MutStorage> emboss_runtime::IntoWriter for ClassOfDeviceMut<S> {
3303    type Writer = ClassOfDeviceWriter<S, emboss_runtime::UncheckedState>;
3304    fn into_writer(self) -> Self::Writer {
3305        ClassOfDeviceWriter::new(self.storage)
3306    }
3307}
3308
3309pub struct ClassOfDeviceWriter<S: emboss_runtime::MutStorage, ST: emboss_runtime::State = emboss_runtime::UncheckedState> {
3310    storage: S,
3311    _marker: core::marker::PhantomData<ST>,
3312}
3313
3314impl<S: emboss_runtime::MutStorage> ClassOfDeviceWriter<S, emboss_runtime::UncheckedState> {
3315    pub fn new(storage: S) -> Self {
3316        Self {
3317            storage,
3318            _marker: core::marker::PhantomData,
3319        }
3320    }
3321}
3322
3323impl<S: emboss_runtime::MutStorage, ST: emboss_runtime::State> ClassOfDeviceWriter<S, ST> {
3324    /**
3325     * Constructs a writer in a specific typestate.
3326     *
3327     * # Safety
3328     *
3329     * The caller must ensure that `storage` satisfies the layout invariants for `ST`.
3330     */
3331    pub unsafe fn new_in_state(storage: S) -> Self {
3332        Self {
3333            storage,
3334            _marker: core::marker::PhantomData,
3335        }
3336    }
3337    pub fn into_storage(self) -> S {
3338        self.storage
3339    }
3340    /** Converts the writer into an immutable view in the same typestate. */
3341    pub fn into_view(self) -> ClassOfDevice<S, ST> {
3342        unsafe { ClassOfDevice::new_in_state(self.storage) }
3343    }
3344    /** Borrows the writer as an immutable view in the same typestate. */
3345    pub fn as_view(&self) -> ClassOfDevice<S::Sliced<'_>, ST> {
3346        unsafe { ClassOfDevice::new_in_state(self.storage.slice(0, self.storage.len())) }
3347    }
3348
3349}
3350
3351impl<S: emboss_runtime::Storage, ST: emboss_runtime::State> emboss_runtime::View for ClassOfDevice<S, ST> {
3352    fn size_in_bytes(&self) -> core::result::Result<usize, emboss_runtime::Error> {
3353        let view = self;
3354        core::result::Result::Ok((((core::cmp::max((core::cmp::max((core::cmp::max((core::cmp::max((core::cmp::max((core::cmp::max((core::cmp::max((core::cmp::max((core::cmp::max((core::cmp::max((core::cmp::max((core::cmp::max((0) as i64, (2) as i64)
3355) as i64, ((if emboss_runtime::SafeCmp::safe_eq(&(({ let val = view.major_device_class().try_read().map_err(|e| match e { emboss_runtime::Error::OutOfBounds => emboss_runtime::Error::OutOfBounds, emboss_runtime::Error::UnknownEnum(_) => emboss_runtime::Error::UnknownEnum(()) })?; val })
3356), (1) as u64)
3357 { 8 } else { 0 })
3358
3359) as i64)
3360) as i64, ((if emboss_runtime::SafeCmp::safe_eq(&(({ let val = view.major_device_class().try_read().map_err(|e| match e { emboss_runtime::Error::OutOfBounds => emboss_runtime::Error::OutOfBounds, emboss_runtime::Error::UnknownEnum(_) => emboss_runtime::Error::UnknownEnum(()) })?; val })
3361), (2) as u64)
3362 { 8 } else { 0 })
3363
3364) as i64)
3365) as i64, ((if emboss_runtime::SafeCmp::safe_eq(&(({ let val = view.major_device_class().try_read().map_err(|e| match e { emboss_runtime::Error::OutOfBounds => emboss_runtime::Error::OutOfBounds, emboss_runtime::Error::UnknownEnum(_) => emboss_runtime::Error::UnknownEnum(()) })?; val })
3366), (3) as u64)
3367 { 8 } else { 0 })
3368
3369) as i64)
3370) as i64, ((if emboss_runtime::SafeCmp::safe_eq(&(({ let val = view.major_device_class().try_read().map_err(|e| match e { emboss_runtime::Error::OutOfBounds => emboss_runtime::Error::OutOfBounds, emboss_runtime::Error::UnknownEnum(_) => emboss_runtime::Error::UnknownEnum(()) })?; val })
3371), (4) as u64)
3372 { 8 } else { 0 })
3373
3374) as i64)
3375) as i64, ((if emboss_runtime::SafeCmp::safe_eq(&(({ let val = view.major_device_class().try_read().map_err(|e| match e { emboss_runtime::Error::OutOfBounds => emboss_runtime::Error::OutOfBounds, emboss_runtime::Error::UnknownEnum(_) => emboss_runtime::Error::UnknownEnum(()) })?; val })
3376), (5) as u64)
3377 { 8 } else { 0 })
3378
3379) as i64)
3380) as i64, ((if emboss_runtime::SafeCmp::safe_eq(&(({ let val = view.major_device_class().try_read().map_err(|e| match e { emboss_runtime::Error::OutOfBounds => emboss_runtime::Error::OutOfBounds, emboss_runtime::Error::UnknownEnum(_) => emboss_runtime::Error::UnknownEnum(()) })?; val })
3381), (6) as u64)
3382 { 8 } else { 0 })
3383
3384) as i64)
3385) as i64, ((if emboss_runtime::SafeCmp::safe_eq(&(({ let val = view.major_device_class().try_read().map_err(|e| match e { emboss_runtime::Error::OutOfBounds => emboss_runtime::Error::OutOfBounds, emboss_runtime::Error::UnknownEnum(_) => emboss_runtime::Error::UnknownEnum(()) })?; val })
3386), (7) as u64)
3387 { 8 } else { 0 })
3388
3389) as i64)
3390) as i64, ((if emboss_runtime::SafeCmp::safe_eq(&(({ let val = view.major_device_class().try_read().map_err(|e| match e { emboss_runtime::Error::OutOfBounds => emboss_runtime::Error::OutOfBounds, emboss_runtime::Error::UnknownEnum(_) => emboss_runtime::Error::UnknownEnum(()) })?; val })
3391), (8) as u64)
3392 { 8 } else { 0 })
3393
3394) as i64)
3395) as i64, ((if emboss_runtime::SafeCmp::safe_eq(&(({ let val = view.major_device_class().try_read().map_err(|e| match e { emboss_runtime::Error::OutOfBounds => emboss_runtime::Error::OutOfBounds, emboss_runtime::Error::UnknownEnum(_) => emboss_runtime::Error::UnknownEnum(()) })?; val })
3396), (9) as u64)
3397 { 8 } else { 0 })
3398
3399) as i64)
3400) as i64, (13) as i64)
3401) as i64, (24) as i64)
3402) + 7) / 8) as usize)
3403    }
3404}
3405
3406impl<S: emboss_runtime::MutStorage> emboss_runtime::View for ClassOfDeviceMut<S> {
3407    fn size_in_bytes(&self) -> core::result::Result<usize, emboss_runtime::Error> {
3408        let view = self.as_view();
3409        <ClassOfDevice<S::Sliced<'_>, emboss_runtime::UncheckedState> as emboss_runtime::View>::size_in_bytes(&view)
3410    }
3411}
3412
3413impl<S: emboss_runtime::MutStorage, ST: emboss_runtime::State> emboss_runtime::View for ClassOfDeviceWriter<S, ST> {
3414    fn size_in_bytes(&self) -> core::result::Result<usize, emboss_runtime::Error> {
3415        let view = self.as_view();
3416        <ClassOfDevice<S::Sliced<'_>, ST> as emboss_runtime::View>::size_in_bytes(&view)
3417    }
3418}
3419
3420impl<S: emboss_runtime::Storage> emboss_runtime::CheckComplete for ClassOfDevice<S, emboss_runtime::UncheckedState> {
3421    type Completed = ClassOfDevice<S, emboss_runtime::CompleteState>;
3422    fn check_complete(self) -> core::result::Result<Self::Completed, emboss_runtime::Error> {
3423        let required_size = <Self as emboss_runtime::View>::size_in_bytes(&self)?;
3424        if self.storage.len() < required_size {
3425            return core::result::Result::Err(emboss_runtime::Error::OutOfBounds);
3426        }
3427        core::result::Result::Ok(unsafe { ClassOfDevice::new_in_state(self.storage) })
3428    }
3429}
3430
3431impl<S: emboss_runtime::MutStorage> emboss_runtime::CheckComplete for ClassOfDeviceWriter<S, emboss_runtime::UncheckedState> {
3432    type Completed = ClassOfDeviceWriter<S, emboss_runtime::CompleteState>;
3433    fn check_complete(self) -> core::result::Result<Self::Completed, emboss_runtime::Error> {
3434        let required_size = <Self as emboss_runtime::View>::size_in_bytes(&self)?;
3435        if self.storage.len() < required_size {
3436            return core::result::Result::Err(emboss_runtime::Error::OutOfBounds);
3437        }
3438        core::result::Result::Ok(unsafe { ClassOfDeviceWriter::new_in_state(self.storage) })
3439    }
3440}
3441
3442impl<S: emboss_runtime::Storage> emboss_runtime::CheckOk for ClassOfDevice<S, emboss_runtime::UncheckedState> {
3443    type Ok = ClassOfDevice<S, emboss_runtime::OkState>;
3444    fn check_ok(self) -> core::result::Result<Self::Ok, emboss_runtime::Error> {
3445        let completed = emboss_runtime::CheckComplete::check_complete(self)?;
3446        core::result::Result::Ok(unsafe { ClassOfDevice::new_in_state(completed.into_storage()) })
3447    }
3448}
3449
3450impl<S: emboss_runtime::Storage> emboss_runtime::CheckOk for ClassOfDevice<S, emboss_runtime::CompleteState> {
3451    type Ok = ClassOfDevice<S, emboss_runtime::OkState>;
3452    fn check_ok(self) -> core::result::Result<Self::Ok, emboss_runtime::Error> {
3453        core::result::Result::Ok(unsafe { ClassOfDevice::new_in_state(self.into_storage()) })
3454    }
3455}
3456
3457impl<S: emboss_runtime::Storage> emboss_runtime::CheckOk for ClassOfDevice<S, emboss_runtime::OkState> {
3458    type Ok = ClassOfDevice<S, emboss_runtime::OkState>;
3459    fn check_ok(self) -> core::result::Result<Self::Ok, emboss_runtime::Error> {
3460        core::result::Result::Ok(self)
3461    }
3462}
3463
3464impl<S: emboss_runtime::MutStorage> emboss_runtime::CheckOk for ClassOfDeviceWriter<S, emboss_runtime::UncheckedState> {
3465    type Ok = ClassOfDeviceWriter<S, emboss_runtime::OkState>;
3466    fn check_ok(self) -> core::result::Result<Self::Ok, emboss_runtime::Error> {
3467        let completed = emboss_runtime::CheckComplete::check_complete(self)?;
3468        core::result::Result::Ok(unsafe { ClassOfDeviceWriter::new_in_state(completed.into_storage()) })
3469    }
3470}
3471
3472impl<S: emboss_runtime::MutStorage> emboss_runtime::CheckOk for ClassOfDeviceWriter<S, emboss_runtime::CompleteState> {
3473    type Ok = ClassOfDeviceWriter<S, emboss_runtime::OkState>;
3474    fn check_ok(self) -> core::result::Result<Self::Ok, emboss_runtime::Error> {
3475        core::result::Result::Ok(unsafe { ClassOfDeviceWriter::new_in_state(self.into_storage()) })
3476    }
3477}
3478
3479impl<S: emboss_runtime::MutStorage> emboss_runtime::CheckOk for ClassOfDeviceWriter<S, emboss_runtime::OkState> {
3480    type Ok = ClassOfDeviceWriter<S, emboss_runtime::OkState>;
3481    fn check_ok(self) -> core::result::Result<Self::Ok, emboss_runtime::Error> {
3482        core::result::Result::Ok(self)
3483    }
3484}
3485
3486pub mod class_of_device {
3487    pub type View<S, ST = emboss_runtime::UncheckedState> = super::ClassOfDevice<S, ST>;
3488    pub type ViewMut<S> = super::ClassOfDeviceMut<S>;
3489    pub type Writer<S, ST = emboss_runtime::UncheckedState> = super::ClassOfDeviceWriter<S, ST>;
3490
3491    pub const MIN_SIZE_IN_BYTES: usize = 3;
3492    pub const MAX_SIZE_IN_BYTES: usize = 3;
3493    pub const SIZE_IN_BYTES: usize = 3;
3494}pub struct ScanEnableBits<S: emboss_runtime::Storage, ST: emboss_runtime::State = emboss_runtime::UncheckedState> {
3495    storage: S,
3496    _marker: core::marker::PhantomData<ST>,
3497}
3498
3499impl<S: emboss_runtime::Storage> ScanEnableBits<S, emboss_runtime::UncheckedState> {
3500    pub fn new(storage: S) -> Self {
3501        Self {
3502            storage,
3503            _marker: core::marker::PhantomData,
3504        }
3505    }
3506}
3507
3508impl<S: emboss_runtime::Storage + core::clone::Clone, ST: emboss_runtime::State> core::clone::Clone for ScanEnableBits<S, ST> {
3509    fn clone(&self) -> Self {
3510        Self {
3511            storage: self.storage.clone(),
3512            _marker: core::marker::PhantomData,
3513        }
3514    }
3515}
3516
3517impl<S: emboss_runtime::Storage, ST: emboss_runtime::State> ScanEnableBits<S, ST> {
3518    /**
3519     * Constructs a view in a specific typestate.
3520     *
3521     * # Safety
3522     *
3523     * The caller must ensure that `storage` satisfies the layout invariants for `ST`.
3524     */
3525    pub unsafe fn new_in_state(storage: S) -> Self {
3526        Self {
3527            storage,
3528            _marker: core::marker::PhantomData,
3529        }
3530    }
3531    pub fn into_storage(self) -> S {
3532        self.storage
3533    }
3534    pub fn inquiry(&self) -> emboss_runtime::BitFlag<1, 0, emboss_runtime::Null, S::Sliced<'_>, ST> {
3535        let len = (1) as usize; // Total struct size in bytes
3536        let storage = self.storage.slice(0, len);
3537        emboss_runtime::BitFlag::<1, 0, emboss_runtime::Null, S::Sliced<'_>, ST>::new(storage)
3538    }
3539    pub fn page(&self) -> emboss_runtime::BitFlag<1, 1, emboss_runtime::Null, S::Sliced<'_>, ST> {
3540        let len = (1) as usize; // Total struct size in bytes
3541        let storage = self.storage.slice(0, len);
3542        emboss_runtime::BitFlag::<1, 1, emboss_runtime::Null, S::Sliced<'_>, ST>::new(storage)
3543    }
3544
3545}
3546
3547pub struct ScanEnableBitsMut<S: emboss_runtime::MutStorage> {
3548    storage: S,
3549}
3550
3551impl<S: emboss_runtime::MutStorage> ScanEnableBitsMut<S> {
3552    pub fn new(storage: S) -> Self {
3553        Self {
3554            storage,
3555        }
3556    }
3557    pub fn into_writer(self) -> ScanEnableBitsWriter<S, emboss_runtime::UncheckedState> {
3558        ScanEnableBitsWriter::new(self.storage)
3559    }
3560    /** Borrows the mutable view as an immutable view in UncheckedState. */
3561    pub fn as_view(&self) -> ScanEnableBits<S::Sliced<'_>, emboss_runtime::UncheckedState> {
3562        unsafe { ScanEnableBits::new_in_state(self.storage.slice(0, self.storage.len())) }
3563    }
3564    pub fn inquiry(&mut self) -> emboss_runtime::BitFlag<1, 0, emboss_runtime::Null, S::SlicedMut<'_>, emboss_runtime::UncheckedState> {
3565        let len = (1) as usize;
3566        let storage = self.storage.slice_mut(0, len);
3567        emboss_runtime::BitFlag::<1, 0, emboss_runtime::Null, S::SlicedMut<'_>, emboss_runtime::UncheckedState>::new(storage)
3568    }
3569    pub fn page(&mut self) -> emboss_runtime::BitFlag<1, 1, emboss_runtime::Null, S::SlicedMut<'_>, emboss_runtime::UncheckedState> {
3570        let len = (1) as usize;
3571        let storage = self.storage.slice_mut(0, len);
3572        emboss_runtime::BitFlag::<1, 1, emboss_runtime::Null, S::SlicedMut<'_>, emboss_runtime::UncheckedState>::new(storage)
3573    }
3574
3575}
3576
3577impl<S: emboss_runtime::MutStorage> emboss_runtime::IntoWriter for ScanEnableBitsMut<S> {
3578    type Writer = ScanEnableBitsWriter<S, emboss_runtime::UncheckedState>;
3579    fn into_writer(self) -> Self::Writer {
3580        ScanEnableBitsWriter::new(self.storage)
3581    }
3582}
3583
3584pub struct ScanEnableBitsWriter<S: emboss_runtime::MutStorage, ST: emboss_runtime::State = emboss_runtime::UncheckedState> {
3585    storage: S,
3586    _marker: core::marker::PhantomData<ST>,
3587}
3588
3589impl<S: emboss_runtime::MutStorage> ScanEnableBitsWriter<S, emboss_runtime::UncheckedState> {
3590    pub fn new(storage: S) -> Self {
3591        Self {
3592            storage,
3593            _marker: core::marker::PhantomData,
3594        }
3595    }
3596}
3597
3598impl<S: emboss_runtime::MutStorage, ST: emboss_runtime::State> ScanEnableBitsWriter<S, ST> {
3599    /**
3600     * Constructs a writer in a specific typestate.
3601     *
3602     * # Safety
3603     *
3604     * The caller must ensure that `storage` satisfies the layout invariants for `ST`.
3605     */
3606    pub unsafe fn new_in_state(storage: S) -> Self {
3607        Self {
3608            storage,
3609            _marker: core::marker::PhantomData,
3610        }
3611    }
3612    pub fn into_storage(self) -> S {
3613        self.storage
3614    }
3615    /** Converts the writer into an immutable view in the same typestate. */
3616    pub fn into_view(self) -> ScanEnableBits<S, ST> {
3617        unsafe { ScanEnableBits::new_in_state(self.storage) }
3618    }
3619    /** Borrows the writer as an immutable view in the same typestate. */
3620    pub fn as_view(&self) -> ScanEnableBits<S::Sliced<'_>, ST> {
3621        unsafe { ScanEnableBits::new_in_state(self.storage.slice(0, self.storage.len())) }
3622    }
3623
3624}
3625
3626impl<S: emboss_runtime::Storage, ST: emboss_runtime::State> emboss_runtime::View for ScanEnableBits<S, ST> {
3627    fn size_in_bytes(&self) -> core::result::Result<usize, emboss_runtime::Error> {
3628        let view = self;
3629        core::result::Result::Ok((((2) + 7) / 8) as usize)
3630    }
3631}
3632
3633impl<S: emboss_runtime::MutStorage> emboss_runtime::View for ScanEnableBitsMut<S> {
3634    fn size_in_bytes(&self) -> core::result::Result<usize, emboss_runtime::Error> {
3635        let view = self.as_view();
3636        <ScanEnableBits<S::Sliced<'_>, emboss_runtime::UncheckedState> as emboss_runtime::View>::size_in_bytes(&view)
3637    }
3638}
3639
3640impl<S: emboss_runtime::MutStorage, ST: emboss_runtime::State> emboss_runtime::View for ScanEnableBitsWriter<S, ST> {
3641    fn size_in_bytes(&self) -> core::result::Result<usize, emboss_runtime::Error> {
3642        let view = self.as_view();
3643        <ScanEnableBits<S::Sliced<'_>, ST> as emboss_runtime::View>::size_in_bytes(&view)
3644    }
3645}
3646
3647impl<S: emboss_runtime::Storage> emboss_runtime::CheckComplete for ScanEnableBits<S, emboss_runtime::UncheckedState> {
3648    type Completed = ScanEnableBits<S, emboss_runtime::CompleteState>;
3649    fn check_complete(self) -> core::result::Result<Self::Completed, emboss_runtime::Error> {
3650        let required_size = <Self as emboss_runtime::View>::size_in_bytes(&self)?;
3651        if self.storage.len() < required_size {
3652            return core::result::Result::Err(emboss_runtime::Error::OutOfBounds);
3653        }
3654        core::result::Result::Ok(unsafe { ScanEnableBits::new_in_state(self.storage) })
3655    }
3656}
3657
3658impl<S: emboss_runtime::MutStorage> emboss_runtime::CheckComplete for ScanEnableBitsWriter<S, emboss_runtime::UncheckedState> {
3659    type Completed = ScanEnableBitsWriter<S, emboss_runtime::CompleteState>;
3660    fn check_complete(self) -> core::result::Result<Self::Completed, emboss_runtime::Error> {
3661        let required_size = <Self as emboss_runtime::View>::size_in_bytes(&self)?;
3662        if self.storage.len() < required_size {
3663            return core::result::Result::Err(emboss_runtime::Error::OutOfBounds);
3664        }
3665        core::result::Result::Ok(unsafe { ScanEnableBitsWriter::new_in_state(self.storage) })
3666    }
3667}
3668
3669impl<S: emboss_runtime::Storage> emboss_runtime::CheckOk for ScanEnableBits<S, emboss_runtime::UncheckedState> {
3670    type Ok = ScanEnableBits<S, emboss_runtime::OkState>;
3671    fn check_ok(self) -> core::result::Result<Self::Ok, emboss_runtime::Error> {
3672        let completed = emboss_runtime::CheckComplete::check_complete(self)?;
3673        core::result::Result::Ok(unsafe { ScanEnableBits::new_in_state(completed.into_storage()) })
3674    }
3675}
3676
3677impl<S: emboss_runtime::Storage> emboss_runtime::CheckOk for ScanEnableBits<S, emboss_runtime::CompleteState> {
3678    type Ok = ScanEnableBits<S, emboss_runtime::OkState>;
3679    fn check_ok(self) -> core::result::Result<Self::Ok, emboss_runtime::Error> {
3680        core::result::Result::Ok(unsafe { ScanEnableBits::new_in_state(self.into_storage()) })
3681    }
3682}
3683
3684impl<S: emboss_runtime::Storage> emboss_runtime::CheckOk for ScanEnableBits<S, emboss_runtime::OkState> {
3685    type Ok = ScanEnableBits<S, emboss_runtime::OkState>;
3686    fn check_ok(self) -> core::result::Result<Self::Ok, emboss_runtime::Error> {
3687        core::result::Result::Ok(self)
3688    }
3689}
3690
3691impl<S: emboss_runtime::MutStorage> emboss_runtime::CheckOk for ScanEnableBitsWriter<S, emboss_runtime::UncheckedState> {
3692    type Ok = ScanEnableBitsWriter<S, emboss_runtime::OkState>;
3693    fn check_ok(self) -> core::result::Result<Self::Ok, emboss_runtime::Error> {
3694        let completed = emboss_runtime::CheckComplete::check_complete(self)?;
3695        core::result::Result::Ok(unsafe { ScanEnableBitsWriter::new_in_state(completed.into_storage()) })
3696    }
3697}
3698
3699impl<S: emboss_runtime::MutStorage> emboss_runtime::CheckOk for ScanEnableBitsWriter<S, emboss_runtime::CompleteState> {
3700    type Ok = ScanEnableBitsWriter<S, emboss_runtime::OkState>;
3701    fn check_ok(self) -> core::result::Result<Self::Ok, emboss_runtime::Error> {
3702        core::result::Result::Ok(unsafe { ScanEnableBitsWriter::new_in_state(self.into_storage()) })
3703    }
3704}
3705
3706impl<S: emboss_runtime::MutStorage> emboss_runtime::CheckOk for ScanEnableBitsWriter<S, emboss_runtime::OkState> {
3707    type Ok = ScanEnableBitsWriter<S, emboss_runtime::OkState>;
3708    fn check_ok(self) -> core::result::Result<Self::Ok, emboss_runtime::Error> {
3709        core::result::Result::Ok(self)
3710    }
3711}
3712
3713pub mod scan_enable_bits {
3714    pub type View<S, ST = emboss_runtime::UncheckedState> = super::ScanEnableBits<S, ST>;
3715    pub type ViewMut<S> = super::ScanEnableBitsMut<S>;
3716    pub type Writer<S, ST = emboss_runtime::UncheckedState> = super::ScanEnableBitsWriter<S, ST>;
3717
3718    pub const MIN_SIZE_IN_BYTES: usize = 1;
3719    pub const MAX_SIZE_IN_BYTES: usize = 1;
3720    pub const SIZE_IN_BYTES: usize = 1;
3721}#[derive(Copy, Clone, Debug, Eq, PartialEq)]
3722#[repr(u64)]
3723pub enum ConnectionRole {
3724    CENTRAL = 0,
3725    PERIPHERAL = 1,
3726
3727}
3728
3729impl core::convert::From<ConnectionRole> for u8 { fn from(val: ConnectionRole) -> Self { val as u8 } }
3730impl core::convert::From<ConnectionRole> for u16 { fn from(val: ConnectionRole) -> Self { val as u16 } }
3731impl core::convert::From<ConnectionRole> for u32 { fn from(val: ConnectionRole) -> Self { val as u32 } }
3732impl core::convert::From<ConnectionRole> for u64 { fn from(val: ConnectionRole) -> Self { val as u64 } }
3733impl core::convert::From<ConnectionRole> for i8 { fn from(val: ConnectionRole) -> Self { val as i8 } }
3734impl core::convert::From<ConnectionRole> for i16 { fn from(val: ConnectionRole) -> Self { val as i16 } }
3735impl core::convert::From<ConnectionRole> for i32 { fn from(val: ConnectionRole) -> Self { val as i32 } }
3736impl core::convert::From<ConnectionRole> for i64 { fn from(val: ConnectionRole) -> Self { val as i64 } }
3737
3738impl emboss_runtime::SafeCmp<ConnectionRole> for ConnectionRole {
3739    fn safe_eq(&self, other: Self) -> bool { *self == other }
3740    fn safe_less(&self, other: Self) -> bool { (*self as u64) < (other as u64) }
3741}
3742
3743impl emboss_runtime::SafeCmp<u64> for ConnectionRole {
3744    fn safe_eq(&self, other: u64) -> bool { emboss_runtime::SafeCmp::safe_eq(&(*self as u64), other) }
3745    fn safe_less(&self, other: u64) -> bool { emboss_runtime::SafeCmp::safe_less(&(*self as u64), other) }
3746}
3747
3748impl emboss_runtime::SafeCmp<i64> for ConnectionRole {
3749    fn safe_eq(&self, other: i64) -> bool { emboss_runtime::SafeCmp::safe_eq(&(*self as u64), other) }
3750    fn safe_less(&self, other: i64) -> bool { emboss_runtime::SafeCmp::safe_less(&(*self as u64), other) }
3751}
3752
3753impl emboss_runtime::SafeCmp<i32> for ConnectionRole {
3754    fn safe_eq(&self, other: i32) -> bool { emboss_runtime::SafeCmp::safe_eq(&(*self as u64), other as i64) }
3755    fn safe_less(&self, other: i32) -> bool { emboss_runtime::SafeCmp::safe_less(&(*self as u64), other as i64) }
3756}
3757
3758impl emboss_runtime::SafeCmp<u32> for ConnectionRole {
3759    fn safe_eq(&self, other: u32) -> bool { emboss_runtime::SafeCmp::safe_eq(&(*self as u64), other as u64) }
3760    fn safe_less(&self, other: u32) -> bool { emboss_runtime::SafeCmp::safe_less(&(*self as u64), other as u64) }
3761}
3762
3763impl emboss_runtime::SafeCmp<ConnectionRole> for u64 {
3764    fn safe_eq(&self, other: ConnectionRole) -> bool { emboss_runtime::SafeCmp::safe_eq(self, other as u64) }
3765    fn safe_less(&self, other: ConnectionRole) -> bool { emboss_runtime::SafeCmp::safe_less(self, other as u64) }
3766}
3767
3768impl emboss_runtime::SafeCmp<ConnectionRole> for i64 {
3769    fn safe_eq(&self, other: ConnectionRole) -> bool { emboss_runtime::SafeCmp::safe_eq(self, other as u64) }
3770    fn safe_less(&self, other: ConnectionRole) -> bool { emboss_runtime::SafeCmp::safe_less(self, other as u64) }
3771}
3772
3773impl<V: core::convert::Into<u64> + core::marker::Copy> emboss_runtime::TryFromRaw<V> for ConnectionRole {
3774    fn try_from_raw(val: V) -> core::result::Result<Self, emboss_runtime::Error<V>> {
3775        let v_raw: u64 = val.into();
3776        match v_raw {
3777            0 => Ok(ConnectionRole::CENTRAL),
3778            1 => Ok(ConnectionRole::PERIPHERAL),
3779
3780            _ => Err(emboss_runtime::Error::UnknownEnum(val)),
3781        }
3782    }
3783}
3784
3785impl ConnectionRole {
3786
3787}
3788#[derive(Copy, Clone, Debug, Eq, PartialEq)]
3789#[repr(u64)]
3790pub enum LEAdvertisingType {
3791    CONNECTABLE_AND_SCANNABLE_UNDIRECTED = 0,
3792    CONNECTABLE_HIGH_DUTY_CYCLE_DIRECTED = 1,
3793    SCANNABLE_UNDIRECTED = 2,
3794    NOT_CONNECTABLE_UNDIRECTED = 3,
3795    CONNECTABLE_LOW_DUTY_CYCLE_DIRECTED = 4,
3796
3797}
3798
3799impl core::convert::From<LEAdvertisingType> for u8 { fn from(val: LEAdvertisingType) -> Self { val as u8 } }
3800impl core::convert::From<LEAdvertisingType> for u16 { fn from(val: LEAdvertisingType) -> Self { val as u16 } }
3801impl core::convert::From<LEAdvertisingType> for u32 { fn from(val: LEAdvertisingType) -> Self { val as u32 } }
3802impl core::convert::From<LEAdvertisingType> for u64 { fn from(val: LEAdvertisingType) -> Self { val as u64 } }
3803impl core::convert::From<LEAdvertisingType> for i8 { fn from(val: LEAdvertisingType) -> Self { val as i8 } }
3804impl core::convert::From<LEAdvertisingType> for i16 { fn from(val: LEAdvertisingType) -> Self { val as i16 } }
3805impl core::convert::From<LEAdvertisingType> for i32 { fn from(val: LEAdvertisingType) -> Self { val as i32 } }
3806impl core::convert::From<LEAdvertisingType> for i64 { fn from(val: LEAdvertisingType) -> Self { val as i64 } }
3807
3808impl emboss_runtime::SafeCmp<LEAdvertisingType> for LEAdvertisingType {
3809    fn safe_eq(&self, other: Self) -> bool { *self == other }
3810    fn safe_less(&self, other: Self) -> bool { (*self as u64) < (other as u64) }
3811}
3812
3813impl emboss_runtime::SafeCmp<u64> for LEAdvertisingType {
3814    fn safe_eq(&self, other: u64) -> bool { emboss_runtime::SafeCmp::safe_eq(&(*self as u64), other) }
3815    fn safe_less(&self, other: u64) -> bool { emboss_runtime::SafeCmp::safe_less(&(*self as u64), other) }
3816}
3817
3818impl emboss_runtime::SafeCmp<i64> for LEAdvertisingType {
3819    fn safe_eq(&self, other: i64) -> bool { emboss_runtime::SafeCmp::safe_eq(&(*self as u64), other) }
3820    fn safe_less(&self, other: i64) -> bool { emboss_runtime::SafeCmp::safe_less(&(*self as u64), other) }
3821}
3822
3823impl emboss_runtime::SafeCmp<i32> for LEAdvertisingType {
3824    fn safe_eq(&self, other: i32) -> bool { emboss_runtime::SafeCmp::safe_eq(&(*self as u64), other as i64) }
3825    fn safe_less(&self, other: i32) -> bool { emboss_runtime::SafeCmp::safe_less(&(*self as u64), other as i64) }
3826}
3827
3828impl emboss_runtime::SafeCmp<u32> for LEAdvertisingType {
3829    fn safe_eq(&self, other: u32) -> bool { emboss_runtime::SafeCmp::safe_eq(&(*self as u64), other as u64) }
3830    fn safe_less(&self, other: u32) -> bool { emboss_runtime::SafeCmp::safe_less(&(*self as u64), other as u64) }
3831}
3832
3833impl emboss_runtime::SafeCmp<LEAdvertisingType> for u64 {
3834    fn safe_eq(&self, other: LEAdvertisingType) -> bool { emboss_runtime::SafeCmp::safe_eq(self, other as u64) }
3835    fn safe_less(&self, other: LEAdvertisingType) -> bool { emboss_runtime::SafeCmp::safe_less(self, other as u64) }
3836}
3837
3838impl emboss_runtime::SafeCmp<LEAdvertisingType> for i64 {
3839    fn safe_eq(&self, other: LEAdvertisingType) -> bool { emboss_runtime::SafeCmp::safe_eq(self, other as u64) }
3840    fn safe_less(&self, other: LEAdvertisingType) -> bool { emboss_runtime::SafeCmp::safe_less(self, other as u64) }
3841}
3842
3843impl<V: core::convert::Into<u64> + core::marker::Copy> emboss_runtime::TryFromRaw<V> for LEAdvertisingType {
3844    fn try_from_raw(val: V) -> core::result::Result<Self, emboss_runtime::Error<V>> {
3845        let v_raw: u64 = val.into();
3846        match v_raw {
3847            0 => Ok(LEAdvertisingType::CONNECTABLE_AND_SCANNABLE_UNDIRECTED),
3848            1 => Ok(LEAdvertisingType::CONNECTABLE_HIGH_DUTY_CYCLE_DIRECTED),
3849            2 => Ok(LEAdvertisingType::SCANNABLE_UNDIRECTED),
3850            3 => Ok(LEAdvertisingType::NOT_CONNECTABLE_UNDIRECTED),
3851            4 => Ok(LEAdvertisingType::CONNECTABLE_LOW_DUTY_CYCLE_DIRECTED),
3852
3853            _ => Err(emboss_runtime::Error::UnknownEnum(val)),
3854        }
3855    }
3856}
3857
3858impl LEAdvertisingType {
3859
3860}
3861#[derive(Copy, Clone, Debug, Eq, PartialEq)]
3862#[repr(u64)]
3863pub enum LEOwnAddressType {
3864    PUBLIC = 0,
3865    RANDOM = 1,
3866    PRIVATE_DEFAULT_TO_PUBLIC = 2,
3867    PRIVATE_DEFAULT_TO_RANDOM = 3,
3868
3869}
3870
3871impl core::convert::From<LEOwnAddressType> for u8 { fn from(val: LEOwnAddressType) -> Self { val as u8 } }
3872impl core::convert::From<LEOwnAddressType> for u16 { fn from(val: LEOwnAddressType) -> Self { val as u16 } }
3873impl core::convert::From<LEOwnAddressType> for u32 { fn from(val: LEOwnAddressType) -> Self { val as u32 } }
3874impl core::convert::From<LEOwnAddressType> for u64 { fn from(val: LEOwnAddressType) -> Self { val as u64 } }
3875impl core::convert::From<LEOwnAddressType> for i8 { fn from(val: LEOwnAddressType) -> Self { val as i8 } }
3876impl core::convert::From<LEOwnAddressType> for i16 { fn from(val: LEOwnAddressType) -> Self { val as i16 } }
3877impl core::convert::From<LEOwnAddressType> for i32 { fn from(val: LEOwnAddressType) -> Self { val as i32 } }
3878impl core::convert::From<LEOwnAddressType> for i64 { fn from(val: LEOwnAddressType) -> Self { val as i64 } }
3879
3880impl emboss_runtime::SafeCmp<LEOwnAddressType> for LEOwnAddressType {
3881    fn safe_eq(&self, other: Self) -> bool { *self == other }
3882    fn safe_less(&self, other: Self) -> bool { (*self as u64) < (other as u64) }
3883}
3884
3885impl emboss_runtime::SafeCmp<u64> for LEOwnAddressType {
3886    fn safe_eq(&self, other: u64) -> bool { emboss_runtime::SafeCmp::safe_eq(&(*self as u64), other) }
3887    fn safe_less(&self, other: u64) -> bool { emboss_runtime::SafeCmp::safe_less(&(*self as u64), other) }
3888}
3889
3890impl emboss_runtime::SafeCmp<i64> for LEOwnAddressType {
3891    fn safe_eq(&self, other: i64) -> bool { emboss_runtime::SafeCmp::safe_eq(&(*self as u64), other) }
3892    fn safe_less(&self, other: i64) -> bool { emboss_runtime::SafeCmp::safe_less(&(*self as u64), other) }
3893}
3894
3895impl emboss_runtime::SafeCmp<i32> for LEOwnAddressType {
3896    fn safe_eq(&self, other: i32) -> bool { emboss_runtime::SafeCmp::safe_eq(&(*self as u64), other as i64) }
3897    fn safe_less(&self, other: i32) -> bool { emboss_runtime::SafeCmp::safe_less(&(*self as u64), other as i64) }
3898}
3899
3900impl emboss_runtime::SafeCmp<u32> for LEOwnAddressType {
3901    fn safe_eq(&self, other: u32) -> bool { emboss_runtime::SafeCmp::safe_eq(&(*self as u64), other as u64) }
3902    fn safe_less(&self, other: u32) -> bool { emboss_runtime::SafeCmp::safe_less(&(*self as u64), other as u64) }
3903}
3904
3905impl emboss_runtime::SafeCmp<LEOwnAddressType> for u64 {
3906    fn safe_eq(&self, other: LEOwnAddressType) -> bool { emboss_runtime::SafeCmp::safe_eq(self, other as u64) }
3907    fn safe_less(&self, other: LEOwnAddressType) -> bool { emboss_runtime::SafeCmp::safe_less(self, other as u64) }
3908}
3909
3910impl emboss_runtime::SafeCmp<LEOwnAddressType> for i64 {
3911    fn safe_eq(&self, other: LEOwnAddressType) -> bool { emboss_runtime::SafeCmp::safe_eq(self, other as u64) }
3912    fn safe_less(&self, other: LEOwnAddressType) -> bool { emboss_runtime::SafeCmp::safe_less(self, other as u64) }
3913}
3914
3915impl<V: core::convert::Into<u64> + core::marker::Copy> emboss_runtime::TryFromRaw<V> for LEOwnAddressType {
3916    fn try_from_raw(val: V) -> core::result::Result<Self, emboss_runtime::Error<V>> {
3917        let v_raw: u64 = val.into();
3918        match v_raw {
3919            0 => Ok(LEOwnAddressType::PUBLIC),
3920            1 => Ok(LEOwnAddressType::RANDOM),
3921            2 => Ok(LEOwnAddressType::PRIVATE_DEFAULT_TO_PUBLIC),
3922            3 => Ok(LEOwnAddressType::PRIVATE_DEFAULT_TO_RANDOM),
3923
3924            _ => Err(emboss_runtime::Error::UnknownEnum(val)),
3925        }
3926    }
3927}
3928
3929impl LEOwnAddressType {
3930
3931}
3932#[derive(Copy, Clone, Debug, Eq, PartialEq)]
3933#[repr(u64)]
3934pub enum LEPeerAddressType {
3935    PUBLIC = 0,
3936    RANDOM = 1,
3937    ANONYMOUS = 255,
3938
3939}
3940
3941impl core::convert::From<LEPeerAddressType> for u8 { fn from(val: LEPeerAddressType) -> Self { val as u8 } }
3942impl core::convert::From<LEPeerAddressType> for u16 { fn from(val: LEPeerAddressType) -> Self { val as u16 } }
3943impl core::convert::From<LEPeerAddressType> for u32 { fn from(val: LEPeerAddressType) -> Self { val as u32 } }
3944impl core::convert::From<LEPeerAddressType> for u64 { fn from(val: LEPeerAddressType) -> Self { val as u64 } }
3945impl core::convert::From<LEPeerAddressType> for i8 { fn from(val: LEPeerAddressType) -> Self { val as i8 } }
3946impl core::convert::From<LEPeerAddressType> for i16 { fn from(val: LEPeerAddressType) -> Self { val as i16 } }
3947impl core::convert::From<LEPeerAddressType> for i32 { fn from(val: LEPeerAddressType) -> Self { val as i32 } }
3948impl core::convert::From<LEPeerAddressType> for i64 { fn from(val: LEPeerAddressType) -> Self { val as i64 } }
3949
3950impl emboss_runtime::SafeCmp<LEPeerAddressType> for LEPeerAddressType {
3951    fn safe_eq(&self, other: Self) -> bool { *self == other }
3952    fn safe_less(&self, other: Self) -> bool { (*self as u64) < (other as u64) }
3953}
3954
3955impl emboss_runtime::SafeCmp<u64> for LEPeerAddressType {
3956    fn safe_eq(&self, other: u64) -> bool { emboss_runtime::SafeCmp::safe_eq(&(*self as u64), other) }
3957    fn safe_less(&self, other: u64) -> bool { emboss_runtime::SafeCmp::safe_less(&(*self as u64), other) }
3958}
3959
3960impl emboss_runtime::SafeCmp<i64> for LEPeerAddressType {
3961    fn safe_eq(&self, other: i64) -> bool { emboss_runtime::SafeCmp::safe_eq(&(*self as u64), other) }
3962    fn safe_less(&self, other: i64) -> bool { emboss_runtime::SafeCmp::safe_less(&(*self as u64), other) }
3963}
3964
3965impl emboss_runtime::SafeCmp<i32> for LEPeerAddressType {
3966    fn safe_eq(&self, other: i32) -> bool { emboss_runtime::SafeCmp::safe_eq(&(*self as u64), other as i64) }
3967    fn safe_less(&self, other: i32) -> bool { emboss_runtime::SafeCmp::safe_less(&(*self as u64), other as i64) }
3968}
3969
3970impl emboss_runtime::SafeCmp<u32> for LEPeerAddressType {
3971    fn safe_eq(&self, other: u32) -> bool { emboss_runtime::SafeCmp::safe_eq(&(*self as u64), other as u64) }
3972    fn safe_less(&self, other: u32) -> bool { emboss_runtime::SafeCmp::safe_less(&(*self as u64), other as u64) }
3973}
3974
3975impl emboss_runtime::SafeCmp<LEPeerAddressType> for u64 {
3976    fn safe_eq(&self, other: LEPeerAddressType) -> bool { emboss_runtime::SafeCmp::safe_eq(self, other as u64) }
3977    fn safe_less(&self, other: LEPeerAddressType) -> bool { emboss_runtime::SafeCmp::safe_less(self, other as u64) }
3978}
3979
3980impl emboss_runtime::SafeCmp<LEPeerAddressType> for i64 {
3981    fn safe_eq(&self, other: LEPeerAddressType) -> bool { emboss_runtime::SafeCmp::safe_eq(self, other as u64) }
3982    fn safe_less(&self, other: LEPeerAddressType) -> bool { emboss_runtime::SafeCmp::safe_less(self, other as u64) }
3983}
3984
3985impl<V: core::convert::Into<u64> + core::marker::Copy> emboss_runtime::TryFromRaw<V> for LEPeerAddressType {
3986    fn try_from_raw(val: V) -> core::result::Result<Self, emboss_runtime::Error<V>> {
3987        let v_raw: u64 = val.into();
3988        match v_raw {
3989            0 => Ok(LEPeerAddressType::PUBLIC),
3990            1 => Ok(LEPeerAddressType::RANDOM),
3991            255 => Ok(LEPeerAddressType::ANONYMOUS),
3992
3993            _ => Err(emboss_runtime::Error::UnknownEnum(val)),
3994        }
3995    }
3996}
3997
3998impl LEPeerAddressType {
3999
4000}
4001#[derive(Copy, Clone, Debug, Eq, PartialEq)]
4002#[repr(u64)]
4003pub enum LEPeerAddressTypeNoAnon {
4004    PUBLIC = 0,
4005    RANDOM = 1,
4006
4007}
4008
4009impl core::convert::From<LEPeerAddressTypeNoAnon> for u8 { fn from(val: LEPeerAddressTypeNoAnon) -> Self { val as u8 } }
4010impl core::convert::From<LEPeerAddressTypeNoAnon> for u16 { fn from(val: LEPeerAddressTypeNoAnon) -> Self { val as u16 } }
4011impl core::convert::From<LEPeerAddressTypeNoAnon> for u32 { fn from(val: LEPeerAddressTypeNoAnon) -> Self { val as u32 } }
4012impl core::convert::From<LEPeerAddressTypeNoAnon> for u64 { fn from(val: LEPeerAddressTypeNoAnon) -> Self { val as u64 } }
4013impl core::convert::From<LEPeerAddressTypeNoAnon> for i8 { fn from(val: LEPeerAddressTypeNoAnon) -> Self { val as i8 } }
4014impl core::convert::From<LEPeerAddressTypeNoAnon> for i16 { fn from(val: LEPeerAddressTypeNoAnon) -> Self { val as i16 } }
4015impl core::convert::From<LEPeerAddressTypeNoAnon> for i32 { fn from(val: LEPeerAddressTypeNoAnon) -> Self { val as i32 } }
4016impl core::convert::From<LEPeerAddressTypeNoAnon> for i64 { fn from(val: LEPeerAddressTypeNoAnon) -> Self { val as i64 } }
4017
4018impl emboss_runtime::SafeCmp<LEPeerAddressTypeNoAnon> for LEPeerAddressTypeNoAnon {
4019    fn safe_eq(&self, other: Self) -> bool { *self == other }
4020    fn safe_less(&self, other: Self) -> bool { (*self as u64) < (other as u64) }
4021}
4022
4023impl emboss_runtime::SafeCmp<u64> for LEPeerAddressTypeNoAnon {
4024    fn safe_eq(&self, other: u64) -> bool { emboss_runtime::SafeCmp::safe_eq(&(*self as u64), other) }
4025    fn safe_less(&self, other: u64) -> bool { emboss_runtime::SafeCmp::safe_less(&(*self as u64), other) }
4026}
4027
4028impl emboss_runtime::SafeCmp<i64> for LEPeerAddressTypeNoAnon {
4029    fn safe_eq(&self, other: i64) -> bool { emboss_runtime::SafeCmp::safe_eq(&(*self as u64), other) }
4030    fn safe_less(&self, other: i64) -> bool { emboss_runtime::SafeCmp::safe_less(&(*self as u64), other) }
4031}
4032
4033impl emboss_runtime::SafeCmp<i32> for LEPeerAddressTypeNoAnon {
4034    fn safe_eq(&self, other: i32) -> bool { emboss_runtime::SafeCmp::safe_eq(&(*self as u64), other as i64) }
4035    fn safe_less(&self, other: i32) -> bool { emboss_runtime::SafeCmp::safe_less(&(*self as u64), other as i64) }
4036}
4037
4038impl emboss_runtime::SafeCmp<u32> for LEPeerAddressTypeNoAnon {
4039    fn safe_eq(&self, other: u32) -> bool { emboss_runtime::SafeCmp::safe_eq(&(*self as u64), other as u64) }
4040    fn safe_less(&self, other: u32) -> bool { emboss_runtime::SafeCmp::safe_less(&(*self as u64), other as u64) }
4041}
4042
4043impl emboss_runtime::SafeCmp<LEPeerAddressTypeNoAnon> for u64 {
4044    fn safe_eq(&self, other: LEPeerAddressTypeNoAnon) -> bool { emboss_runtime::SafeCmp::safe_eq(self, other as u64) }
4045    fn safe_less(&self, other: LEPeerAddressTypeNoAnon) -> bool { emboss_runtime::SafeCmp::safe_less(self, other as u64) }
4046}
4047
4048impl emboss_runtime::SafeCmp<LEPeerAddressTypeNoAnon> for i64 {
4049    fn safe_eq(&self, other: LEPeerAddressTypeNoAnon) -> bool { emboss_runtime::SafeCmp::safe_eq(self, other as u64) }
4050    fn safe_less(&self, other: LEPeerAddressTypeNoAnon) -> bool { emboss_runtime::SafeCmp::safe_less(self, other as u64) }
4051}
4052
4053impl<V: core::convert::Into<u64> + core::marker::Copy> emboss_runtime::TryFromRaw<V> for LEPeerAddressTypeNoAnon {
4054    fn try_from_raw(val: V) -> core::result::Result<Self, emboss_runtime::Error<V>> {
4055        let v_raw: u64 = val.into();
4056        match v_raw {
4057            0 => Ok(LEPeerAddressTypeNoAnon::PUBLIC),
4058            1 => Ok(LEPeerAddressTypeNoAnon::RANDOM),
4059
4060            _ => Err(emboss_runtime::Error::UnknownEnum(val)),
4061        }
4062    }
4063}
4064
4065impl LEPeerAddressTypeNoAnon {
4066
4067}
4068pub struct ClockOffset<S: emboss_runtime::Storage, ST: emboss_runtime::State = emboss_runtime::UncheckedState> {
4069    storage: S,
4070    _marker: core::marker::PhantomData<ST>,
4071}
4072
4073impl<S: emboss_runtime::Storage> ClockOffset<S, emboss_runtime::UncheckedState> {
4074    pub fn new(storage: S) -> Self {
4075        Self {
4076            storage,
4077            _marker: core::marker::PhantomData,
4078        }
4079    }
4080}
4081
4082impl<S: emboss_runtime::Storage + core::clone::Clone, ST: emboss_runtime::State> core::clone::Clone for ClockOffset<S, ST> {
4083    fn clone(&self) -> Self {
4084        Self {
4085            storage: self.storage.clone(),
4086            _marker: core::marker::PhantomData,
4087        }
4088    }
4089}
4090
4091impl<S: emboss_runtime::Storage, ST: emboss_runtime::State> ClockOffset<S, ST> {
4092    /**
4093     * Constructs a view in a specific typestate.
4094     *
4095     * # Safety
4096     *
4097     * The caller must ensure that `storage` satisfies the layout invariants for `ST`.
4098     */
4099    pub unsafe fn new_in_state(storage: S) -> Self {
4100        Self {
4101            storage,
4102            _marker: core::marker::PhantomData,
4103        }
4104    }
4105    pub fn into_storage(self) -> S {
4106        self.storage
4107    }
4108    pub fn clock_offset(&self) -> emboss_runtime::BitUInt<15, 0, emboss_runtime::Null, S::Sliced<'_>, ST> {
4109        let len = (2) as usize; // Total struct size in bytes
4110        let storage = self.storage.slice(0, len);
4111        emboss_runtime::BitUInt::<15, 0, emboss_runtime::Null, S::Sliced<'_>, ST>::new(storage)
4112    }
4113    pub fn valid(&self) -> emboss_runtime::BitFlag<1, 15, emboss_runtime::Null, S::Sliced<'_>, ST> {
4114        let len = (2) as usize; // Total struct size in bytes
4115        let storage = self.storage.slice(0, len);
4116        emboss_runtime::BitFlag::<1, 15, emboss_runtime::Null, S::Sliced<'_>, ST>::new(storage)
4117    }
4118
4119}
4120
4121pub struct ClockOffsetMut<S: emboss_runtime::MutStorage> {
4122    storage: S,
4123}
4124
4125impl<S: emboss_runtime::MutStorage> ClockOffsetMut<S> {
4126    pub fn new(storage: S) -> Self {
4127        Self {
4128            storage,
4129        }
4130    }
4131    pub fn into_writer(self) -> ClockOffsetWriter<S, emboss_runtime::UncheckedState> {
4132        ClockOffsetWriter::new(self.storage)
4133    }
4134    /** Borrows the mutable view as an immutable view in UncheckedState. */
4135    pub fn as_view(&self) -> ClockOffset<S::Sliced<'_>, emboss_runtime::UncheckedState> {
4136        unsafe { ClockOffset::new_in_state(self.storage.slice(0, self.storage.len())) }
4137    }
4138    pub fn clock_offset(&mut self) -> emboss_runtime::BitUInt<15, 0, emboss_runtime::Null, S::SlicedMut<'_>, emboss_runtime::UncheckedState> {
4139        let len = (2) as usize;
4140        let storage = self.storage.slice_mut(0, len);
4141        emboss_runtime::BitUInt::<15, 0, emboss_runtime::Null, S::SlicedMut<'_>, emboss_runtime::UncheckedState>::new(storage)
4142    }
4143    pub fn valid(&mut self) -> emboss_runtime::BitFlag<1, 15, emboss_runtime::Null, S::SlicedMut<'_>, emboss_runtime::UncheckedState> {
4144        let len = (2) as usize;
4145        let storage = self.storage.slice_mut(0, len);
4146        emboss_runtime::BitFlag::<1, 15, emboss_runtime::Null, S::SlicedMut<'_>, emboss_runtime::UncheckedState>::new(storage)
4147    }
4148
4149}
4150
4151impl<S: emboss_runtime::MutStorage> emboss_runtime::IntoWriter for ClockOffsetMut<S> {
4152    type Writer = ClockOffsetWriter<S, emboss_runtime::UncheckedState>;
4153    fn into_writer(self) -> Self::Writer {
4154        ClockOffsetWriter::new(self.storage)
4155    }
4156}
4157
4158pub struct ClockOffsetWriter<S: emboss_runtime::MutStorage, ST: emboss_runtime::State = emboss_runtime::UncheckedState> {
4159    storage: S,
4160    _marker: core::marker::PhantomData<ST>,
4161}
4162
4163impl<S: emboss_runtime::MutStorage> ClockOffsetWriter<S, emboss_runtime::UncheckedState> {
4164    pub fn new(storage: S) -> Self {
4165        Self {
4166            storage,
4167            _marker: core::marker::PhantomData,
4168        }
4169    }
4170}
4171
4172impl<S: emboss_runtime::MutStorage, ST: emboss_runtime::State> ClockOffsetWriter<S, ST> {
4173    /**
4174     * Constructs a writer in a specific typestate.
4175     *
4176     * # Safety
4177     *
4178     * The caller must ensure that `storage` satisfies the layout invariants for `ST`.
4179     */
4180    pub unsafe fn new_in_state(storage: S) -> Self {
4181        Self {
4182            storage,
4183            _marker: core::marker::PhantomData,
4184        }
4185    }
4186    pub fn into_storage(self) -> S {
4187        self.storage
4188    }
4189    /** Converts the writer into an immutable view in the same typestate. */
4190    pub fn into_view(self) -> ClockOffset<S, ST> {
4191        unsafe { ClockOffset::new_in_state(self.storage) }
4192    }
4193    /** Borrows the writer as an immutable view in the same typestate. */
4194    pub fn as_view(&self) -> ClockOffset<S::Sliced<'_>, ST> {
4195        unsafe { ClockOffset::new_in_state(self.storage.slice(0, self.storage.len())) }
4196    }
4197
4198}
4199
4200impl<S: emboss_runtime::Storage, ST: emboss_runtime::State> emboss_runtime::View for ClockOffset<S, ST> {
4201    fn size_in_bytes(&self) -> core::result::Result<usize, emboss_runtime::Error> {
4202        let view = self;
4203        core::result::Result::Ok((((16) + 7) / 8) as usize)
4204    }
4205}
4206
4207impl<S: emboss_runtime::MutStorage> emboss_runtime::View for ClockOffsetMut<S> {
4208    fn size_in_bytes(&self) -> core::result::Result<usize, emboss_runtime::Error> {
4209        let view = self.as_view();
4210        <ClockOffset<S::Sliced<'_>, emboss_runtime::UncheckedState> as emboss_runtime::View>::size_in_bytes(&view)
4211    }
4212}
4213
4214impl<S: emboss_runtime::MutStorage, ST: emboss_runtime::State> emboss_runtime::View for ClockOffsetWriter<S, ST> {
4215    fn size_in_bytes(&self) -> core::result::Result<usize, emboss_runtime::Error> {
4216        let view = self.as_view();
4217        <ClockOffset<S::Sliced<'_>, ST> as emboss_runtime::View>::size_in_bytes(&view)
4218    }
4219}
4220
4221impl<S: emboss_runtime::Storage> emboss_runtime::CheckComplete for ClockOffset<S, emboss_runtime::UncheckedState> {
4222    type Completed = ClockOffset<S, emboss_runtime::CompleteState>;
4223    fn check_complete(self) -> core::result::Result<Self::Completed, emboss_runtime::Error> {
4224        let required_size = <Self as emboss_runtime::View>::size_in_bytes(&self)?;
4225        if self.storage.len() < required_size {
4226            return core::result::Result::Err(emboss_runtime::Error::OutOfBounds);
4227        }
4228        core::result::Result::Ok(unsafe { ClockOffset::new_in_state(self.storage) })
4229    }
4230}
4231
4232impl<S: emboss_runtime::MutStorage> emboss_runtime::CheckComplete for ClockOffsetWriter<S, emboss_runtime::UncheckedState> {
4233    type Completed = ClockOffsetWriter<S, emboss_runtime::CompleteState>;
4234    fn check_complete(self) -> core::result::Result<Self::Completed, emboss_runtime::Error> {
4235        let required_size = <Self as emboss_runtime::View>::size_in_bytes(&self)?;
4236        if self.storage.len() < required_size {
4237            return core::result::Result::Err(emboss_runtime::Error::OutOfBounds);
4238        }
4239        core::result::Result::Ok(unsafe { ClockOffsetWriter::new_in_state(self.storage) })
4240    }
4241}
4242
4243impl<S: emboss_runtime::Storage> emboss_runtime::CheckOk for ClockOffset<S, emboss_runtime::UncheckedState> {
4244    type Ok = ClockOffset<S, emboss_runtime::OkState>;
4245    fn check_ok(self) -> core::result::Result<Self::Ok, emboss_runtime::Error> {
4246        let completed = emboss_runtime::CheckComplete::check_complete(self)?;
4247        core::result::Result::Ok(unsafe { ClockOffset::new_in_state(completed.into_storage()) })
4248    }
4249}
4250
4251impl<S: emboss_runtime::Storage> emboss_runtime::CheckOk for ClockOffset<S, emboss_runtime::CompleteState> {
4252    type Ok = ClockOffset<S, emboss_runtime::OkState>;
4253    fn check_ok(self) -> core::result::Result<Self::Ok, emboss_runtime::Error> {
4254        core::result::Result::Ok(unsafe { ClockOffset::new_in_state(self.into_storage()) })
4255    }
4256}
4257
4258impl<S: emboss_runtime::Storage> emboss_runtime::CheckOk for ClockOffset<S, emboss_runtime::OkState> {
4259    type Ok = ClockOffset<S, emboss_runtime::OkState>;
4260    fn check_ok(self) -> core::result::Result<Self::Ok, emboss_runtime::Error> {
4261        core::result::Result::Ok(self)
4262    }
4263}
4264
4265impl<S: emboss_runtime::MutStorage> emboss_runtime::CheckOk for ClockOffsetWriter<S, emboss_runtime::UncheckedState> {
4266    type Ok = ClockOffsetWriter<S, emboss_runtime::OkState>;
4267    fn check_ok(self) -> core::result::Result<Self::Ok, emboss_runtime::Error> {
4268        let completed = emboss_runtime::CheckComplete::check_complete(self)?;
4269        core::result::Result::Ok(unsafe { ClockOffsetWriter::new_in_state(completed.into_storage()) })
4270    }
4271}
4272
4273impl<S: emboss_runtime::MutStorage> emboss_runtime::CheckOk for ClockOffsetWriter<S, emboss_runtime::CompleteState> {
4274    type Ok = ClockOffsetWriter<S, emboss_runtime::OkState>;
4275    fn check_ok(self) -> core::result::Result<Self::Ok, emboss_runtime::Error> {
4276        core::result::Result::Ok(unsafe { ClockOffsetWriter::new_in_state(self.into_storage()) })
4277    }
4278}
4279
4280impl<S: emboss_runtime::MutStorage> emboss_runtime::CheckOk for ClockOffsetWriter<S, emboss_runtime::OkState> {
4281    type Ok = ClockOffsetWriter<S, emboss_runtime::OkState>;
4282    fn check_ok(self) -> core::result::Result<Self::Ok, emboss_runtime::Error> {
4283        core::result::Result::Ok(self)
4284    }
4285}
4286
4287pub mod clock_offset {
4288    pub type View<S, ST = emboss_runtime::UncheckedState> = super::ClockOffset<S, ST>;
4289    pub type ViewMut<S> = super::ClockOffsetMut<S>;
4290    pub type Writer<S, ST = emboss_runtime::UncheckedState> = super::ClockOffsetWriter<S, ST>;
4291
4292    pub const MIN_SIZE_IN_BYTES: usize = 2;
4293    pub const MAX_SIZE_IN_BYTES: usize = 2;
4294    pub const SIZE_IN_BYTES: usize = 2;
4295}#[derive(Copy, Clone, Debug, Eq, PartialEq)]
4296#[repr(u64)]
4297pub enum LEPrimaryAdvertisingPHY {
4298    LE_1M = 1,
4299    LE_CODED = 3,
4300    LE_CODED_S2 = 4,
4301
4302}
4303
4304impl core::convert::From<LEPrimaryAdvertisingPHY> for u8 { fn from(val: LEPrimaryAdvertisingPHY) -> Self { val as u8 } }
4305impl core::convert::From<LEPrimaryAdvertisingPHY> for u16 { fn from(val: LEPrimaryAdvertisingPHY) -> Self { val as u16 } }
4306impl core::convert::From<LEPrimaryAdvertisingPHY> for u32 { fn from(val: LEPrimaryAdvertisingPHY) -> Self { val as u32 } }
4307impl core::convert::From<LEPrimaryAdvertisingPHY> for u64 { fn from(val: LEPrimaryAdvertisingPHY) -> Self { val as u64 } }
4308impl core::convert::From<LEPrimaryAdvertisingPHY> for i8 { fn from(val: LEPrimaryAdvertisingPHY) -> Self { val as i8 } }
4309impl core::convert::From<LEPrimaryAdvertisingPHY> for i16 { fn from(val: LEPrimaryAdvertisingPHY) -> Self { val as i16 } }
4310impl core::convert::From<LEPrimaryAdvertisingPHY> for i32 { fn from(val: LEPrimaryAdvertisingPHY) -> Self { val as i32 } }
4311impl core::convert::From<LEPrimaryAdvertisingPHY> for i64 { fn from(val: LEPrimaryAdvertisingPHY) -> Self { val as i64 } }
4312
4313impl emboss_runtime::SafeCmp<LEPrimaryAdvertisingPHY> for LEPrimaryAdvertisingPHY {
4314    fn safe_eq(&self, other: Self) -> bool { *self == other }
4315    fn safe_less(&self, other: Self) -> bool { (*self as u64) < (other as u64) }
4316}
4317
4318impl emboss_runtime::SafeCmp<u64> for LEPrimaryAdvertisingPHY {
4319    fn safe_eq(&self, other: u64) -> bool { emboss_runtime::SafeCmp::safe_eq(&(*self as u64), other) }
4320    fn safe_less(&self, other: u64) -> bool { emboss_runtime::SafeCmp::safe_less(&(*self as u64), other) }
4321}
4322
4323impl emboss_runtime::SafeCmp<i64> for LEPrimaryAdvertisingPHY {
4324    fn safe_eq(&self, other: i64) -> bool { emboss_runtime::SafeCmp::safe_eq(&(*self as u64), other) }
4325    fn safe_less(&self, other: i64) -> bool { emboss_runtime::SafeCmp::safe_less(&(*self as u64), other) }
4326}
4327
4328impl emboss_runtime::SafeCmp<i32> for LEPrimaryAdvertisingPHY {
4329    fn safe_eq(&self, other: i32) -> bool { emboss_runtime::SafeCmp::safe_eq(&(*self as u64), other as i64) }
4330    fn safe_less(&self, other: i32) -> bool { emboss_runtime::SafeCmp::safe_less(&(*self as u64), other as i64) }
4331}
4332
4333impl emboss_runtime::SafeCmp<u32> for LEPrimaryAdvertisingPHY {
4334    fn safe_eq(&self, other: u32) -> bool { emboss_runtime::SafeCmp::safe_eq(&(*self as u64), other as u64) }
4335    fn safe_less(&self, other: u32) -> bool { emboss_runtime::SafeCmp::safe_less(&(*self as u64), other as u64) }
4336}
4337
4338impl emboss_runtime::SafeCmp<LEPrimaryAdvertisingPHY> for u64 {
4339    fn safe_eq(&self, other: LEPrimaryAdvertisingPHY) -> bool { emboss_runtime::SafeCmp::safe_eq(self, other as u64) }
4340    fn safe_less(&self, other: LEPrimaryAdvertisingPHY) -> bool { emboss_runtime::SafeCmp::safe_less(self, other as u64) }
4341}
4342
4343impl emboss_runtime::SafeCmp<LEPrimaryAdvertisingPHY> for i64 {
4344    fn safe_eq(&self, other: LEPrimaryAdvertisingPHY) -> bool { emboss_runtime::SafeCmp::safe_eq(self, other as u64) }
4345    fn safe_less(&self, other: LEPrimaryAdvertisingPHY) -> bool { emboss_runtime::SafeCmp::safe_less(self, other as u64) }
4346}
4347
4348impl<V: core::convert::Into<u64> + core::marker::Copy> emboss_runtime::TryFromRaw<V> for LEPrimaryAdvertisingPHY {
4349    fn try_from_raw(val: V) -> core::result::Result<Self, emboss_runtime::Error<V>> {
4350        let v_raw: u64 = val.into();
4351        match v_raw {
4352            1 => Ok(LEPrimaryAdvertisingPHY::LE_1M),
4353            3 => Ok(LEPrimaryAdvertisingPHY::LE_CODED),
4354            4 => Ok(LEPrimaryAdvertisingPHY::LE_CODED_S2),
4355
4356            _ => Err(emboss_runtime::Error::UnknownEnum(val)),
4357        }
4358    }
4359}
4360
4361impl LEPrimaryAdvertisingPHY {
4362
4363}
4364#[derive(Copy, Clone, Debug, Eq, PartialEq)]
4365#[repr(u64)]
4366pub enum LEPhy {
4367    LE_1M = 1,
4368    LE_2M = 2,
4369    LE_CODED = 3,
4370
4371}
4372
4373impl core::convert::From<LEPhy> for u8 { fn from(val: LEPhy) -> Self { val as u8 } }
4374impl core::convert::From<LEPhy> for u16 { fn from(val: LEPhy) -> Self { val as u16 } }
4375impl core::convert::From<LEPhy> for u32 { fn from(val: LEPhy) -> Self { val as u32 } }
4376impl core::convert::From<LEPhy> for u64 { fn from(val: LEPhy) -> Self { val as u64 } }
4377impl core::convert::From<LEPhy> for i8 { fn from(val: LEPhy) -> Self { val as i8 } }
4378impl core::convert::From<LEPhy> for i16 { fn from(val: LEPhy) -> Self { val as i16 } }
4379impl core::convert::From<LEPhy> for i32 { fn from(val: LEPhy) -> Self { val as i32 } }
4380impl core::convert::From<LEPhy> for i64 { fn from(val: LEPhy) -> Self { val as i64 } }
4381
4382impl emboss_runtime::SafeCmp<LEPhy> for LEPhy {
4383    fn safe_eq(&self, other: Self) -> bool { *self == other }
4384    fn safe_less(&self, other: Self) -> bool { (*self as u64) < (other as u64) }
4385}
4386
4387impl emboss_runtime::SafeCmp<u64> for LEPhy {
4388    fn safe_eq(&self, other: u64) -> bool { emboss_runtime::SafeCmp::safe_eq(&(*self as u64), other) }
4389    fn safe_less(&self, other: u64) -> bool { emboss_runtime::SafeCmp::safe_less(&(*self as u64), other) }
4390}
4391
4392impl emboss_runtime::SafeCmp<i64> for LEPhy {
4393    fn safe_eq(&self, other: i64) -> bool { emboss_runtime::SafeCmp::safe_eq(&(*self as u64), other) }
4394    fn safe_less(&self, other: i64) -> bool { emboss_runtime::SafeCmp::safe_less(&(*self as u64), other) }
4395}
4396
4397impl emboss_runtime::SafeCmp<i32> for LEPhy {
4398    fn safe_eq(&self, other: i32) -> bool { emboss_runtime::SafeCmp::safe_eq(&(*self as u64), other as i64) }
4399    fn safe_less(&self, other: i32) -> bool { emboss_runtime::SafeCmp::safe_less(&(*self as u64), other as i64) }
4400}
4401
4402impl emboss_runtime::SafeCmp<u32> for LEPhy {
4403    fn safe_eq(&self, other: u32) -> bool { emboss_runtime::SafeCmp::safe_eq(&(*self as u64), other as u64) }
4404    fn safe_less(&self, other: u32) -> bool { emboss_runtime::SafeCmp::safe_less(&(*self as u64), other as u64) }
4405}
4406
4407impl emboss_runtime::SafeCmp<LEPhy> for u64 {
4408    fn safe_eq(&self, other: LEPhy) -> bool { emboss_runtime::SafeCmp::safe_eq(self, other as u64) }
4409    fn safe_less(&self, other: LEPhy) -> bool { emboss_runtime::SafeCmp::safe_less(self, other as u64) }
4410}
4411
4412impl emboss_runtime::SafeCmp<LEPhy> for i64 {
4413    fn safe_eq(&self, other: LEPhy) -> bool { emboss_runtime::SafeCmp::safe_eq(self, other as u64) }
4414    fn safe_less(&self, other: LEPhy) -> bool { emboss_runtime::SafeCmp::safe_less(self, other as u64) }
4415}
4416
4417impl<V: core::convert::Into<u64> + core::marker::Copy> emboss_runtime::TryFromRaw<V> for LEPhy {
4418    fn try_from_raw(val: V) -> core::result::Result<Self, emboss_runtime::Error<V>> {
4419        let v_raw: u64 = val.into();
4420        match v_raw {
4421            1 => Ok(LEPhy::LE_1M),
4422            2 => Ok(LEPhy::LE_2M),
4423            3 => Ok(LEPhy::LE_CODED),
4424
4425            _ => Err(emboss_runtime::Error::UnknownEnum(val)),
4426        }
4427    }
4428}
4429
4430impl LEPhy {
4431
4432}
4433#[derive(Copy, Clone, Debug, Eq, PartialEq)]
4434#[repr(u64)]
4435pub enum LESecondaryAdvertisingPHY {
4436    NONE = 0,
4437    LE_1M = 1,
4438    LE_2M = 2,
4439    LE_CODED = 3,
4440    LE_CODED_S2 = 4,
4441
4442}
4443
4444impl core::convert::From<LESecondaryAdvertisingPHY> for u8 { fn from(val: LESecondaryAdvertisingPHY) -> Self { val as u8 } }
4445impl core::convert::From<LESecondaryAdvertisingPHY> for u16 { fn from(val: LESecondaryAdvertisingPHY) -> Self { val as u16 } }
4446impl core::convert::From<LESecondaryAdvertisingPHY> for u32 { fn from(val: LESecondaryAdvertisingPHY) -> Self { val as u32 } }
4447impl core::convert::From<LESecondaryAdvertisingPHY> for u64 { fn from(val: LESecondaryAdvertisingPHY) -> Self { val as u64 } }
4448impl core::convert::From<LESecondaryAdvertisingPHY> for i8 { fn from(val: LESecondaryAdvertisingPHY) -> Self { val as i8 } }
4449impl core::convert::From<LESecondaryAdvertisingPHY> for i16 { fn from(val: LESecondaryAdvertisingPHY) -> Self { val as i16 } }
4450impl core::convert::From<LESecondaryAdvertisingPHY> for i32 { fn from(val: LESecondaryAdvertisingPHY) -> Self { val as i32 } }
4451impl core::convert::From<LESecondaryAdvertisingPHY> for i64 { fn from(val: LESecondaryAdvertisingPHY) -> Self { val as i64 } }
4452
4453impl emboss_runtime::SafeCmp<LESecondaryAdvertisingPHY> for LESecondaryAdvertisingPHY {
4454    fn safe_eq(&self, other: Self) -> bool { *self == other }
4455    fn safe_less(&self, other: Self) -> bool { (*self as u64) < (other as u64) }
4456}
4457
4458impl emboss_runtime::SafeCmp<u64> for LESecondaryAdvertisingPHY {
4459    fn safe_eq(&self, other: u64) -> bool { emboss_runtime::SafeCmp::safe_eq(&(*self as u64), other) }
4460    fn safe_less(&self, other: u64) -> bool { emboss_runtime::SafeCmp::safe_less(&(*self as u64), other) }
4461}
4462
4463impl emboss_runtime::SafeCmp<i64> for LESecondaryAdvertisingPHY {
4464    fn safe_eq(&self, other: i64) -> bool { emboss_runtime::SafeCmp::safe_eq(&(*self as u64), other) }
4465    fn safe_less(&self, other: i64) -> bool { emboss_runtime::SafeCmp::safe_less(&(*self as u64), other) }
4466}
4467
4468impl emboss_runtime::SafeCmp<i32> for LESecondaryAdvertisingPHY {
4469    fn safe_eq(&self, other: i32) -> bool { emboss_runtime::SafeCmp::safe_eq(&(*self as u64), other as i64) }
4470    fn safe_less(&self, other: i32) -> bool { emboss_runtime::SafeCmp::safe_less(&(*self as u64), other as i64) }
4471}
4472
4473impl emboss_runtime::SafeCmp<u32> for LESecondaryAdvertisingPHY {
4474    fn safe_eq(&self, other: u32) -> bool { emboss_runtime::SafeCmp::safe_eq(&(*self as u64), other as u64) }
4475    fn safe_less(&self, other: u32) -> bool { emboss_runtime::SafeCmp::safe_less(&(*self as u64), other as u64) }
4476}
4477
4478impl emboss_runtime::SafeCmp<LESecondaryAdvertisingPHY> for u64 {
4479    fn safe_eq(&self, other: LESecondaryAdvertisingPHY) -> bool { emboss_runtime::SafeCmp::safe_eq(self, other as u64) }
4480    fn safe_less(&self, other: LESecondaryAdvertisingPHY) -> bool { emboss_runtime::SafeCmp::safe_less(self, other as u64) }
4481}
4482
4483impl emboss_runtime::SafeCmp<LESecondaryAdvertisingPHY> for i64 {
4484    fn safe_eq(&self, other: LESecondaryAdvertisingPHY) -> bool { emboss_runtime::SafeCmp::safe_eq(self, other as u64) }
4485    fn safe_less(&self, other: LESecondaryAdvertisingPHY) -> bool { emboss_runtime::SafeCmp::safe_less(self, other as u64) }
4486}
4487
4488impl<V: core::convert::Into<u64> + core::marker::Copy> emboss_runtime::TryFromRaw<V> for LESecondaryAdvertisingPHY {
4489    fn try_from_raw(val: V) -> core::result::Result<Self, emboss_runtime::Error<V>> {
4490        let v_raw: u64 = val.into();
4491        match v_raw {
4492            0 => Ok(LESecondaryAdvertisingPHY::NONE),
4493            1 => Ok(LESecondaryAdvertisingPHY::LE_1M),
4494            2 => Ok(LESecondaryAdvertisingPHY::LE_2M),
4495            3 => Ok(LESecondaryAdvertisingPHY::LE_CODED),
4496            4 => Ok(LESecondaryAdvertisingPHY::LE_CODED_S2),
4497
4498            _ => Err(emboss_runtime::Error::UnknownEnum(val)),
4499        }
4500    }
4501}
4502
4503impl LESecondaryAdvertisingPHY {
4504
4505}
4506#[derive(Copy, Clone, Debug, Eq, PartialEq)]
4507#[repr(u64)]
4508pub enum LEAddressType {
4509    PUBLIC = 0,
4510    RANDOM = 1,
4511    PUBLIC_IDENTITY = 2,
4512    RANDOM_IDENTITY = 3,
4513
4514}
4515
4516impl core::convert::From<LEAddressType> for u8 { fn from(val: LEAddressType) -> Self { val as u8 } }
4517impl core::convert::From<LEAddressType> for u16 { fn from(val: LEAddressType) -> Self { val as u16 } }
4518impl core::convert::From<LEAddressType> for u32 { fn from(val: LEAddressType) -> Self { val as u32 } }
4519impl core::convert::From<LEAddressType> for u64 { fn from(val: LEAddressType) -> Self { val as u64 } }
4520impl core::convert::From<LEAddressType> for i8 { fn from(val: LEAddressType) -> Self { val as i8 } }
4521impl core::convert::From<LEAddressType> for i16 { fn from(val: LEAddressType) -> Self { val as i16 } }
4522impl core::convert::From<LEAddressType> for i32 { fn from(val: LEAddressType) -> Self { val as i32 } }
4523impl core::convert::From<LEAddressType> for i64 { fn from(val: LEAddressType) -> Self { val as i64 } }
4524
4525impl emboss_runtime::SafeCmp<LEAddressType> for LEAddressType {
4526    fn safe_eq(&self, other: Self) -> bool { *self == other }
4527    fn safe_less(&self, other: Self) -> bool { (*self as u64) < (other as u64) }
4528}
4529
4530impl emboss_runtime::SafeCmp<u64> for LEAddressType {
4531    fn safe_eq(&self, other: u64) -> bool { emboss_runtime::SafeCmp::safe_eq(&(*self as u64), other) }
4532    fn safe_less(&self, other: u64) -> bool { emboss_runtime::SafeCmp::safe_less(&(*self as u64), other) }
4533}
4534
4535impl emboss_runtime::SafeCmp<i64> for LEAddressType {
4536    fn safe_eq(&self, other: i64) -> bool { emboss_runtime::SafeCmp::safe_eq(&(*self as u64), other) }
4537    fn safe_less(&self, other: i64) -> bool { emboss_runtime::SafeCmp::safe_less(&(*self as u64), other) }
4538}
4539
4540impl emboss_runtime::SafeCmp<i32> for LEAddressType {
4541    fn safe_eq(&self, other: i32) -> bool { emboss_runtime::SafeCmp::safe_eq(&(*self as u64), other as i64) }
4542    fn safe_less(&self, other: i32) -> bool { emboss_runtime::SafeCmp::safe_less(&(*self as u64), other as i64) }
4543}
4544
4545impl emboss_runtime::SafeCmp<u32> for LEAddressType {
4546    fn safe_eq(&self, other: u32) -> bool { emboss_runtime::SafeCmp::safe_eq(&(*self as u64), other as u64) }
4547    fn safe_less(&self, other: u32) -> bool { emboss_runtime::SafeCmp::safe_less(&(*self as u64), other as u64) }
4548}
4549
4550impl emboss_runtime::SafeCmp<LEAddressType> for u64 {
4551    fn safe_eq(&self, other: LEAddressType) -> bool { emboss_runtime::SafeCmp::safe_eq(self, other as u64) }
4552    fn safe_less(&self, other: LEAddressType) -> bool { emboss_runtime::SafeCmp::safe_less(self, other as u64) }
4553}
4554
4555impl emboss_runtime::SafeCmp<LEAddressType> for i64 {
4556    fn safe_eq(&self, other: LEAddressType) -> bool { emboss_runtime::SafeCmp::safe_eq(self, other as u64) }
4557    fn safe_less(&self, other: LEAddressType) -> bool { emboss_runtime::SafeCmp::safe_less(self, other as u64) }
4558}
4559
4560impl<V: core::convert::Into<u64> + core::marker::Copy> emboss_runtime::TryFromRaw<V> for LEAddressType {
4561    fn try_from_raw(val: V) -> core::result::Result<Self, emboss_runtime::Error<V>> {
4562        let v_raw: u64 = val.into();
4563        match v_raw {
4564            0 => Ok(LEAddressType::PUBLIC),
4565            1 => Ok(LEAddressType::RANDOM),
4566            2 => Ok(LEAddressType::PUBLIC_IDENTITY),
4567            3 => Ok(LEAddressType::RANDOM_IDENTITY),
4568
4569            _ => Err(emboss_runtime::Error::UnknownEnum(val)),
4570        }
4571    }
4572}
4573
4574impl LEAddressType {
4575
4576}
4577#[derive(Copy, Clone, Debug, Eq, PartialEq)]
4578#[repr(u64)]
4579pub enum LEExtendedAddressType {
4580    PUBLIC = 0,
4581    RANDOM = 1,
4582    PUBLIC_IDENTITY = 2,
4583    RANDOM_IDENTITY = 3,
4584    ANONYMOUS = 255,
4585
4586}
4587
4588impl core::convert::From<LEExtendedAddressType> for u8 { fn from(val: LEExtendedAddressType) -> Self { val as u8 } }
4589impl core::convert::From<LEExtendedAddressType> for u16 { fn from(val: LEExtendedAddressType) -> Self { val as u16 } }
4590impl core::convert::From<LEExtendedAddressType> for u32 { fn from(val: LEExtendedAddressType) -> Self { val as u32 } }
4591impl core::convert::From<LEExtendedAddressType> for u64 { fn from(val: LEExtendedAddressType) -> Self { val as u64 } }
4592impl core::convert::From<LEExtendedAddressType> for i8 { fn from(val: LEExtendedAddressType) -> Self { val as i8 } }
4593impl core::convert::From<LEExtendedAddressType> for i16 { fn from(val: LEExtendedAddressType) -> Self { val as i16 } }
4594impl core::convert::From<LEExtendedAddressType> for i32 { fn from(val: LEExtendedAddressType) -> Self { val as i32 } }
4595impl core::convert::From<LEExtendedAddressType> for i64 { fn from(val: LEExtendedAddressType) -> Self { val as i64 } }
4596
4597impl emboss_runtime::SafeCmp<LEExtendedAddressType> for LEExtendedAddressType {
4598    fn safe_eq(&self, other: Self) -> bool { *self == other }
4599    fn safe_less(&self, other: Self) -> bool { (*self as u64) < (other as u64) }
4600}
4601
4602impl emboss_runtime::SafeCmp<u64> for LEExtendedAddressType {
4603    fn safe_eq(&self, other: u64) -> bool { emboss_runtime::SafeCmp::safe_eq(&(*self as u64), other) }
4604    fn safe_less(&self, other: u64) -> bool { emboss_runtime::SafeCmp::safe_less(&(*self as u64), other) }
4605}
4606
4607impl emboss_runtime::SafeCmp<i64> for LEExtendedAddressType {
4608    fn safe_eq(&self, other: i64) -> bool { emboss_runtime::SafeCmp::safe_eq(&(*self as u64), other) }
4609    fn safe_less(&self, other: i64) -> bool { emboss_runtime::SafeCmp::safe_less(&(*self as u64), other) }
4610}
4611
4612impl emboss_runtime::SafeCmp<i32> for LEExtendedAddressType {
4613    fn safe_eq(&self, other: i32) -> bool { emboss_runtime::SafeCmp::safe_eq(&(*self as u64), other as i64) }
4614    fn safe_less(&self, other: i32) -> bool { emboss_runtime::SafeCmp::safe_less(&(*self as u64), other as i64) }
4615}
4616
4617impl emboss_runtime::SafeCmp<u32> for LEExtendedAddressType {
4618    fn safe_eq(&self, other: u32) -> bool { emboss_runtime::SafeCmp::safe_eq(&(*self as u64), other as u64) }
4619    fn safe_less(&self, other: u32) -> bool { emboss_runtime::SafeCmp::safe_less(&(*self as u64), other as u64) }
4620}
4621
4622impl emboss_runtime::SafeCmp<LEExtendedAddressType> for u64 {
4623    fn safe_eq(&self, other: LEExtendedAddressType) -> bool { emboss_runtime::SafeCmp::safe_eq(self, other as u64) }
4624    fn safe_less(&self, other: LEExtendedAddressType) -> bool { emboss_runtime::SafeCmp::safe_less(self, other as u64) }
4625}
4626
4627impl emboss_runtime::SafeCmp<LEExtendedAddressType> for i64 {
4628    fn safe_eq(&self, other: LEExtendedAddressType) -> bool { emboss_runtime::SafeCmp::safe_eq(self, other as u64) }
4629    fn safe_less(&self, other: LEExtendedAddressType) -> bool { emboss_runtime::SafeCmp::safe_less(self, other as u64) }
4630}
4631
4632impl<V: core::convert::Into<u64> + core::marker::Copy> emboss_runtime::TryFromRaw<V> for LEExtendedAddressType {
4633    fn try_from_raw(val: V) -> core::result::Result<Self, emboss_runtime::Error<V>> {
4634        let v_raw: u64 = val.into();
4635        match v_raw {
4636            0 => Ok(LEExtendedAddressType::PUBLIC),
4637            1 => Ok(LEExtendedAddressType::RANDOM),
4638            2 => Ok(LEExtendedAddressType::PUBLIC_IDENTITY),
4639            3 => Ok(LEExtendedAddressType::RANDOM_IDENTITY),
4640            255 => Ok(LEExtendedAddressType::ANONYMOUS),
4641
4642            _ => Err(emboss_runtime::Error::UnknownEnum(val)),
4643        }
4644    }
4645}
4646
4647impl LEExtendedAddressType {
4648
4649}
4650pub struct LEAdvertisingChannels<S: emboss_runtime::Storage, ST: emboss_runtime::State = emboss_runtime::UncheckedState> {
4651    storage: S,
4652    _marker: core::marker::PhantomData<ST>,
4653}
4654
4655impl<S: emboss_runtime::Storage> LEAdvertisingChannels<S, emboss_runtime::UncheckedState> {
4656    pub fn new(storage: S) -> Self {
4657        Self {
4658            storage,
4659            _marker: core::marker::PhantomData,
4660        }
4661    }
4662}
4663
4664impl<S: emboss_runtime::Storage + core::clone::Clone, ST: emboss_runtime::State> core::clone::Clone for LEAdvertisingChannels<S, ST> {
4665    fn clone(&self) -> Self {
4666        Self {
4667            storage: self.storage.clone(),
4668            _marker: core::marker::PhantomData,
4669        }
4670    }
4671}
4672
4673impl<S: emboss_runtime::Storage, ST: emboss_runtime::State> LEAdvertisingChannels<S, ST> {
4674    /**
4675     * Constructs a view in a specific typestate.
4676     *
4677     * # Safety
4678     *
4679     * The caller must ensure that `storage` satisfies the layout invariants for `ST`.
4680     */
4681    pub unsafe fn new_in_state(storage: S) -> Self {
4682        Self {
4683            storage,
4684            _marker: core::marker::PhantomData,
4685        }
4686    }
4687    pub fn into_storage(self) -> S {
4688        self.storage
4689    }
4690    pub fn channel_37(&self) -> emboss_runtime::BitFlag<1, 0, emboss_runtime::Null, S::Sliced<'_>, ST> {
4691        let len = (1) as usize; // Total struct size in bytes
4692        let storage = self.storage.slice(0, len);
4693        emboss_runtime::BitFlag::<1, 0, emboss_runtime::Null, S::Sliced<'_>, ST>::new(storage)
4694    }
4695    pub fn channel_38(&self) -> emboss_runtime::BitFlag<1, 1, emboss_runtime::Null, S::Sliced<'_>, ST> {
4696        let len = (1) as usize; // Total struct size in bytes
4697        let storage = self.storage.slice(0, len);
4698        emboss_runtime::BitFlag::<1, 1, emboss_runtime::Null, S::Sliced<'_>, ST>::new(storage)
4699    }
4700    pub fn channel_39(&self) -> emboss_runtime::BitFlag<1, 2, emboss_runtime::Null, S::Sliced<'_>, ST> {
4701        let len = (1) as usize; // Total struct size in bytes
4702        let storage = self.storage.slice(0, len);
4703        emboss_runtime::BitFlag::<1, 2, emboss_runtime::Null, S::Sliced<'_>, ST>::new(storage)
4704    }
4705
4706}
4707
4708pub struct LEAdvertisingChannelsMut<S: emboss_runtime::MutStorage> {
4709    storage: S,
4710}
4711
4712impl<S: emboss_runtime::MutStorage> LEAdvertisingChannelsMut<S> {
4713    pub fn new(storage: S) -> Self {
4714        Self {
4715            storage,
4716        }
4717    }
4718    pub fn into_writer(self) -> LEAdvertisingChannelsWriter<S, emboss_runtime::UncheckedState> {
4719        LEAdvertisingChannelsWriter::new(self.storage)
4720    }
4721    /** Borrows the mutable view as an immutable view in UncheckedState. */
4722    pub fn as_view(&self) -> LEAdvertisingChannels<S::Sliced<'_>, emboss_runtime::UncheckedState> {
4723        unsafe { LEAdvertisingChannels::new_in_state(self.storage.slice(0, self.storage.len())) }
4724    }
4725    pub fn channel_37(&mut self) -> emboss_runtime::BitFlag<1, 0, emboss_runtime::Null, S::SlicedMut<'_>, emboss_runtime::UncheckedState> {
4726        let len = (1) as usize;
4727        let storage = self.storage.slice_mut(0, len);
4728        emboss_runtime::BitFlag::<1, 0, emboss_runtime::Null, S::SlicedMut<'_>, emboss_runtime::UncheckedState>::new(storage)
4729    }
4730    pub fn channel_38(&mut self) -> emboss_runtime::BitFlag<1, 1, emboss_runtime::Null, S::SlicedMut<'_>, emboss_runtime::UncheckedState> {
4731        let len = (1) as usize;
4732        let storage = self.storage.slice_mut(0, len);
4733        emboss_runtime::BitFlag::<1, 1, emboss_runtime::Null, S::SlicedMut<'_>, emboss_runtime::UncheckedState>::new(storage)
4734    }
4735    pub fn channel_39(&mut self) -> emboss_runtime::BitFlag<1, 2, emboss_runtime::Null, S::SlicedMut<'_>, emboss_runtime::UncheckedState> {
4736        let len = (1) as usize;
4737        let storage = self.storage.slice_mut(0, len);
4738        emboss_runtime::BitFlag::<1, 2, emboss_runtime::Null, S::SlicedMut<'_>, emboss_runtime::UncheckedState>::new(storage)
4739    }
4740
4741}
4742
4743impl<S: emboss_runtime::MutStorage> emboss_runtime::IntoWriter for LEAdvertisingChannelsMut<S> {
4744    type Writer = LEAdvertisingChannelsWriter<S, emboss_runtime::UncheckedState>;
4745    fn into_writer(self) -> Self::Writer {
4746        LEAdvertisingChannelsWriter::new(self.storage)
4747    }
4748}
4749
4750pub struct LEAdvertisingChannelsWriter<S: emboss_runtime::MutStorage, ST: emboss_runtime::State = emboss_runtime::UncheckedState> {
4751    storage: S,
4752    _marker: core::marker::PhantomData<ST>,
4753}
4754
4755impl<S: emboss_runtime::MutStorage> LEAdvertisingChannelsWriter<S, emboss_runtime::UncheckedState> {
4756    pub fn new(storage: S) -> Self {
4757        Self {
4758            storage,
4759            _marker: core::marker::PhantomData,
4760        }
4761    }
4762}
4763
4764impl<S: emboss_runtime::MutStorage, ST: emboss_runtime::State> LEAdvertisingChannelsWriter<S, ST> {
4765    /**
4766     * Constructs a writer in a specific typestate.
4767     *
4768     * # Safety
4769     *
4770     * The caller must ensure that `storage` satisfies the layout invariants for `ST`.
4771     */
4772    pub unsafe fn new_in_state(storage: S) -> Self {
4773        Self {
4774            storage,
4775            _marker: core::marker::PhantomData,
4776        }
4777    }
4778    pub fn into_storage(self) -> S {
4779        self.storage
4780    }
4781    /** Converts the writer into an immutable view in the same typestate. */
4782    pub fn into_view(self) -> LEAdvertisingChannels<S, ST> {
4783        unsafe { LEAdvertisingChannels::new_in_state(self.storage) }
4784    }
4785    /** Borrows the writer as an immutable view in the same typestate. */
4786    pub fn as_view(&self) -> LEAdvertisingChannels<S::Sliced<'_>, ST> {
4787        unsafe { LEAdvertisingChannels::new_in_state(self.storage.slice(0, self.storage.len())) }
4788    }
4789
4790}
4791
4792impl<S: emboss_runtime::Storage, ST: emboss_runtime::State> emboss_runtime::View for LEAdvertisingChannels<S, ST> {
4793    fn size_in_bytes(&self) -> core::result::Result<usize, emboss_runtime::Error> {
4794        let view = self;
4795        core::result::Result::Ok((((3) + 7) / 8) as usize)
4796    }
4797}
4798
4799impl<S: emboss_runtime::MutStorage> emboss_runtime::View for LEAdvertisingChannelsMut<S> {
4800    fn size_in_bytes(&self) -> core::result::Result<usize, emboss_runtime::Error> {
4801        let view = self.as_view();
4802        <LEAdvertisingChannels<S::Sliced<'_>, emboss_runtime::UncheckedState> as emboss_runtime::View>::size_in_bytes(&view)
4803    }
4804}
4805
4806impl<S: emboss_runtime::MutStorage, ST: emboss_runtime::State> emboss_runtime::View for LEAdvertisingChannelsWriter<S, ST> {
4807    fn size_in_bytes(&self) -> core::result::Result<usize, emboss_runtime::Error> {
4808        let view = self.as_view();
4809        <LEAdvertisingChannels<S::Sliced<'_>, ST> as emboss_runtime::View>::size_in_bytes(&view)
4810    }
4811}
4812
4813impl<S: emboss_runtime::Storage> emboss_runtime::CheckComplete for LEAdvertisingChannels<S, emboss_runtime::UncheckedState> {
4814    type Completed = LEAdvertisingChannels<S, emboss_runtime::CompleteState>;
4815    fn check_complete(self) -> core::result::Result<Self::Completed, emboss_runtime::Error> {
4816        let required_size = <Self as emboss_runtime::View>::size_in_bytes(&self)?;
4817        if self.storage.len() < required_size {
4818            return core::result::Result::Err(emboss_runtime::Error::OutOfBounds);
4819        }
4820        core::result::Result::Ok(unsafe { LEAdvertisingChannels::new_in_state(self.storage) })
4821    }
4822}
4823
4824impl<S: emboss_runtime::MutStorage> emboss_runtime::CheckComplete for LEAdvertisingChannelsWriter<S, emboss_runtime::UncheckedState> {
4825    type Completed = LEAdvertisingChannelsWriter<S, emboss_runtime::CompleteState>;
4826    fn check_complete(self) -> core::result::Result<Self::Completed, emboss_runtime::Error> {
4827        let required_size = <Self as emboss_runtime::View>::size_in_bytes(&self)?;
4828        if self.storage.len() < required_size {
4829            return core::result::Result::Err(emboss_runtime::Error::OutOfBounds);
4830        }
4831        core::result::Result::Ok(unsafe { LEAdvertisingChannelsWriter::new_in_state(self.storage) })
4832    }
4833}
4834
4835impl<S: emboss_runtime::Storage> emboss_runtime::CheckOk for LEAdvertisingChannels<S, emboss_runtime::UncheckedState> {
4836    type Ok = LEAdvertisingChannels<S, emboss_runtime::OkState>;
4837    fn check_ok(self) -> core::result::Result<Self::Ok, emboss_runtime::Error> {
4838        let completed = emboss_runtime::CheckComplete::check_complete(self)?;
4839        core::result::Result::Ok(unsafe { LEAdvertisingChannels::new_in_state(completed.into_storage()) })
4840    }
4841}
4842
4843impl<S: emboss_runtime::Storage> emboss_runtime::CheckOk for LEAdvertisingChannels<S, emboss_runtime::CompleteState> {
4844    type Ok = LEAdvertisingChannels<S, emboss_runtime::OkState>;
4845    fn check_ok(self) -> core::result::Result<Self::Ok, emboss_runtime::Error> {
4846        core::result::Result::Ok(unsafe { LEAdvertisingChannels::new_in_state(self.into_storage()) })
4847    }
4848}
4849
4850impl<S: emboss_runtime::Storage> emboss_runtime::CheckOk for LEAdvertisingChannels<S, emboss_runtime::OkState> {
4851    type Ok = LEAdvertisingChannels<S, emboss_runtime::OkState>;
4852    fn check_ok(self) -> core::result::Result<Self::Ok, emboss_runtime::Error> {
4853        core::result::Result::Ok(self)
4854    }
4855}
4856
4857impl<S: emboss_runtime::MutStorage> emboss_runtime::CheckOk for LEAdvertisingChannelsWriter<S, emboss_runtime::UncheckedState> {
4858    type Ok = LEAdvertisingChannelsWriter<S, emboss_runtime::OkState>;
4859    fn check_ok(self) -> core::result::Result<Self::Ok, emboss_runtime::Error> {
4860        let completed = emboss_runtime::CheckComplete::check_complete(self)?;
4861        core::result::Result::Ok(unsafe { LEAdvertisingChannelsWriter::new_in_state(completed.into_storage()) })
4862    }
4863}
4864
4865impl<S: emboss_runtime::MutStorage> emboss_runtime::CheckOk for LEAdvertisingChannelsWriter<S, emboss_runtime::CompleteState> {
4866    type Ok = LEAdvertisingChannelsWriter<S, emboss_runtime::OkState>;
4867    fn check_ok(self) -> core::result::Result<Self::Ok, emboss_runtime::Error> {
4868        core::result::Result::Ok(unsafe { LEAdvertisingChannelsWriter::new_in_state(self.into_storage()) })
4869    }
4870}
4871
4872impl<S: emboss_runtime::MutStorage> emboss_runtime::CheckOk for LEAdvertisingChannelsWriter<S, emboss_runtime::OkState> {
4873    type Ok = LEAdvertisingChannelsWriter<S, emboss_runtime::OkState>;
4874    fn check_ok(self) -> core::result::Result<Self::Ok, emboss_runtime::Error> {
4875        core::result::Result::Ok(self)
4876    }
4877}
4878
4879pub mod l_e_advertising_channels {
4880    pub type View<S, ST = emboss_runtime::UncheckedState> = super::LEAdvertisingChannels<S, ST>;
4881    pub type ViewMut<S> = super::LEAdvertisingChannelsMut<S>;
4882    pub type Writer<S, ST = emboss_runtime::UncheckedState> = super::LEAdvertisingChannelsWriter<S, ST>;
4883
4884    pub const MIN_SIZE_IN_BYTES: usize = 1;
4885    pub const MAX_SIZE_IN_BYTES: usize = 1;
4886    pub const SIZE_IN_BYTES: usize = 1;
4887}#[derive(Copy, Clone, Debug, Eq, PartialEq)]
4888#[repr(u64)]
4889pub enum LEAdvertisingFilterPolicy {
4890    ALLOW_ALL = 0,
4891    ALLOW_ALL_CONNECTIONS_AND_USE_FILTER_ACCEPT_LIST_FOR_SCANS = 1,
4892    ALLOW_ALL_SCANS_AND_USE_FILTER_ACCEPT_LIST_FOR_CONNECTIONS = 2,
4893    ALLOW_FILTER_ACCEPT_LIST_ONLY = 3,
4894
4895}
4896
4897impl core::convert::From<LEAdvertisingFilterPolicy> for u8 { fn from(val: LEAdvertisingFilterPolicy) -> Self { val as u8 } }
4898impl core::convert::From<LEAdvertisingFilterPolicy> for u16 { fn from(val: LEAdvertisingFilterPolicy) -> Self { val as u16 } }
4899impl core::convert::From<LEAdvertisingFilterPolicy> for u32 { fn from(val: LEAdvertisingFilterPolicy) -> Self { val as u32 } }
4900impl core::convert::From<LEAdvertisingFilterPolicy> for u64 { fn from(val: LEAdvertisingFilterPolicy) -> Self { val as u64 } }
4901impl core::convert::From<LEAdvertisingFilterPolicy> for i8 { fn from(val: LEAdvertisingFilterPolicy) -> Self { val as i8 } }
4902impl core::convert::From<LEAdvertisingFilterPolicy> for i16 { fn from(val: LEAdvertisingFilterPolicy) -> Self { val as i16 } }
4903impl core::convert::From<LEAdvertisingFilterPolicy> for i32 { fn from(val: LEAdvertisingFilterPolicy) -> Self { val as i32 } }
4904impl core::convert::From<LEAdvertisingFilterPolicy> for i64 { fn from(val: LEAdvertisingFilterPolicy) -> Self { val as i64 } }
4905
4906impl emboss_runtime::SafeCmp<LEAdvertisingFilterPolicy> for LEAdvertisingFilterPolicy {
4907    fn safe_eq(&self, other: Self) -> bool { *self == other }
4908    fn safe_less(&self, other: Self) -> bool { (*self as u64) < (other as u64) }
4909}
4910
4911impl emboss_runtime::SafeCmp<u64> for LEAdvertisingFilterPolicy {
4912    fn safe_eq(&self, other: u64) -> bool { emboss_runtime::SafeCmp::safe_eq(&(*self as u64), other) }
4913    fn safe_less(&self, other: u64) -> bool { emboss_runtime::SafeCmp::safe_less(&(*self as u64), other) }
4914}
4915
4916impl emboss_runtime::SafeCmp<i64> for LEAdvertisingFilterPolicy {
4917    fn safe_eq(&self, other: i64) -> bool { emboss_runtime::SafeCmp::safe_eq(&(*self as u64), other) }
4918    fn safe_less(&self, other: i64) -> bool { emboss_runtime::SafeCmp::safe_less(&(*self as u64), other) }
4919}
4920
4921impl emboss_runtime::SafeCmp<i32> for LEAdvertisingFilterPolicy {
4922    fn safe_eq(&self, other: i32) -> bool { emboss_runtime::SafeCmp::safe_eq(&(*self as u64), other as i64) }
4923    fn safe_less(&self, other: i32) -> bool { emboss_runtime::SafeCmp::safe_less(&(*self as u64), other as i64) }
4924}
4925
4926impl emboss_runtime::SafeCmp<u32> for LEAdvertisingFilterPolicy {
4927    fn safe_eq(&self, other: u32) -> bool { emboss_runtime::SafeCmp::safe_eq(&(*self as u64), other as u64) }
4928    fn safe_less(&self, other: u32) -> bool { emboss_runtime::SafeCmp::safe_less(&(*self as u64), other as u64) }
4929}
4930
4931impl emboss_runtime::SafeCmp<LEAdvertisingFilterPolicy> for u64 {
4932    fn safe_eq(&self, other: LEAdvertisingFilterPolicy) -> bool { emboss_runtime::SafeCmp::safe_eq(self, other as u64) }
4933    fn safe_less(&self, other: LEAdvertisingFilterPolicy) -> bool { emboss_runtime::SafeCmp::safe_less(self, other as u64) }
4934}
4935
4936impl emboss_runtime::SafeCmp<LEAdvertisingFilterPolicy> for i64 {
4937    fn safe_eq(&self, other: LEAdvertisingFilterPolicy) -> bool { emboss_runtime::SafeCmp::safe_eq(self, other as u64) }
4938    fn safe_less(&self, other: LEAdvertisingFilterPolicy) -> bool { emboss_runtime::SafeCmp::safe_less(self, other as u64) }
4939}
4940
4941impl<V: core::convert::Into<u64> + core::marker::Copy> emboss_runtime::TryFromRaw<V> for LEAdvertisingFilterPolicy {
4942    fn try_from_raw(val: V) -> core::result::Result<Self, emboss_runtime::Error<V>> {
4943        let v_raw: u64 = val.into();
4944        match v_raw {
4945            0 => Ok(LEAdvertisingFilterPolicy::ALLOW_ALL),
4946            1 => Ok(LEAdvertisingFilterPolicy::ALLOW_ALL_CONNECTIONS_AND_USE_FILTER_ACCEPT_LIST_FOR_SCANS),
4947            2 => Ok(LEAdvertisingFilterPolicy::ALLOW_ALL_SCANS_AND_USE_FILTER_ACCEPT_LIST_FOR_CONNECTIONS),
4948            3 => Ok(LEAdvertisingFilterPolicy::ALLOW_FILTER_ACCEPT_LIST_ONLY),
4949
4950            _ => Err(emboss_runtime::Error::UnknownEnum(val)),
4951        }
4952    }
4953}
4954
4955impl LEAdvertisingFilterPolicy {
4956
4957}
4958#[derive(Copy, Clone, Debug, Eq, PartialEq)]
4959#[repr(u64)]
4960pub enum PageScanRepetitionMode {
4961    R0_ = 0,
4962    R1_ = 1,
4963    R2_ = 2,
4964
4965}
4966
4967impl core::convert::From<PageScanRepetitionMode> for u8 { fn from(val: PageScanRepetitionMode) -> Self { val as u8 } }
4968impl core::convert::From<PageScanRepetitionMode> for u16 { fn from(val: PageScanRepetitionMode) -> Self { val as u16 } }
4969impl core::convert::From<PageScanRepetitionMode> for u32 { fn from(val: PageScanRepetitionMode) -> Self { val as u32 } }
4970impl core::convert::From<PageScanRepetitionMode> for u64 { fn from(val: PageScanRepetitionMode) -> Self { val as u64 } }
4971impl core::convert::From<PageScanRepetitionMode> for i8 { fn from(val: PageScanRepetitionMode) -> Self { val as i8 } }
4972impl core::convert::From<PageScanRepetitionMode> for i16 { fn from(val: PageScanRepetitionMode) -> Self { val as i16 } }
4973impl core::convert::From<PageScanRepetitionMode> for i32 { fn from(val: PageScanRepetitionMode) -> Self { val as i32 } }
4974impl core::convert::From<PageScanRepetitionMode> for i64 { fn from(val: PageScanRepetitionMode) -> Self { val as i64 } }
4975
4976impl emboss_runtime::SafeCmp<PageScanRepetitionMode> for PageScanRepetitionMode {
4977    fn safe_eq(&self, other: Self) -> bool { *self == other }
4978    fn safe_less(&self, other: Self) -> bool { (*self as u64) < (other as u64) }
4979}
4980
4981impl emboss_runtime::SafeCmp<u64> for PageScanRepetitionMode {
4982    fn safe_eq(&self, other: u64) -> bool { emboss_runtime::SafeCmp::safe_eq(&(*self as u64), other) }
4983    fn safe_less(&self, other: u64) -> bool { emboss_runtime::SafeCmp::safe_less(&(*self as u64), other) }
4984}
4985
4986impl emboss_runtime::SafeCmp<i64> for PageScanRepetitionMode {
4987    fn safe_eq(&self, other: i64) -> bool { emboss_runtime::SafeCmp::safe_eq(&(*self as u64), other) }
4988    fn safe_less(&self, other: i64) -> bool { emboss_runtime::SafeCmp::safe_less(&(*self as u64), other) }
4989}
4990
4991impl emboss_runtime::SafeCmp<i32> for PageScanRepetitionMode {
4992    fn safe_eq(&self, other: i32) -> bool { emboss_runtime::SafeCmp::safe_eq(&(*self as u64), other as i64) }
4993    fn safe_less(&self, other: i32) -> bool { emboss_runtime::SafeCmp::safe_less(&(*self as u64), other as i64) }
4994}
4995
4996impl emboss_runtime::SafeCmp<u32> for PageScanRepetitionMode {
4997    fn safe_eq(&self, other: u32) -> bool { emboss_runtime::SafeCmp::safe_eq(&(*self as u64), other as u64) }
4998    fn safe_less(&self, other: u32) -> bool { emboss_runtime::SafeCmp::safe_less(&(*self as u64), other as u64) }
4999}
5000
5001impl emboss_runtime::SafeCmp<PageScanRepetitionMode> for u64 {
5002    fn safe_eq(&self, other: PageScanRepetitionMode) -> bool { emboss_runtime::SafeCmp::safe_eq(self, other as u64) }
5003    fn safe_less(&self, other: PageScanRepetitionMode) -> bool { emboss_runtime::SafeCmp::safe_less(self, other as u64) }
5004}
5005
5006impl emboss_runtime::SafeCmp<PageScanRepetitionMode> for i64 {
5007    fn safe_eq(&self, other: PageScanRepetitionMode) -> bool { emboss_runtime::SafeCmp::safe_eq(self, other as u64) }
5008    fn safe_less(&self, other: PageScanRepetitionMode) -> bool { emboss_runtime::SafeCmp::safe_less(self, other as u64) }
5009}
5010
5011impl<V: core::convert::Into<u64> + core::marker::Copy> emboss_runtime::TryFromRaw<V> for PageScanRepetitionMode {
5012    fn try_from_raw(val: V) -> core::result::Result<Self, emboss_runtime::Error<V>> {
5013        let v_raw: u64 = val.into();
5014        match v_raw {
5015            0 => Ok(PageScanRepetitionMode::R0_),
5016            1 => Ok(PageScanRepetitionMode::R1_),
5017            2 => Ok(PageScanRepetitionMode::R2_),
5018
5019            _ => Err(emboss_runtime::Error::UnknownEnum(val)),
5020        }
5021    }
5022}
5023
5024impl PageScanRepetitionMode {
5025
5026}
5027#[derive(Copy, Clone, Debug, Eq, PartialEq)]
5028#[repr(u64)]
5029pub enum CodingFormat {
5030    U_LAW = 0,
5031    A_LAW = 1,
5032    CVSD = 2,
5033    TRANSPARENT = 3,
5034    LINEAR_PCM = 4,
5035    MSBC = 5,
5036    LC3 = 6,
5037    G729A = 7,
5038    VENDOR_SPECIFIC = 255,
5039
5040}
5041
5042impl core::convert::From<CodingFormat> for u8 { fn from(val: CodingFormat) -> Self { val as u8 } }
5043impl core::convert::From<CodingFormat> for u16 { fn from(val: CodingFormat) -> Self { val as u16 } }
5044impl core::convert::From<CodingFormat> for u32 { fn from(val: CodingFormat) -> Self { val as u32 } }
5045impl core::convert::From<CodingFormat> for u64 { fn from(val: CodingFormat) -> Self { val as u64 } }
5046impl core::convert::From<CodingFormat> for i8 { fn from(val: CodingFormat) -> Self { val as i8 } }
5047impl core::convert::From<CodingFormat> for i16 { fn from(val: CodingFormat) -> Self { val as i16 } }
5048impl core::convert::From<CodingFormat> for i32 { fn from(val: CodingFormat) -> Self { val as i32 } }
5049impl core::convert::From<CodingFormat> for i64 { fn from(val: CodingFormat) -> Self { val as i64 } }
5050
5051impl emboss_runtime::SafeCmp<CodingFormat> for CodingFormat {
5052    fn safe_eq(&self, other: Self) -> bool { *self == other }
5053    fn safe_less(&self, other: Self) -> bool { (*self as u64) < (other as u64) }
5054}
5055
5056impl emboss_runtime::SafeCmp<u64> for CodingFormat {
5057    fn safe_eq(&self, other: u64) -> bool { emboss_runtime::SafeCmp::safe_eq(&(*self as u64), other) }
5058    fn safe_less(&self, other: u64) -> bool { emboss_runtime::SafeCmp::safe_less(&(*self as u64), other) }
5059}
5060
5061impl emboss_runtime::SafeCmp<i64> for CodingFormat {
5062    fn safe_eq(&self, other: i64) -> bool { emboss_runtime::SafeCmp::safe_eq(&(*self as u64), other) }
5063    fn safe_less(&self, other: i64) -> bool { emboss_runtime::SafeCmp::safe_less(&(*self as u64), other) }
5064}
5065
5066impl emboss_runtime::SafeCmp<i32> for CodingFormat {
5067    fn safe_eq(&self, other: i32) -> bool { emboss_runtime::SafeCmp::safe_eq(&(*self as u64), other as i64) }
5068    fn safe_less(&self, other: i32) -> bool { emboss_runtime::SafeCmp::safe_less(&(*self as u64), other as i64) }
5069}
5070
5071impl emboss_runtime::SafeCmp<u32> for CodingFormat {
5072    fn safe_eq(&self, other: u32) -> bool { emboss_runtime::SafeCmp::safe_eq(&(*self as u64), other as u64) }
5073    fn safe_less(&self, other: u32) -> bool { emboss_runtime::SafeCmp::safe_less(&(*self as u64), other as u64) }
5074}
5075
5076impl emboss_runtime::SafeCmp<CodingFormat> for u64 {
5077    fn safe_eq(&self, other: CodingFormat) -> bool { emboss_runtime::SafeCmp::safe_eq(self, other as u64) }
5078    fn safe_less(&self, other: CodingFormat) -> bool { emboss_runtime::SafeCmp::safe_less(self, other as u64) }
5079}
5080
5081impl emboss_runtime::SafeCmp<CodingFormat> for i64 {
5082    fn safe_eq(&self, other: CodingFormat) -> bool { emboss_runtime::SafeCmp::safe_eq(self, other as u64) }
5083    fn safe_less(&self, other: CodingFormat) -> bool { emboss_runtime::SafeCmp::safe_less(self, other as u64) }
5084}
5085
5086impl<V: core::convert::Into<u64> + core::marker::Copy> emboss_runtime::TryFromRaw<V> for CodingFormat {
5087    fn try_from_raw(val: V) -> core::result::Result<Self, emboss_runtime::Error<V>> {
5088        let v_raw: u64 = val.into();
5089        match v_raw {
5090            0 => Ok(CodingFormat::U_LAW),
5091            1 => Ok(CodingFormat::A_LAW),
5092            2 => Ok(CodingFormat::CVSD),
5093            3 => Ok(CodingFormat::TRANSPARENT),
5094            4 => Ok(CodingFormat::LINEAR_PCM),
5095            5 => Ok(CodingFormat::MSBC),
5096            6 => Ok(CodingFormat::LC3),
5097            7 => Ok(CodingFormat::G729A),
5098            255 => Ok(CodingFormat::VENDOR_SPECIFIC),
5099
5100            _ => Err(emboss_runtime::Error::UnknownEnum(val)),
5101        }
5102    }
5103}
5104
5105impl CodingFormat {
5106
5107}
5108#[derive(Copy, Clone, Debug, Eq, PartialEq)]
5109#[repr(u64)]
5110pub enum IoCapability {
5111    DISPLAY_ONLY = 0,
5112    DISPLAY_YES_NO = 1,
5113    KEYBOARD_ONLY = 2,
5114    NO_INPUT_NO_OUTPUT = 3,
5115    KEYBOARD_DISPLAY = 4,
5116
5117}
5118
5119impl core::convert::From<IoCapability> for u8 { fn from(val: IoCapability) -> Self { val as u8 } }
5120impl core::convert::From<IoCapability> for u16 { fn from(val: IoCapability) -> Self { val as u16 } }
5121impl core::convert::From<IoCapability> for u32 { fn from(val: IoCapability) -> Self { val as u32 } }
5122impl core::convert::From<IoCapability> for u64 { fn from(val: IoCapability) -> Self { val as u64 } }
5123impl core::convert::From<IoCapability> for i8 { fn from(val: IoCapability) -> Self { val as i8 } }
5124impl core::convert::From<IoCapability> for i16 { fn from(val: IoCapability) -> Self { val as i16 } }
5125impl core::convert::From<IoCapability> for i32 { fn from(val: IoCapability) -> Self { val as i32 } }
5126impl core::convert::From<IoCapability> for i64 { fn from(val: IoCapability) -> Self { val as i64 } }
5127
5128impl emboss_runtime::SafeCmp<IoCapability> for IoCapability {
5129    fn safe_eq(&self, other: Self) -> bool { *self == other }
5130    fn safe_less(&self, other: Self) -> bool { (*self as u64) < (other as u64) }
5131}
5132
5133impl emboss_runtime::SafeCmp<u64> for IoCapability {
5134    fn safe_eq(&self, other: u64) -> bool { emboss_runtime::SafeCmp::safe_eq(&(*self as u64), other) }
5135    fn safe_less(&self, other: u64) -> bool { emboss_runtime::SafeCmp::safe_less(&(*self as u64), other) }
5136}
5137
5138impl emboss_runtime::SafeCmp<i64> for IoCapability {
5139    fn safe_eq(&self, other: i64) -> bool { emboss_runtime::SafeCmp::safe_eq(&(*self as u64), other) }
5140    fn safe_less(&self, other: i64) -> bool { emboss_runtime::SafeCmp::safe_less(&(*self as u64), other) }
5141}
5142
5143impl emboss_runtime::SafeCmp<i32> for IoCapability {
5144    fn safe_eq(&self, other: i32) -> bool { emboss_runtime::SafeCmp::safe_eq(&(*self as u64), other as i64) }
5145    fn safe_less(&self, other: i32) -> bool { emboss_runtime::SafeCmp::safe_less(&(*self as u64), other as i64) }
5146}
5147
5148impl emboss_runtime::SafeCmp<u32> for IoCapability {
5149    fn safe_eq(&self, other: u32) -> bool { emboss_runtime::SafeCmp::safe_eq(&(*self as u64), other as u64) }
5150    fn safe_less(&self, other: u32) -> bool { emboss_runtime::SafeCmp::safe_less(&(*self as u64), other as u64) }
5151}
5152
5153impl emboss_runtime::SafeCmp<IoCapability> for u64 {
5154    fn safe_eq(&self, other: IoCapability) -> bool { emboss_runtime::SafeCmp::safe_eq(self, other as u64) }
5155    fn safe_less(&self, other: IoCapability) -> bool { emboss_runtime::SafeCmp::safe_less(self, other as u64) }
5156}
5157
5158impl emboss_runtime::SafeCmp<IoCapability> for i64 {
5159    fn safe_eq(&self, other: IoCapability) -> bool { emboss_runtime::SafeCmp::safe_eq(self, other as u64) }
5160    fn safe_less(&self, other: IoCapability) -> bool { emboss_runtime::SafeCmp::safe_less(self, other as u64) }
5161}
5162
5163impl<V: core::convert::Into<u64> + core::marker::Copy> emboss_runtime::TryFromRaw<V> for IoCapability {
5164    fn try_from_raw(val: V) -> core::result::Result<Self, emboss_runtime::Error<V>> {
5165        let v_raw: u64 = val.into();
5166        match v_raw {
5167            0 => Ok(IoCapability::DISPLAY_ONLY),
5168            1 => Ok(IoCapability::DISPLAY_YES_NO),
5169            2 => Ok(IoCapability::KEYBOARD_ONLY),
5170            3 => Ok(IoCapability::NO_INPUT_NO_OUTPUT),
5171            4 => Ok(IoCapability::KEYBOARD_DISPLAY),
5172
5173            _ => Err(emboss_runtime::Error::UnknownEnum(val)),
5174        }
5175    }
5176}
5177
5178impl IoCapability {
5179
5180}
5181#[derive(Copy, Clone, Debug, Eq, PartialEq)]
5182#[repr(u64)]
5183pub enum LESleepClockAccuracyRange {
5184    PPM_251_TO_500 = 0,
5185    PPM_151_TO_250 = 1,
5186    PPM_101_TO_150 = 2,
5187    PPM_76_TO_100 = 3,
5188    PPM_51_TO_75 = 4,
5189    PPM_31_TO_50 = 5,
5190    PPM_21_TO_30 = 6,
5191    PPM_0_TO_20 = 7,
5192
5193}
5194
5195impl core::convert::From<LESleepClockAccuracyRange> for u8 { fn from(val: LESleepClockAccuracyRange) -> Self { val as u8 } }
5196impl core::convert::From<LESleepClockAccuracyRange> for u16 { fn from(val: LESleepClockAccuracyRange) -> Self { val as u16 } }
5197impl core::convert::From<LESleepClockAccuracyRange> for u32 { fn from(val: LESleepClockAccuracyRange) -> Self { val as u32 } }
5198impl core::convert::From<LESleepClockAccuracyRange> for u64 { fn from(val: LESleepClockAccuracyRange) -> Self { val as u64 } }
5199impl core::convert::From<LESleepClockAccuracyRange> for i8 { fn from(val: LESleepClockAccuracyRange) -> Self { val as i8 } }
5200impl core::convert::From<LESleepClockAccuracyRange> for i16 { fn from(val: LESleepClockAccuracyRange) -> Self { val as i16 } }
5201impl core::convert::From<LESleepClockAccuracyRange> for i32 { fn from(val: LESleepClockAccuracyRange) -> Self { val as i32 } }
5202impl core::convert::From<LESleepClockAccuracyRange> for i64 { fn from(val: LESleepClockAccuracyRange) -> Self { val as i64 } }
5203
5204impl emboss_runtime::SafeCmp<LESleepClockAccuracyRange> for LESleepClockAccuracyRange {
5205    fn safe_eq(&self, other: Self) -> bool { *self == other }
5206    fn safe_less(&self, other: Self) -> bool { (*self as u64) < (other as u64) }
5207}
5208
5209impl emboss_runtime::SafeCmp<u64> for LESleepClockAccuracyRange {
5210    fn safe_eq(&self, other: u64) -> bool { emboss_runtime::SafeCmp::safe_eq(&(*self as u64), other) }
5211    fn safe_less(&self, other: u64) -> bool { emboss_runtime::SafeCmp::safe_less(&(*self as u64), other) }
5212}
5213
5214impl emboss_runtime::SafeCmp<i64> for LESleepClockAccuracyRange {
5215    fn safe_eq(&self, other: i64) -> bool { emboss_runtime::SafeCmp::safe_eq(&(*self as u64), other) }
5216    fn safe_less(&self, other: i64) -> bool { emboss_runtime::SafeCmp::safe_less(&(*self as u64), other) }
5217}
5218
5219impl emboss_runtime::SafeCmp<i32> for LESleepClockAccuracyRange {
5220    fn safe_eq(&self, other: i32) -> bool { emboss_runtime::SafeCmp::safe_eq(&(*self as u64), other as i64) }
5221    fn safe_less(&self, other: i32) -> bool { emboss_runtime::SafeCmp::safe_less(&(*self as u64), other as i64) }
5222}
5223
5224impl emboss_runtime::SafeCmp<u32> for LESleepClockAccuracyRange {
5225    fn safe_eq(&self, other: u32) -> bool { emboss_runtime::SafeCmp::safe_eq(&(*self as u64), other as u64) }
5226    fn safe_less(&self, other: u32) -> bool { emboss_runtime::SafeCmp::safe_less(&(*self as u64), other as u64) }
5227}
5228
5229impl emboss_runtime::SafeCmp<LESleepClockAccuracyRange> for u64 {
5230    fn safe_eq(&self, other: LESleepClockAccuracyRange) -> bool { emboss_runtime::SafeCmp::safe_eq(self, other as u64) }
5231    fn safe_less(&self, other: LESleepClockAccuracyRange) -> bool { emboss_runtime::SafeCmp::safe_less(self, other as u64) }
5232}
5233
5234impl emboss_runtime::SafeCmp<LESleepClockAccuracyRange> for i64 {
5235    fn safe_eq(&self, other: LESleepClockAccuracyRange) -> bool { emboss_runtime::SafeCmp::safe_eq(self, other as u64) }
5236    fn safe_less(&self, other: LESleepClockAccuracyRange) -> bool { emboss_runtime::SafeCmp::safe_less(self, other as u64) }
5237}
5238
5239impl<V: core::convert::Into<u64> + core::marker::Copy> emboss_runtime::TryFromRaw<V> for LESleepClockAccuracyRange {
5240    fn try_from_raw(val: V) -> core::result::Result<Self, emboss_runtime::Error<V>> {
5241        let v_raw: u64 = val.into();
5242        match v_raw {
5243            0 => Ok(LESleepClockAccuracyRange::PPM_251_TO_500),
5244            1 => Ok(LESleepClockAccuracyRange::PPM_151_TO_250),
5245            2 => Ok(LESleepClockAccuracyRange::PPM_101_TO_150),
5246            3 => Ok(LESleepClockAccuracyRange::PPM_76_TO_100),
5247            4 => Ok(LESleepClockAccuracyRange::PPM_51_TO_75),
5248            5 => Ok(LESleepClockAccuracyRange::PPM_31_TO_50),
5249            6 => Ok(LESleepClockAccuracyRange::PPM_21_TO_30),
5250            7 => Ok(LESleepClockAccuracyRange::PPM_0_TO_20),
5251
5252            _ => Err(emboss_runtime::Error::UnknownEnum(val)),
5253        }
5254    }
5255}
5256
5257impl LESleepClockAccuracyRange {
5258
5259}
5260#[derive(Copy, Clone, Debug, Eq, PartialEq)]
5261#[repr(u64)]
5262pub enum AuthenticationRequirements {
5263    NO_BONDING = 0,
5264    MITM_NO_BONDING = 1,
5265    DEDICATED_BONDING = 2,
5266    MITM_DEDICATED_BONDING = 3,
5267    GENERAL_BONDING = 4,
5268    MITM_GENERAL_BONDING = 5,
5269
5270}
5271
5272impl core::convert::From<AuthenticationRequirements> for u8 { fn from(val: AuthenticationRequirements) -> Self { val as u8 } }
5273impl core::convert::From<AuthenticationRequirements> for u16 { fn from(val: AuthenticationRequirements) -> Self { val as u16 } }
5274impl core::convert::From<AuthenticationRequirements> for u32 { fn from(val: AuthenticationRequirements) -> Self { val as u32 } }
5275impl core::convert::From<AuthenticationRequirements> for u64 { fn from(val: AuthenticationRequirements) -> Self { val as u64 } }
5276impl core::convert::From<AuthenticationRequirements> for i8 { fn from(val: AuthenticationRequirements) -> Self { val as i8 } }
5277impl core::convert::From<AuthenticationRequirements> for i16 { fn from(val: AuthenticationRequirements) -> Self { val as i16 } }
5278impl core::convert::From<AuthenticationRequirements> for i32 { fn from(val: AuthenticationRequirements) -> Self { val as i32 } }
5279impl core::convert::From<AuthenticationRequirements> for i64 { fn from(val: AuthenticationRequirements) -> Self { val as i64 } }
5280
5281impl emboss_runtime::SafeCmp<AuthenticationRequirements> for AuthenticationRequirements {
5282    fn safe_eq(&self, other: Self) -> bool { *self == other }
5283    fn safe_less(&self, other: Self) -> bool { (*self as u64) < (other as u64) }
5284}
5285
5286impl emboss_runtime::SafeCmp<u64> for AuthenticationRequirements {
5287    fn safe_eq(&self, other: u64) -> bool { emboss_runtime::SafeCmp::safe_eq(&(*self as u64), other) }
5288    fn safe_less(&self, other: u64) -> bool { emboss_runtime::SafeCmp::safe_less(&(*self as u64), other) }
5289}
5290
5291impl emboss_runtime::SafeCmp<i64> for AuthenticationRequirements {
5292    fn safe_eq(&self, other: i64) -> bool { emboss_runtime::SafeCmp::safe_eq(&(*self as u64), other) }
5293    fn safe_less(&self, other: i64) -> bool { emboss_runtime::SafeCmp::safe_less(&(*self as u64), other) }
5294}
5295
5296impl emboss_runtime::SafeCmp<i32> for AuthenticationRequirements {
5297    fn safe_eq(&self, other: i32) -> bool { emboss_runtime::SafeCmp::safe_eq(&(*self as u64), other as i64) }
5298    fn safe_less(&self, other: i32) -> bool { emboss_runtime::SafeCmp::safe_less(&(*self as u64), other as i64) }
5299}
5300
5301impl emboss_runtime::SafeCmp<u32> for AuthenticationRequirements {
5302    fn safe_eq(&self, other: u32) -> bool { emboss_runtime::SafeCmp::safe_eq(&(*self as u64), other as u64) }
5303    fn safe_less(&self, other: u32) -> bool { emboss_runtime::SafeCmp::safe_less(&(*self as u64), other as u64) }
5304}
5305
5306impl emboss_runtime::SafeCmp<AuthenticationRequirements> for u64 {
5307    fn safe_eq(&self, other: AuthenticationRequirements) -> bool { emboss_runtime::SafeCmp::safe_eq(self, other as u64) }
5308    fn safe_less(&self, other: AuthenticationRequirements) -> bool { emboss_runtime::SafeCmp::safe_less(self, other as u64) }
5309}
5310
5311impl emboss_runtime::SafeCmp<AuthenticationRequirements> for i64 {
5312    fn safe_eq(&self, other: AuthenticationRequirements) -> bool { emboss_runtime::SafeCmp::safe_eq(self, other as u64) }
5313    fn safe_less(&self, other: AuthenticationRequirements) -> bool { emboss_runtime::SafeCmp::safe_less(self, other as u64) }
5314}
5315
5316impl<V: core::convert::Into<u64> + core::marker::Copy> emboss_runtime::TryFromRaw<V> for AuthenticationRequirements {
5317    fn try_from_raw(val: V) -> core::result::Result<Self, emboss_runtime::Error<V>> {
5318        let v_raw: u64 = val.into();
5319        match v_raw {
5320            0 => Ok(AuthenticationRequirements::NO_BONDING),
5321            1 => Ok(AuthenticationRequirements::MITM_NO_BONDING),
5322            2 => Ok(AuthenticationRequirements::DEDICATED_BONDING),
5323            3 => Ok(AuthenticationRequirements::MITM_DEDICATED_BONDING),
5324            4 => Ok(AuthenticationRequirements::GENERAL_BONDING),
5325            5 => Ok(AuthenticationRequirements::MITM_GENERAL_BONDING),
5326
5327            _ => Err(emboss_runtime::Error::UnknownEnum(val)),
5328        }
5329    }
5330}
5331
5332impl AuthenticationRequirements {
5333
5334}
5335#[derive(Copy, Clone, Debug, Eq, PartialEq)]
5336#[repr(u64)]
5337pub enum PinType {
5338    VARIABLE = 0,
5339    FIXED = 1,
5340
5341}
5342
5343impl core::convert::From<PinType> for u8 { fn from(val: PinType) -> Self { val as u8 } }
5344impl core::convert::From<PinType> for u16 { fn from(val: PinType) -> Self { val as u16 } }
5345impl core::convert::From<PinType> for u32 { fn from(val: PinType) -> Self { val as u32 } }
5346impl core::convert::From<PinType> for u64 { fn from(val: PinType) -> Self { val as u64 } }
5347impl core::convert::From<PinType> for i8 { fn from(val: PinType) -> Self { val as i8 } }
5348impl core::convert::From<PinType> for i16 { fn from(val: PinType) -> Self { val as i16 } }
5349impl core::convert::From<PinType> for i32 { fn from(val: PinType) -> Self { val as i32 } }
5350impl core::convert::From<PinType> for i64 { fn from(val: PinType) -> Self { val as i64 } }
5351
5352impl emboss_runtime::SafeCmp<PinType> for PinType {
5353    fn safe_eq(&self, other: Self) -> bool { *self == other }
5354    fn safe_less(&self, other: Self) -> bool { (*self as u64) < (other as u64) }
5355}
5356
5357impl emboss_runtime::SafeCmp<u64> for PinType {
5358    fn safe_eq(&self, other: u64) -> bool { emboss_runtime::SafeCmp::safe_eq(&(*self as u64), other) }
5359    fn safe_less(&self, other: u64) -> bool { emboss_runtime::SafeCmp::safe_less(&(*self as u64), other) }
5360}
5361
5362impl emboss_runtime::SafeCmp<i64> for PinType {
5363    fn safe_eq(&self, other: i64) -> bool { emboss_runtime::SafeCmp::safe_eq(&(*self as u64), other) }
5364    fn safe_less(&self, other: i64) -> bool { emboss_runtime::SafeCmp::safe_less(&(*self as u64), other) }
5365}
5366
5367impl emboss_runtime::SafeCmp<i32> for PinType {
5368    fn safe_eq(&self, other: i32) -> bool { emboss_runtime::SafeCmp::safe_eq(&(*self as u64), other as i64) }
5369    fn safe_less(&self, other: i32) -> bool { emboss_runtime::SafeCmp::safe_less(&(*self as u64), other as i64) }
5370}
5371
5372impl emboss_runtime::SafeCmp<u32> for PinType {
5373    fn safe_eq(&self, other: u32) -> bool { emboss_runtime::SafeCmp::safe_eq(&(*self as u64), other as u64) }
5374    fn safe_less(&self, other: u32) -> bool { emboss_runtime::SafeCmp::safe_less(&(*self as u64), other as u64) }
5375}
5376
5377impl emboss_runtime::SafeCmp<PinType> for u64 {
5378    fn safe_eq(&self, other: PinType) -> bool { emboss_runtime::SafeCmp::safe_eq(self, other as u64) }
5379    fn safe_less(&self, other: PinType) -> bool { emboss_runtime::SafeCmp::safe_less(self, other as u64) }
5380}
5381
5382impl emboss_runtime::SafeCmp<PinType> for i64 {
5383    fn safe_eq(&self, other: PinType) -> bool { emboss_runtime::SafeCmp::safe_eq(self, other as u64) }
5384    fn safe_less(&self, other: PinType) -> bool { emboss_runtime::SafeCmp::safe_less(self, other as u64) }
5385}
5386
5387impl<V: core::convert::Into<u64> + core::marker::Copy> emboss_runtime::TryFromRaw<V> for PinType {
5388    fn try_from_raw(val: V) -> core::result::Result<Self, emboss_runtime::Error<V>> {
5389        let v_raw: u64 = val.into();
5390        match v_raw {
5391            0 => Ok(PinType::VARIABLE),
5392            1 => Ok(PinType::FIXED),
5393
5394            _ => Err(emboss_runtime::Error::UnknownEnum(val)),
5395        }
5396    }
5397}
5398
5399impl PinType {
5400
5401}
5402#[derive(Copy, Clone, Debug, Eq, PartialEq)]
5403#[repr(u64)]
5404pub enum InquiryScanType {
5405    STANDARD = 0,
5406    INTERLACED = 1,
5407
5408}
5409
5410impl core::convert::From<InquiryScanType> for u8 { fn from(val: InquiryScanType) -> Self { val as u8 } }
5411impl core::convert::From<InquiryScanType> for u16 { fn from(val: InquiryScanType) -> Self { val as u16 } }
5412impl core::convert::From<InquiryScanType> for u32 { fn from(val: InquiryScanType) -> Self { val as u32 } }
5413impl core::convert::From<InquiryScanType> for u64 { fn from(val: InquiryScanType) -> Self { val as u64 } }
5414impl core::convert::From<InquiryScanType> for i8 { fn from(val: InquiryScanType) -> Self { val as i8 } }
5415impl core::convert::From<InquiryScanType> for i16 { fn from(val: InquiryScanType) -> Self { val as i16 } }
5416impl core::convert::From<InquiryScanType> for i32 { fn from(val: InquiryScanType) -> Self { val as i32 } }
5417impl core::convert::From<InquiryScanType> for i64 { fn from(val: InquiryScanType) -> Self { val as i64 } }
5418
5419impl emboss_runtime::SafeCmp<InquiryScanType> for InquiryScanType {
5420    fn safe_eq(&self, other: Self) -> bool { *self == other }
5421    fn safe_less(&self, other: Self) -> bool { (*self as u64) < (other as u64) }
5422}
5423
5424impl emboss_runtime::SafeCmp<u64> for InquiryScanType {
5425    fn safe_eq(&self, other: u64) -> bool { emboss_runtime::SafeCmp::safe_eq(&(*self as u64), other) }
5426    fn safe_less(&self, other: u64) -> bool { emboss_runtime::SafeCmp::safe_less(&(*self as u64), other) }
5427}
5428
5429impl emboss_runtime::SafeCmp<i64> for InquiryScanType {
5430    fn safe_eq(&self, other: i64) -> bool { emboss_runtime::SafeCmp::safe_eq(&(*self as u64), other) }
5431    fn safe_less(&self, other: i64) -> bool { emboss_runtime::SafeCmp::safe_less(&(*self as u64), other) }
5432}
5433
5434impl emboss_runtime::SafeCmp<i32> for InquiryScanType {
5435    fn safe_eq(&self, other: i32) -> bool { emboss_runtime::SafeCmp::safe_eq(&(*self as u64), other as i64) }
5436    fn safe_less(&self, other: i32) -> bool { emboss_runtime::SafeCmp::safe_less(&(*self as u64), other as i64) }
5437}
5438
5439impl emboss_runtime::SafeCmp<u32> for InquiryScanType {
5440    fn safe_eq(&self, other: u32) -> bool { emboss_runtime::SafeCmp::safe_eq(&(*self as u64), other as u64) }
5441    fn safe_less(&self, other: u32) -> bool { emboss_runtime::SafeCmp::safe_less(&(*self as u64), other as u64) }
5442}
5443
5444impl emboss_runtime::SafeCmp<InquiryScanType> for u64 {
5445    fn safe_eq(&self, other: InquiryScanType) -> bool { emboss_runtime::SafeCmp::safe_eq(self, other as u64) }
5446    fn safe_less(&self, other: InquiryScanType) -> bool { emboss_runtime::SafeCmp::safe_less(self, other as u64) }
5447}
5448
5449impl emboss_runtime::SafeCmp<InquiryScanType> for i64 {
5450    fn safe_eq(&self, other: InquiryScanType) -> bool { emboss_runtime::SafeCmp::safe_eq(self, other as u64) }
5451    fn safe_less(&self, other: InquiryScanType) -> bool { emboss_runtime::SafeCmp::safe_less(self, other as u64) }
5452}
5453
5454impl<V: core::convert::Into<u64> + core::marker::Copy> emboss_runtime::TryFromRaw<V> for InquiryScanType {
5455    fn try_from_raw(val: V) -> core::result::Result<Self, emboss_runtime::Error<V>> {
5456        let v_raw: u64 = val.into();
5457        match v_raw {
5458            0 => Ok(InquiryScanType::STANDARD),
5459            1 => Ok(InquiryScanType::INTERLACED),
5460
5461            _ => Err(emboss_runtime::Error::UnknownEnum(val)),
5462        }
5463    }
5464}
5465
5466impl InquiryScanType {
5467
5468}
5469#[derive(Copy, Clone, Debug, Eq, PartialEq)]
5470#[repr(u64)]
5471pub enum InquiryMode {
5472    STANDARD = 0,
5473    RSSI = 1,
5474    EXTENDED = 2,
5475
5476}
5477
5478impl core::convert::From<InquiryMode> for u8 { fn from(val: InquiryMode) -> Self { val as u8 } }
5479impl core::convert::From<InquiryMode> for u16 { fn from(val: InquiryMode) -> Self { val as u16 } }
5480impl core::convert::From<InquiryMode> for u32 { fn from(val: InquiryMode) -> Self { val as u32 } }
5481impl core::convert::From<InquiryMode> for u64 { fn from(val: InquiryMode) -> Self { val as u64 } }
5482impl core::convert::From<InquiryMode> for i8 { fn from(val: InquiryMode) -> Self { val as i8 } }
5483impl core::convert::From<InquiryMode> for i16 { fn from(val: InquiryMode) -> Self { val as i16 } }
5484impl core::convert::From<InquiryMode> for i32 { fn from(val: InquiryMode) -> Self { val as i32 } }
5485impl core::convert::From<InquiryMode> for i64 { fn from(val: InquiryMode) -> Self { val as i64 } }
5486
5487impl emboss_runtime::SafeCmp<InquiryMode> for InquiryMode {
5488    fn safe_eq(&self, other: Self) -> bool { *self == other }
5489    fn safe_less(&self, other: Self) -> bool { (*self as u64) < (other as u64) }
5490}
5491
5492impl emboss_runtime::SafeCmp<u64> for InquiryMode {
5493    fn safe_eq(&self, other: u64) -> bool { emboss_runtime::SafeCmp::safe_eq(&(*self as u64), other) }
5494    fn safe_less(&self, other: u64) -> bool { emboss_runtime::SafeCmp::safe_less(&(*self as u64), other) }
5495}
5496
5497impl emboss_runtime::SafeCmp<i64> for InquiryMode {
5498    fn safe_eq(&self, other: i64) -> bool { emboss_runtime::SafeCmp::safe_eq(&(*self as u64), other) }
5499    fn safe_less(&self, other: i64) -> bool { emboss_runtime::SafeCmp::safe_less(&(*self as u64), other) }
5500}
5501
5502impl emboss_runtime::SafeCmp<i32> for InquiryMode {
5503    fn safe_eq(&self, other: i32) -> bool { emboss_runtime::SafeCmp::safe_eq(&(*self as u64), other as i64) }
5504    fn safe_less(&self, other: i32) -> bool { emboss_runtime::SafeCmp::safe_less(&(*self as u64), other as i64) }
5505}
5506
5507impl emboss_runtime::SafeCmp<u32> for InquiryMode {
5508    fn safe_eq(&self, other: u32) -> bool { emboss_runtime::SafeCmp::safe_eq(&(*self as u64), other as u64) }
5509    fn safe_less(&self, other: u32) -> bool { emboss_runtime::SafeCmp::safe_less(&(*self as u64), other as u64) }
5510}
5511
5512impl emboss_runtime::SafeCmp<InquiryMode> for u64 {
5513    fn safe_eq(&self, other: InquiryMode) -> bool { emboss_runtime::SafeCmp::safe_eq(self, other as u64) }
5514    fn safe_less(&self, other: InquiryMode) -> bool { emboss_runtime::SafeCmp::safe_less(self, other as u64) }
5515}
5516
5517impl emboss_runtime::SafeCmp<InquiryMode> for i64 {
5518    fn safe_eq(&self, other: InquiryMode) -> bool { emboss_runtime::SafeCmp::safe_eq(self, other as u64) }
5519    fn safe_less(&self, other: InquiryMode) -> bool { emboss_runtime::SafeCmp::safe_less(self, other as u64) }
5520}
5521
5522impl<V: core::convert::Into<u64> + core::marker::Copy> emboss_runtime::TryFromRaw<V> for InquiryMode {
5523    fn try_from_raw(val: V) -> core::result::Result<Self, emboss_runtime::Error<V>> {
5524        let v_raw: u64 = val.into();
5525        match v_raw {
5526            0 => Ok(InquiryMode::STANDARD),
5527            1 => Ok(InquiryMode::RSSI),
5528            2 => Ok(InquiryMode::EXTENDED),
5529
5530            _ => Err(emboss_runtime::Error::UnknownEnum(val)),
5531        }
5532    }
5533}
5534
5535impl InquiryMode {
5536
5537}
5538#[derive(Copy, Clone, Debug, Eq, PartialEq)]
5539#[repr(u64)]
5540pub enum PageScanType {
5541    STANDARD_SCAN = 0,
5542    INTERLACED_SCAN = 1,
5543
5544}
5545
5546impl core::convert::From<PageScanType> for u8 { fn from(val: PageScanType) -> Self { val as u8 } }
5547impl core::convert::From<PageScanType> for u16 { fn from(val: PageScanType) -> Self { val as u16 } }
5548impl core::convert::From<PageScanType> for u32 { fn from(val: PageScanType) -> Self { val as u32 } }
5549impl core::convert::From<PageScanType> for u64 { fn from(val: PageScanType) -> Self { val as u64 } }
5550impl core::convert::From<PageScanType> for i8 { fn from(val: PageScanType) -> Self { val as i8 } }
5551impl core::convert::From<PageScanType> for i16 { fn from(val: PageScanType) -> Self { val as i16 } }
5552impl core::convert::From<PageScanType> for i32 { fn from(val: PageScanType) -> Self { val as i32 } }
5553impl core::convert::From<PageScanType> for i64 { fn from(val: PageScanType) -> Self { val as i64 } }
5554
5555impl emboss_runtime::SafeCmp<PageScanType> for PageScanType {
5556    fn safe_eq(&self, other: Self) -> bool { *self == other }
5557    fn safe_less(&self, other: Self) -> bool { (*self as u64) < (other as u64) }
5558}
5559
5560impl emboss_runtime::SafeCmp<u64> for PageScanType {
5561    fn safe_eq(&self, other: u64) -> bool { emboss_runtime::SafeCmp::safe_eq(&(*self as u64), other) }
5562    fn safe_less(&self, other: u64) -> bool { emboss_runtime::SafeCmp::safe_less(&(*self as u64), other) }
5563}
5564
5565impl emboss_runtime::SafeCmp<i64> for PageScanType {
5566    fn safe_eq(&self, other: i64) -> bool { emboss_runtime::SafeCmp::safe_eq(&(*self as u64), other) }
5567    fn safe_less(&self, other: i64) -> bool { emboss_runtime::SafeCmp::safe_less(&(*self as u64), other) }
5568}
5569
5570impl emboss_runtime::SafeCmp<i32> for PageScanType {
5571    fn safe_eq(&self, other: i32) -> bool { emboss_runtime::SafeCmp::safe_eq(&(*self as u64), other as i64) }
5572    fn safe_less(&self, other: i32) -> bool { emboss_runtime::SafeCmp::safe_less(&(*self as u64), other as i64) }
5573}
5574
5575impl emboss_runtime::SafeCmp<u32> for PageScanType {
5576    fn safe_eq(&self, other: u32) -> bool { emboss_runtime::SafeCmp::safe_eq(&(*self as u64), other as u64) }
5577    fn safe_less(&self, other: u32) -> bool { emboss_runtime::SafeCmp::safe_less(&(*self as u64), other as u64) }
5578}
5579
5580impl emboss_runtime::SafeCmp<PageScanType> for u64 {
5581    fn safe_eq(&self, other: PageScanType) -> bool { emboss_runtime::SafeCmp::safe_eq(self, other as u64) }
5582    fn safe_less(&self, other: PageScanType) -> bool { emboss_runtime::SafeCmp::safe_less(self, other as u64) }
5583}
5584
5585impl emboss_runtime::SafeCmp<PageScanType> for i64 {
5586    fn safe_eq(&self, other: PageScanType) -> bool { emboss_runtime::SafeCmp::safe_eq(self, other as u64) }
5587    fn safe_less(&self, other: PageScanType) -> bool { emboss_runtime::SafeCmp::safe_less(self, other as u64) }
5588}
5589
5590impl<V: core::convert::Into<u64> + core::marker::Copy> emboss_runtime::TryFromRaw<V> for PageScanType {
5591    fn try_from_raw(val: V) -> core::result::Result<Self, emboss_runtime::Error<V>> {
5592        let v_raw: u64 = val.into();
5593        match v_raw {
5594            0 => Ok(PageScanType::STANDARD_SCAN),
5595            1 => Ok(PageScanType::INTERLACED_SCAN),
5596
5597            _ => Err(emboss_runtime::Error::UnknownEnum(val)),
5598        }
5599    }
5600}
5601
5602impl PageScanType {
5603
5604}
5605pub struct LinkKey_Value_ArrayView<S: emboss_runtime::Storage> {
5606    storage: S,
5607    element_count: usize,
5608}
5609
5610impl<S: emboss_runtime::Storage + core::clone::Clone> core::clone::Clone for LinkKey_Value_ArrayView<S> {
5611    fn clone(&self) -> Self {
5612        Self {
5613            storage: self.storage.clone(),
5614            element_count: self.element_count,
5615        }
5616    }
5617}
5618
5619impl<S: emboss_runtime::Storage> LinkKey_Value_ArrayView<S> {
5620    pub const ELEMENT_SIZE_BYTES: usize = 1;
5621    pub fn new(storage: S, element_count: usize) -> Self {
5622        Self { storage, element_count }
5623    }
5624    pub fn element_count(&self) -> usize {
5625        self.element_count
5626    }
5627    pub fn get(&self, index: usize) -> core::result::Result<emboss_runtime::UInt<8, emboss_runtime::LittleEndian, S::Sliced<'_>>
5628, emboss_runtime::Error> {
5629        if index >= self.element_count {
5630            return core::result::Result::Err(emboss_runtime::Error::OutOfBounds);
5631        }
5632        let offset = index * Self::ELEMENT_SIZE_BYTES;
5633        let storage = self.storage.slice(offset, Self::ELEMENT_SIZE_BYTES);
5634        core::result::Result::Ok(emboss_runtime::UInt::new(storage)
5635)
5636    }
5637}
5638
5639pub struct LinkKey_Value_ArrayViewMut<S: emboss_runtime::MutStorage> {
5640    storage: S,
5641    element_count: usize,
5642}
5643
5644impl<S: emboss_runtime::MutStorage> LinkKey_Value_ArrayViewMut<S> {
5645    pub const ELEMENT_SIZE_BYTES: usize = 1;
5646    pub fn new(storage: S, element_count: usize) -> Self {
5647        Self { storage, element_count }
5648    }
5649    pub fn element_count(&self) -> usize {
5650        self.element_count
5651    }
5652    pub fn get_mut(&mut self, index: usize) -> core::result::Result<emboss_runtime::UInt<8, emboss_runtime::LittleEndian, S::SlicedMut<'_>>
5653, emboss_runtime::Error> {
5654        if index >= self.element_count {
5655            return core::result::Result::Err(emboss_runtime::Error::OutOfBounds);
5656        }
5657        let offset = index * Self::ELEMENT_SIZE_BYTES;
5658        let storage = self.storage.slice_mut(offset, Self::ELEMENT_SIZE_BYTES);
5659        core::result::Result::Ok(emboss_runtime::UInt::new(storage)
5660)
5661    }
5662}
5663pub struct LinkKey<S: emboss_runtime::Storage, ST: emboss_runtime::State = emboss_runtime::UncheckedState> {
5664    storage: S,
5665    _marker: core::marker::PhantomData<ST>,
5666}
5667
5668impl<S: emboss_runtime::Storage> LinkKey<S, emboss_runtime::UncheckedState> {
5669    pub fn new(storage: S) -> Self {
5670        Self {
5671            storage,
5672            _marker: core::marker::PhantomData,
5673        }
5674    }
5675}
5676
5677impl<S: emboss_runtime::Storage + core::clone::Clone, ST: emboss_runtime::State> core::clone::Clone for LinkKey<S, ST> {
5678    fn clone(&self) -> Self {
5679        Self {
5680            storage: self.storage.clone(),
5681            _marker: core::marker::PhantomData,
5682        }
5683    }
5684}
5685
5686impl<S: emboss_runtime::Storage, ST: emboss_runtime::State> LinkKey<S, ST> {
5687    /**
5688     * Constructs a view in a specific typestate.
5689     *
5690     * # Safety
5691     *
5692     * The caller must ensure that `storage` satisfies the layout invariants for `ST`.
5693     */
5694    pub unsafe fn new_in_state(storage: S) -> Self {
5695        Self {
5696            storage,
5697            _marker: core::marker::PhantomData,
5698        }
5699    }
5700    pub fn into_storage(self) -> S {
5701        self.storage
5702    }
5703    pub fn value(&self) -> core::result::Result<LinkKey_Value_ArrayView<S::Sliced<'_>>, emboss_runtime::Error> {
5704        let offset_res = (|| -> core::result::Result<(usize, usize, usize), emboss_runtime::Error> {
5705            let offset = (0) as usize;
5706            let len = (16) as usize;
5707            let element_count = (len / (1)) as usize;
5708            core::result::Result::Ok((offset, len, element_count))
5709        })();
5710        match offset_res {
5711            core::result::Result::Ok((offset, len, element_count)) => {
5712                if len > 0 {
5713                    let end = offset.checked_add(len).ok_or(emboss_runtime::Error::OutOfBounds)?;
5714                    self.storage.try_read_byte(end - 1)?;
5715                }
5716                let storage = self.storage.slice(offset, len);
5717                core::result::Result::Ok(LinkKey_Value_ArrayView::new(storage, element_count))
5718            },
5719            core::result::Result::Err(e) => core::result::Result::Err(e),
5720        }
5721    }
5722
5723}
5724
5725pub struct LinkKeyMut<S: emboss_runtime::MutStorage> {
5726    storage: S,
5727}
5728
5729impl<S: emboss_runtime::MutStorage> LinkKeyMut<S> {
5730    pub fn new(storage: S) -> Self {
5731        Self {
5732            storage,
5733        }
5734    }
5735    pub fn into_writer(self) -> LinkKeyWriter<S, emboss_runtime::UncheckedState> {
5736        LinkKeyWriter::new(self.storage)
5737    }
5738    /** Borrows the mutable view as an immutable view in UncheckedState. */
5739    pub fn as_view(&self) -> LinkKey<S::Sliced<'_>, emboss_runtime::UncheckedState> {
5740        unsafe { LinkKey::new_in_state(self.storage.slice(0, self.storage.len())) }
5741    }
5742    pub fn value_mut(&mut self) -> core::result::Result<LinkKey_Value_ArrayViewMut<S::SlicedMut<'_>>, emboss_runtime::Error> {
5743        let offset_res = (|| -> core::result::Result<(usize, usize, usize), emboss_runtime::Error> {
5744            let offset = (0) as usize;
5745            let len = (16) as usize;
5746            let element_count = (len / (1)) as usize;
5747            core::result::Result::Ok((offset, len, element_count))
5748        })();
5749        match offset_res {
5750            core::result::Result::Ok((offset, len, element_count)) => {
5751                if len > 0 {
5752                    let end = offset.checked_add(len).ok_or(emboss_runtime::Error::OutOfBounds)?;
5753                    self.storage.try_read_byte(end - 1)?;
5754                }
5755                let storage = self.storage.slice_mut(offset, len);
5756                core::result::Result::Ok(LinkKey_Value_ArrayViewMut::new(storage, element_count))
5757            },
5758            core::result::Result::Err(e) => core::result::Result::Err(e),
5759        }
5760    }
5761
5762}
5763
5764impl<S: emboss_runtime::MutStorage> emboss_runtime::IntoWriter for LinkKeyMut<S> {
5765    type Writer = LinkKeyWriter<S, emboss_runtime::UncheckedState>;
5766    fn into_writer(self) -> Self::Writer {
5767        LinkKeyWriter::new(self.storage)
5768    }
5769}
5770
5771pub struct LinkKeyWriter<S: emboss_runtime::MutStorage, ST: emboss_runtime::State = emboss_runtime::UncheckedState> {
5772    storage: S,
5773    _marker: core::marker::PhantomData<ST>,
5774}
5775
5776impl<S: emboss_runtime::MutStorage> LinkKeyWriter<S, emboss_runtime::UncheckedState> {
5777    pub fn new(storage: S) -> Self {
5778        Self {
5779            storage,
5780            _marker: core::marker::PhantomData,
5781        }
5782    }
5783}
5784
5785impl<S: emboss_runtime::MutStorage, ST: emboss_runtime::State> LinkKeyWriter<S, ST> {
5786    /**
5787     * Constructs a writer in a specific typestate.
5788     *
5789     * # Safety
5790     *
5791     * The caller must ensure that `storage` satisfies the layout invariants for `ST`.
5792     */
5793    pub unsafe fn new_in_state(storage: S) -> Self {
5794        Self {
5795            storage,
5796            _marker: core::marker::PhantomData,
5797        }
5798    }
5799    pub fn into_storage(self) -> S {
5800        self.storage
5801    }
5802    /** Converts the writer into an immutable view in the same typestate. */
5803    pub fn into_view(self) -> LinkKey<S, ST> {
5804        unsafe { LinkKey::new_in_state(self.storage) }
5805    }
5806    /** Borrows the writer as an immutable view in the same typestate. */
5807    pub fn as_view(&self) -> LinkKey<S::Sliced<'_>, ST> {
5808        unsafe { LinkKey::new_in_state(self.storage.slice(0, self.storage.len())) }
5809    }
5810
5811}
5812
5813impl<S: emboss_runtime::Storage, ST: emboss_runtime::State> emboss_runtime::View for LinkKey<S, ST> {
5814    fn size_in_bytes(&self) -> core::result::Result<usize, emboss_runtime::Error> {
5815        let view = self;
5816        core::result::Result::Ok((16) as usize)
5817    }
5818}
5819
5820impl<S: emboss_runtime::MutStorage> emboss_runtime::View for LinkKeyMut<S> {
5821    fn size_in_bytes(&self) -> core::result::Result<usize, emboss_runtime::Error> {
5822        let view = self.as_view();
5823        <LinkKey<S::Sliced<'_>, emboss_runtime::UncheckedState> as emboss_runtime::View>::size_in_bytes(&view)
5824    }
5825}
5826
5827impl<S: emboss_runtime::MutStorage, ST: emboss_runtime::State> emboss_runtime::View for LinkKeyWriter<S, ST> {
5828    fn size_in_bytes(&self) -> core::result::Result<usize, emboss_runtime::Error> {
5829        let view = self.as_view();
5830        <LinkKey<S::Sliced<'_>, ST> as emboss_runtime::View>::size_in_bytes(&view)
5831    }
5832}
5833
5834impl<S: emboss_runtime::Storage> emboss_runtime::CheckComplete for LinkKey<S, emboss_runtime::UncheckedState> {
5835    type Completed = LinkKey<S, emboss_runtime::CompleteState>;
5836    fn check_complete(self) -> core::result::Result<Self::Completed, emboss_runtime::Error> {
5837        let required_size = <Self as emboss_runtime::View>::size_in_bytes(&self)?;
5838        if self.storage.len() < required_size {
5839            return core::result::Result::Err(emboss_runtime::Error::OutOfBounds);
5840        }
5841        core::result::Result::Ok(unsafe { LinkKey::new_in_state(self.storage) })
5842    }
5843}
5844
5845impl<S: emboss_runtime::MutStorage> emboss_runtime::CheckComplete for LinkKeyWriter<S, emboss_runtime::UncheckedState> {
5846    type Completed = LinkKeyWriter<S, emboss_runtime::CompleteState>;
5847    fn check_complete(self) -> core::result::Result<Self::Completed, emboss_runtime::Error> {
5848        let required_size = <Self as emboss_runtime::View>::size_in_bytes(&self)?;
5849        if self.storage.len() < required_size {
5850            return core::result::Result::Err(emboss_runtime::Error::OutOfBounds);
5851        }
5852        core::result::Result::Ok(unsafe { LinkKeyWriter::new_in_state(self.storage) })
5853    }
5854}
5855
5856impl<S: emboss_runtime::Storage> emboss_runtime::CheckOk for LinkKey<S, emboss_runtime::UncheckedState> {
5857    type Ok = LinkKey<S, emboss_runtime::OkState>;
5858    fn check_ok(self) -> core::result::Result<Self::Ok, emboss_runtime::Error> {
5859        let completed = emboss_runtime::CheckComplete::check_complete(self)?;
5860        core::result::Result::Ok(unsafe { LinkKey::new_in_state(completed.into_storage()) })
5861    }
5862}
5863
5864impl<S: emboss_runtime::Storage> emboss_runtime::CheckOk for LinkKey<S, emboss_runtime::CompleteState> {
5865    type Ok = LinkKey<S, emboss_runtime::OkState>;
5866    fn check_ok(self) -> core::result::Result<Self::Ok, emboss_runtime::Error> {
5867        core::result::Result::Ok(unsafe { LinkKey::new_in_state(self.into_storage()) })
5868    }
5869}
5870
5871impl<S: emboss_runtime::Storage> emboss_runtime::CheckOk for LinkKey<S, emboss_runtime::OkState> {
5872    type Ok = LinkKey<S, emboss_runtime::OkState>;
5873    fn check_ok(self) -> core::result::Result<Self::Ok, emboss_runtime::Error> {
5874        core::result::Result::Ok(self)
5875    }
5876}
5877
5878impl<S: emboss_runtime::MutStorage> emboss_runtime::CheckOk for LinkKeyWriter<S, emboss_runtime::UncheckedState> {
5879    type Ok = LinkKeyWriter<S, emboss_runtime::OkState>;
5880    fn check_ok(self) -> core::result::Result<Self::Ok, emboss_runtime::Error> {
5881        let completed = emboss_runtime::CheckComplete::check_complete(self)?;
5882        core::result::Result::Ok(unsafe { LinkKeyWriter::new_in_state(completed.into_storage()) })
5883    }
5884}
5885
5886impl<S: emboss_runtime::MutStorage> emboss_runtime::CheckOk for LinkKeyWriter<S, emboss_runtime::CompleteState> {
5887    type Ok = LinkKeyWriter<S, emboss_runtime::OkState>;
5888    fn check_ok(self) -> core::result::Result<Self::Ok, emboss_runtime::Error> {
5889        core::result::Result::Ok(unsafe { LinkKeyWriter::new_in_state(self.into_storage()) })
5890    }
5891}
5892
5893impl<S: emboss_runtime::MutStorage> emboss_runtime::CheckOk for LinkKeyWriter<S, emboss_runtime::OkState> {
5894    type Ok = LinkKeyWriter<S, emboss_runtime::OkState>;
5895    fn check_ok(self) -> core::result::Result<Self::Ok, emboss_runtime::Error> {
5896        core::result::Result::Ok(self)
5897    }
5898}
5899
5900pub mod link_key {
5901    pub type View<S, ST = emboss_runtime::UncheckedState> = super::LinkKey<S, ST>;
5902    pub type ViewMut<S> = super::LinkKeyMut<S>;
5903    pub type Writer<S, ST = emboss_runtime::UncheckedState> = super::LinkKeyWriter<S, ST>;
5904
5905    pub const MIN_SIZE_IN_BYTES: usize = 16;
5906    pub const MAX_SIZE_IN_BYTES: usize = 16;
5907    pub const SIZE_IN_BYTES: usize = 16;
5908}pub struct OpCodeBits<S: emboss_runtime::Storage, ST: emboss_runtime::State = emboss_runtime::UncheckedState> {
5909    storage: S,
5910    _marker: core::marker::PhantomData<ST>,
5911}
5912
5913impl<S: emboss_runtime::Storage> OpCodeBits<S, emboss_runtime::UncheckedState> {
5914    pub fn new(storage: S) -> Self {
5915        Self {
5916            storage,
5917            _marker: core::marker::PhantomData,
5918        }
5919    }
5920}
5921
5922impl<S: emboss_runtime::Storage + core::clone::Clone, ST: emboss_runtime::State> core::clone::Clone for OpCodeBits<S, ST> {
5923    fn clone(&self) -> Self {
5924        Self {
5925            storage: self.storage.clone(),
5926            _marker: core::marker::PhantomData,
5927        }
5928    }
5929}
5930
5931impl<S: emboss_runtime::Storage, ST: emboss_runtime::State> OpCodeBits<S, ST> {
5932    /**
5933     * Constructs a view in a specific typestate.
5934     *
5935     * # Safety
5936     *
5937     * The caller must ensure that `storage` satisfies the layout invariants for `ST`.
5938     */
5939    pub unsafe fn new_in_state(storage: S) -> Self {
5940        Self {
5941            storage,
5942            _marker: core::marker::PhantomData,
5943        }
5944    }
5945    pub fn into_storage(self) -> S {
5946        self.storage
5947    }
5948    pub fn ocf(&self) -> emboss_runtime::BitUInt<10, 0, emboss_runtime::Null, S::Sliced<'_>, ST> {
5949        let len = (2) as usize; // Total struct size in bytes
5950        let storage = self.storage.slice(0, len);
5951        emboss_runtime::BitUInt::<10, 0, emboss_runtime::Null, S::Sliced<'_>, ST>::new(storage)
5952    }
5953    pub fn ogf(&self) -> emboss_runtime::BitUInt<6, 10, emboss_runtime::Null, S::Sliced<'_>, ST> {
5954        let len = (2) as usize; // Total struct size in bytes
5955        let storage = self.storage.slice(0, len);
5956        emboss_runtime::BitUInt::<6, 10, emboss_runtime::Null, S::Sliced<'_>, ST>::new(storage)
5957    }
5958
5959}
5960
5961pub struct OpCodeBitsMut<S: emboss_runtime::MutStorage> {
5962    storage: S,
5963}
5964
5965impl<S: emboss_runtime::MutStorage> OpCodeBitsMut<S> {
5966    pub fn new(storage: S) -> Self {
5967        Self {
5968            storage,
5969        }
5970    }
5971    pub fn into_writer(self) -> OpCodeBitsWriter<S, emboss_runtime::UncheckedState> {
5972        OpCodeBitsWriter::new(self.storage)
5973    }
5974    /** Borrows the mutable view as an immutable view in UncheckedState. */
5975    pub fn as_view(&self) -> OpCodeBits<S::Sliced<'_>, emboss_runtime::UncheckedState> {
5976        unsafe { OpCodeBits::new_in_state(self.storage.slice(0, self.storage.len())) }
5977    }
5978    pub fn ocf(&mut self) -> emboss_runtime::BitUInt<10, 0, emboss_runtime::Null, S::SlicedMut<'_>, emboss_runtime::UncheckedState> {
5979        let len = (2) as usize;
5980        let storage = self.storage.slice_mut(0, len);
5981        emboss_runtime::BitUInt::<10, 0, emboss_runtime::Null, S::SlicedMut<'_>, emboss_runtime::UncheckedState>::new(storage)
5982    }
5983    pub fn ogf(&mut self) -> emboss_runtime::BitUInt<6, 10, emboss_runtime::Null, S::SlicedMut<'_>, emboss_runtime::UncheckedState> {
5984        let len = (2) as usize;
5985        let storage = self.storage.slice_mut(0, len);
5986        emboss_runtime::BitUInt::<6, 10, emboss_runtime::Null, S::SlicedMut<'_>, emboss_runtime::UncheckedState>::new(storage)
5987    }
5988
5989}
5990
5991impl<S: emboss_runtime::MutStorage> emboss_runtime::IntoWriter for OpCodeBitsMut<S> {
5992    type Writer = OpCodeBitsWriter<S, emboss_runtime::UncheckedState>;
5993    fn into_writer(self) -> Self::Writer {
5994        OpCodeBitsWriter::new(self.storage)
5995    }
5996}
5997
5998pub struct OpCodeBitsWriter<S: emboss_runtime::MutStorage, ST: emboss_runtime::State = emboss_runtime::UncheckedState> {
5999    storage: S,
6000    _marker: core::marker::PhantomData<ST>,
6001}
6002
6003impl<S: emboss_runtime::MutStorage> OpCodeBitsWriter<S, emboss_runtime::UncheckedState> {
6004    pub fn new(storage: S) -> Self {
6005        Self {
6006            storage,
6007            _marker: core::marker::PhantomData,
6008        }
6009    }
6010}
6011
6012impl<S: emboss_runtime::MutStorage, ST: emboss_runtime::State> OpCodeBitsWriter<S, ST> {
6013    /**
6014     * Constructs a writer in a specific typestate.
6015     *
6016     * # Safety
6017     *
6018     * The caller must ensure that `storage` satisfies the layout invariants for `ST`.
6019     */
6020    pub unsafe fn new_in_state(storage: S) -> Self {
6021        Self {
6022            storage,
6023            _marker: core::marker::PhantomData,
6024        }
6025    }
6026    pub fn into_storage(self) -> S {
6027        self.storage
6028    }
6029    /** Converts the writer into an immutable view in the same typestate. */
6030    pub fn into_view(self) -> OpCodeBits<S, ST> {
6031        unsafe { OpCodeBits::new_in_state(self.storage) }
6032    }
6033    /** Borrows the writer as an immutable view in the same typestate. */
6034    pub fn as_view(&self) -> OpCodeBits<S::Sliced<'_>, ST> {
6035        unsafe { OpCodeBits::new_in_state(self.storage.slice(0, self.storage.len())) }
6036    }
6037
6038}
6039
6040impl<S: emboss_runtime::Storage, ST: emboss_runtime::State> emboss_runtime::View for OpCodeBits<S, ST> {
6041    fn size_in_bytes(&self) -> core::result::Result<usize, emboss_runtime::Error> {
6042        let view = self;
6043        core::result::Result::Ok((((16) + 7) / 8) as usize)
6044    }
6045}
6046
6047impl<S: emboss_runtime::MutStorage> emboss_runtime::View for OpCodeBitsMut<S> {
6048    fn size_in_bytes(&self) -> core::result::Result<usize, emboss_runtime::Error> {
6049        let view = self.as_view();
6050        <OpCodeBits<S::Sliced<'_>, emboss_runtime::UncheckedState> as emboss_runtime::View>::size_in_bytes(&view)
6051    }
6052}
6053
6054impl<S: emboss_runtime::MutStorage, ST: emboss_runtime::State> emboss_runtime::View for OpCodeBitsWriter<S, ST> {
6055    fn size_in_bytes(&self) -> core::result::Result<usize, emboss_runtime::Error> {
6056        let view = self.as_view();
6057        <OpCodeBits<S::Sliced<'_>, ST> as emboss_runtime::View>::size_in_bytes(&view)
6058    }
6059}
6060
6061impl<S: emboss_runtime::Storage> emboss_runtime::CheckComplete for OpCodeBits<S, emboss_runtime::UncheckedState> {
6062    type Completed = OpCodeBits<S, emboss_runtime::CompleteState>;
6063    fn check_complete(self) -> core::result::Result<Self::Completed, emboss_runtime::Error> {
6064        let required_size = <Self as emboss_runtime::View>::size_in_bytes(&self)?;
6065        if self.storage.len() < required_size {
6066            return core::result::Result::Err(emboss_runtime::Error::OutOfBounds);
6067        }
6068        core::result::Result::Ok(unsafe { OpCodeBits::new_in_state(self.storage) })
6069    }
6070}
6071
6072impl<S: emboss_runtime::MutStorage> emboss_runtime::CheckComplete for OpCodeBitsWriter<S, emboss_runtime::UncheckedState> {
6073    type Completed = OpCodeBitsWriter<S, emboss_runtime::CompleteState>;
6074    fn check_complete(self) -> core::result::Result<Self::Completed, emboss_runtime::Error> {
6075        let required_size = <Self as emboss_runtime::View>::size_in_bytes(&self)?;
6076        if self.storage.len() < required_size {
6077            return core::result::Result::Err(emboss_runtime::Error::OutOfBounds);
6078        }
6079        core::result::Result::Ok(unsafe { OpCodeBitsWriter::new_in_state(self.storage) })
6080    }
6081}
6082
6083impl<S: emboss_runtime::Storage> emboss_runtime::CheckOk for OpCodeBits<S, emboss_runtime::UncheckedState> {
6084    type Ok = OpCodeBits<S, emboss_runtime::OkState>;
6085    fn check_ok(self) -> core::result::Result<Self::Ok, emboss_runtime::Error> {
6086        let completed = emboss_runtime::CheckComplete::check_complete(self)?;
6087        core::result::Result::Ok(unsafe { OpCodeBits::new_in_state(completed.into_storage()) })
6088    }
6089}
6090
6091impl<S: emboss_runtime::Storage> emboss_runtime::CheckOk for OpCodeBits<S, emboss_runtime::CompleteState> {
6092    type Ok = OpCodeBits<S, emboss_runtime::OkState>;
6093    fn check_ok(self) -> core::result::Result<Self::Ok, emboss_runtime::Error> {
6094        core::result::Result::Ok(unsafe { OpCodeBits::new_in_state(self.into_storage()) })
6095    }
6096}
6097
6098impl<S: emboss_runtime::Storage> emboss_runtime::CheckOk for OpCodeBits<S, emboss_runtime::OkState> {
6099    type Ok = OpCodeBits<S, emboss_runtime::OkState>;
6100    fn check_ok(self) -> core::result::Result<Self::Ok, emboss_runtime::Error> {
6101        core::result::Result::Ok(self)
6102    }
6103}
6104
6105impl<S: emboss_runtime::MutStorage> emboss_runtime::CheckOk for OpCodeBitsWriter<S, emboss_runtime::UncheckedState> {
6106    type Ok = OpCodeBitsWriter<S, emboss_runtime::OkState>;
6107    fn check_ok(self) -> core::result::Result<Self::Ok, emboss_runtime::Error> {
6108        let completed = emboss_runtime::CheckComplete::check_complete(self)?;
6109        core::result::Result::Ok(unsafe { OpCodeBitsWriter::new_in_state(completed.into_storage()) })
6110    }
6111}
6112
6113impl<S: emboss_runtime::MutStorage> emboss_runtime::CheckOk for OpCodeBitsWriter<S, emboss_runtime::CompleteState> {
6114    type Ok = OpCodeBitsWriter<S, emboss_runtime::OkState>;
6115    fn check_ok(self) -> core::result::Result<Self::Ok, emboss_runtime::Error> {
6116        core::result::Result::Ok(unsafe { OpCodeBitsWriter::new_in_state(self.into_storage()) })
6117    }
6118}
6119
6120impl<S: emboss_runtime::MutStorage> emboss_runtime::CheckOk for OpCodeBitsWriter<S, emboss_runtime::OkState> {
6121    type Ok = OpCodeBitsWriter<S, emboss_runtime::OkState>;
6122    fn check_ok(self) -> core::result::Result<Self::Ok, emboss_runtime::Error> {
6123        core::result::Result::Ok(self)
6124    }
6125}
6126
6127pub mod op_code_bits {
6128    pub type View<S, ST = emboss_runtime::UncheckedState> = super::OpCodeBits<S, ST>;
6129    pub type ViewMut<S> = super::OpCodeBitsMut<S>;
6130    pub type Writer<S, ST = emboss_runtime::UncheckedState> = super::OpCodeBitsWriter<S, ST>;
6131
6132    pub const MIN_SIZE_IN_BYTES: usize = 2;
6133    pub const MAX_SIZE_IN_BYTES: usize = 2;
6134    pub const SIZE_IN_BYTES: usize = 2;
6135}pub struct CommandHeader<S: emboss_runtime::Storage, ST: emboss_runtime::State = emboss_runtime::UncheckedState> {
6136    storage: S,
6137    _marker: core::marker::PhantomData<ST>,
6138}
6139
6140impl<S: emboss_runtime::Storage> CommandHeader<S, emboss_runtime::UncheckedState> {
6141    pub fn new(storage: S) -> Self {
6142        Self {
6143            storage,
6144            _marker: core::marker::PhantomData,
6145        }
6146    }
6147}
6148
6149impl<S: emboss_runtime::Storage + core::clone::Clone, ST: emboss_runtime::State> core::clone::Clone for CommandHeader<S, ST> {
6150    fn clone(&self) -> Self {
6151        Self {
6152            storage: self.storage.clone(),
6153            _marker: core::marker::PhantomData,
6154        }
6155    }
6156}
6157
6158impl<S: emboss_runtime::Storage, ST: emboss_runtime::State> CommandHeader<S, ST> {
6159    /**
6160     * Constructs a view in a specific typestate.
6161     *
6162     * # Safety
6163     *
6164     * The caller must ensure that `storage` satisfies the layout invariants for `ST`.
6165     */
6166    pub unsafe fn new_in_state(storage: S) -> Self {
6167        Self {
6168            storage,
6169            _marker: core::marker::PhantomData,
6170        }
6171    }
6172    pub fn into_storage(self) -> S {
6173        self.storage
6174    }
6175    pub fn opcode(&self) -> emboss_runtime::EnumView<OpCode, emboss_runtime::UInt<16, emboss_runtime::LittleEndian, S::Sliced<'_>, ST>> {
6176        let (offset, len) = (|| -> core::result::Result<(usize, usize), emboss_runtime::Error> {
6177            let offset = (0) as usize;
6178            let len = (2) as usize;
6179            core::result::Result::Ok((offset, len))
6180        })().unwrap_or((usize::MAX, 0));
6181        let storage = self.storage.slice(offset, len);
6182        emboss_runtime::EnumView::new(emboss_runtime::UInt::new(storage))
6183    }
6184    pub fn opcode_bits(&self) -> OpCodeBits<S::Sliced<'_>, emboss_runtime::UncheckedState> {
6185        let (offset, len) = (|| -> core::result::Result<(usize, usize), emboss_runtime::Error> {
6186            let offset = (0) as usize;
6187            let len = (2) as usize;
6188            core::result::Result::Ok((offset, len))
6189        })().unwrap_or((usize::MAX, 0));
6190        let storage = self.storage.slice(offset, len);
6191        unsafe { OpCodeBits::<S::Sliced<'_>, emboss_runtime::UncheckedState>::new_in_state(storage) }
6192    }
6193    pub fn parameter_total_size(&self) -> UInt<8, emboss_runtime::LittleEndian, S::Sliced<'_>, ST> {
6194        let (offset, len) = (|| -> core::result::Result<(usize, usize), emboss_runtime::Error> {
6195            let offset = (2) as usize;
6196            let len = (1) as usize;
6197            core::result::Result::Ok((offset, len))
6198        })().unwrap_or((usize::MAX, 0));
6199        let storage = self.storage.slice(offset, len);
6200        UInt::<8, emboss_runtime::LittleEndian, S::Sliced<'_>, ST>::new(storage)
6201    }
6202
6203}
6204
6205pub struct CommandHeaderMut<S: emboss_runtime::MutStorage> {
6206    storage: S,
6207}
6208
6209impl<S: emboss_runtime::MutStorage> CommandHeaderMut<S> {
6210    pub fn new(storage: S) -> Self {
6211        Self {
6212            storage,
6213        }
6214    }
6215    pub fn into_writer(self) -> CommandHeaderWriter<S, emboss_runtime::UncheckedState> {
6216        CommandHeaderWriter::new(self.storage)
6217    }
6218    /** Borrows the mutable view as an immutable view in UncheckedState. */
6219    pub fn as_view(&self) -> CommandHeader<S::Sliced<'_>, emboss_runtime::UncheckedState> {
6220        unsafe { CommandHeader::new_in_state(self.storage.slice(0, self.storage.len())) }
6221    }
6222    pub fn opcode(&mut self) -> emboss_runtime::EnumViewMut<OpCode, emboss_runtime::UInt<16, emboss_runtime::LittleEndian, S::SlicedMut<'_>, emboss_runtime::UncheckedState>> {
6223        let (offset, len) = (|| -> core::result::Result<(usize, usize), emboss_runtime::Error> {
6224            let offset = (0) as usize;
6225            let len = (2) as usize;
6226            core::result::Result::Ok((offset, len))
6227        })().unwrap_or((usize::MAX, 0));
6228        let storage = self.storage.slice_mut(offset, len);
6229        emboss_runtime::EnumViewMut::new(emboss_runtime::UInt::new(storage))
6230    }
6231    pub fn opcode_bits(&mut self) -> OpCodeBitsMut<S::SlicedMut<'_>> {
6232        let (offset, len) = (|| -> core::result::Result<(usize, usize), emboss_runtime::Error> {
6233            let offset = (0) as usize;
6234            let len = (2) as usize;
6235            core::result::Result::Ok((offset, len))
6236        })().unwrap_or((usize::MAX, 0));
6237        let storage = self.storage.slice_mut(offset, len);
6238        OpCodeBitsMut::<S::SlicedMut<'_>>::new(storage)
6239    }
6240    pub fn parameter_total_size(&mut self) -> UInt<8, emboss_runtime::LittleEndian, S::SlicedMut<'_>, emboss_runtime::UncheckedState> {
6241        let (offset, len) = (|| -> core::result::Result<(usize, usize), emboss_runtime::Error> {
6242            let offset = (2) as usize;
6243            let len = (1) as usize;
6244            core::result::Result::Ok((offset, len))
6245        })().unwrap_or((usize::MAX, 0));
6246        let storage = self.storage.slice_mut(offset, len);
6247        UInt::<8, emboss_runtime::LittleEndian, S::SlicedMut<'_>, emboss_runtime::UncheckedState>::new(storage)
6248    }
6249
6250}
6251
6252impl<S: emboss_runtime::MutStorage> emboss_runtime::IntoWriter for CommandHeaderMut<S> {
6253    type Writer = CommandHeaderWriter<S, emboss_runtime::UncheckedState>;
6254    fn into_writer(self) -> Self::Writer {
6255        CommandHeaderWriter::new(self.storage)
6256    }
6257}
6258
6259pub struct CommandHeaderWriter<S: emboss_runtime::MutStorage, ST: emboss_runtime::State = emboss_runtime::UncheckedState> {
6260    storage: S,
6261    _marker: core::marker::PhantomData<ST>,
6262}
6263
6264impl<S: emboss_runtime::MutStorage> CommandHeaderWriter<S, emboss_runtime::UncheckedState> {
6265    pub fn new(storage: S) -> Self {
6266        Self {
6267            storage,
6268            _marker: core::marker::PhantomData,
6269        }
6270    }
6271}
6272
6273impl<S: emboss_runtime::MutStorage, ST: emboss_runtime::State> CommandHeaderWriter<S, ST> {
6274    /**
6275     * Constructs a writer in a specific typestate.
6276     *
6277     * # Safety
6278     *
6279     * The caller must ensure that `storage` satisfies the layout invariants for `ST`.
6280     */
6281    pub unsafe fn new_in_state(storage: S) -> Self {
6282        Self {
6283            storage,
6284            _marker: core::marker::PhantomData,
6285        }
6286    }
6287    pub fn into_storage(self) -> S {
6288        self.storage
6289    }
6290    /** Converts the writer into an immutable view in the same typestate. */
6291    pub fn into_view(self) -> CommandHeader<S, ST> {
6292        unsafe { CommandHeader::new_in_state(self.storage) }
6293    }
6294    /** Borrows the writer as an immutable view in the same typestate. */
6295    pub fn as_view(&self) -> CommandHeader<S::Sliced<'_>, ST> {
6296        unsafe { CommandHeader::new_in_state(self.storage.slice(0, self.storage.len())) }
6297    }
6298    pub fn write_opcode(self, val: OpCode) -> CommandHeaderWriter<S, ST::OnValidMutation> {
6299        let view = self.into_view();
6300        let (offset, len) = (|| -> core::result::Result<(usize, usize), emboss_runtime::Error> {
6301            let offset = (0) as usize;
6302            let len = (2) as usize;
6303            core::result::Result::Ok((offset, len))
6304        })().expect("valid layout in complete state");
6305        let mut storage = view.into_storage();
6306        {
6307            let slice = storage.slice_mut(offset, len);
6308            let mut field_view = emboss_runtime::EnumViewMut::<OpCode, emboss_runtime::UInt<16, emboss_runtime::LittleEndian, _>>::new(emboss_runtime::UInt::new(slice));
6309            field_view.try_write(val).expect("valid write in complete state");
6310        }
6311        unsafe { CommandHeaderWriter::new_in_state(storage) }
6312    }
6313    pub fn write_parameter_total_size(self, val: <emboss_runtime::SizeSelector<8> as emboss_runtime::SmallestUInt>::T) -> CommandHeaderWriter<S, ST::OnLayoutMutation> {
6314        let view = self.into_view();
6315        let (offset, len) = (|| -> core::result::Result<(usize, usize), emboss_runtime::Error> {
6316            let offset = (2) as usize;
6317            let len = (1) as usize;
6318            core::result::Result::Ok((offset, len))
6319        })().expect("valid layout in complete state");
6320        let mut storage = view.into_storage();
6321        {
6322            let slice = storage.slice_mut(offset, len);
6323            let mut field_view = emboss_runtime::UInt::<8, emboss_runtime::LittleEndian, _>::new(slice);
6324            field_view.try_write(val).expect("valid write in complete state");
6325        }
6326        unsafe { CommandHeaderWriter::new_in_state(storage) }
6327    }
6328
6329}
6330
6331impl<S: emboss_runtime::Storage, ST: emboss_runtime::State> emboss_runtime::View for CommandHeader<S, ST> {
6332    fn size_in_bytes(&self) -> core::result::Result<usize, emboss_runtime::Error> {
6333        let view = self;
6334        core::result::Result::Ok((3) as usize)
6335    }
6336}
6337
6338impl<S: emboss_runtime::MutStorage> emboss_runtime::View for CommandHeaderMut<S> {
6339    fn size_in_bytes(&self) -> core::result::Result<usize, emboss_runtime::Error> {
6340        let view = self.as_view();
6341        <CommandHeader<S::Sliced<'_>, emboss_runtime::UncheckedState> as emboss_runtime::View>::size_in_bytes(&view)
6342    }
6343}
6344
6345impl<S: emboss_runtime::MutStorage, ST: emboss_runtime::State> emboss_runtime::View for CommandHeaderWriter<S, ST> {
6346    fn size_in_bytes(&self) -> core::result::Result<usize, emboss_runtime::Error> {
6347        let view = self.as_view();
6348        <CommandHeader<S::Sliced<'_>, ST> as emboss_runtime::View>::size_in_bytes(&view)
6349    }
6350}
6351
6352impl<S: emboss_runtime::Storage> emboss_runtime::CheckComplete for CommandHeader<S, emboss_runtime::UncheckedState> {
6353    type Completed = CommandHeader<S, emboss_runtime::CompleteState>;
6354    fn check_complete(self) -> core::result::Result<Self::Completed, emboss_runtime::Error> {
6355        let required_size = <Self as emboss_runtime::View>::size_in_bytes(&self)?;
6356        if self.storage.len() < required_size {
6357            return core::result::Result::Err(emboss_runtime::Error::OutOfBounds);
6358        }
6359        core::result::Result::Ok(unsafe { CommandHeader::new_in_state(self.storage) })
6360    }
6361}
6362
6363impl<S: emboss_runtime::MutStorage> emboss_runtime::CheckComplete for CommandHeaderWriter<S, emboss_runtime::UncheckedState> {
6364    type Completed = CommandHeaderWriter<S, emboss_runtime::CompleteState>;
6365    fn check_complete(self) -> core::result::Result<Self::Completed, emboss_runtime::Error> {
6366        let required_size = <Self as emboss_runtime::View>::size_in_bytes(&self)?;
6367        if self.storage.len() < required_size {
6368            return core::result::Result::Err(emboss_runtime::Error::OutOfBounds);
6369        }
6370        core::result::Result::Ok(unsafe { CommandHeaderWriter::new_in_state(self.storage) })
6371    }
6372}
6373
6374impl<S: emboss_runtime::Storage> emboss_runtime::CheckOk for CommandHeader<S, emboss_runtime::UncheckedState> {
6375    type Ok = CommandHeader<S, emboss_runtime::OkState>;
6376    fn check_ok(self) -> core::result::Result<Self::Ok, emboss_runtime::Error> {
6377        let completed = emboss_runtime::CheckComplete::check_complete(self)?;
6378        core::result::Result::Ok(unsafe { CommandHeader::new_in_state(completed.into_storage()) })
6379    }
6380}
6381
6382impl<S: emboss_runtime::Storage> emboss_runtime::CheckOk for CommandHeader<S, emboss_runtime::CompleteState> {
6383    type Ok = CommandHeader<S, emboss_runtime::OkState>;
6384    fn check_ok(self) -> core::result::Result<Self::Ok, emboss_runtime::Error> {
6385        core::result::Result::Ok(unsafe { CommandHeader::new_in_state(self.into_storage()) })
6386    }
6387}
6388
6389impl<S: emboss_runtime::Storage> emboss_runtime::CheckOk for CommandHeader<S, emboss_runtime::OkState> {
6390    type Ok = CommandHeader<S, emboss_runtime::OkState>;
6391    fn check_ok(self) -> core::result::Result<Self::Ok, emboss_runtime::Error> {
6392        core::result::Result::Ok(self)
6393    }
6394}
6395
6396impl<S: emboss_runtime::MutStorage> emboss_runtime::CheckOk for CommandHeaderWriter<S, emboss_runtime::UncheckedState> {
6397    type Ok = CommandHeaderWriter<S, emboss_runtime::OkState>;
6398    fn check_ok(self) -> core::result::Result<Self::Ok, emboss_runtime::Error> {
6399        let completed = emboss_runtime::CheckComplete::check_complete(self)?;
6400        core::result::Result::Ok(unsafe { CommandHeaderWriter::new_in_state(completed.into_storage()) })
6401    }
6402}
6403
6404impl<S: emboss_runtime::MutStorage> emboss_runtime::CheckOk for CommandHeaderWriter<S, emboss_runtime::CompleteState> {
6405    type Ok = CommandHeaderWriter<S, emboss_runtime::OkState>;
6406    fn check_ok(self) -> core::result::Result<Self::Ok, emboss_runtime::Error> {
6407        core::result::Result::Ok(unsafe { CommandHeaderWriter::new_in_state(self.into_storage()) })
6408    }
6409}
6410
6411impl<S: emboss_runtime::MutStorage> emboss_runtime::CheckOk for CommandHeaderWriter<S, emboss_runtime::OkState> {
6412    type Ok = CommandHeaderWriter<S, emboss_runtime::OkState>;
6413    fn check_ok(self) -> core::result::Result<Self::Ok, emboss_runtime::Error> {
6414        core::result::Result::Ok(self)
6415    }
6416}
6417
6418pub mod command_header {
6419    pub type View<S, ST = emboss_runtime::UncheckedState> = super::CommandHeader<S, ST>;
6420    pub type ViewMut<S> = super::CommandHeaderMut<S>;
6421    pub type Writer<S, ST = emboss_runtime::UncheckedState> = super::CommandHeaderWriter<S, ST>;
6422
6423    pub const MIN_SIZE_IN_BYTES: usize = 3;
6424    pub const MAX_SIZE_IN_BYTES: usize = 3;
6425    pub const SIZE_IN_BYTES: usize = 3;
6426}pub struct CommandPacket_Payload_ArrayView<S: emboss_runtime::Storage> {
6427    storage: S,
6428    element_count: usize,
6429}
6430
6431impl<S: emboss_runtime::Storage + core::clone::Clone> core::clone::Clone for CommandPacket_Payload_ArrayView<S> {
6432    fn clone(&self) -> Self {
6433        Self {
6434            storage: self.storage.clone(),
6435            element_count: self.element_count,
6436        }
6437    }
6438}
6439
6440impl<S: emboss_runtime::Storage> CommandPacket_Payload_ArrayView<S> {
6441    pub const ELEMENT_SIZE_BYTES: usize = 1;
6442    pub fn new(storage: S, element_count: usize) -> Self {
6443        Self { storage, element_count }
6444    }
6445    pub fn element_count(&self) -> usize {
6446        self.element_count
6447    }
6448    pub fn get(&self, index: usize) -> core::result::Result<emboss_runtime::UInt<8, emboss_runtime::LittleEndian, S::Sliced<'_>>
6449, emboss_runtime::Error> {
6450        if index >= self.element_count {
6451            return core::result::Result::Err(emboss_runtime::Error::OutOfBounds);
6452        }
6453        let offset = index * Self::ELEMENT_SIZE_BYTES;
6454        let storage = self.storage.slice(offset, Self::ELEMENT_SIZE_BYTES);
6455        core::result::Result::Ok(emboss_runtime::UInt::new(storage)
6456)
6457    }
6458}
6459
6460pub struct CommandPacket_Payload_ArrayViewMut<S: emboss_runtime::MutStorage> {
6461    storage: S,
6462    element_count: usize,
6463}
6464
6465impl<S: emboss_runtime::MutStorage> CommandPacket_Payload_ArrayViewMut<S> {
6466    pub const ELEMENT_SIZE_BYTES: usize = 1;
6467    pub fn new(storage: S, element_count: usize) -> Self {
6468        Self { storage, element_count }
6469    }
6470    pub fn element_count(&self) -> usize {
6471        self.element_count
6472    }
6473    pub fn get_mut(&mut self, index: usize) -> core::result::Result<emboss_runtime::UInt<8, emboss_runtime::LittleEndian, S::SlicedMut<'_>>
6474, emboss_runtime::Error> {
6475        if index >= self.element_count {
6476            return core::result::Result::Err(emboss_runtime::Error::OutOfBounds);
6477        }
6478        let offset = index * Self::ELEMENT_SIZE_BYTES;
6479        let storage = self.storage.slice_mut(offset, Self::ELEMENT_SIZE_BYTES);
6480        core::result::Result::Ok(emboss_runtime::UInt::new(storage)
6481)
6482    }
6483}
6484pub struct CommandPacket<S: emboss_runtime::Storage, ST: emboss_runtime::State = emboss_runtime::UncheckedState> {
6485    storage: S,
6486    _marker: core::marker::PhantomData<ST>,
6487}
6488
6489impl<S: emboss_runtime::Storage> CommandPacket<S, emboss_runtime::UncheckedState> {
6490    pub fn new(storage: S) -> Self {
6491        Self {
6492            storage,
6493            _marker: core::marker::PhantomData,
6494        }
6495    }
6496}
6497
6498impl<S: emboss_runtime::Storage + core::clone::Clone, ST: emboss_runtime::State> core::clone::Clone for CommandPacket<S, ST> {
6499    fn clone(&self) -> Self {
6500        Self {
6501            storage: self.storage.clone(),
6502            _marker: core::marker::PhantomData,
6503        }
6504    }
6505}
6506
6507impl<S: emboss_runtime::Storage, ST: emboss_runtime::State> CommandPacket<S, ST> {
6508    /**
6509     * Constructs a view in a specific typestate.
6510     *
6511     * # Safety
6512     *
6513     * The caller must ensure that `storage` satisfies the layout invariants for `ST`.
6514     */
6515    pub unsafe fn new_in_state(storage: S) -> Self {
6516        Self {
6517            storage,
6518            _marker: core::marker::PhantomData,
6519        }
6520    }
6521    pub fn into_storage(self) -> S {
6522        self.storage
6523    }
6524    pub fn hdr_size(&self) -> emboss_runtime::VirtualField<u64> {
6525        let value = (|| -> core::result::Result<u64, emboss_runtime::Error> {
6526        core::result::Result::Ok( (3) as u64 )
6527    })();
6528        emboss_runtime::VirtualField::new(value)
6529    }
6530    pub fn header(&self) -> CommandHeader<S::Sliced<'_>, emboss_runtime::UncheckedState> {
6531        let (offset, len) = (|| -> core::result::Result<(usize, usize), emboss_runtime::Error> {
6532            let offset = (0) as usize;
6533            let len = (({ let val = self.hdr_size().try_read().map_err(|e| match e { emboss_runtime::Error::OutOfBounds => emboss_runtime::Error::OutOfBounds, emboss_runtime::Error::UnknownEnum(_) => emboss_runtime::Error::UnknownEnum(()) })?; val })
6534) as usize;
6535            core::result::Result::Ok((offset, len))
6536        })().unwrap_or((usize::MAX, 0));
6537        let storage = self.storage.slice(offset, len);
6538        unsafe { CommandHeader::<S::Sliced<'_>, emboss_runtime::UncheckedState>::new_in_state(storage) }
6539    }
6540    pub fn length(&self) -> emboss_runtime::VirtualField<u64> {
6541        let value = (|| -> core::result::Result<u64, emboss_runtime::Error> {
6542        core::result::Result::Ok( (({ let val = self.header().parameter_total_size().try_read().map_err(|e| match e { emboss_runtime::Error::OutOfBounds => emboss_runtime::Error::OutOfBounds, emboss_runtime::Error::UnknownEnum(_) => emboss_runtime::Error::UnknownEnum(()) })?; val })
6543) as u64 )
6544    })();
6545        emboss_runtime::VirtualField::new(value)
6546    }
6547    pub fn payload(&self) -> core::result::Result<CommandPacket_Payload_ArrayView<S::Sliced<'_>>, emboss_runtime::Error> {
6548        let offset_res = (|| -> core::result::Result<(usize, usize, usize), emboss_runtime::Error> {
6549            let offset = (( (0) as i64 + (({ let val = self.hdr_size().try_read().map_err(|e| match e { emboss_runtime::Error::OutOfBounds => emboss_runtime::Error::OutOfBounds, emboss_runtime::Error::UnknownEnum(_) => emboss_runtime::Error::UnknownEnum(()) })?; val })
6550) as i64 )
6551) as usize;
6552            let len = (({ let val = self.length().try_read().map_err(|e| match e { emboss_runtime::Error::OutOfBounds => emboss_runtime::Error::OutOfBounds, emboss_runtime::Error::UnknownEnum(_) => emboss_runtime::Error::UnknownEnum(()) })?; val })
6553) as usize;
6554            let element_count = (len / (1)) as usize;
6555            core::result::Result::Ok((offset, len, element_count))
6556        })();
6557        match offset_res {
6558            core::result::Result::Ok((offset, len, element_count)) => {
6559                if len > 0 {
6560                    let end = offset.checked_add(len).ok_or(emboss_runtime::Error::OutOfBounds)?;
6561                    self.storage.try_read_byte(end - 1)?;
6562                }
6563                let storage = self.storage.slice(offset, len);
6564                core::result::Result::Ok(CommandPacket_Payload_ArrayView::new(storage, element_count))
6565            },
6566            core::result::Result::Err(e) => core::result::Result::Err(e),
6567        }
6568    }
6569
6570}
6571
6572pub struct CommandPacketMut<S: emboss_runtime::MutStorage> {
6573    storage: S,
6574}
6575
6576impl<S: emboss_runtime::MutStorage> CommandPacketMut<S> {
6577    pub fn new(storage: S) -> Self {
6578        Self {
6579            storage,
6580        }
6581    }
6582    pub fn into_writer(self) -> CommandPacketWriter<S, emboss_runtime::UncheckedState> {
6583        CommandPacketWriter::new(self.storage)
6584    }
6585    /** Borrows the mutable view as an immutable view in UncheckedState. */
6586    pub fn as_view(&self) -> CommandPacket<S::Sliced<'_>, emboss_runtime::UncheckedState> {
6587        unsafe { CommandPacket::new_in_state(self.storage.slice(0, self.storage.len())) }
6588    }
6589    pub fn hdr_size(&mut self) -> emboss_runtime::VirtualField<u64> {
6590        let value = (|| -> core::result::Result<u64, emboss_runtime::Error> {
6591        core::result::Result::Ok( (3) as u64 )
6592    })();
6593        emboss_runtime::VirtualField::new(value)
6594    }
6595    pub fn header(&mut self) -> CommandHeaderMut<S::SlicedMut<'_>> {
6596        let (offset, len) = (|| -> core::result::Result<(usize, usize), emboss_runtime::Error> {
6597            let offset = (0) as usize;
6598            let len = (({ let val = self.hdr_size().try_read().map_err(|e| match e { emboss_runtime::Error::OutOfBounds => emboss_runtime::Error::OutOfBounds, emboss_runtime::Error::UnknownEnum(_) => emboss_runtime::Error::UnknownEnum(()) })?; val })
6599) as usize;
6600            core::result::Result::Ok((offset, len))
6601        })().unwrap_or((usize::MAX, 0));
6602        let storage = self.storage.slice_mut(offset, len);
6603        CommandHeaderMut::<S::SlicedMut<'_>>::new(storage)
6604    }
6605    pub fn length(&mut self) -> emboss_runtime::VirtualField<u64> {
6606        let value = (|| -> core::result::Result<u64, emboss_runtime::Error> {
6607        core::result::Result::Ok( (({ let val = self.header().parameter_total_size().try_read().map_err(|e| match e { emboss_runtime::Error::OutOfBounds => emboss_runtime::Error::OutOfBounds, emboss_runtime::Error::UnknownEnum(_) => emboss_runtime::Error::UnknownEnum(()) })?; val })
6608) as u64 )
6609    })();
6610        emboss_runtime::VirtualField::new(value)
6611    }
6612    pub fn payload_mut(&mut self) -> core::result::Result<CommandPacket_Payload_ArrayViewMut<S::SlicedMut<'_>>, emboss_runtime::Error> {
6613        let offset_res = (|| -> core::result::Result<(usize, usize, usize), emboss_runtime::Error> {
6614            let offset = (( (0) as i64 + (({ let val = self.hdr_size().try_read().map_err(|e| match e { emboss_runtime::Error::OutOfBounds => emboss_runtime::Error::OutOfBounds, emboss_runtime::Error::UnknownEnum(_) => emboss_runtime::Error::UnknownEnum(()) })?; val })
6615) as i64 )
6616) as usize;
6617            let len = (({ let val = self.length().try_read().map_err(|e| match e { emboss_runtime::Error::OutOfBounds => emboss_runtime::Error::OutOfBounds, emboss_runtime::Error::UnknownEnum(_) => emboss_runtime::Error::UnknownEnum(()) })?; val })
6618) as usize;
6619            let element_count = (len / (1)) as usize;
6620            core::result::Result::Ok((offset, len, element_count))
6621        })();
6622        match offset_res {
6623            core::result::Result::Ok((offset, len, element_count)) => {
6624                if len > 0 {
6625                    let end = offset.checked_add(len).ok_or(emboss_runtime::Error::OutOfBounds)?;
6626                    self.storage.try_read_byte(end - 1)?;
6627                }
6628                let storage = self.storage.slice_mut(offset, len);
6629                core::result::Result::Ok(CommandPacket_Payload_ArrayViewMut::new(storage, element_count))
6630            },
6631            core::result::Result::Err(e) => core::result::Result::Err(e),
6632        }
6633    }
6634
6635}
6636
6637impl<S: emboss_runtime::MutStorage> emboss_runtime::IntoWriter for CommandPacketMut<S> {
6638    type Writer = CommandPacketWriter<S, emboss_runtime::UncheckedState>;
6639    fn into_writer(self) -> Self::Writer {
6640        CommandPacketWriter::new(self.storage)
6641    }
6642}
6643
6644pub struct CommandPacketWriter<S: emboss_runtime::MutStorage, ST: emboss_runtime::State = emboss_runtime::UncheckedState> {
6645    storage: S,
6646    _marker: core::marker::PhantomData<ST>,
6647}
6648
6649impl<S: emboss_runtime::MutStorage> CommandPacketWriter<S, emboss_runtime::UncheckedState> {
6650    pub fn new(storage: S) -> Self {
6651        Self {
6652            storage,
6653            _marker: core::marker::PhantomData,
6654        }
6655    }
6656}
6657
6658impl<S: emboss_runtime::MutStorage, ST: emboss_runtime::State> CommandPacketWriter<S, ST> {
6659    /**
6660     * Constructs a writer in a specific typestate.
6661     *
6662     * # Safety
6663     *
6664     * The caller must ensure that `storage` satisfies the layout invariants for `ST`.
6665     */
6666    pub unsafe fn new_in_state(storage: S) -> Self {
6667        Self {
6668            storage,
6669            _marker: core::marker::PhantomData,
6670        }
6671    }
6672    pub fn into_storage(self) -> S {
6673        self.storage
6674    }
6675    /** Converts the writer into an immutable view in the same typestate. */
6676    pub fn into_view(self) -> CommandPacket<S, ST> {
6677        unsafe { CommandPacket::new_in_state(self.storage) }
6678    }
6679    /** Borrows the writer as an immutable view in the same typestate. */
6680    pub fn as_view(&self) -> CommandPacket<S::Sliced<'_>, ST> {
6681        unsafe { CommandPacket::new_in_state(self.storage.slice(0, self.storage.len())) }
6682    }
6683
6684}
6685
6686impl<S: emboss_runtime::Storage, ST: emboss_runtime::State> emboss_runtime::View for CommandPacket<S, ST> {
6687    fn size_in_bytes(&self) -> core::result::Result<usize, emboss_runtime::Error> {
6688        let view = self;
6689        core::result::Result::Ok((core::cmp::max((core::cmp::max((0) as i64, ((if true { ( (0) as i64 + (({ let val = view.hdr_size().try_read().map_err(|e| match e { emboss_runtime::Error::OutOfBounds => emboss_runtime::Error::OutOfBounds, emboss_runtime::Error::UnknownEnum(_) => emboss_runtime::Error::UnknownEnum(()) })?; val })
6690) as i64 )
6691 } else { 0 })
6692
6693) as i64)
6694) as i64, ((if true { ( (( (0) as i64 + (({ let val = view.hdr_size().try_read().map_err(|e| match e { emboss_runtime::Error::OutOfBounds => emboss_runtime::Error::OutOfBounds, emboss_runtime::Error::UnknownEnum(_) => emboss_runtime::Error::UnknownEnum(()) })?; val })
6695) as i64 )
6696) as i64 + (({ let val = view.length().try_read().map_err(|e| match e { emboss_runtime::Error::OutOfBounds => emboss_runtime::Error::OutOfBounds, emboss_runtime::Error::UnknownEnum(_) => emboss_runtime::Error::UnknownEnum(()) })?; val })
6697) as i64 )
6698 } else { 0 })
6699
6700) as i64)
6701) as usize)
6702    }
6703}
6704
6705impl<S: emboss_runtime::MutStorage> emboss_runtime::View for CommandPacketMut<S> {
6706    fn size_in_bytes(&self) -> core::result::Result<usize, emboss_runtime::Error> {
6707        let view = self.as_view();
6708        <CommandPacket<S::Sliced<'_>, emboss_runtime::UncheckedState> as emboss_runtime::View>::size_in_bytes(&view)
6709    }
6710}
6711
6712impl<S: emboss_runtime::MutStorage, ST: emboss_runtime::State> emboss_runtime::View for CommandPacketWriter<S, ST> {
6713    fn size_in_bytes(&self) -> core::result::Result<usize, emboss_runtime::Error> {
6714        let view = self.as_view();
6715        <CommandPacket<S::Sliced<'_>, ST> as emboss_runtime::View>::size_in_bytes(&view)
6716    }
6717}
6718
6719impl<S: emboss_runtime::Storage> emboss_runtime::CheckComplete for CommandPacket<S, emboss_runtime::UncheckedState> {
6720    type Completed = CommandPacket<S, emboss_runtime::CompleteState>;
6721    fn check_complete(self) -> core::result::Result<Self::Completed, emboss_runtime::Error> {
6722        let required_size = <Self as emboss_runtime::View>::size_in_bytes(&self)?;
6723        if self.storage.len() < required_size {
6724            return core::result::Result::Err(emboss_runtime::Error::OutOfBounds);
6725        }
6726        core::result::Result::Ok(unsafe { CommandPacket::new_in_state(self.storage) })
6727    }
6728}
6729
6730impl<S: emboss_runtime::MutStorage> emboss_runtime::CheckComplete for CommandPacketWriter<S, emboss_runtime::UncheckedState> {
6731    type Completed = CommandPacketWriter<S, emboss_runtime::CompleteState>;
6732    fn check_complete(self) -> core::result::Result<Self::Completed, emboss_runtime::Error> {
6733        let required_size = <Self as emboss_runtime::View>::size_in_bytes(&self)?;
6734        if self.storage.len() < required_size {
6735            return core::result::Result::Err(emboss_runtime::Error::OutOfBounds);
6736        }
6737        core::result::Result::Ok(unsafe { CommandPacketWriter::new_in_state(self.storage) })
6738    }
6739}
6740
6741impl<S: emboss_runtime::Storage> emboss_runtime::CheckOk for CommandPacket<S, emboss_runtime::UncheckedState> {
6742    type Ok = CommandPacket<S, emboss_runtime::OkState>;
6743    fn check_ok(self) -> core::result::Result<Self::Ok, emboss_runtime::Error> {
6744        let completed = emboss_runtime::CheckComplete::check_complete(self)?;
6745        core::result::Result::Ok(unsafe { CommandPacket::new_in_state(completed.into_storage()) })
6746    }
6747}
6748
6749impl<S: emboss_runtime::Storage> emboss_runtime::CheckOk for CommandPacket<S, emboss_runtime::CompleteState> {
6750    type Ok = CommandPacket<S, emboss_runtime::OkState>;
6751    fn check_ok(self) -> core::result::Result<Self::Ok, emboss_runtime::Error> {
6752        core::result::Result::Ok(unsafe { CommandPacket::new_in_state(self.into_storage()) })
6753    }
6754}
6755
6756impl<S: emboss_runtime::Storage> emboss_runtime::CheckOk for CommandPacket<S, emboss_runtime::OkState> {
6757    type Ok = CommandPacket<S, emboss_runtime::OkState>;
6758    fn check_ok(self) -> core::result::Result<Self::Ok, emboss_runtime::Error> {
6759        core::result::Result::Ok(self)
6760    }
6761}
6762
6763impl<S: emboss_runtime::MutStorage> emboss_runtime::CheckOk for CommandPacketWriter<S, emboss_runtime::UncheckedState> {
6764    type Ok = CommandPacketWriter<S, emboss_runtime::OkState>;
6765    fn check_ok(self) -> core::result::Result<Self::Ok, emboss_runtime::Error> {
6766        let completed = emboss_runtime::CheckComplete::check_complete(self)?;
6767        core::result::Result::Ok(unsafe { CommandPacketWriter::new_in_state(completed.into_storage()) })
6768    }
6769}
6770
6771impl<S: emboss_runtime::MutStorage> emboss_runtime::CheckOk for CommandPacketWriter<S, emboss_runtime::CompleteState> {
6772    type Ok = CommandPacketWriter<S, emboss_runtime::OkState>;
6773    fn check_ok(self) -> core::result::Result<Self::Ok, emboss_runtime::Error> {
6774        core::result::Result::Ok(unsafe { CommandPacketWriter::new_in_state(self.into_storage()) })
6775    }
6776}
6777
6778impl<S: emboss_runtime::MutStorage> emboss_runtime::CheckOk for CommandPacketWriter<S, emboss_runtime::OkState> {
6779    type Ok = CommandPacketWriter<S, emboss_runtime::OkState>;
6780    fn check_ok(self) -> core::result::Result<Self::Ok, emboss_runtime::Error> {
6781        core::result::Result::Ok(self)
6782    }
6783}
6784
6785pub mod command_packet {
6786    pub type View<S, ST = emboss_runtime::UncheckedState> = super::CommandPacket<S, ST>;
6787    pub type ViewMut<S> = super::CommandPacketMut<S>;
6788    pub type Writer<S, ST = emboss_runtime::UncheckedState> = super::CommandPacketWriter<S, ST>;
6789
6790    pub const MIN_SIZE_IN_BYTES: usize = 3;
6791    pub const MAX_SIZE_IN_BYTES: usize = 258;
6792}pub struct EventHeader<S: emboss_runtime::Storage, ST: emboss_runtime::State = emboss_runtime::UncheckedState> {
6793    storage: S,
6794    _marker: core::marker::PhantomData<ST>,
6795}
6796
6797impl<S: emboss_runtime::Storage> EventHeader<S, emboss_runtime::UncheckedState> {
6798    pub fn new(storage: S) -> Self {
6799        Self {
6800            storage,
6801            _marker: core::marker::PhantomData,
6802        }
6803    }
6804}
6805
6806impl<S: emboss_runtime::Storage + core::clone::Clone, ST: emboss_runtime::State> core::clone::Clone for EventHeader<S, ST> {
6807    fn clone(&self) -> Self {
6808        Self {
6809            storage: self.storage.clone(),
6810            _marker: core::marker::PhantomData,
6811        }
6812    }
6813}
6814
6815impl<S: emboss_runtime::Storage, ST: emboss_runtime::State> EventHeader<S, ST> {
6816    /**
6817     * Constructs a view in a specific typestate.
6818     *
6819     * # Safety
6820     *
6821     * The caller must ensure that `storage` satisfies the layout invariants for `ST`.
6822     */
6823    pub unsafe fn new_in_state(storage: S) -> Self {
6824        Self {
6825            storage,
6826            _marker: core::marker::PhantomData,
6827        }
6828    }
6829    pub fn into_storage(self) -> S {
6830        self.storage
6831    }
6832    pub fn event_code(&self) -> emboss_runtime::EnumView<EventCode, emboss_runtime::UInt<8, emboss_runtime::LittleEndian, S::Sliced<'_>, ST>> {
6833        let (offset, len) = (|| -> core::result::Result<(usize, usize), emboss_runtime::Error> {
6834            let offset = (0) as usize;
6835            let len = (1) as usize;
6836            core::result::Result::Ok((offset, len))
6837        })().unwrap_or((usize::MAX, 0));
6838        let storage = self.storage.slice(offset, len);
6839        emboss_runtime::EnumView::new(emboss_runtime::UInt::new(storage))
6840    }
6841    pub fn event_code_uint(&self) -> UInt<8, emboss_runtime::LittleEndian, S::Sliced<'_>, ST> {
6842        let (offset, len) = (|| -> core::result::Result<(usize, usize), emboss_runtime::Error> {
6843            let offset = (0) as usize;
6844            let len = (1) as usize;
6845            core::result::Result::Ok((offset, len))
6846        })().unwrap_or((usize::MAX, 0));
6847        let storage = self.storage.slice(offset, len);
6848        UInt::<8, emboss_runtime::LittleEndian, S::Sliced<'_>, ST>::new(storage)
6849    }
6850    pub fn parameter_total_size(&self) -> UInt<8, emboss_runtime::LittleEndian, S::Sliced<'_>, ST> {
6851        let (offset, len) = (|| -> core::result::Result<(usize, usize), emboss_runtime::Error> {
6852            let offset = (1) as usize;
6853            let len = (1) as usize;
6854            core::result::Result::Ok((offset, len))
6855        })().unwrap_or((usize::MAX, 0));
6856        let storage = self.storage.slice(offset, len);
6857        UInt::<8, emboss_runtime::LittleEndian, S::Sliced<'_>, ST>::new(storage)
6858    }
6859
6860}
6861
6862pub struct EventHeaderMut<S: emboss_runtime::MutStorage> {
6863    storage: S,
6864}
6865
6866impl<S: emboss_runtime::MutStorage> EventHeaderMut<S> {
6867    pub fn new(storage: S) -> Self {
6868        Self {
6869            storage,
6870        }
6871    }
6872    pub fn into_writer(self) -> EventHeaderWriter<S, emboss_runtime::UncheckedState> {
6873        EventHeaderWriter::new(self.storage)
6874    }
6875    /** Borrows the mutable view as an immutable view in UncheckedState. */
6876    pub fn as_view(&self) -> EventHeader<S::Sliced<'_>, emboss_runtime::UncheckedState> {
6877        unsafe { EventHeader::new_in_state(self.storage.slice(0, self.storage.len())) }
6878    }
6879    pub fn event_code(&mut self) -> emboss_runtime::EnumViewMut<EventCode, emboss_runtime::UInt<8, emboss_runtime::LittleEndian, S::SlicedMut<'_>, emboss_runtime::UncheckedState>> {
6880        let (offset, len) = (|| -> core::result::Result<(usize, usize), emboss_runtime::Error> {
6881            let offset = (0) as usize;
6882            let len = (1) as usize;
6883            core::result::Result::Ok((offset, len))
6884        })().unwrap_or((usize::MAX, 0));
6885        let storage = self.storage.slice_mut(offset, len);
6886        emboss_runtime::EnumViewMut::new(emboss_runtime::UInt::new(storage))
6887    }
6888    pub fn event_code_uint(&mut self) -> UInt<8, emboss_runtime::LittleEndian, S::SlicedMut<'_>, emboss_runtime::UncheckedState> {
6889        let (offset, len) = (|| -> core::result::Result<(usize, usize), emboss_runtime::Error> {
6890            let offset = (0) as usize;
6891            let len = (1) as usize;
6892            core::result::Result::Ok((offset, len))
6893        })().unwrap_or((usize::MAX, 0));
6894        let storage = self.storage.slice_mut(offset, len);
6895        UInt::<8, emboss_runtime::LittleEndian, S::SlicedMut<'_>, emboss_runtime::UncheckedState>::new(storage)
6896    }
6897    pub fn parameter_total_size(&mut self) -> UInt<8, emboss_runtime::LittleEndian, S::SlicedMut<'_>, emboss_runtime::UncheckedState> {
6898        let (offset, len) = (|| -> core::result::Result<(usize, usize), emboss_runtime::Error> {
6899            let offset = (1) as usize;
6900            let len = (1) as usize;
6901            core::result::Result::Ok((offset, len))
6902        })().unwrap_or((usize::MAX, 0));
6903        let storage = self.storage.slice_mut(offset, len);
6904        UInt::<8, emboss_runtime::LittleEndian, S::SlicedMut<'_>, emboss_runtime::UncheckedState>::new(storage)
6905    }
6906
6907}
6908
6909impl<S: emboss_runtime::MutStorage> emboss_runtime::IntoWriter for EventHeaderMut<S> {
6910    type Writer = EventHeaderWriter<S, emboss_runtime::UncheckedState>;
6911    fn into_writer(self) -> Self::Writer {
6912        EventHeaderWriter::new(self.storage)
6913    }
6914}
6915
6916pub struct EventHeaderWriter<S: emboss_runtime::MutStorage, ST: emboss_runtime::State = emboss_runtime::UncheckedState> {
6917    storage: S,
6918    _marker: core::marker::PhantomData<ST>,
6919}
6920
6921impl<S: emboss_runtime::MutStorage> EventHeaderWriter<S, emboss_runtime::UncheckedState> {
6922    pub fn new(storage: S) -> Self {
6923        Self {
6924            storage,
6925            _marker: core::marker::PhantomData,
6926        }
6927    }
6928}
6929
6930impl<S: emboss_runtime::MutStorage, ST: emboss_runtime::State> EventHeaderWriter<S, ST> {
6931    /**
6932     * Constructs a writer in a specific typestate.
6933     *
6934     * # Safety
6935     *
6936     * The caller must ensure that `storage` satisfies the layout invariants for `ST`.
6937     */
6938    pub unsafe fn new_in_state(storage: S) -> Self {
6939        Self {
6940            storage,
6941            _marker: core::marker::PhantomData,
6942        }
6943    }
6944    pub fn into_storage(self) -> S {
6945        self.storage
6946    }
6947    /** Converts the writer into an immutable view in the same typestate. */
6948    pub fn into_view(self) -> EventHeader<S, ST> {
6949        unsafe { EventHeader::new_in_state(self.storage) }
6950    }
6951    /** Borrows the writer as an immutable view in the same typestate. */
6952    pub fn as_view(&self) -> EventHeader<S::Sliced<'_>, ST> {
6953        unsafe { EventHeader::new_in_state(self.storage.slice(0, self.storage.len())) }
6954    }
6955    pub fn write_event_code(self, val: EventCode) -> EventHeaderWriter<S, ST::OnValidMutation> {
6956        let view = self.into_view();
6957        let (offset, len) = (|| -> core::result::Result<(usize, usize), emboss_runtime::Error> {
6958            let offset = (0) as usize;
6959            let len = (1) as usize;
6960            core::result::Result::Ok((offset, len))
6961        })().expect("valid layout in complete state");
6962        let mut storage = view.into_storage();
6963        {
6964            let slice = storage.slice_mut(offset, len);
6965            let mut field_view = emboss_runtime::EnumViewMut::<EventCode, emboss_runtime::UInt<8, emboss_runtime::LittleEndian, _>>::new(emboss_runtime::UInt::new(slice));
6966            field_view.try_write(val).expect("valid write in complete state");
6967        }
6968        unsafe { EventHeaderWriter::new_in_state(storage) }
6969    }
6970    pub fn write_event_code_uint(self, val: <emboss_runtime::SizeSelector<8> as emboss_runtime::SmallestUInt>::T) -> EventHeaderWriter<S, ST::OnValidMutation> {
6971        let view = self.into_view();
6972        let (offset, len) = (|| -> core::result::Result<(usize, usize), emboss_runtime::Error> {
6973            let offset = (0) as usize;
6974            let len = (1) as usize;
6975            core::result::Result::Ok((offset, len))
6976        })().expect("valid layout in complete state");
6977        let mut storage = view.into_storage();
6978        {
6979            let slice = storage.slice_mut(offset, len);
6980            let mut field_view = emboss_runtime::UInt::<8, emboss_runtime::LittleEndian, _>::new(slice);
6981            field_view.try_write(val).expect("valid write in complete state");
6982        }
6983        unsafe { EventHeaderWriter::new_in_state(storage) }
6984    }
6985    pub fn write_parameter_total_size(self, val: <emboss_runtime::SizeSelector<8> as emboss_runtime::SmallestUInt>::T) -> EventHeaderWriter<S, ST::OnValidMutation> {
6986        let view = self.into_view();
6987        let (offset, len) = (|| -> core::result::Result<(usize, usize), emboss_runtime::Error> {
6988            let offset = (1) as usize;
6989            let len = (1) as usize;
6990            core::result::Result::Ok((offset, len))
6991        })().expect("valid layout in complete state");
6992        let mut storage = view.into_storage();
6993        {
6994            let slice = storage.slice_mut(offset, len);
6995            let mut field_view = emboss_runtime::UInt::<8, emboss_runtime::LittleEndian, _>::new(slice);
6996            field_view.try_write(val).expect("valid write in complete state");
6997        }
6998        unsafe { EventHeaderWriter::new_in_state(storage) }
6999    }
7000
7001}
7002
7003impl<S: emboss_runtime::Storage, ST: emboss_runtime::State> emboss_runtime::View for EventHeader<S, ST> {
7004    fn size_in_bytes(&self) -> core::result::Result<usize, emboss_runtime::Error> {
7005        let view = self;
7006        core::result::Result::Ok((2) as usize)
7007    }
7008}
7009
7010impl<S: emboss_runtime::MutStorage> emboss_runtime::View for EventHeaderMut<S> {
7011    fn size_in_bytes(&self) -> core::result::Result<usize, emboss_runtime::Error> {
7012        let view = self.as_view();
7013        <EventHeader<S::Sliced<'_>, emboss_runtime::UncheckedState> as emboss_runtime::View>::size_in_bytes(&view)
7014    }
7015}
7016
7017impl<S: emboss_runtime::MutStorage, ST: emboss_runtime::State> emboss_runtime::View for EventHeaderWriter<S, ST> {
7018    fn size_in_bytes(&self) -> core::result::Result<usize, emboss_runtime::Error> {
7019        let view = self.as_view();
7020        <EventHeader<S::Sliced<'_>, ST> as emboss_runtime::View>::size_in_bytes(&view)
7021    }
7022}
7023
7024impl<S: emboss_runtime::Storage> emboss_runtime::CheckComplete for EventHeader<S, emboss_runtime::UncheckedState> {
7025    type Completed = EventHeader<S, emboss_runtime::CompleteState>;
7026    fn check_complete(self) -> core::result::Result<Self::Completed, emboss_runtime::Error> {
7027        let required_size = <Self as emboss_runtime::View>::size_in_bytes(&self)?;
7028        if self.storage.len() < required_size {
7029            return core::result::Result::Err(emboss_runtime::Error::OutOfBounds);
7030        }
7031        core::result::Result::Ok(unsafe { EventHeader::new_in_state(self.storage) })
7032    }
7033}
7034
7035impl<S: emboss_runtime::MutStorage> emboss_runtime::CheckComplete for EventHeaderWriter<S, emboss_runtime::UncheckedState> {
7036    type Completed = EventHeaderWriter<S, emboss_runtime::CompleteState>;
7037    fn check_complete(self) -> core::result::Result<Self::Completed, emboss_runtime::Error> {
7038        let required_size = <Self as emboss_runtime::View>::size_in_bytes(&self)?;
7039        if self.storage.len() < required_size {
7040            return core::result::Result::Err(emboss_runtime::Error::OutOfBounds);
7041        }
7042        core::result::Result::Ok(unsafe { EventHeaderWriter::new_in_state(self.storage) })
7043    }
7044}
7045
7046impl<S: emboss_runtime::Storage> emboss_runtime::CheckOk for EventHeader<S, emboss_runtime::UncheckedState> {
7047    type Ok = EventHeader<S, emboss_runtime::OkState>;
7048    fn check_ok(self) -> core::result::Result<Self::Ok, emboss_runtime::Error> {
7049        let completed = emboss_runtime::CheckComplete::check_complete(self)?;
7050        core::result::Result::Ok(unsafe { EventHeader::new_in_state(completed.into_storage()) })
7051    }
7052}
7053
7054impl<S: emboss_runtime::Storage> emboss_runtime::CheckOk for EventHeader<S, emboss_runtime::CompleteState> {
7055    type Ok = EventHeader<S, emboss_runtime::OkState>;
7056    fn check_ok(self) -> core::result::Result<Self::Ok, emboss_runtime::Error> {
7057        core::result::Result::Ok(unsafe { EventHeader::new_in_state(self.into_storage()) })
7058    }
7059}
7060
7061impl<S: emboss_runtime::Storage> emboss_runtime::CheckOk for EventHeader<S, emboss_runtime::OkState> {
7062    type Ok = EventHeader<S, emboss_runtime::OkState>;
7063    fn check_ok(self) -> core::result::Result<Self::Ok, emboss_runtime::Error> {
7064        core::result::Result::Ok(self)
7065    }
7066}
7067
7068impl<S: emboss_runtime::MutStorage> emboss_runtime::CheckOk for EventHeaderWriter<S, emboss_runtime::UncheckedState> {
7069    type Ok = EventHeaderWriter<S, emboss_runtime::OkState>;
7070    fn check_ok(self) -> core::result::Result<Self::Ok, emboss_runtime::Error> {
7071        let completed = emboss_runtime::CheckComplete::check_complete(self)?;
7072        core::result::Result::Ok(unsafe { EventHeaderWriter::new_in_state(completed.into_storage()) })
7073    }
7074}
7075
7076impl<S: emboss_runtime::MutStorage> emboss_runtime::CheckOk for EventHeaderWriter<S, emboss_runtime::CompleteState> {
7077    type Ok = EventHeaderWriter<S, emboss_runtime::OkState>;
7078    fn check_ok(self) -> core::result::Result<Self::Ok, emboss_runtime::Error> {
7079        core::result::Result::Ok(unsafe { EventHeaderWriter::new_in_state(self.into_storage()) })
7080    }
7081}
7082
7083impl<S: emboss_runtime::MutStorage> emboss_runtime::CheckOk for EventHeaderWriter<S, emboss_runtime::OkState> {
7084    type Ok = EventHeaderWriter<S, emboss_runtime::OkState>;
7085    fn check_ok(self) -> core::result::Result<Self::Ok, emboss_runtime::Error> {
7086        core::result::Result::Ok(self)
7087    }
7088}
7089
7090pub mod event_header {
7091    pub type View<S, ST = emboss_runtime::UncheckedState> = super::EventHeader<S, ST>;
7092    pub type ViewMut<S> = super::EventHeaderMut<S>;
7093    pub type Writer<S, ST = emboss_runtime::UncheckedState> = super::EventHeaderWriter<S, ST>;
7094
7095    pub const MIN_SIZE_IN_BYTES: usize = 2;
7096    pub const MAX_SIZE_IN_BYTES: usize = 2;
7097    pub const SIZE_IN_BYTES: usize = 2;
7098}pub struct EventPacket_Payload_ArrayView<S: emboss_runtime::Storage> {
7099    storage: S,
7100    element_count: usize,
7101}
7102
7103impl<S: emboss_runtime::Storage + core::clone::Clone> core::clone::Clone for EventPacket_Payload_ArrayView<S> {
7104    fn clone(&self) -> Self {
7105        Self {
7106            storage: self.storage.clone(),
7107            element_count: self.element_count,
7108        }
7109    }
7110}
7111
7112impl<S: emboss_runtime::Storage> EventPacket_Payload_ArrayView<S> {
7113    pub const ELEMENT_SIZE_BYTES: usize = 1;
7114    pub fn new(storage: S, element_count: usize) -> Self {
7115        Self { storage, element_count }
7116    }
7117    pub fn element_count(&self) -> usize {
7118        self.element_count
7119    }
7120    pub fn get(&self, index: usize) -> core::result::Result<emboss_runtime::UInt<8, emboss_runtime::LittleEndian, S::Sliced<'_>>
7121, emboss_runtime::Error> {
7122        if index >= self.element_count {
7123            return core::result::Result::Err(emboss_runtime::Error::OutOfBounds);
7124        }
7125        let offset = index * Self::ELEMENT_SIZE_BYTES;
7126        let storage = self.storage.slice(offset, Self::ELEMENT_SIZE_BYTES);
7127        core::result::Result::Ok(emboss_runtime::UInt::new(storage)
7128)
7129    }
7130}
7131
7132pub struct EventPacket_Payload_ArrayViewMut<S: emboss_runtime::MutStorage> {
7133    storage: S,
7134    element_count: usize,
7135}
7136
7137impl<S: emboss_runtime::MutStorage> EventPacket_Payload_ArrayViewMut<S> {
7138    pub const ELEMENT_SIZE_BYTES: usize = 1;
7139    pub fn new(storage: S, element_count: usize) -> Self {
7140        Self { storage, element_count }
7141    }
7142    pub fn element_count(&self) -> usize {
7143        self.element_count
7144    }
7145    pub fn get_mut(&mut self, index: usize) -> core::result::Result<emboss_runtime::UInt<8, emboss_runtime::LittleEndian, S::SlicedMut<'_>>
7146, emboss_runtime::Error> {
7147        if index >= self.element_count {
7148            return core::result::Result::Err(emboss_runtime::Error::OutOfBounds);
7149        }
7150        let offset = index * Self::ELEMENT_SIZE_BYTES;
7151        let storage = self.storage.slice_mut(offset, Self::ELEMENT_SIZE_BYTES);
7152        core::result::Result::Ok(emboss_runtime::UInt::new(storage)
7153)
7154    }
7155}
7156pub struct EventPacket<S: emboss_runtime::Storage, ST: emboss_runtime::State = emboss_runtime::UncheckedState> {
7157    storage: S,
7158    _marker: core::marker::PhantomData<ST>,
7159}
7160
7161impl<S: emboss_runtime::Storage> EventPacket<S, emboss_runtime::UncheckedState> {
7162    pub fn new(storage: S) -> Self {
7163        Self {
7164            storage,
7165            _marker: core::marker::PhantomData,
7166        }
7167    }
7168}
7169
7170impl<S: emboss_runtime::Storage + core::clone::Clone, ST: emboss_runtime::State> core::clone::Clone for EventPacket<S, ST> {
7171    fn clone(&self) -> Self {
7172        Self {
7173            storage: self.storage.clone(),
7174            _marker: core::marker::PhantomData,
7175        }
7176    }
7177}
7178
7179impl<S: emboss_runtime::Storage, ST: emboss_runtime::State> EventPacket<S, ST> {
7180    /**
7181     * Constructs a view in a specific typestate.
7182     *
7183     * # Safety
7184     *
7185     * The caller must ensure that `storage` satisfies the layout invariants for `ST`.
7186     */
7187    pub unsafe fn new_in_state(storage: S) -> Self {
7188        Self {
7189            storage,
7190            _marker: core::marker::PhantomData,
7191        }
7192    }
7193    pub fn into_storage(self) -> S {
7194        self.storage
7195    }
7196    pub fn hdr_size(&self) -> emboss_runtime::VirtualField<u64> {
7197        let value = (|| -> core::result::Result<u64, emboss_runtime::Error> {
7198        core::result::Result::Ok( (2) as u64 )
7199    })();
7200        emboss_runtime::VirtualField::new(value)
7201    }
7202    pub fn header(&self) -> EventHeader<S::Sliced<'_>, emboss_runtime::UncheckedState> {
7203        let (offset, len) = (|| -> core::result::Result<(usize, usize), emboss_runtime::Error> {
7204            let offset = (0) as usize;
7205            let len = (({ let val = self.hdr_size().try_read().map_err(|e| match e { emboss_runtime::Error::OutOfBounds => emboss_runtime::Error::OutOfBounds, emboss_runtime::Error::UnknownEnum(_) => emboss_runtime::Error::UnknownEnum(()) })?; val })
7206) as usize;
7207            core::result::Result::Ok((offset, len))
7208        })().unwrap_or((usize::MAX, 0));
7209        let storage = self.storage.slice(offset, len);
7210        unsafe { EventHeader::<S::Sliced<'_>, emboss_runtime::UncheckedState>::new_in_state(storage) }
7211    }
7212    pub fn length(&self) -> emboss_runtime::VirtualField<u64> {
7213        let value = (|| -> core::result::Result<u64, emboss_runtime::Error> {
7214        core::result::Result::Ok( (({ let val = self.header().parameter_total_size().try_read().map_err(|e| match e { emboss_runtime::Error::OutOfBounds => emboss_runtime::Error::OutOfBounds, emboss_runtime::Error::UnknownEnum(_) => emboss_runtime::Error::UnknownEnum(()) })?; val })
7215) as u64 )
7216    })();
7217        emboss_runtime::VirtualField::new(value)
7218    }
7219    pub fn payload(&self) -> core::result::Result<EventPacket_Payload_ArrayView<S::Sliced<'_>>, emboss_runtime::Error> {
7220        let offset_res = (|| -> core::result::Result<(usize, usize, usize), emboss_runtime::Error> {
7221            let offset = (( (0) as i64 + (({ let val = self.hdr_size().try_read().map_err(|e| match e { emboss_runtime::Error::OutOfBounds => emboss_runtime::Error::OutOfBounds, emboss_runtime::Error::UnknownEnum(_) => emboss_runtime::Error::UnknownEnum(()) })?; val })
7222) as i64 )
7223) as usize;
7224            let len = (({ let val = self.length().try_read().map_err(|e| match e { emboss_runtime::Error::OutOfBounds => emboss_runtime::Error::OutOfBounds, emboss_runtime::Error::UnknownEnum(_) => emboss_runtime::Error::UnknownEnum(()) })?; val })
7225) as usize;
7226            let element_count = (len / (1)) as usize;
7227            core::result::Result::Ok((offset, len, element_count))
7228        })();
7229        match offset_res {
7230            core::result::Result::Ok((offset, len, element_count)) => {
7231                if len > 0 {
7232                    let end = offset.checked_add(len).ok_or(emboss_runtime::Error::OutOfBounds)?;
7233                    self.storage.try_read_byte(end - 1)?;
7234                }
7235                let storage = self.storage.slice(offset, len);
7236                core::result::Result::Ok(EventPacket_Payload_ArrayView::new(storage, element_count))
7237            },
7238            core::result::Result::Err(e) => core::result::Result::Err(e),
7239        }
7240    }
7241
7242}
7243
7244pub struct EventPacketMut<S: emboss_runtime::MutStorage> {
7245    storage: S,
7246}
7247
7248impl<S: emboss_runtime::MutStorage> EventPacketMut<S> {
7249    pub fn new(storage: S) -> Self {
7250        Self {
7251            storage,
7252        }
7253    }
7254    pub fn into_writer(self) -> EventPacketWriter<S, emboss_runtime::UncheckedState> {
7255        EventPacketWriter::new(self.storage)
7256    }
7257    /** Borrows the mutable view as an immutable view in UncheckedState. */
7258    pub fn as_view(&self) -> EventPacket<S::Sliced<'_>, emboss_runtime::UncheckedState> {
7259        unsafe { EventPacket::new_in_state(self.storage.slice(0, self.storage.len())) }
7260    }
7261    pub fn hdr_size(&mut self) -> emboss_runtime::VirtualField<u64> {
7262        let value = (|| -> core::result::Result<u64, emboss_runtime::Error> {
7263        core::result::Result::Ok( (2) as u64 )
7264    })();
7265        emboss_runtime::VirtualField::new(value)
7266    }
7267    pub fn header(&mut self) -> EventHeaderMut<S::SlicedMut<'_>> {
7268        let (offset, len) = (|| -> core::result::Result<(usize, usize), emboss_runtime::Error> {
7269            let offset = (0) as usize;
7270            let len = (({ let val = self.hdr_size().try_read().map_err(|e| match e { emboss_runtime::Error::OutOfBounds => emboss_runtime::Error::OutOfBounds, emboss_runtime::Error::UnknownEnum(_) => emboss_runtime::Error::UnknownEnum(()) })?; val })
7271) as usize;
7272            core::result::Result::Ok((offset, len))
7273        })().unwrap_or((usize::MAX, 0));
7274        let storage = self.storage.slice_mut(offset, len);
7275        EventHeaderMut::<S::SlicedMut<'_>>::new(storage)
7276    }
7277    pub fn length(&mut self) -> emboss_runtime::VirtualField<u64> {
7278        let value = (|| -> core::result::Result<u64, emboss_runtime::Error> {
7279        core::result::Result::Ok( (({ let val = self.header().parameter_total_size().try_read().map_err(|e| match e { emboss_runtime::Error::OutOfBounds => emboss_runtime::Error::OutOfBounds, emboss_runtime::Error::UnknownEnum(_) => emboss_runtime::Error::UnknownEnum(()) })?; val })
7280) as u64 )
7281    })();
7282        emboss_runtime::VirtualField::new(value)
7283    }
7284    pub fn payload_mut(&mut self) -> core::result::Result<EventPacket_Payload_ArrayViewMut<S::SlicedMut<'_>>, emboss_runtime::Error> {
7285        let offset_res = (|| -> core::result::Result<(usize, usize, usize), emboss_runtime::Error> {
7286            let offset = (( (0) as i64 + (({ let val = self.hdr_size().try_read().map_err(|e| match e { emboss_runtime::Error::OutOfBounds => emboss_runtime::Error::OutOfBounds, emboss_runtime::Error::UnknownEnum(_) => emboss_runtime::Error::UnknownEnum(()) })?; val })
7287) as i64 )
7288) as usize;
7289            let len = (({ let val = self.length().try_read().map_err(|e| match e { emboss_runtime::Error::OutOfBounds => emboss_runtime::Error::OutOfBounds, emboss_runtime::Error::UnknownEnum(_) => emboss_runtime::Error::UnknownEnum(()) })?; val })
7290) as usize;
7291            let element_count = (len / (1)) as usize;
7292            core::result::Result::Ok((offset, len, element_count))
7293        })();
7294        match offset_res {
7295            core::result::Result::Ok((offset, len, element_count)) => {
7296                if len > 0 {
7297                    let end = offset.checked_add(len).ok_or(emboss_runtime::Error::OutOfBounds)?;
7298                    self.storage.try_read_byte(end - 1)?;
7299                }
7300                let storage = self.storage.slice_mut(offset, len);
7301                core::result::Result::Ok(EventPacket_Payload_ArrayViewMut::new(storage, element_count))
7302            },
7303            core::result::Result::Err(e) => core::result::Result::Err(e),
7304        }
7305    }
7306
7307}
7308
7309impl<S: emboss_runtime::MutStorage> emboss_runtime::IntoWriter for EventPacketMut<S> {
7310    type Writer = EventPacketWriter<S, emboss_runtime::UncheckedState>;
7311    fn into_writer(self) -> Self::Writer {
7312        EventPacketWriter::new(self.storage)
7313    }
7314}
7315
7316pub struct EventPacketWriter<S: emboss_runtime::MutStorage, ST: emboss_runtime::State = emboss_runtime::UncheckedState> {
7317    storage: S,
7318    _marker: core::marker::PhantomData<ST>,
7319}
7320
7321impl<S: emboss_runtime::MutStorage> EventPacketWriter<S, emboss_runtime::UncheckedState> {
7322    pub fn new(storage: S) -> Self {
7323        Self {
7324            storage,
7325            _marker: core::marker::PhantomData,
7326        }
7327    }
7328}
7329
7330impl<S: emboss_runtime::MutStorage, ST: emboss_runtime::State> EventPacketWriter<S, ST> {
7331    /**
7332     * Constructs a writer in a specific typestate.
7333     *
7334     * # Safety
7335     *
7336     * The caller must ensure that `storage` satisfies the layout invariants for `ST`.
7337     */
7338    pub unsafe fn new_in_state(storage: S) -> Self {
7339        Self {
7340            storage,
7341            _marker: core::marker::PhantomData,
7342        }
7343    }
7344    pub fn into_storage(self) -> S {
7345        self.storage
7346    }
7347    /** Converts the writer into an immutable view in the same typestate. */
7348    pub fn into_view(self) -> EventPacket<S, ST> {
7349        unsafe { EventPacket::new_in_state(self.storage) }
7350    }
7351    /** Borrows the writer as an immutable view in the same typestate. */
7352    pub fn as_view(&self) -> EventPacket<S::Sliced<'_>, ST> {
7353        unsafe { EventPacket::new_in_state(self.storage.slice(0, self.storage.len())) }
7354    }
7355
7356}
7357
7358impl<S: emboss_runtime::Storage, ST: emboss_runtime::State> emboss_runtime::View for EventPacket<S, ST> {
7359    fn size_in_bytes(&self) -> core::result::Result<usize, emboss_runtime::Error> {
7360        let view = self;
7361        core::result::Result::Ok((core::cmp::max((core::cmp::max((0) as i64, ((if true { ( (0) as i64 + (({ let val = view.hdr_size().try_read().map_err(|e| match e { emboss_runtime::Error::OutOfBounds => emboss_runtime::Error::OutOfBounds, emboss_runtime::Error::UnknownEnum(_) => emboss_runtime::Error::UnknownEnum(()) })?; val })
7362) as i64 )
7363 } else { 0 })
7364
7365) as i64)
7366) as i64, ((if true { ( (( (0) as i64 + (({ let val = view.hdr_size().try_read().map_err(|e| match e { emboss_runtime::Error::OutOfBounds => emboss_runtime::Error::OutOfBounds, emboss_runtime::Error::UnknownEnum(_) => emboss_runtime::Error::UnknownEnum(()) })?; val })
7367) as i64 )
7368) as i64 + (({ let val = view.length().try_read().map_err(|e| match e { emboss_runtime::Error::OutOfBounds => emboss_runtime::Error::OutOfBounds, emboss_runtime::Error::UnknownEnum(_) => emboss_runtime::Error::UnknownEnum(()) })?; val })
7369) as i64 )
7370 } else { 0 })
7371
7372) as i64)
7373) as usize)
7374    }
7375}
7376
7377impl<S: emboss_runtime::MutStorage> emboss_runtime::View for EventPacketMut<S> {
7378    fn size_in_bytes(&self) -> core::result::Result<usize, emboss_runtime::Error> {
7379        let view = self.as_view();
7380        <EventPacket<S::Sliced<'_>, emboss_runtime::UncheckedState> as emboss_runtime::View>::size_in_bytes(&view)
7381    }
7382}
7383
7384impl<S: emboss_runtime::MutStorage, ST: emboss_runtime::State> emboss_runtime::View for EventPacketWriter<S, ST> {
7385    fn size_in_bytes(&self) -> core::result::Result<usize, emboss_runtime::Error> {
7386        let view = self.as_view();
7387        <EventPacket<S::Sliced<'_>, ST> as emboss_runtime::View>::size_in_bytes(&view)
7388    }
7389}
7390
7391impl<S: emboss_runtime::Storage> emboss_runtime::CheckComplete for EventPacket<S, emboss_runtime::UncheckedState> {
7392    type Completed = EventPacket<S, emboss_runtime::CompleteState>;
7393    fn check_complete(self) -> core::result::Result<Self::Completed, emboss_runtime::Error> {
7394        let required_size = <Self as emboss_runtime::View>::size_in_bytes(&self)?;
7395        if self.storage.len() < required_size {
7396            return core::result::Result::Err(emboss_runtime::Error::OutOfBounds);
7397        }
7398        core::result::Result::Ok(unsafe { EventPacket::new_in_state(self.storage) })
7399    }
7400}
7401
7402impl<S: emboss_runtime::MutStorage> emboss_runtime::CheckComplete for EventPacketWriter<S, emboss_runtime::UncheckedState> {
7403    type Completed = EventPacketWriter<S, emboss_runtime::CompleteState>;
7404    fn check_complete(self) -> core::result::Result<Self::Completed, emboss_runtime::Error> {
7405        let required_size = <Self as emboss_runtime::View>::size_in_bytes(&self)?;
7406        if self.storage.len() < required_size {
7407            return core::result::Result::Err(emboss_runtime::Error::OutOfBounds);
7408        }
7409        core::result::Result::Ok(unsafe { EventPacketWriter::new_in_state(self.storage) })
7410    }
7411}
7412
7413impl<S: emboss_runtime::Storage> emboss_runtime::CheckOk for EventPacket<S, emboss_runtime::UncheckedState> {
7414    type Ok = EventPacket<S, emboss_runtime::OkState>;
7415    fn check_ok(self) -> core::result::Result<Self::Ok, emboss_runtime::Error> {
7416        let completed = emboss_runtime::CheckComplete::check_complete(self)?;
7417        core::result::Result::Ok(unsafe { EventPacket::new_in_state(completed.into_storage()) })
7418    }
7419}
7420
7421impl<S: emboss_runtime::Storage> emboss_runtime::CheckOk for EventPacket<S, emboss_runtime::CompleteState> {
7422    type Ok = EventPacket<S, emboss_runtime::OkState>;
7423    fn check_ok(self) -> core::result::Result<Self::Ok, emboss_runtime::Error> {
7424        core::result::Result::Ok(unsafe { EventPacket::new_in_state(self.into_storage()) })
7425    }
7426}
7427
7428impl<S: emboss_runtime::Storage> emboss_runtime::CheckOk for EventPacket<S, emboss_runtime::OkState> {
7429    type Ok = EventPacket<S, emboss_runtime::OkState>;
7430    fn check_ok(self) -> core::result::Result<Self::Ok, emboss_runtime::Error> {
7431        core::result::Result::Ok(self)
7432    }
7433}
7434
7435impl<S: emboss_runtime::MutStorage> emboss_runtime::CheckOk for EventPacketWriter<S, emboss_runtime::UncheckedState> {
7436    type Ok = EventPacketWriter<S, emboss_runtime::OkState>;
7437    fn check_ok(self) -> core::result::Result<Self::Ok, emboss_runtime::Error> {
7438        let completed = emboss_runtime::CheckComplete::check_complete(self)?;
7439        core::result::Result::Ok(unsafe { EventPacketWriter::new_in_state(completed.into_storage()) })
7440    }
7441}
7442
7443impl<S: emboss_runtime::MutStorage> emboss_runtime::CheckOk for EventPacketWriter<S, emboss_runtime::CompleteState> {
7444    type Ok = EventPacketWriter<S, emboss_runtime::OkState>;
7445    fn check_ok(self) -> core::result::Result<Self::Ok, emboss_runtime::Error> {
7446        core::result::Result::Ok(unsafe { EventPacketWriter::new_in_state(self.into_storage()) })
7447    }
7448}
7449
7450impl<S: emboss_runtime::MutStorage> emboss_runtime::CheckOk for EventPacketWriter<S, emboss_runtime::OkState> {
7451    type Ok = EventPacketWriter<S, emboss_runtime::OkState>;
7452    fn check_ok(self) -> core::result::Result<Self::Ok, emboss_runtime::Error> {
7453        core::result::Result::Ok(self)
7454    }
7455}
7456
7457pub mod event_packet {
7458    pub type View<S, ST = emboss_runtime::UncheckedState> = super::EventPacket<S, ST>;
7459    pub type ViewMut<S> = super::EventPacketMut<S>;
7460    pub type Writer<S, ST = emboss_runtime::UncheckedState> = super::EventPacketWriter<S, ST>;
7461
7462    pub const MIN_SIZE_IN_BYTES: usize = 2;
7463    pub const MAX_SIZE_IN_BYTES: usize = 257;
7464}pub struct CommandCompleteEvent<S: emboss_runtime::Storage, ST: emboss_runtime::State = emboss_runtime::UncheckedState> {
7465    storage: S,
7466    _marker: core::marker::PhantomData<ST>,
7467}
7468
7469impl<S: emboss_runtime::Storage> CommandCompleteEvent<S, emboss_runtime::UncheckedState> {
7470    pub fn new(storage: S) -> Self {
7471        Self {
7472            storage,
7473            _marker: core::marker::PhantomData,
7474        }
7475    }
7476}
7477
7478impl<S: emboss_runtime::Storage + core::clone::Clone, ST: emboss_runtime::State> core::clone::Clone for CommandCompleteEvent<S, ST> {
7479    fn clone(&self) -> Self {
7480        Self {
7481            storage: self.storage.clone(),
7482            _marker: core::marker::PhantomData,
7483        }
7484    }
7485}
7486
7487impl<S: emboss_runtime::Storage, ST: emboss_runtime::State> CommandCompleteEvent<S, ST> {
7488    /**
7489     * Constructs a view in a specific typestate.
7490     *
7491     * # Safety
7492     *
7493     * The caller must ensure that `storage` satisfies the layout invariants for `ST`.
7494     */
7495    pub unsafe fn new_in_state(storage: S) -> Self {
7496        Self {
7497            storage,
7498            _marker: core::marker::PhantomData,
7499        }
7500    }
7501    pub fn into_storage(self) -> S {
7502        self.storage
7503    }
7504    pub fn hdr_size(&self) -> emboss_runtime::VirtualField<u64> {
7505        let value = (|| -> core::result::Result<u64, emboss_runtime::Error> {
7506        core::result::Result::Ok( (2) as u64 )
7507    })();
7508        emboss_runtime::VirtualField::new(value)
7509    }
7510    pub fn header(&self) -> EventHeader<S::Sliced<'_>, emboss_runtime::UncheckedState> {
7511        let (offset, len) = (|| -> core::result::Result<(usize, usize), emboss_runtime::Error> {
7512            let offset = (0) as usize;
7513            let len = (({ let val = self.hdr_size().try_read().map_err(|e| match e { emboss_runtime::Error::OutOfBounds => emboss_runtime::Error::OutOfBounds, emboss_runtime::Error::UnknownEnum(_) => emboss_runtime::Error::UnknownEnum(()) })?; val })
7514) as usize;
7515            core::result::Result::Ok((offset, len))
7516        })().unwrap_or((usize::MAX, 0));
7517        let storage = self.storage.slice(offset, len);
7518        unsafe { EventHeader::<S::Sliced<'_>, emboss_runtime::UncheckedState>::new_in_state(storage) }
7519    }
7520    pub fn num_hci_command_packets(&self) -> UInt<8, emboss_runtime::LittleEndian, S::Sliced<'_>, ST> {
7521        let (offset, len) = (|| -> core::result::Result<(usize, usize), emboss_runtime::Error> {
7522            let offset = (({ let val = self.hdr_size().try_read().map_err(|e| match e { emboss_runtime::Error::OutOfBounds => emboss_runtime::Error::OutOfBounds, emboss_runtime::Error::UnknownEnum(_) => emboss_runtime::Error::UnknownEnum(()) })?; val })
7523) as usize;
7524            let len = (1) as usize;
7525            core::result::Result::Ok((offset, len))
7526        })().unwrap_or((usize::MAX, 0));
7527        let storage = self.storage.slice(offset, len);
7528        UInt::<8, emboss_runtime::LittleEndian, S::Sliced<'_>, ST>::new(storage)
7529    }
7530    pub fn command_opcode(&self) -> emboss_runtime::EnumView<OpCode, emboss_runtime::UInt<16, emboss_runtime::LittleEndian, S::Sliced<'_>, ST>> {
7531        let (offset, len) = (|| -> core::result::Result<(usize, usize), emboss_runtime::Error> {
7532            let offset = (( (({ let val = self.hdr_size().try_read().map_err(|e| match e { emboss_runtime::Error::OutOfBounds => emboss_runtime::Error::OutOfBounds, emboss_runtime::Error::UnknownEnum(_) => emboss_runtime::Error::UnknownEnum(()) })?; val })
7533) as i64 + (1) as i64 )
7534) as usize;
7535            let len = (2) as usize;
7536            core::result::Result::Ok((offset, len))
7537        })().unwrap_or((usize::MAX, 0));
7538        let storage = self.storage.slice(offset, len);
7539        emboss_runtime::EnumView::new(emboss_runtime::UInt::new(storage))
7540    }
7541    pub fn command_opcode_bits(&self) -> OpCodeBits<S::Sliced<'_>, emboss_runtime::UncheckedState> {
7542        let (offset, len) = (|| -> core::result::Result<(usize, usize), emboss_runtime::Error> {
7543            let offset = (( (({ let val = self.hdr_size().try_read().map_err(|e| match e { emboss_runtime::Error::OutOfBounds => emboss_runtime::Error::OutOfBounds, emboss_runtime::Error::UnknownEnum(_) => emboss_runtime::Error::UnknownEnum(()) })?; val })
7544) as i64 + (1) as i64 )
7545) as usize;
7546            let len = (2) as usize;
7547            core::result::Result::Ok((offset, len))
7548        })().unwrap_or((usize::MAX, 0));
7549        let storage = self.storage.slice(offset, len);
7550        unsafe { OpCodeBits::<S::Sliced<'_>, emboss_runtime::UncheckedState>::new_in_state(storage) }
7551    }
7552    pub fn command_opcode_uint(&self) -> UInt<16, emboss_runtime::LittleEndian, S::Sliced<'_>, ST> {
7553        let (offset, len) = (|| -> core::result::Result<(usize, usize), emboss_runtime::Error> {
7554            let offset = (( (({ let val = self.hdr_size().try_read().map_err(|e| match e { emboss_runtime::Error::OutOfBounds => emboss_runtime::Error::OutOfBounds, emboss_runtime::Error::UnknownEnum(_) => emboss_runtime::Error::UnknownEnum(()) })?; val })
7555) as i64 + (1) as i64 )
7556) as usize;
7557            let len = (2) as usize;
7558            core::result::Result::Ok((offset, len))
7559        })().unwrap_or((usize::MAX, 0));
7560        let storage = self.storage.slice(offset, len);
7561        UInt::<16, emboss_runtime::LittleEndian, S::Sliced<'_>, ST>::new(storage)
7562    }
7563
7564}
7565
7566pub struct CommandCompleteEventMut<S: emboss_runtime::MutStorage> {
7567    storage: S,
7568}
7569
7570impl<S: emboss_runtime::MutStorage> CommandCompleteEventMut<S> {
7571    pub fn new(storage: S) -> Self {
7572        Self {
7573            storage,
7574        }
7575    }
7576    pub fn into_writer(self) -> CommandCompleteEventWriter<S, emboss_runtime::UncheckedState> {
7577        CommandCompleteEventWriter::new(self.storage)
7578    }
7579    /** Borrows the mutable view as an immutable view in UncheckedState. */
7580    pub fn as_view(&self) -> CommandCompleteEvent<S::Sliced<'_>, emboss_runtime::UncheckedState> {
7581        unsafe { CommandCompleteEvent::new_in_state(self.storage.slice(0, self.storage.len())) }
7582    }
7583    pub fn hdr_size(&mut self) -> emboss_runtime::VirtualField<u64> {
7584        let value = (|| -> core::result::Result<u64, emboss_runtime::Error> {
7585        core::result::Result::Ok( (2) as u64 )
7586    })();
7587        emboss_runtime::VirtualField::new(value)
7588    }
7589    pub fn header(&mut self) -> EventHeaderMut<S::SlicedMut<'_>> {
7590        let (offset, len) = (|| -> core::result::Result<(usize, usize), emboss_runtime::Error> {
7591            let offset = (0) as usize;
7592            let len = (({ let val = self.hdr_size().try_read().map_err(|e| match e { emboss_runtime::Error::OutOfBounds => emboss_runtime::Error::OutOfBounds, emboss_runtime::Error::UnknownEnum(_) => emboss_runtime::Error::UnknownEnum(()) })?; val })
7593) as usize;
7594            core::result::Result::Ok((offset, len))
7595        })().unwrap_or((usize::MAX, 0));
7596        let storage = self.storage.slice_mut(offset, len);
7597        EventHeaderMut::<S::SlicedMut<'_>>::new(storage)
7598    }
7599    pub fn num_hci_command_packets(&mut self) -> UInt<8, emboss_runtime::LittleEndian, S::SlicedMut<'_>, emboss_runtime::UncheckedState> {
7600        let (offset, len) = (|| -> core::result::Result<(usize, usize), emboss_runtime::Error> {
7601            let offset = (({ let val = self.hdr_size().try_read().map_err(|e| match e { emboss_runtime::Error::OutOfBounds => emboss_runtime::Error::OutOfBounds, emboss_runtime::Error::UnknownEnum(_) => emboss_runtime::Error::UnknownEnum(()) })?; val })
7602) as usize;
7603            let len = (1) as usize;
7604            core::result::Result::Ok((offset, len))
7605        })().unwrap_or((usize::MAX, 0));
7606        let storage = self.storage.slice_mut(offset, len);
7607        UInt::<8, emboss_runtime::LittleEndian, S::SlicedMut<'_>, emboss_runtime::UncheckedState>::new(storage)
7608    }
7609    pub fn command_opcode(&mut self) -> emboss_runtime::EnumViewMut<OpCode, emboss_runtime::UInt<16, emboss_runtime::LittleEndian, S::SlicedMut<'_>, emboss_runtime::UncheckedState>> {
7610        let (offset, len) = (|| -> core::result::Result<(usize, usize), emboss_runtime::Error> {
7611            let offset = (( (({ let val = self.hdr_size().try_read().map_err(|e| match e { emboss_runtime::Error::OutOfBounds => emboss_runtime::Error::OutOfBounds, emboss_runtime::Error::UnknownEnum(_) => emboss_runtime::Error::UnknownEnum(()) })?; val })
7612) as i64 + (1) as i64 )
7613) as usize;
7614            let len = (2) as usize;
7615            core::result::Result::Ok((offset, len))
7616        })().unwrap_or((usize::MAX, 0));
7617        let storage = self.storage.slice_mut(offset, len);
7618        emboss_runtime::EnumViewMut::new(emboss_runtime::UInt::new(storage))
7619    }
7620    pub fn command_opcode_bits(&mut self) -> OpCodeBitsMut<S::SlicedMut<'_>> {
7621        let (offset, len) = (|| -> core::result::Result<(usize, usize), emboss_runtime::Error> {
7622            let offset = (( (({ let val = self.hdr_size().try_read().map_err(|e| match e { emboss_runtime::Error::OutOfBounds => emboss_runtime::Error::OutOfBounds, emboss_runtime::Error::UnknownEnum(_) => emboss_runtime::Error::UnknownEnum(()) })?; val })
7623) as i64 + (1) as i64 )
7624) as usize;
7625            let len = (2) as usize;
7626            core::result::Result::Ok((offset, len))
7627        })().unwrap_or((usize::MAX, 0));
7628        let storage = self.storage.slice_mut(offset, len);
7629        OpCodeBitsMut::<S::SlicedMut<'_>>::new(storage)
7630    }
7631    pub fn command_opcode_uint(&mut self) -> UInt<16, emboss_runtime::LittleEndian, S::SlicedMut<'_>, emboss_runtime::UncheckedState> {
7632        let (offset, len) = (|| -> core::result::Result<(usize, usize), emboss_runtime::Error> {
7633            let offset = (( (({ let val = self.hdr_size().try_read().map_err(|e| match e { emboss_runtime::Error::OutOfBounds => emboss_runtime::Error::OutOfBounds, emboss_runtime::Error::UnknownEnum(_) => emboss_runtime::Error::UnknownEnum(()) })?; val })
7634) as i64 + (1) as i64 )
7635) as usize;
7636            let len = (2) as usize;
7637            core::result::Result::Ok((offset, len))
7638        })().unwrap_or((usize::MAX, 0));
7639        let storage = self.storage.slice_mut(offset, len);
7640        UInt::<16, emboss_runtime::LittleEndian, S::SlicedMut<'_>, emboss_runtime::UncheckedState>::new(storage)
7641    }
7642
7643}
7644
7645impl<S: emboss_runtime::MutStorage> emboss_runtime::IntoWriter for CommandCompleteEventMut<S> {
7646    type Writer = CommandCompleteEventWriter<S, emboss_runtime::UncheckedState>;
7647    fn into_writer(self) -> Self::Writer {
7648        CommandCompleteEventWriter::new(self.storage)
7649    }
7650}
7651
7652pub struct CommandCompleteEventWriter<S: emboss_runtime::MutStorage, ST: emboss_runtime::State = emboss_runtime::UncheckedState> {
7653    storage: S,
7654    _marker: core::marker::PhantomData<ST>,
7655}
7656
7657impl<S: emboss_runtime::MutStorage> CommandCompleteEventWriter<S, emboss_runtime::UncheckedState> {
7658    pub fn new(storage: S) -> Self {
7659        Self {
7660            storage,
7661            _marker: core::marker::PhantomData,
7662        }
7663    }
7664}
7665
7666impl<S: emboss_runtime::MutStorage, ST: emboss_runtime::State> CommandCompleteEventWriter<S, ST> {
7667    /**
7668     * Constructs a writer in a specific typestate.
7669     *
7670     * # Safety
7671     *
7672     * The caller must ensure that `storage` satisfies the layout invariants for `ST`.
7673     */
7674    pub unsafe fn new_in_state(storage: S) -> Self {
7675        Self {
7676            storage,
7677            _marker: core::marker::PhantomData,
7678        }
7679    }
7680    pub fn into_storage(self) -> S {
7681        self.storage
7682    }
7683    /** Converts the writer into an immutable view in the same typestate. */
7684    pub fn into_view(self) -> CommandCompleteEvent<S, ST> {
7685        unsafe { CommandCompleteEvent::new_in_state(self.storage) }
7686    }
7687    /** Borrows the writer as an immutable view in the same typestate. */
7688    pub fn as_view(&self) -> CommandCompleteEvent<S::Sliced<'_>, ST> {
7689        unsafe { CommandCompleteEvent::new_in_state(self.storage.slice(0, self.storage.len())) }
7690    }
7691    pub fn write_num_hci_command_packets(self, val: <emboss_runtime::SizeSelector<8> as emboss_runtime::SmallestUInt>::T) -> CommandCompleteEventWriter<S, ST::OnValidMutation> {
7692        let view = self.into_view();
7693        let (offset, len) = (|| -> core::result::Result<(usize, usize), emboss_runtime::Error> {
7694            let offset = (({ let val = view.hdr_size().try_read().map_err(|e| match e { emboss_runtime::Error::OutOfBounds => emboss_runtime::Error::OutOfBounds, emboss_runtime::Error::UnknownEnum(_) => emboss_runtime::Error::UnknownEnum(()) })?; val })
7695) as usize;
7696            let len = (1) as usize;
7697            core::result::Result::Ok((offset, len))
7698        })().expect("valid layout in complete state");
7699        let mut storage = view.into_storage();
7700        {
7701            let slice = storage.slice_mut(offset, len);
7702            let mut field_view = emboss_runtime::UInt::<8, emboss_runtime::LittleEndian, _>::new(slice);
7703            field_view.try_write(val).expect("valid write in complete state");
7704        }
7705        unsafe { CommandCompleteEventWriter::new_in_state(storage) }
7706    }
7707    pub fn write_command_opcode(self, val: OpCode) -> CommandCompleteEventWriter<S, ST::OnValidMutation> {
7708        let view = self.into_view();
7709        let (offset, len) = (|| -> core::result::Result<(usize, usize), emboss_runtime::Error> {
7710            let offset = (( (({ let val = view.hdr_size().try_read().map_err(|e| match e { emboss_runtime::Error::OutOfBounds => emboss_runtime::Error::OutOfBounds, emboss_runtime::Error::UnknownEnum(_) => emboss_runtime::Error::UnknownEnum(()) })?; val })
7711) as i64 + (1) as i64 )
7712) as usize;
7713            let len = (2) as usize;
7714            core::result::Result::Ok((offset, len))
7715        })().expect("valid layout in complete state");
7716        let mut storage = view.into_storage();
7717        {
7718            let slice = storage.slice_mut(offset, len);
7719            let mut field_view = emboss_runtime::EnumViewMut::<OpCode, emboss_runtime::UInt<16, emboss_runtime::LittleEndian, _>>::new(emboss_runtime::UInt::new(slice));
7720            field_view.try_write(val).expect("valid write in complete state");
7721        }
7722        unsafe { CommandCompleteEventWriter::new_in_state(storage) }
7723    }
7724    pub fn write_command_opcode_uint(self, val: <emboss_runtime::SizeSelector<16> as emboss_runtime::SmallestUInt>::T) -> CommandCompleteEventWriter<S, ST::OnValidMutation> {
7725        let view = self.into_view();
7726        let (offset, len) = (|| -> core::result::Result<(usize, usize), emboss_runtime::Error> {
7727            let offset = (( (({ let val = view.hdr_size().try_read().map_err(|e| match e { emboss_runtime::Error::OutOfBounds => emboss_runtime::Error::OutOfBounds, emboss_runtime::Error::UnknownEnum(_) => emboss_runtime::Error::UnknownEnum(()) })?; val })
7728) as i64 + (1) as i64 )
7729) as usize;
7730            let len = (2) as usize;
7731            core::result::Result::Ok((offset, len))
7732        })().expect("valid layout in complete state");
7733        let mut storage = view.into_storage();
7734        {
7735            let slice = storage.slice_mut(offset, len);
7736            let mut field_view = emboss_runtime::UInt::<16, emboss_runtime::LittleEndian, _>::new(slice);
7737            field_view.try_write(val).expect("valid write in complete state");
7738        }
7739        unsafe { CommandCompleteEventWriter::new_in_state(storage) }
7740    }
7741
7742}
7743
7744impl<S: emboss_runtime::Storage, ST: emboss_runtime::State> emboss_runtime::View for CommandCompleteEvent<S, ST> {
7745    fn size_in_bytes(&self) -> core::result::Result<usize, emboss_runtime::Error> {
7746        let view = self;
7747        core::result::Result::Ok((core::cmp::max((core::cmp::max((core::cmp::max((core::cmp::max((core::cmp::max((0) as i64, ((if true { ( (0) as i64 + (({ let val = view.hdr_size().try_read().map_err(|e| match e { emboss_runtime::Error::OutOfBounds => emboss_runtime::Error::OutOfBounds, emboss_runtime::Error::UnknownEnum(_) => emboss_runtime::Error::UnknownEnum(()) })?; val })
7748) as i64 )
7749 } else { 0 })
7750
7751) as i64)
7752) as i64, ((if true { ( (({ let val = view.hdr_size().try_read().map_err(|e| match e { emboss_runtime::Error::OutOfBounds => emboss_runtime::Error::OutOfBounds, emboss_runtime::Error::UnknownEnum(_) => emboss_runtime::Error::UnknownEnum(()) })?; val })
7753) as i64 + (1) as i64 )
7754 } else { 0 })
7755
7756) as i64)
7757) as i64, ((if true { ( (( (({ let val = view.hdr_size().try_read().map_err(|e| match e { emboss_runtime::Error::OutOfBounds => emboss_runtime::Error::OutOfBounds, emboss_runtime::Error::UnknownEnum(_) => emboss_runtime::Error::UnknownEnum(()) })?; val })
7758) as i64 + (1) as i64 )
7759) as i64 + (2) as i64 )
7760 } else { 0 })
7761
7762) as i64)
7763) as i64, ((if true { ( (( (({ let val = view.hdr_size().try_read().map_err(|e| match e { emboss_runtime::Error::OutOfBounds => emboss_runtime::Error::OutOfBounds, emboss_runtime::Error::UnknownEnum(_) => emboss_runtime::Error::UnknownEnum(()) })?; val })
7764) as i64 + (1) as i64 )
7765) as i64 + (2) as i64 )
7766 } else { 0 })
7767
7768) as i64)
7769) as i64, ((if true { ( (( (({ let val = view.hdr_size().try_read().map_err(|e| match e { emboss_runtime::Error::OutOfBounds => emboss_runtime::Error::OutOfBounds, emboss_runtime::Error::UnknownEnum(_) => emboss_runtime::Error::UnknownEnum(()) })?; val })
7770) as i64 + (1) as i64 )
7771) as i64 + (2) as i64 )
7772 } else { 0 })
7773
7774) as i64)
7775) as usize)
7776    }
7777}
7778
7779impl<S: emboss_runtime::MutStorage> emboss_runtime::View for CommandCompleteEventMut<S> {
7780    fn size_in_bytes(&self) -> core::result::Result<usize, emboss_runtime::Error> {
7781        let view = self.as_view();
7782        <CommandCompleteEvent<S::Sliced<'_>, emboss_runtime::UncheckedState> as emboss_runtime::View>::size_in_bytes(&view)
7783    }
7784}
7785
7786impl<S: emboss_runtime::MutStorage, ST: emboss_runtime::State> emboss_runtime::View for CommandCompleteEventWriter<S, ST> {
7787    fn size_in_bytes(&self) -> core::result::Result<usize, emboss_runtime::Error> {
7788        let view = self.as_view();
7789        <CommandCompleteEvent<S::Sliced<'_>, ST> as emboss_runtime::View>::size_in_bytes(&view)
7790    }
7791}
7792
7793impl<S: emboss_runtime::Storage> emboss_runtime::CheckComplete for CommandCompleteEvent<S, emboss_runtime::UncheckedState> {
7794    type Completed = CommandCompleteEvent<S, emboss_runtime::CompleteState>;
7795    fn check_complete(self) -> core::result::Result<Self::Completed, emboss_runtime::Error> {
7796        let required_size = <Self as emboss_runtime::View>::size_in_bytes(&self)?;
7797        if self.storage.len() < required_size {
7798            return core::result::Result::Err(emboss_runtime::Error::OutOfBounds);
7799        }
7800        core::result::Result::Ok(unsafe { CommandCompleteEvent::new_in_state(self.storage) })
7801    }
7802}
7803
7804impl<S: emboss_runtime::MutStorage> emboss_runtime::CheckComplete for CommandCompleteEventWriter<S, emboss_runtime::UncheckedState> {
7805    type Completed = CommandCompleteEventWriter<S, emboss_runtime::CompleteState>;
7806    fn check_complete(self) -> core::result::Result<Self::Completed, emboss_runtime::Error> {
7807        let required_size = <Self as emboss_runtime::View>::size_in_bytes(&self)?;
7808        if self.storage.len() < required_size {
7809            return core::result::Result::Err(emboss_runtime::Error::OutOfBounds);
7810        }
7811        core::result::Result::Ok(unsafe { CommandCompleteEventWriter::new_in_state(self.storage) })
7812    }
7813}
7814
7815impl<S: emboss_runtime::Storage> emboss_runtime::CheckOk for CommandCompleteEvent<S, emboss_runtime::UncheckedState> {
7816    type Ok = CommandCompleteEvent<S, emboss_runtime::OkState>;
7817    fn check_ok(self) -> core::result::Result<Self::Ok, emboss_runtime::Error> {
7818        let completed = emboss_runtime::CheckComplete::check_complete(self)?;
7819        core::result::Result::Ok(unsafe { CommandCompleteEvent::new_in_state(completed.into_storage()) })
7820    }
7821}
7822
7823impl<S: emboss_runtime::Storage> emboss_runtime::CheckOk for CommandCompleteEvent<S, emboss_runtime::CompleteState> {
7824    type Ok = CommandCompleteEvent<S, emboss_runtime::OkState>;
7825    fn check_ok(self) -> core::result::Result<Self::Ok, emboss_runtime::Error> {
7826        core::result::Result::Ok(unsafe { CommandCompleteEvent::new_in_state(self.into_storage()) })
7827    }
7828}
7829
7830impl<S: emboss_runtime::Storage> emboss_runtime::CheckOk for CommandCompleteEvent<S, emboss_runtime::OkState> {
7831    type Ok = CommandCompleteEvent<S, emboss_runtime::OkState>;
7832    fn check_ok(self) -> core::result::Result<Self::Ok, emboss_runtime::Error> {
7833        core::result::Result::Ok(self)
7834    }
7835}
7836
7837impl<S: emboss_runtime::MutStorage> emboss_runtime::CheckOk for CommandCompleteEventWriter<S, emboss_runtime::UncheckedState> {
7838    type Ok = CommandCompleteEventWriter<S, emboss_runtime::OkState>;
7839    fn check_ok(self) -> core::result::Result<Self::Ok, emboss_runtime::Error> {
7840        let completed = emboss_runtime::CheckComplete::check_complete(self)?;
7841        core::result::Result::Ok(unsafe { CommandCompleteEventWriter::new_in_state(completed.into_storage()) })
7842    }
7843}
7844
7845impl<S: emboss_runtime::MutStorage> emboss_runtime::CheckOk for CommandCompleteEventWriter<S, emboss_runtime::CompleteState> {
7846    type Ok = CommandCompleteEventWriter<S, emboss_runtime::OkState>;
7847    fn check_ok(self) -> core::result::Result<Self::Ok, emboss_runtime::Error> {
7848        core::result::Result::Ok(unsafe { CommandCompleteEventWriter::new_in_state(self.into_storage()) })
7849    }
7850}
7851
7852impl<S: emboss_runtime::MutStorage> emboss_runtime::CheckOk for CommandCompleteEventWriter<S, emboss_runtime::OkState> {
7853    type Ok = CommandCompleteEventWriter<S, emboss_runtime::OkState>;
7854    fn check_ok(self) -> core::result::Result<Self::Ok, emboss_runtime::Error> {
7855        core::result::Result::Ok(self)
7856    }
7857}
7858
7859pub mod command_complete_event {
7860    pub type View<S, ST = emboss_runtime::UncheckedState> = super::CommandCompleteEvent<S, ST>;
7861    pub type ViewMut<S> = super::CommandCompleteEventMut<S>;
7862    pub type Writer<S, ST = emboss_runtime::UncheckedState> = super::CommandCompleteEventWriter<S, ST>;
7863
7864    pub const MIN_SIZE_IN_BYTES: usize = 5;
7865    pub const MAX_SIZE_IN_BYTES: usize = 5;
7866    pub const SIZE_IN_BYTES: usize = 5;
7867}pub struct VendorDebugEvent<S: emboss_runtime::Storage, ST: emboss_runtime::State = emboss_runtime::UncheckedState> {
7868    storage: S,
7869    _marker: core::marker::PhantomData<ST>,
7870}
7871
7872impl<S: emboss_runtime::Storage> VendorDebugEvent<S, emboss_runtime::UncheckedState> {
7873    pub fn new(storage: S) -> Self {
7874        Self {
7875            storage,
7876            _marker: core::marker::PhantomData,
7877        }
7878    }
7879}
7880
7881impl<S: emboss_runtime::Storage + core::clone::Clone, ST: emboss_runtime::State> core::clone::Clone for VendorDebugEvent<S, ST> {
7882    fn clone(&self) -> Self {
7883        Self {
7884            storage: self.storage.clone(),
7885            _marker: core::marker::PhantomData,
7886        }
7887    }
7888}
7889
7890impl<S: emboss_runtime::Storage, ST: emboss_runtime::State> VendorDebugEvent<S, ST> {
7891    /**
7892     * Constructs a view in a specific typestate.
7893     *
7894     * # Safety
7895     *
7896     * The caller must ensure that `storage` satisfies the layout invariants for `ST`.
7897     */
7898    pub unsafe fn new_in_state(storage: S) -> Self {
7899        Self {
7900            storage,
7901            _marker: core::marker::PhantomData,
7902        }
7903    }
7904    pub fn into_storage(self) -> S {
7905        self.storage
7906    }
7907    pub fn hdr_size(&self) -> emboss_runtime::VirtualField<u64> {
7908        let value = (|| -> core::result::Result<u64, emboss_runtime::Error> {
7909        core::result::Result::Ok( (2) as u64 )
7910    })();
7911        emboss_runtime::VirtualField::new(value)
7912    }
7913    pub fn header(&self) -> EventHeader<S::Sliced<'_>, emboss_runtime::UncheckedState> {
7914        let (offset, len) = (|| -> core::result::Result<(usize, usize), emboss_runtime::Error> {
7915            let offset = (0) as usize;
7916            let len = (({ let val = self.hdr_size().try_read().map_err(|e| match e { emboss_runtime::Error::OutOfBounds => emboss_runtime::Error::OutOfBounds, emboss_runtime::Error::UnknownEnum(_) => emboss_runtime::Error::UnknownEnum(()) })?; val })
7917) as usize;
7918            core::result::Result::Ok((offset, len))
7919        })().unwrap_or((usize::MAX, 0));
7920        let storage = self.storage.slice(offset, len);
7921        unsafe { EventHeader::<S::Sliced<'_>, emboss_runtime::UncheckedState>::new_in_state(storage) }
7922    }
7923    pub fn subevent_code(&self) -> UInt<8, emboss_runtime::LittleEndian, S::Sliced<'_>, ST> {
7924        let (offset, len) = (|| -> core::result::Result<(usize, usize), emboss_runtime::Error> {
7925            let offset = (( (0) as i64 + (({ let val = self.hdr_size().try_read().map_err(|e| match e { emboss_runtime::Error::OutOfBounds => emboss_runtime::Error::OutOfBounds, emboss_runtime::Error::UnknownEnum(_) => emboss_runtime::Error::UnknownEnum(()) })?; val })
7926) as i64 )
7927) as usize;
7928            let len = (1) as usize;
7929            core::result::Result::Ok((offset, len))
7930        })().unwrap_or((usize::MAX, 0));
7931        let storage = self.storage.slice(offset, len);
7932        UInt::<8, emboss_runtime::LittleEndian, S::Sliced<'_>, ST>::new(storage)
7933    }
7934
7935}
7936
7937pub struct VendorDebugEventMut<S: emboss_runtime::MutStorage> {
7938    storage: S,
7939}
7940
7941impl<S: emboss_runtime::MutStorage> VendorDebugEventMut<S> {
7942    pub fn new(storage: S) -> Self {
7943        Self {
7944            storage,
7945        }
7946    }
7947    pub fn into_writer(self) -> VendorDebugEventWriter<S, emboss_runtime::UncheckedState> {
7948        VendorDebugEventWriter::new(self.storage)
7949    }
7950    /** Borrows the mutable view as an immutable view in UncheckedState. */
7951    pub fn as_view(&self) -> VendorDebugEvent<S::Sliced<'_>, emboss_runtime::UncheckedState> {
7952        unsafe { VendorDebugEvent::new_in_state(self.storage.slice(0, self.storage.len())) }
7953    }
7954    pub fn hdr_size(&mut self) -> emboss_runtime::VirtualField<u64> {
7955        let value = (|| -> core::result::Result<u64, emboss_runtime::Error> {
7956        core::result::Result::Ok( (2) as u64 )
7957    })();
7958        emboss_runtime::VirtualField::new(value)
7959    }
7960    pub fn header(&mut self) -> EventHeaderMut<S::SlicedMut<'_>> {
7961        let (offset, len) = (|| -> core::result::Result<(usize, usize), emboss_runtime::Error> {
7962            let offset = (0) as usize;
7963            let len = (({ let val = self.hdr_size().try_read().map_err(|e| match e { emboss_runtime::Error::OutOfBounds => emboss_runtime::Error::OutOfBounds, emboss_runtime::Error::UnknownEnum(_) => emboss_runtime::Error::UnknownEnum(()) })?; val })
7964) as usize;
7965            core::result::Result::Ok((offset, len))
7966        })().unwrap_or((usize::MAX, 0));
7967        let storage = self.storage.slice_mut(offset, len);
7968        EventHeaderMut::<S::SlicedMut<'_>>::new(storage)
7969    }
7970    pub fn subevent_code(&mut self) -> UInt<8, emboss_runtime::LittleEndian, S::SlicedMut<'_>, emboss_runtime::UncheckedState> {
7971        let (offset, len) = (|| -> core::result::Result<(usize, usize), emboss_runtime::Error> {
7972            let offset = (( (0) as i64 + (({ let val = self.hdr_size().try_read().map_err(|e| match e { emboss_runtime::Error::OutOfBounds => emboss_runtime::Error::OutOfBounds, emboss_runtime::Error::UnknownEnum(_) => emboss_runtime::Error::UnknownEnum(()) })?; val })
7973) as i64 )
7974) as usize;
7975            let len = (1) as usize;
7976            core::result::Result::Ok((offset, len))
7977        })().unwrap_or((usize::MAX, 0));
7978        let storage = self.storage.slice_mut(offset, len);
7979        UInt::<8, emboss_runtime::LittleEndian, S::SlicedMut<'_>, emboss_runtime::UncheckedState>::new(storage)
7980    }
7981
7982}
7983
7984impl<S: emboss_runtime::MutStorage> emboss_runtime::IntoWriter for VendorDebugEventMut<S> {
7985    type Writer = VendorDebugEventWriter<S, emboss_runtime::UncheckedState>;
7986    fn into_writer(self) -> Self::Writer {
7987        VendorDebugEventWriter::new(self.storage)
7988    }
7989}
7990
7991pub struct VendorDebugEventWriter<S: emboss_runtime::MutStorage, ST: emboss_runtime::State = emboss_runtime::UncheckedState> {
7992    storage: S,
7993    _marker: core::marker::PhantomData<ST>,
7994}
7995
7996impl<S: emboss_runtime::MutStorage> VendorDebugEventWriter<S, emboss_runtime::UncheckedState> {
7997    pub fn new(storage: S) -> Self {
7998        Self {
7999            storage,
8000            _marker: core::marker::PhantomData,
8001        }
8002    }
8003}
8004
8005impl<S: emboss_runtime::MutStorage, ST: emboss_runtime::State> VendorDebugEventWriter<S, ST> {
8006    /**
8007     * Constructs a writer in a specific typestate.
8008     *
8009     * # Safety
8010     *
8011     * The caller must ensure that `storage` satisfies the layout invariants for `ST`.
8012     */
8013    pub unsafe fn new_in_state(storage: S) -> Self {
8014        Self {
8015            storage,
8016            _marker: core::marker::PhantomData,
8017        }
8018    }
8019    pub fn into_storage(self) -> S {
8020        self.storage
8021    }
8022    /** Converts the writer into an immutable view in the same typestate. */
8023    pub fn into_view(self) -> VendorDebugEvent<S, ST> {
8024        unsafe { VendorDebugEvent::new_in_state(self.storage) }
8025    }
8026    /** Borrows the writer as an immutable view in the same typestate. */
8027    pub fn as_view(&self) -> VendorDebugEvent<S::Sliced<'_>, ST> {
8028        unsafe { VendorDebugEvent::new_in_state(self.storage.slice(0, self.storage.len())) }
8029    }
8030    pub fn write_subevent_code(self, val: <emboss_runtime::SizeSelector<8> as emboss_runtime::SmallestUInt>::T) -> VendorDebugEventWriter<S, ST::OnValidMutation> {
8031        let view = self.into_view();
8032        let (offset, len) = (|| -> core::result::Result<(usize, usize), emboss_runtime::Error> {
8033            let offset = (( (0) as i64 + (({ let val = view.hdr_size().try_read().map_err(|e| match e { emboss_runtime::Error::OutOfBounds => emboss_runtime::Error::OutOfBounds, emboss_runtime::Error::UnknownEnum(_) => emboss_runtime::Error::UnknownEnum(()) })?; val })
8034) as i64 )
8035) as usize;
8036            let len = (1) as usize;
8037            core::result::Result::Ok((offset, len))
8038        })().expect("valid layout in complete state");
8039        let mut storage = view.into_storage();
8040        {
8041            let slice = storage.slice_mut(offset, len);
8042            let mut field_view = emboss_runtime::UInt::<8, emboss_runtime::LittleEndian, _>::new(slice);
8043            field_view.try_write(val).expect("valid write in complete state");
8044        }
8045        unsafe { VendorDebugEventWriter::new_in_state(storage) }
8046    }
8047
8048}
8049
8050impl<S: emboss_runtime::Storage, ST: emboss_runtime::State> emboss_runtime::View for VendorDebugEvent<S, ST> {
8051    fn size_in_bytes(&self) -> core::result::Result<usize, emboss_runtime::Error> {
8052        let view = self;
8053        core::result::Result::Ok((core::cmp::max((core::cmp::max((0) as i64, ((if true { ( (0) as i64 + (({ let val = view.hdr_size().try_read().map_err(|e| match e { emboss_runtime::Error::OutOfBounds => emboss_runtime::Error::OutOfBounds, emboss_runtime::Error::UnknownEnum(_) => emboss_runtime::Error::UnknownEnum(()) })?; val })
8054) as i64 )
8055 } else { 0 })
8056
8057) as i64)
8058) as i64, ((if true { ( (( (0) as i64 + (({ let val = view.hdr_size().try_read().map_err(|e| match e { emboss_runtime::Error::OutOfBounds => emboss_runtime::Error::OutOfBounds, emboss_runtime::Error::UnknownEnum(_) => emboss_runtime::Error::UnknownEnum(()) })?; val })
8059) as i64 )
8060) as i64 + (1) as i64 )
8061 } else { 0 })
8062
8063) as i64)
8064) as usize)
8065    }
8066}
8067
8068impl<S: emboss_runtime::MutStorage> emboss_runtime::View for VendorDebugEventMut<S> {
8069    fn size_in_bytes(&self) -> core::result::Result<usize, emboss_runtime::Error> {
8070        let view = self.as_view();
8071        <VendorDebugEvent<S::Sliced<'_>, emboss_runtime::UncheckedState> as emboss_runtime::View>::size_in_bytes(&view)
8072    }
8073}
8074
8075impl<S: emboss_runtime::MutStorage, ST: emboss_runtime::State> emboss_runtime::View for VendorDebugEventWriter<S, ST> {
8076    fn size_in_bytes(&self) -> core::result::Result<usize, emboss_runtime::Error> {
8077        let view = self.as_view();
8078        <VendorDebugEvent<S::Sliced<'_>, ST> as emboss_runtime::View>::size_in_bytes(&view)
8079    }
8080}
8081
8082impl<S: emboss_runtime::Storage> emboss_runtime::CheckComplete for VendorDebugEvent<S, emboss_runtime::UncheckedState> {
8083    type Completed = VendorDebugEvent<S, emboss_runtime::CompleteState>;
8084    fn check_complete(self) -> core::result::Result<Self::Completed, emboss_runtime::Error> {
8085        let required_size = <Self as emboss_runtime::View>::size_in_bytes(&self)?;
8086        if self.storage.len() < required_size {
8087            return core::result::Result::Err(emboss_runtime::Error::OutOfBounds);
8088        }
8089        core::result::Result::Ok(unsafe { VendorDebugEvent::new_in_state(self.storage) })
8090    }
8091}
8092
8093impl<S: emboss_runtime::MutStorage> emboss_runtime::CheckComplete for VendorDebugEventWriter<S, emboss_runtime::UncheckedState> {
8094    type Completed = VendorDebugEventWriter<S, emboss_runtime::CompleteState>;
8095    fn check_complete(self) -> core::result::Result<Self::Completed, emboss_runtime::Error> {
8096        let required_size = <Self as emboss_runtime::View>::size_in_bytes(&self)?;
8097        if self.storage.len() < required_size {
8098            return core::result::Result::Err(emboss_runtime::Error::OutOfBounds);
8099        }
8100        core::result::Result::Ok(unsafe { VendorDebugEventWriter::new_in_state(self.storage) })
8101    }
8102}
8103
8104impl<S: emboss_runtime::Storage> emboss_runtime::CheckOk for VendorDebugEvent<S, emboss_runtime::UncheckedState> {
8105    type Ok = VendorDebugEvent<S, emboss_runtime::OkState>;
8106    fn check_ok(self) -> core::result::Result<Self::Ok, emboss_runtime::Error> {
8107        let completed = emboss_runtime::CheckComplete::check_complete(self)?;
8108        core::result::Result::Ok(unsafe { VendorDebugEvent::new_in_state(completed.into_storage()) })
8109    }
8110}
8111
8112impl<S: emboss_runtime::Storage> emboss_runtime::CheckOk for VendorDebugEvent<S, emboss_runtime::CompleteState> {
8113    type Ok = VendorDebugEvent<S, emboss_runtime::OkState>;
8114    fn check_ok(self) -> core::result::Result<Self::Ok, emboss_runtime::Error> {
8115        core::result::Result::Ok(unsafe { VendorDebugEvent::new_in_state(self.into_storage()) })
8116    }
8117}
8118
8119impl<S: emboss_runtime::Storage> emboss_runtime::CheckOk for VendorDebugEvent<S, emboss_runtime::OkState> {
8120    type Ok = VendorDebugEvent<S, emboss_runtime::OkState>;
8121    fn check_ok(self) -> core::result::Result<Self::Ok, emboss_runtime::Error> {
8122        core::result::Result::Ok(self)
8123    }
8124}
8125
8126impl<S: emboss_runtime::MutStorage> emboss_runtime::CheckOk for VendorDebugEventWriter<S, emboss_runtime::UncheckedState> {
8127    type Ok = VendorDebugEventWriter<S, emboss_runtime::OkState>;
8128    fn check_ok(self) -> core::result::Result<Self::Ok, emboss_runtime::Error> {
8129        let completed = emboss_runtime::CheckComplete::check_complete(self)?;
8130        core::result::Result::Ok(unsafe { VendorDebugEventWriter::new_in_state(completed.into_storage()) })
8131    }
8132}
8133
8134impl<S: emboss_runtime::MutStorage> emboss_runtime::CheckOk for VendorDebugEventWriter<S, emboss_runtime::CompleteState> {
8135    type Ok = VendorDebugEventWriter<S, emboss_runtime::OkState>;
8136    fn check_ok(self) -> core::result::Result<Self::Ok, emboss_runtime::Error> {
8137        core::result::Result::Ok(unsafe { VendorDebugEventWriter::new_in_state(self.into_storage()) })
8138    }
8139}
8140
8141impl<S: emboss_runtime::MutStorage> emboss_runtime::CheckOk for VendorDebugEventWriter<S, emboss_runtime::OkState> {
8142    type Ok = VendorDebugEventWriter<S, emboss_runtime::OkState>;
8143    fn check_ok(self) -> core::result::Result<Self::Ok, emboss_runtime::Error> {
8144        core::result::Result::Ok(self)
8145    }
8146}
8147
8148pub mod vendor_debug_event {
8149    pub type View<S, ST = emboss_runtime::UncheckedState> = super::VendorDebugEvent<S, ST>;
8150    pub type ViewMut<S> = super::VendorDebugEventMut<S>;
8151    pub type Writer<S, ST = emboss_runtime::UncheckedState> = super::VendorDebugEventWriter<S, ST>;
8152
8153    pub const MIN_SIZE_IN_BYTES: usize = 3;
8154    pub const MAX_SIZE_IN_BYTES: usize = 3;
8155    pub const SIZE_IN_BYTES: usize = 3;
8156}pub struct PacketType<S: emboss_runtime::Storage, ST: emboss_runtime::State = emboss_runtime::UncheckedState> {
8157    storage: S,
8158    _marker: core::marker::PhantomData<ST>,
8159}
8160
8161impl<S: emboss_runtime::Storage> PacketType<S, emboss_runtime::UncheckedState> {
8162    pub fn new(storage: S) -> Self {
8163        Self {
8164            storage,
8165            _marker: core::marker::PhantomData,
8166        }
8167    }
8168}
8169
8170impl<S: emboss_runtime::Storage + core::clone::Clone, ST: emboss_runtime::State> core::clone::Clone for PacketType<S, ST> {
8171    fn clone(&self) -> Self {
8172        Self {
8173            storage: self.storage.clone(),
8174            _marker: core::marker::PhantomData,
8175        }
8176    }
8177}
8178
8179impl<S: emboss_runtime::Storage, ST: emboss_runtime::State> PacketType<S, ST> {
8180    /**
8181     * Constructs a view in a specific typestate.
8182     *
8183     * # Safety
8184     *
8185     * The caller must ensure that `storage` satisfies the layout invariants for `ST`.
8186     */
8187    pub unsafe fn new_in_state(storage: S) -> Self {
8188        Self {
8189            storage,
8190            _marker: core::marker::PhantomData,
8191        }
8192    }
8193    pub fn into_storage(self) -> S {
8194        self.storage
8195    }
8196    pub fn disable_2_dh1(&self) -> emboss_runtime::BitFlag<1, 1, emboss_runtime::Null, S::Sliced<'_>, ST> {
8197        let len = (1) as usize; // Total struct size in bytes
8198        let storage = self.storage.slice(0, len);
8199        emboss_runtime::BitFlag::<1, 1, emboss_runtime::Null, S::Sliced<'_>, ST>::new(storage)
8200    }
8201    pub fn disable_3_dh1(&self) -> emboss_runtime::BitFlag<1, 2, emboss_runtime::Null, S::Sliced<'_>, ST> {
8202        let len = (1) as usize; // Total struct size in bytes
8203        let storage = self.storage.slice(0, len);
8204        emboss_runtime::BitFlag::<1, 2, emboss_runtime::Null, S::Sliced<'_>, ST>::new(storage)
8205    }
8206    pub fn enable_dm1(&self) -> emboss_runtime::BitFlag<1, 3, emboss_runtime::Null, S::Sliced<'_>, ST> {
8207        let len = (1) as usize; // Total struct size in bytes
8208        let storage = self.storage.slice(0, len);
8209        emboss_runtime::BitFlag::<1, 3, emboss_runtime::Null, S::Sliced<'_>, ST>::new(storage)
8210    }
8211    pub fn enable_dh1(&self) -> emboss_runtime::BitFlag<1, 4, emboss_runtime::Null, S::Sliced<'_>, ST> {
8212        let len = (1) as usize; // Total struct size in bytes
8213        let storage = self.storage.slice(0, len);
8214        emboss_runtime::BitFlag::<1, 4, emboss_runtime::Null, S::Sliced<'_>, ST>::new(storage)
8215    }
8216    pub fn enable_hv1(&self) -> emboss_runtime::BitFlag<1, 5, emboss_runtime::Null, S::Sliced<'_>, ST> {
8217        let len = (1) as usize; // Total struct size in bytes
8218        let storage = self.storage.slice(0, len);
8219        emboss_runtime::BitFlag::<1, 5, emboss_runtime::Null, S::Sliced<'_>, ST>::new(storage)
8220    }
8221    pub fn enable_hv2(&self) -> emboss_runtime::BitFlag<1, 6, emboss_runtime::Null, S::Sliced<'_>, ST> {
8222        let len = (1) as usize; // Total struct size in bytes
8223        let storage = self.storage.slice(0, len);
8224        emboss_runtime::BitFlag::<1, 6, emboss_runtime::Null, S::Sliced<'_>, ST>::new(storage)
8225    }
8226    pub fn enable_hv3(&self) -> emboss_runtime::BitFlag<1, 7, emboss_runtime::Null, S::Sliced<'_>, ST> {
8227        let len = (1) as usize; // Total struct size in bytes
8228        let storage = self.storage.slice(0, len);
8229        emboss_runtime::BitFlag::<1, 7, emboss_runtime::Null, S::Sliced<'_>, ST>::new(storage)
8230    }
8231    pub fn disable_2_dh3(&self) -> emboss_runtime::BitFlag<1, 8, emboss_runtime::Null, S::Sliced<'_>, ST> {
8232        let len = (2) as usize; // Total struct size in bytes
8233        let storage = self.storage.slice(0, len);
8234        emboss_runtime::BitFlag::<1, 8, emboss_runtime::Null, S::Sliced<'_>, ST>::new(storage)
8235    }
8236    pub fn disable_3_dh3(&self) -> emboss_runtime::BitFlag<1, 9, emboss_runtime::Null, S::Sliced<'_>, ST> {
8237        let len = (2) as usize; // Total struct size in bytes
8238        let storage = self.storage.slice(0, len);
8239        emboss_runtime::BitFlag::<1, 9, emboss_runtime::Null, S::Sliced<'_>, ST>::new(storage)
8240    }
8241    pub fn enable_dm3(&self) -> emboss_runtime::BitFlag<1, 10, emboss_runtime::Null, S::Sliced<'_>, ST> {
8242        let len = (2) as usize; // Total struct size in bytes
8243        let storage = self.storage.slice(0, len);
8244        emboss_runtime::BitFlag::<1, 10, emboss_runtime::Null, S::Sliced<'_>, ST>::new(storage)
8245    }
8246    pub fn enable_dh3(&self) -> emboss_runtime::BitFlag<1, 11, emboss_runtime::Null, S::Sliced<'_>, ST> {
8247        let len = (2) as usize; // Total struct size in bytes
8248        let storage = self.storage.slice(0, len);
8249        emboss_runtime::BitFlag::<1, 11, emboss_runtime::Null, S::Sliced<'_>, ST>::new(storage)
8250    }
8251    pub fn disable_2_dh5(&self) -> emboss_runtime::BitFlag<1, 12, emboss_runtime::Null, S::Sliced<'_>, ST> {
8252        let len = (2) as usize; // Total struct size in bytes
8253        let storage = self.storage.slice(0, len);
8254        emboss_runtime::BitFlag::<1, 12, emboss_runtime::Null, S::Sliced<'_>, ST>::new(storage)
8255    }
8256    pub fn disable_3_dh5(&self) -> emboss_runtime::BitFlag<1, 13, emboss_runtime::Null, S::Sliced<'_>, ST> {
8257        let len = (2) as usize; // Total struct size in bytes
8258        let storage = self.storage.slice(0, len);
8259        emboss_runtime::BitFlag::<1, 13, emboss_runtime::Null, S::Sliced<'_>, ST>::new(storage)
8260    }
8261    pub fn enable_dm5(&self) -> emboss_runtime::BitFlag<1, 14, emboss_runtime::Null, S::Sliced<'_>, ST> {
8262        let len = (2) as usize; // Total struct size in bytes
8263        let storage = self.storage.slice(0, len);
8264        emboss_runtime::BitFlag::<1, 14, emboss_runtime::Null, S::Sliced<'_>, ST>::new(storage)
8265    }
8266    pub fn enable_dh5(&self) -> emboss_runtime::BitFlag<1, 15, emboss_runtime::Null, S::Sliced<'_>, ST> {
8267        let len = (2) as usize; // Total struct size in bytes
8268        let storage = self.storage.slice(0, len);
8269        emboss_runtime::BitFlag::<1, 15, emboss_runtime::Null, S::Sliced<'_>, ST>::new(storage)
8270    }
8271
8272}
8273
8274pub struct PacketTypeMut<S: emboss_runtime::MutStorage> {
8275    storage: S,
8276}
8277
8278impl<S: emboss_runtime::MutStorage> PacketTypeMut<S> {
8279    pub fn new(storage: S) -> Self {
8280        Self {
8281            storage,
8282        }
8283    }
8284    pub fn into_writer(self) -> PacketTypeWriter<S, emboss_runtime::UncheckedState> {
8285        PacketTypeWriter::new(self.storage)
8286    }
8287    /** Borrows the mutable view as an immutable view in UncheckedState. */
8288    pub fn as_view(&self) -> PacketType<S::Sliced<'_>, emboss_runtime::UncheckedState> {
8289        unsafe { PacketType::new_in_state(self.storage.slice(0, self.storage.len())) }
8290    }
8291    pub fn disable_2_dh1(&mut self) -> emboss_runtime::BitFlag<1, 1, emboss_runtime::Null, S::SlicedMut<'_>, emboss_runtime::UncheckedState> {
8292        let len = (1) as usize;
8293        let storage = self.storage.slice_mut(0, len);
8294        emboss_runtime::BitFlag::<1, 1, emboss_runtime::Null, S::SlicedMut<'_>, emboss_runtime::UncheckedState>::new(storage)
8295    }
8296    pub fn disable_3_dh1(&mut self) -> emboss_runtime::BitFlag<1, 2, emboss_runtime::Null, S::SlicedMut<'_>, emboss_runtime::UncheckedState> {
8297        let len = (1) as usize;
8298        let storage = self.storage.slice_mut(0, len);
8299        emboss_runtime::BitFlag::<1, 2, emboss_runtime::Null, S::SlicedMut<'_>, emboss_runtime::UncheckedState>::new(storage)
8300    }
8301    pub fn enable_dm1(&mut self) -> emboss_runtime::BitFlag<1, 3, emboss_runtime::Null, S::SlicedMut<'_>, emboss_runtime::UncheckedState> {
8302        let len = (1) as usize;
8303        let storage = self.storage.slice_mut(0, len);
8304        emboss_runtime::BitFlag::<1, 3, emboss_runtime::Null, S::SlicedMut<'_>, emboss_runtime::UncheckedState>::new(storage)
8305    }
8306    pub fn enable_dh1(&mut self) -> emboss_runtime::BitFlag<1, 4, emboss_runtime::Null, S::SlicedMut<'_>, emboss_runtime::UncheckedState> {
8307        let len = (1) as usize;
8308        let storage = self.storage.slice_mut(0, len);
8309        emboss_runtime::BitFlag::<1, 4, emboss_runtime::Null, S::SlicedMut<'_>, emboss_runtime::UncheckedState>::new(storage)
8310    }
8311    pub fn enable_hv1(&mut self) -> emboss_runtime::BitFlag<1, 5, emboss_runtime::Null, S::SlicedMut<'_>, emboss_runtime::UncheckedState> {
8312        let len = (1) as usize;
8313        let storage = self.storage.slice_mut(0, len);
8314        emboss_runtime::BitFlag::<1, 5, emboss_runtime::Null, S::SlicedMut<'_>, emboss_runtime::UncheckedState>::new(storage)
8315    }
8316    pub fn enable_hv2(&mut self) -> emboss_runtime::BitFlag<1, 6, emboss_runtime::Null, S::SlicedMut<'_>, emboss_runtime::UncheckedState> {
8317        let len = (1) as usize;
8318        let storage = self.storage.slice_mut(0, len);
8319        emboss_runtime::BitFlag::<1, 6, emboss_runtime::Null, S::SlicedMut<'_>, emboss_runtime::UncheckedState>::new(storage)
8320    }
8321    pub fn enable_hv3(&mut self) -> emboss_runtime::BitFlag<1, 7, emboss_runtime::Null, S::SlicedMut<'_>, emboss_runtime::UncheckedState> {
8322        let len = (1) as usize;
8323        let storage = self.storage.slice_mut(0, len);
8324        emboss_runtime::BitFlag::<1, 7, emboss_runtime::Null, S::SlicedMut<'_>, emboss_runtime::UncheckedState>::new(storage)
8325    }
8326    pub fn disable_2_dh3(&mut self) -> emboss_runtime::BitFlag<1, 8, emboss_runtime::Null, S::SlicedMut<'_>, emboss_runtime::UncheckedState> {
8327        let len = (2) as usize;
8328        let storage = self.storage.slice_mut(0, len);
8329        emboss_runtime::BitFlag::<1, 8, emboss_runtime::Null, S::SlicedMut<'_>, emboss_runtime::UncheckedState>::new(storage)
8330    }
8331    pub fn disable_3_dh3(&mut self) -> emboss_runtime::BitFlag<1, 9, emboss_runtime::Null, S::SlicedMut<'_>, emboss_runtime::UncheckedState> {
8332        let len = (2) as usize;
8333        let storage = self.storage.slice_mut(0, len);
8334        emboss_runtime::BitFlag::<1, 9, emboss_runtime::Null, S::SlicedMut<'_>, emboss_runtime::UncheckedState>::new(storage)
8335    }
8336    pub fn enable_dm3(&mut self) -> emboss_runtime::BitFlag<1, 10, emboss_runtime::Null, S::SlicedMut<'_>, emboss_runtime::UncheckedState> {
8337        let len = (2) as usize;
8338        let storage = self.storage.slice_mut(0, len);
8339        emboss_runtime::BitFlag::<1, 10, emboss_runtime::Null, S::SlicedMut<'_>, emboss_runtime::UncheckedState>::new(storage)
8340    }
8341    pub fn enable_dh3(&mut self) -> emboss_runtime::BitFlag<1, 11, emboss_runtime::Null, S::SlicedMut<'_>, emboss_runtime::UncheckedState> {
8342        let len = (2) as usize;
8343        let storage = self.storage.slice_mut(0, len);
8344        emboss_runtime::BitFlag::<1, 11, emboss_runtime::Null, S::SlicedMut<'_>, emboss_runtime::UncheckedState>::new(storage)
8345    }
8346    pub fn disable_2_dh5(&mut self) -> emboss_runtime::BitFlag<1, 12, emboss_runtime::Null, S::SlicedMut<'_>, emboss_runtime::UncheckedState> {
8347        let len = (2) as usize;
8348        let storage = self.storage.slice_mut(0, len);
8349        emboss_runtime::BitFlag::<1, 12, emboss_runtime::Null, S::SlicedMut<'_>, emboss_runtime::UncheckedState>::new(storage)
8350    }
8351    pub fn disable_3_dh5(&mut self) -> emboss_runtime::BitFlag<1, 13, emboss_runtime::Null, S::SlicedMut<'_>, emboss_runtime::UncheckedState> {
8352        let len = (2) as usize;
8353        let storage = self.storage.slice_mut(0, len);
8354        emboss_runtime::BitFlag::<1, 13, emboss_runtime::Null, S::SlicedMut<'_>, emboss_runtime::UncheckedState>::new(storage)
8355    }
8356    pub fn enable_dm5(&mut self) -> emboss_runtime::BitFlag<1, 14, emboss_runtime::Null, S::SlicedMut<'_>, emboss_runtime::UncheckedState> {
8357        let len = (2) as usize;
8358        let storage = self.storage.slice_mut(0, len);
8359        emboss_runtime::BitFlag::<1, 14, emboss_runtime::Null, S::SlicedMut<'_>, emboss_runtime::UncheckedState>::new(storage)
8360    }
8361    pub fn enable_dh5(&mut self) -> emboss_runtime::BitFlag<1, 15, emboss_runtime::Null, S::SlicedMut<'_>, emboss_runtime::UncheckedState> {
8362        let len = (2) as usize;
8363        let storage = self.storage.slice_mut(0, len);
8364        emboss_runtime::BitFlag::<1, 15, emboss_runtime::Null, S::SlicedMut<'_>, emboss_runtime::UncheckedState>::new(storage)
8365    }
8366
8367}
8368
8369impl<S: emboss_runtime::MutStorage> emboss_runtime::IntoWriter for PacketTypeMut<S> {
8370    type Writer = PacketTypeWriter<S, emboss_runtime::UncheckedState>;
8371    fn into_writer(self) -> Self::Writer {
8372        PacketTypeWriter::new(self.storage)
8373    }
8374}
8375
8376pub struct PacketTypeWriter<S: emboss_runtime::MutStorage, ST: emboss_runtime::State = emboss_runtime::UncheckedState> {
8377    storage: S,
8378    _marker: core::marker::PhantomData<ST>,
8379}
8380
8381impl<S: emboss_runtime::MutStorage> PacketTypeWriter<S, emboss_runtime::UncheckedState> {
8382    pub fn new(storage: S) -> Self {
8383        Self {
8384            storage,
8385            _marker: core::marker::PhantomData,
8386        }
8387    }
8388}
8389
8390impl<S: emboss_runtime::MutStorage, ST: emboss_runtime::State> PacketTypeWriter<S, ST> {
8391    /**
8392     * Constructs a writer in a specific typestate.
8393     *
8394     * # Safety
8395     *
8396     * The caller must ensure that `storage` satisfies the layout invariants for `ST`.
8397     */
8398    pub unsafe fn new_in_state(storage: S) -> Self {
8399        Self {
8400            storage,
8401            _marker: core::marker::PhantomData,
8402        }
8403    }
8404    pub fn into_storage(self) -> S {
8405        self.storage
8406    }
8407    /** Converts the writer into an immutable view in the same typestate. */
8408    pub fn into_view(self) -> PacketType<S, ST> {
8409        unsafe { PacketType::new_in_state(self.storage) }
8410    }
8411    /** Borrows the writer as an immutable view in the same typestate. */
8412    pub fn as_view(&self) -> PacketType<S::Sliced<'_>, ST> {
8413        unsafe { PacketType::new_in_state(self.storage.slice(0, self.storage.len())) }
8414    }
8415
8416}
8417
8418impl<S: emboss_runtime::Storage, ST: emboss_runtime::State> emboss_runtime::View for PacketType<S, ST> {
8419    fn size_in_bytes(&self) -> core::result::Result<usize, emboss_runtime::Error> {
8420        let view = self;
8421        core::result::Result::Ok((((16) + 7) / 8) as usize)
8422    }
8423}
8424
8425impl<S: emboss_runtime::MutStorage> emboss_runtime::View for PacketTypeMut<S> {
8426    fn size_in_bytes(&self) -> core::result::Result<usize, emboss_runtime::Error> {
8427        let view = self.as_view();
8428        <PacketType<S::Sliced<'_>, emboss_runtime::UncheckedState> as emboss_runtime::View>::size_in_bytes(&view)
8429    }
8430}
8431
8432impl<S: emboss_runtime::MutStorage, ST: emboss_runtime::State> emboss_runtime::View for PacketTypeWriter<S, ST> {
8433    fn size_in_bytes(&self) -> core::result::Result<usize, emboss_runtime::Error> {
8434        let view = self.as_view();
8435        <PacketType<S::Sliced<'_>, ST> as emboss_runtime::View>::size_in_bytes(&view)
8436    }
8437}
8438
8439impl<S: emboss_runtime::Storage> emboss_runtime::CheckComplete for PacketType<S, emboss_runtime::UncheckedState> {
8440    type Completed = PacketType<S, emboss_runtime::CompleteState>;
8441    fn check_complete(self) -> core::result::Result<Self::Completed, emboss_runtime::Error> {
8442        let required_size = <Self as emboss_runtime::View>::size_in_bytes(&self)?;
8443        if self.storage.len() < required_size {
8444            return core::result::Result::Err(emboss_runtime::Error::OutOfBounds);
8445        }
8446        core::result::Result::Ok(unsafe { PacketType::new_in_state(self.storage) })
8447    }
8448}
8449
8450impl<S: emboss_runtime::MutStorage> emboss_runtime::CheckComplete for PacketTypeWriter<S, emboss_runtime::UncheckedState> {
8451    type Completed = PacketTypeWriter<S, emboss_runtime::CompleteState>;
8452    fn check_complete(self) -> core::result::Result<Self::Completed, emboss_runtime::Error> {
8453        let required_size = <Self as emboss_runtime::View>::size_in_bytes(&self)?;
8454        if self.storage.len() < required_size {
8455            return core::result::Result::Err(emboss_runtime::Error::OutOfBounds);
8456        }
8457        core::result::Result::Ok(unsafe { PacketTypeWriter::new_in_state(self.storage) })
8458    }
8459}
8460
8461impl<S: emboss_runtime::Storage> emboss_runtime::CheckOk for PacketType<S, emboss_runtime::UncheckedState> {
8462    type Ok = PacketType<S, emboss_runtime::OkState>;
8463    fn check_ok(self) -> core::result::Result<Self::Ok, emboss_runtime::Error> {
8464        let completed = emboss_runtime::CheckComplete::check_complete(self)?;
8465        core::result::Result::Ok(unsafe { PacketType::new_in_state(completed.into_storage()) })
8466    }
8467}
8468
8469impl<S: emboss_runtime::Storage> emboss_runtime::CheckOk for PacketType<S, emboss_runtime::CompleteState> {
8470    type Ok = PacketType<S, emboss_runtime::OkState>;
8471    fn check_ok(self) -> core::result::Result<Self::Ok, emboss_runtime::Error> {
8472        core::result::Result::Ok(unsafe { PacketType::new_in_state(self.into_storage()) })
8473    }
8474}
8475
8476impl<S: emboss_runtime::Storage> emboss_runtime::CheckOk for PacketType<S, emboss_runtime::OkState> {
8477    type Ok = PacketType<S, emboss_runtime::OkState>;
8478    fn check_ok(self) -> core::result::Result<Self::Ok, emboss_runtime::Error> {
8479        core::result::Result::Ok(self)
8480    }
8481}
8482
8483impl<S: emboss_runtime::MutStorage> emboss_runtime::CheckOk for PacketTypeWriter<S, emboss_runtime::UncheckedState> {
8484    type Ok = PacketTypeWriter<S, emboss_runtime::OkState>;
8485    fn check_ok(self) -> core::result::Result<Self::Ok, emboss_runtime::Error> {
8486        let completed = emboss_runtime::CheckComplete::check_complete(self)?;
8487        core::result::Result::Ok(unsafe { PacketTypeWriter::new_in_state(completed.into_storage()) })
8488    }
8489}
8490
8491impl<S: emboss_runtime::MutStorage> emboss_runtime::CheckOk for PacketTypeWriter<S, emboss_runtime::CompleteState> {
8492    type Ok = PacketTypeWriter<S, emboss_runtime::OkState>;
8493    fn check_ok(self) -> core::result::Result<Self::Ok, emboss_runtime::Error> {
8494        core::result::Result::Ok(unsafe { PacketTypeWriter::new_in_state(self.into_storage()) })
8495    }
8496}
8497
8498impl<S: emboss_runtime::MutStorage> emboss_runtime::CheckOk for PacketTypeWriter<S, emboss_runtime::OkState> {
8499    type Ok = PacketTypeWriter<S, emboss_runtime::OkState>;
8500    fn check_ok(self) -> core::result::Result<Self::Ok, emboss_runtime::Error> {
8501        core::result::Result::Ok(self)
8502    }
8503}
8504
8505pub mod packet_type {
8506    pub type View<S, ST = emboss_runtime::UncheckedState> = super::PacketType<S, ST>;
8507    pub type ViewMut<S> = super::PacketTypeMut<S>;
8508    pub type Writer<S, ST = emboss_runtime::UncheckedState> = super::PacketTypeWriter<S, ST>;
8509
8510    pub const MIN_SIZE_IN_BYTES: usize = 2;
8511    pub const MAX_SIZE_IN_BYTES: usize = 2;
8512    pub const SIZE_IN_BYTES: usize = 2;
8513}