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 REQUEST_PEER_SCA_COMPLETE = 31,
887 CIS_REQUEST = 26,
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 31 => Ok(LeSubEventCode::REQUEST_PEER_SCA_COMPLETE),
968 26 => Ok(LeSubEventCode::CIS_REQUEST),
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 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; 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; 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; 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; 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; 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; 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; 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; 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; 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; 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; 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 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 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 pub fn into_view(self) -> MajorServiceClasses<S, ST> {
1282 unsafe { MajorServiceClasses::new_in_state(self.storage) }
1283 }
1284 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 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 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 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 pub fn into_view(self) -> PeripheralMinorDeviceClass<S, ST> {
1997 unsafe { PeripheralMinorDeviceClass::new_in_state(self.storage) }
1998 }
1999 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 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; 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; 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; 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; 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 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 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 pub fn into_view(self) -> ImagingMinorDeviceClassBits<S, ST> {
2319 unsafe { ImagingMinorDeviceClassBits::new_in_state(self.storage) }
2320 }
2321 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 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 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 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 pub fn into_view(self) -> BdAddr<S, ST> {
2919 unsafe { BdAddr::new_in_state(self.storage) }
2920 }
2921 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 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; 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 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 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 pub fn into_view(self) -> ClassOfDevice<S, ST> {
3342 unsafe { ClassOfDevice::new_in_state(self.storage) }
3343 }
3344 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 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; 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; 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 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 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 pub fn into_view(self) -> ScanEnableBits<S, ST> {
3617 unsafe { ScanEnableBits::new_in_state(self.storage) }
3618 }
3619 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 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 valid(&self) -> emboss_runtime::BitFlag<1, 15, emboss_runtime::Null, S::Sliced<'_>, ST> {
4109 let len = (2) as usize; let storage = self.storage.slice(0, len);
4111 emboss_runtime::BitFlag::<1, 15, emboss_runtime::Null, S::Sliced<'_>, ST>::new(storage)
4112 }
4113
4114}
4115
4116pub struct ClockOffsetMut<S: emboss_runtime::MutStorage> {
4117 storage: S,
4118}
4119
4120impl<S: emboss_runtime::MutStorage> ClockOffsetMut<S> {
4121 pub fn new(storage: S) -> Self {
4122 Self {
4123 storage,
4124 }
4125 }
4126 pub fn into_writer(self) -> ClockOffsetWriter<S, emboss_runtime::UncheckedState> {
4127 ClockOffsetWriter::new(self.storage)
4128 }
4129 pub fn as_view(&self) -> ClockOffset<S::Sliced<'_>, emboss_runtime::UncheckedState> {
4131 unsafe { ClockOffset::new_in_state(self.storage.slice(0, self.storage.len())) }
4132 }
4133 pub fn valid(&mut self) -> emboss_runtime::BitFlag<1, 15, emboss_runtime::Null, S::SlicedMut<'_>, emboss_runtime::UncheckedState> {
4134 let len = (2) as usize;
4135 let storage = self.storage.slice_mut(0, len);
4136 emboss_runtime::BitFlag::<1, 15, emboss_runtime::Null, S::SlicedMut<'_>, emboss_runtime::UncheckedState>::new(storage)
4137 }
4138
4139}
4140
4141impl<S: emboss_runtime::MutStorage> emboss_runtime::IntoWriter for ClockOffsetMut<S> {
4142 type Writer = ClockOffsetWriter<S, emboss_runtime::UncheckedState>;
4143 fn into_writer(self) -> Self::Writer {
4144 ClockOffsetWriter::new(self.storage)
4145 }
4146}
4147
4148pub struct ClockOffsetWriter<S: emboss_runtime::MutStorage, ST: emboss_runtime::State = emboss_runtime::UncheckedState> {
4149 storage: S,
4150 _marker: core::marker::PhantomData<ST>,
4151}
4152
4153impl<S: emboss_runtime::MutStorage> ClockOffsetWriter<S, emboss_runtime::UncheckedState> {
4154 pub fn new(storage: S) -> Self {
4155 Self {
4156 storage,
4157 _marker: core::marker::PhantomData,
4158 }
4159 }
4160}
4161
4162impl<S: emboss_runtime::MutStorage, ST: emboss_runtime::State> ClockOffsetWriter<S, ST> {
4163 pub unsafe fn new_in_state(storage: S) -> Self {
4171 Self {
4172 storage,
4173 _marker: core::marker::PhantomData,
4174 }
4175 }
4176 pub fn into_storage(self) -> S {
4177 self.storage
4178 }
4179 pub fn into_view(self) -> ClockOffset<S, ST> {
4181 unsafe { ClockOffset::new_in_state(self.storage) }
4182 }
4183 pub fn as_view(&self) -> ClockOffset<S::Sliced<'_>, ST> {
4185 unsafe { ClockOffset::new_in_state(self.storage.slice(0, self.storage.len())) }
4186 }
4187
4188}
4189
4190impl<S: emboss_runtime::Storage, ST: emboss_runtime::State> emboss_runtime::View for ClockOffset<S, ST> {
4191 fn size_in_bytes(&self) -> core::result::Result<usize, emboss_runtime::Error> {
4192 let view = self;
4193 core::result::Result::Ok((((core::cmp::max((core::cmp::max((0) as i64, (16) as i64)
4194) as i64, ((if ({ let val = view.valid().try_read().map_err(|e| match e { emboss_runtime::Error::OutOfBounds => emboss_runtime::Error::OutOfBounds, emboss_runtime::Error::UnknownEnum(_) => emboss_runtime::Error::UnknownEnum(()) })?; val })
4195 { 15 } else { 0 })
4196
4197) as i64)
4198) + 7) / 8) as usize)
4199 }
4200}
4201
4202impl<S: emboss_runtime::MutStorage> emboss_runtime::View for ClockOffsetMut<S> {
4203 fn size_in_bytes(&self) -> core::result::Result<usize, emboss_runtime::Error> {
4204 let view = self.as_view();
4205 <ClockOffset<S::Sliced<'_>, emboss_runtime::UncheckedState> as emboss_runtime::View>::size_in_bytes(&view)
4206 }
4207}
4208
4209impl<S: emboss_runtime::MutStorage, ST: emboss_runtime::State> emboss_runtime::View for ClockOffsetWriter<S, ST> {
4210 fn size_in_bytes(&self) -> core::result::Result<usize, emboss_runtime::Error> {
4211 let view = self.as_view();
4212 <ClockOffset<S::Sliced<'_>, ST> as emboss_runtime::View>::size_in_bytes(&view)
4213 }
4214}
4215
4216impl<S: emboss_runtime::Storage> emboss_runtime::CheckComplete for ClockOffset<S, emboss_runtime::UncheckedState> {
4217 type Completed = ClockOffset<S, emboss_runtime::CompleteState>;
4218 fn check_complete(self) -> core::result::Result<Self::Completed, emboss_runtime::Error> {
4219 let required_size = <Self as emboss_runtime::View>::size_in_bytes(&self)?;
4220 if self.storage.len() < required_size {
4221 return core::result::Result::Err(emboss_runtime::Error::OutOfBounds);
4222 }
4223 core::result::Result::Ok(unsafe { ClockOffset::new_in_state(self.storage) })
4224 }
4225}
4226
4227impl<S: emboss_runtime::MutStorage> emboss_runtime::CheckComplete for ClockOffsetWriter<S, emboss_runtime::UncheckedState> {
4228 type Completed = ClockOffsetWriter<S, emboss_runtime::CompleteState>;
4229 fn check_complete(self) -> core::result::Result<Self::Completed, emboss_runtime::Error> {
4230 let required_size = <Self as emboss_runtime::View>::size_in_bytes(&self)?;
4231 if self.storage.len() < required_size {
4232 return core::result::Result::Err(emboss_runtime::Error::OutOfBounds);
4233 }
4234 core::result::Result::Ok(unsafe { ClockOffsetWriter::new_in_state(self.storage) })
4235 }
4236}
4237
4238impl<S: emboss_runtime::Storage> emboss_runtime::CheckOk for ClockOffset<S, emboss_runtime::UncheckedState> {
4239 type Ok = ClockOffset<S, emboss_runtime::OkState>;
4240 fn check_ok(self) -> core::result::Result<Self::Ok, emboss_runtime::Error> {
4241 let completed = emboss_runtime::CheckComplete::check_complete(self)?;
4242 core::result::Result::Ok(unsafe { ClockOffset::new_in_state(completed.into_storage()) })
4243 }
4244}
4245
4246impl<S: emboss_runtime::Storage> emboss_runtime::CheckOk for ClockOffset<S, emboss_runtime::CompleteState> {
4247 type Ok = ClockOffset<S, emboss_runtime::OkState>;
4248 fn check_ok(self) -> core::result::Result<Self::Ok, emboss_runtime::Error> {
4249 core::result::Result::Ok(unsafe { ClockOffset::new_in_state(self.into_storage()) })
4250 }
4251}
4252
4253impl<S: emboss_runtime::Storage> emboss_runtime::CheckOk for ClockOffset<S, emboss_runtime::OkState> {
4254 type Ok = ClockOffset<S, emboss_runtime::OkState>;
4255 fn check_ok(self) -> core::result::Result<Self::Ok, emboss_runtime::Error> {
4256 core::result::Result::Ok(self)
4257 }
4258}
4259
4260impl<S: emboss_runtime::MutStorage> emboss_runtime::CheckOk for ClockOffsetWriter<S, emboss_runtime::UncheckedState> {
4261 type Ok = ClockOffsetWriter<S, emboss_runtime::OkState>;
4262 fn check_ok(self) -> core::result::Result<Self::Ok, emboss_runtime::Error> {
4263 let completed = emboss_runtime::CheckComplete::check_complete(self)?;
4264 core::result::Result::Ok(unsafe { ClockOffsetWriter::new_in_state(completed.into_storage()) })
4265 }
4266}
4267
4268impl<S: emboss_runtime::MutStorage> emboss_runtime::CheckOk for ClockOffsetWriter<S, emboss_runtime::CompleteState> {
4269 type Ok = ClockOffsetWriter<S, emboss_runtime::OkState>;
4270 fn check_ok(self) -> core::result::Result<Self::Ok, emboss_runtime::Error> {
4271 core::result::Result::Ok(unsafe { ClockOffsetWriter::new_in_state(self.into_storage()) })
4272 }
4273}
4274
4275impl<S: emboss_runtime::MutStorage> emboss_runtime::CheckOk for ClockOffsetWriter<S, emboss_runtime::OkState> {
4276 type Ok = ClockOffsetWriter<S, emboss_runtime::OkState>;
4277 fn check_ok(self) -> core::result::Result<Self::Ok, emboss_runtime::Error> {
4278 core::result::Result::Ok(self)
4279 }
4280}
4281
4282pub mod clock_offset {
4283 pub type View<S, ST = emboss_runtime::UncheckedState> = super::ClockOffset<S, ST>;
4284 pub type ViewMut<S> = super::ClockOffsetMut<S>;
4285 pub type Writer<S, ST = emboss_runtime::UncheckedState> = super::ClockOffsetWriter<S, ST>;
4286
4287 pub const MIN_SIZE_IN_BYTES: usize = 2;
4288 pub const MAX_SIZE_IN_BYTES: usize = 2;
4289 pub const SIZE_IN_BYTES: usize = 2;
4290}#[derive(Copy, Clone, Debug, Eq, PartialEq)]
4291#[repr(u64)]
4292pub enum LEPrimaryAdvertisingPHY {
4293 LE_1M = 1,
4294 LE_CODED = 3,
4295 LE_CODED_S2 = 4,
4296
4297}
4298
4299impl core::convert::From<LEPrimaryAdvertisingPHY> for u8 { fn from(val: LEPrimaryAdvertisingPHY) -> Self { val as u8 } }
4300impl core::convert::From<LEPrimaryAdvertisingPHY> for u16 { fn from(val: LEPrimaryAdvertisingPHY) -> Self { val as u16 } }
4301impl core::convert::From<LEPrimaryAdvertisingPHY> for u32 { fn from(val: LEPrimaryAdvertisingPHY) -> Self { val as u32 } }
4302impl core::convert::From<LEPrimaryAdvertisingPHY> for u64 { fn from(val: LEPrimaryAdvertisingPHY) -> Self { val as u64 } }
4303impl core::convert::From<LEPrimaryAdvertisingPHY> for i8 { fn from(val: LEPrimaryAdvertisingPHY) -> Self { val as i8 } }
4304impl core::convert::From<LEPrimaryAdvertisingPHY> for i16 { fn from(val: LEPrimaryAdvertisingPHY) -> Self { val as i16 } }
4305impl core::convert::From<LEPrimaryAdvertisingPHY> for i32 { fn from(val: LEPrimaryAdvertisingPHY) -> Self { val as i32 } }
4306impl core::convert::From<LEPrimaryAdvertisingPHY> for i64 { fn from(val: LEPrimaryAdvertisingPHY) -> Self { val as i64 } }
4307
4308impl emboss_runtime::SafeCmp<LEPrimaryAdvertisingPHY> for LEPrimaryAdvertisingPHY {
4309 fn safe_eq(&self, other: Self) -> bool { *self == other }
4310 fn safe_less(&self, other: Self) -> bool { (*self as u64) < (other as u64) }
4311}
4312
4313impl emboss_runtime::SafeCmp<u64> for LEPrimaryAdvertisingPHY {
4314 fn safe_eq(&self, other: u64) -> bool { emboss_runtime::SafeCmp::safe_eq(&(*self as u64), other) }
4315 fn safe_less(&self, other: u64) -> bool { emboss_runtime::SafeCmp::safe_less(&(*self as u64), other) }
4316}
4317
4318impl emboss_runtime::SafeCmp<i64> for LEPrimaryAdvertisingPHY {
4319 fn safe_eq(&self, other: i64) -> bool { emboss_runtime::SafeCmp::safe_eq(&(*self as u64), other) }
4320 fn safe_less(&self, other: i64) -> bool { emboss_runtime::SafeCmp::safe_less(&(*self as u64), other) }
4321}
4322
4323impl emboss_runtime::SafeCmp<i32> for LEPrimaryAdvertisingPHY {
4324 fn safe_eq(&self, other: i32) -> bool { emboss_runtime::SafeCmp::safe_eq(&(*self as u64), other as i64) }
4325 fn safe_less(&self, other: i32) -> bool { emboss_runtime::SafeCmp::safe_less(&(*self as u64), other as i64) }
4326}
4327
4328impl emboss_runtime::SafeCmp<u32> for LEPrimaryAdvertisingPHY {
4329 fn safe_eq(&self, other: u32) -> bool { emboss_runtime::SafeCmp::safe_eq(&(*self as u64), other as u64) }
4330 fn safe_less(&self, other: u32) -> bool { emboss_runtime::SafeCmp::safe_less(&(*self as u64), other as u64) }
4331}
4332
4333impl emboss_runtime::SafeCmp<LEPrimaryAdvertisingPHY> for u64 {
4334 fn safe_eq(&self, other: LEPrimaryAdvertisingPHY) -> bool { emboss_runtime::SafeCmp::safe_eq(self, other as u64) }
4335 fn safe_less(&self, other: LEPrimaryAdvertisingPHY) -> bool { emboss_runtime::SafeCmp::safe_less(self, other as u64) }
4336}
4337
4338impl emboss_runtime::SafeCmp<LEPrimaryAdvertisingPHY> for i64 {
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<V: core::convert::Into<u64> + core::marker::Copy> emboss_runtime::TryFromRaw<V> for LEPrimaryAdvertisingPHY {
4344 fn try_from_raw(val: V) -> core::result::Result<Self, emboss_runtime::Error<V>> {
4345 let v_raw: u64 = val.into();
4346 match v_raw {
4347 1 => Ok(LEPrimaryAdvertisingPHY::LE_1M),
4348 3 => Ok(LEPrimaryAdvertisingPHY::LE_CODED),
4349 4 => Ok(LEPrimaryAdvertisingPHY::LE_CODED_S2),
4350
4351 _ => Err(emboss_runtime::Error::UnknownEnum(val)),
4352 }
4353 }
4354}
4355
4356impl LEPrimaryAdvertisingPHY {
4357
4358}
4359#[derive(Copy, Clone, Debug, Eq, PartialEq)]
4360#[repr(u64)]
4361pub enum LEPhy {
4362 LE_1M = 1,
4363 LE_2M = 2,
4364 LE_CODED = 3,
4365
4366}
4367
4368impl core::convert::From<LEPhy> for u8 { fn from(val: LEPhy) -> Self { val as u8 } }
4369impl core::convert::From<LEPhy> for u16 { fn from(val: LEPhy) -> Self { val as u16 } }
4370impl core::convert::From<LEPhy> for u32 { fn from(val: LEPhy) -> Self { val as u32 } }
4371impl core::convert::From<LEPhy> for u64 { fn from(val: LEPhy) -> Self { val as u64 } }
4372impl core::convert::From<LEPhy> for i8 { fn from(val: LEPhy) -> Self { val as i8 } }
4373impl core::convert::From<LEPhy> for i16 { fn from(val: LEPhy) -> Self { val as i16 } }
4374impl core::convert::From<LEPhy> for i32 { fn from(val: LEPhy) -> Self { val as i32 } }
4375impl core::convert::From<LEPhy> for i64 { fn from(val: LEPhy) -> Self { val as i64 } }
4376
4377impl emboss_runtime::SafeCmp<LEPhy> for LEPhy {
4378 fn safe_eq(&self, other: Self) -> bool { *self == other }
4379 fn safe_less(&self, other: Self) -> bool { (*self as u64) < (other as u64) }
4380}
4381
4382impl emboss_runtime::SafeCmp<u64> for LEPhy {
4383 fn safe_eq(&self, other: u64) -> bool { emboss_runtime::SafeCmp::safe_eq(&(*self as u64), other) }
4384 fn safe_less(&self, other: u64) -> bool { emboss_runtime::SafeCmp::safe_less(&(*self as u64), other) }
4385}
4386
4387impl emboss_runtime::SafeCmp<i64> for LEPhy {
4388 fn safe_eq(&self, other: i64) -> bool { emboss_runtime::SafeCmp::safe_eq(&(*self as u64), other) }
4389 fn safe_less(&self, other: i64) -> bool { emboss_runtime::SafeCmp::safe_less(&(*self as u64), other) }
4390}
4391
4392impl emboss_runtime::SafeCmp<i32> for LEPhy {
4393 fn safe_eq(&self, other: i32) -> bool { emboss_runtime::SafeCmp::safe_eq(&(*self as u64), other as i64) }
4394 fn safe_less(&self, other: i32) -> bool { emboss_runtime::SafeCmp::safe_less(&(*self as u64), other as i64) }
4395}
4396
4397impl emboss_runtime::SafeCmp<u32> for LEPhy {
4398 fn safe_eq(&self, other: u32) -> bool { emboss_runtime::SafeCmp::safe_eq(&(*self as u64), other as u64) }
4399 fn safe_less(&self, other: u32) -> bool { emboss_runtime::SafeCmp::safe_less(&(*self as u64), other as u64) }
4400}
4401
4402impl emboss_runtime::SafeCmp<LEPhy> for u64 {
4403 fn safe_eq(&self, other: LEPhy) -> bool { emboss_runtime::SafeCmp::safe_eq(self, other as u64) }
4404 fn safe_less(&self, other: LEPhy) -> bool { emboss_runtime::SafeCmp::safe_less(self, other as u64) }
4405}
4406
4407impl emboss_runtime::SafeCmp<LEPhy> for i64 {
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<V: core::convert::Into<u64> + core::marker::Copy> emboss_runtime::TryFromRaw<V> for LEPhy {
4413 fn try_from_raw(val: V) -> core::result::Result<Self, emboss_runtime::Error<V>> {
4414 let v_raw: u64 = val.into();
4415 match v_raw {
4416 1 => Ok(LEPhy::LE_1M),
4417 2 => Ok(LEPhy::LE_2M),
4418 3 => Ok(LEPhy::LE_CODED),
4419
4420 _ => Err(emboss_runtime::Error::UnknownEnum(val)),
4421 }
4422 }
4423}
4424
4425impl LEPhy {
4426
4427}
4428#[derive(Copy, Clone, Debug, Eq, PartialEq)]
4429#[repr(u64)]
4430pub enum LESecondaryAdvertisingPHY {
4431 NONE = 0,
4432 LE_1M = 1,
4433 LE_2M = 2,
4434 LE_CODED = 3,
4435 LE_CODED_S2 = 4,
4436
4437}
4438
4439impl core::convert::From<LESecondaryAdvertisingPHY> for u8 { fn from(val: LESecondaryAdvertisingPHY) -> Self { val as u8 } }
4440impl core::convert::From<LESecondaryAdvertisingPHY> for u16 { fn from(val: LESecondaryAdvertisingPHY) -> Self { val as u16 } }
4441impl core::convert::From<LESecondaryAdvertisingPHY> for u32 { fn from(val: LESecondaryAdvertisingPHY) -> Self { val as u32 } }
4442impl core::convert::From<LESecondaryAdvertisingPHY> for u64 { fn from(val: LESecondaryAdvertisingPHY) -> Self { val as u64 } }
4443impl core::convert::From<LESecondaryAdvertisingPHY> for i8 { fn from(val: LESecondaryAdvertisingPHY) -> Self { val as i8 } }
4444impl core::convert::From<LESecondaryAdvertisingPHY> for i16 { fn from(val: LESecondaryAdvertisingPHY) -> Self { val as i16 } }
4445impl core::convert::From<LESecondaryAdvertisingPHY> for i32 { fn from(val: LESecondaryAdvertisingPHY) -> Self { val as i32 } }
4446impl core::convert::From<LESecondaryAdvertisingPHY> for i64 { fn from(val: LESecondaryAdvertisingPHY) -> Self { val as i64 } }
4447
4448impl emboss_runtime::SafeCmp<LESecondaryAdvertisingPHY> for LESecondaryAdvertisingPHY {
4449 fn safe_eq(&self, other: Self) -> bool { *self == other }
4450 fn safe_less(&self, other: Self) -> bool { (*self as u64) < (other as u64) }
4451}
4452
4453impl emboss_runtime::SafeCmp<u64> for LESecondaryAdvertisingPHY {
4454 fn safe_eq(&self, other: u64) -> bool { emboss_runtime::SafeCmp::safe_eq(&(*self as u64), other) }
4455 fn safe_less(&self, other: u64) -> bool { emboss_runtime::SafeCmp::safe_less(&(*self as u64), other) }
4456}
4457
4458impl emboss_runtime::SafeCmp<i64> for LESecondaryAdvertisingPHY {
4459 fn safe_eq(&self, other: i64) -> bool { emboss_runtime::SafeCmp::safe_eq(&(*self as u64), other) }
4460 fn safe_less(&self, other: i64) -> bool { emboss_runtime::SafeCmp::safe_less(&(*self as u64), other) }
4461}
4462
4463impl emboss_runtime::SafeCmp<i32> for LESecondaryAdvertisingPHY {
4464 fn safe_eq(&self, other: i32) -> bool { emboss_runtime::SafeCmp::safe_eq(&(*self as u64), other as i64) }
4465 fn safe_less(&self, other: i32) -> bool { emboss_runtime::SafeCmp::safe_less(&(*self as u64), other as i64) }
4466}
4467
4468impl emboss_runtime::SafeCmp<u32> for LESecondaryAdvertisingPHY {
4469 fn safe_eq(&self, other: u32) -> bool { emboss_runtime::SafeCmp::safe_eq(&(*self as u64), other as u64) }
4470 fn safe_less(&self, other: u32) -> bool { emboss_runtime::SafeCmp::safe_less(&(*self as u64), other as u64) }
4471}
4472
4473impl emboss_runtime::SafeCmp<LESecondaryAdvertisingPHY> for u64 {
4474 fn safe_eq(&self, other: LESecondaryAdvertisingPHY) -> bool { emboss_runtime::SafeCmp::safe_eq(self, other as u64) }
4475 fn safe_less(&self, other: LESecondaryAdvertisingPHY) -> bool { emboss_runtime::SafeCmp::safe_less(self, other as u64) }
4476}
4477
4478impl emboss_runtime::SafeCmp<LESecondaryAdvertisingPHY> for i64 {
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<V: core::convert::Into<u64> + core::marker::Copy> emboss_runtime::TryFromRaw<V> for LESecondaryAdvertisingPHY {
4484 fn try_from_raw(val: V) -> core::result::Result<Self, emboss_runtime::Error<V>> {
4485 let v_raw: u64 = val.into();
4486 match v_raw {
4487 0 => Ok(LESecondaryAdvertisingPHY::NONE),
4488 1 => Ok(LESecondaryAdvertisingPHY::LE_1M),
4489 2 => Ok(LESecondaryAdvertisingPHY::LE_2M),
4490 3 => Ok(LESecondaryAdvertisingPHY::LE_CODED),
4491 4 => Ok(LESecondaryAdvertisingPHY::LE_CODED_S2),
4492
4493 _ => Err(emboss_runtime::Error::UnknownEnum(val)),
4494 }
4495 }
4496}
4497
4498impl LESecondaryAdvertisingPHY {
4499
4500}
4501#[derive(Copy, Clone, Debug, Eq, PartialEq)]
4502#[repr(u64)]
4503pub enum LEAddressType {
4504 PUBLIC = 0,
4505 RANDOM = 1,
4506 PUBLIC_IDENTITY = 2,
4507 RANDOM_IDENTITY = 3,
4508
4509}
4510
4511impl core::convert::From<LEAddressType> for u8 { fn from(val: LEAddressType) -> Self { val as u8 } }
4512impl core::convert::From<LEAddressType> for u16 { fn from(val: LEAddressType) -> Self { val as u16 } }
4513impl core::convert::From<LEAddressType> for u32 { fn from(val: LEAddressType) -> Self { val as u32 } }
4514impl core::convert::From<LEAddressType> for u64 { fn from(val: LEAddressType) -> Self { val as u64 } }
4515impl core::convert::From<LEAddressType> for i8 { fn from(val: LEAddressType) -> Self { val as i8 } }
4516impl core::convert::From<LEAddressType> for i16 { fn from(val: LEAddressType) -> Self { val as i16 } }
4517impl core::convert::From<LEAddressType> for i32 { fn from(val: LEAddressType) -> Self { val as i32 } }
4518impl core::convert::From<LEAddressType> for i64 { fn from(val: LEAddressType) -> Self { val as i64 } }
4519
4520impl emboss_runtime::SafeCmp<LEAddressType> for LEAddressType {
4521 fn safe_eq(&self, other: Self) -> bool { *self == other }
4522 fn safe_less(&self, other: Self) -> bool { (*self as u64) < (other as u64) }
4523}
4524
4525impl emboss_runtime::SafeCmp<u64> for LEAddressType {
4526 fn safe_eq(&self, other: u64) -> bool { emboss_runtime::SafeCmp::safe_eq(&(*self as u64), other) }
4527 fn safe_less(&self, other: u64) -> bool { emboss_runtime::SafeCmp::safe_less(&(*self as u64), other) }
4528}
4529
4530impl emboss_runtime::SafeCmp<i64> for LEAddressType {
4531 fn safe_eq(&self, other: i64) -> bool { emboss_runtime::SafeCmp::safe_eq(&(*self as u64), other) }
4532 fn safe_less(&self, other: i64) -> bool { emboss_runtime::SafeCmp::safe_less(&(*self as u64), other) }
4533}
4534
4535impl emboss_runtime::SafeCmp<i32> for LEAddressType {
4536 fn safe_eq(&self, other: i32) -> bool { emboss_runtime::SafeCmp::safe_eq(&(*self as u64), other as i64) }
4537 fn safe_less(&self, other: i32) -> bool { emboss_runtime::SafeCmp::safe_less(&(*self as u64), other as i64) }
4538}
4539
4540impl emboss_runtime::SafeCmp<u32> for LEAddressType {
4541 fn safe_eq(&self, other: u32) -> bool { emboss_runtime::SafeCmp::safe_eq(&(*self as u64), other as u64) }
4542 fn safe_less(&self, other: u32) -> bool { emboss_runtime::SafeCmp::safe_less(&(*self as u64), other as u64) }
4543}
4544
4545impl emboss_runtime::SafeCmp<LEAddressType> for u64 {
4546 fn safe_eq(&self, other: LEAddressType) -> bool { emboss_runtime::SafeCmp::safe_eq(self, other as u64) }
4547 fn safe_less(&self, other: LEAddressType) -> bool { emboss_runtime::SafeCmp::safe_less(self, other as u64) }
4548}
4549
4550impl emboss_runtime::SafeCmp<LEAddressType> for i64 {
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<V: core::convert::Into<u64> + core::marker::Copy> emboss_runtime::TryFromRaw<V> for LEAddressType {
4556 fn try_from_raw(val: V) -> core::result::Result<Self, emboss_runtime::Error<V>> {
4557 let v_raw: u64 = val.into();
4558 match v_raw {
4559 0 => Ok(LEAddressType::PUBLIC),
4560 1 => Ok(LEAddressType::RANDOM),
4561 2 => Ok(LEAddressType::PUBLIC_IDENTITY),
4562 3 => Ok(LEAddressType::RANDOM_IDENTITY),
4563
4564 _ => Err(emboss_runtime::Error::UnknownEnum(val)),
4565 }
4566 }
4567}
4568
4569impl LEAddressType {
4570
4571}
4572#[derive(Copy, Clone, Debug, Eq, PartialEq)]
4573#[repr(u64)]
4574pub enum LEExtendedAddressType {
4575 PUBLIC = 0,
4576 RANDOM = 1,
4577 PUBLIC_IDENTITY = 2,
4578 RANDOM_IDENTITY = 3,
4579 ANONYMOUS = 255,
4580
4581}
4582
4583impl core::convert::From<LEExtendedAddressType> for u8 { fn from(val: LEExtendedAddressType) -> Self { val as u8 } }
4584impl core::convert::From<LEExtendedAddressType> for u16 { fn from(val: LEExtendedAddressType) -> Self { val as u16 } }
4585impl core::convert::From<LEExtendedAddressType> for u32 { fn from(val: LEExtendedAddressType) -> Self { val as u32 } }
4586impl core::convert::From<LEExtendedAddressType> for u64 { fn from(val: LEExtendedAddressType) -> Self { val as u64 } }
4587impl core::convert::From<LEExtendedAddressType> for i8 { fn from(val: LEExtendedAddressType) -> Self { val as i8 } }
4588impl core::convert::From<LEExtendedAddressType> for i16 { fn from(val: LEExtendedAddressType) -> Self { val as i16 } }
4589impl core::convert::From<LEExtendedAddressType> for i32 { fn from(val: LEExtendedAddressType) -> Self { val as i32 } }
4590impl core::convert::From<LEExtendedAddressType> for i64 { fn from(val: LEExtendedAddressType) -> Self { val as i64 } }
4591
4592impl emboss_runtime::SafeCmp<LEExtendedAddressType> for LEExtendedAddressType {
4593 fn safe_eq(&self, other: Self) -> bool { *self == other }
4594 fn safe_less(&self, other: Self) -> bool { (*self as u64) < (other as u64) }
4595}
4596
4597impl emboss_runtime::SafeCmp<u64> for LEExtendedAddressType {
4598 fn safe_eq(&self, other: u64) -> bool { emboss_runtime::SafeCmp::safe_eq(&(*self as u64), other) }
4599 fn safe_less(&self, other: u64) -> bool { emboss_runtime::SafeCmp::safe_less(&(*self as u64), other) }
4600}
4601
4602impl emboss_runtime::SafeCmp<i64> for LEExtendedAddressType {
4603 fn safe_eq(&self, other: i64) -> bool { emboss_runtime::SafeCmp::safe_eq(&(*self as u64), other) }
4604 fn safe_less(&self, other: i64) -> bool { emboss_runtime::SafeCmp::safe_less(&(*self as u64), other) }
4605}
4606
4607impl emboss_runtime::SafeCmp<i32> for LEExtendedAddressType {
4608 fn safe_eq(&self, other: i32) -> bool { emboss_runtime::SafeCmp::safe_eq(&(*self as u64), other as i64) }
4609 fn safe_less(&self, other: i32) -> bool { emboss_runtime::SafeCmp::safe_less(&(*self as u64), other as i64) }
4610}
4611
4612impl emboss_runtime::SafeCmp<u32> for LEExtendedAddressType {
4613 fn safe_eq(&self, other: u32) -> bool { emboss_runtime::SafeCmp::safe_eq(&(*self as u64), other as u64) }
4614 fn safe_less(&self, other: u32) -> bool { emboss_runtime::SafeCmp::safe_less(&(*self as u64), other as u64) }
4615}
4616
4617impl emboss_runtime::SafeCmp<LEExtendedAddressType> for u64 {
4618 fn safe_eq(&self, other: LEExtendedAddressType) -> bool { emboss_runtime::SafeCmp::safe_eq(self, other as u64) }
4619 fn safe_less(&self, other: LEExtendedAddressType) -> bool { emboss_runtime::SafeCmp::safe_less(self, other as u64) }
4620}
4621
4622impl emboss_runtime::SafeCmp<LEExtendedAddressType> for i64 {
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<V: core::convert::Into<u64> + core::marker::Copy> emboss_runtime::TryFromRaw<V> for LEExtendedAddressType {
4628 fn try_from_raw(val: V) -> core::result::Result<Self, emboss_runtime::Error<V>> {
4629 let v_raw: u64 = val.into();
4630 match v_raw {
4631 0 => Ok(LEExtendedAddressType::PUBLIC),
4632 1 => Ok(LEExtendedAddressType::RANDOM),
4633 2 => Ok(LEExtendedAddressType::PUBLIC_IDENTITY),
4634 3 => Ok(LEExtendedAddressType::RANDOM_IDENTITY),
4635 255 => Ok(LEExtendedAddressType::ANONYMOUS),
4636
4637 _ => Err(emboss_runtime::Error::UnknownEnum(val)),
4638 }
4639 }
4640}
4641
4642impl LEExtendedAddressType {
4643
4644}
4645pub struct LEAdvertisingChannels<S: emboss_runtime::Storage, ST: emboss_runtime::State = emboss_runtime::UncheckedState> {
4646 storage: S,
4647 _marker: core::marker::PhantomData<ST>,
4648}
4649
4650impl<S: emboss_runtime::Storage> LEAdvertisingChannels<S, emboss_runtime::UncheckedState> {
4651 pub fn new(storage: S) -> Self {
4652 Self {
4653 storage,
4654 _marker: core::marker::PhantomData,
4655 }
4656 }
4657}
4658
4659impl<S: emboss_runtime::Storage + core::clone::Clone, ST: emboss_runtime::State> core::clone::Clone for LEAdvertisingChannels<S, ST> {
4660 fn clone(&self) -> Self {
4661 Self {
4662 storage: self.storage.clone(),
4663 _marker: core::marker::PhantomData,
4664 }
4665 }
4666}
4667
4668impl<S: emboss_runtime::Storage, ST: emboss_runtime::State> LEAdvertisingChannels<S, ST> {
4669 pub unsafe fn new_in_state(storage: S) -> Self {
4677 Self {
4678 storage,
4679 _marker: core::marker::PhantomData,
4680 }
4681 }
4682 pub fn into_storage(self) -> S {
4683 self.storage
4684 }
4685 pub fn channel_37(&self) -> emboss_runtime::BitFlag<1, 0, emboss_runtime::Null, S::Sliced<'_>, ST> {
4686 let len = (1) as usize; let storage = self.storage.slice(0, len);
4688 emboss_runtime::BitFlag::<1, 0, emboss_runtime::Null, S::Sliced<'_>, ST>::new(storage)
4689 }
4690 pub fn channel_38(&self) -> emboss_runtime::BitFlag<1, 1, emboss_runtime::Null, S::Sliced<'_>, ST> {
4691 let len = (1) as usize; let storage = self.storage.slice(0, len);
4693 emboss_runtime::BitFlag::<1, 1, emboss_runtime::Null, S::Sliced<'_>, ST>::new(storage)
4694 }
4695 pub fn channel_39(&self) -> emboss_runtime::BitFlag<1, 2, emboss_runtime::Null, S::Sliced<'_>, ST> {
4696 let len = (1) as usize; let storage = self.storage.slice(0, len);
4698 emboss_runtime::BitFlag::<1, 2, emboss_runtime::Null, S::Sliced<'_>, ST>::new(storage)
4699 }
4700
4701}
4702
4703pub struct LEAdvertisingChannelsMut<S: emboss_runtime::MutStorage> {
4704 storage: S,
4705}
4706
4707impl<S: emboss_runtime::MutStorage> LEAdvertisingChannelsMut<S> {
4708 pub fn new(storage: S) -> Self {
4709 Self {
4710 storage,
4711 }
4712 }
4713 pub fn into_writer(self) -> LEAdvertisingChannelsWriter<S, emboss_runtime::UncheckedState> {
4714 LEAdvertisingChannelsWriter::new(self.storage)
4715 }
4716 pub fn as_view(&self) -> LEAdvertisingChannels<S::Sliced<'_>, emboss_runtime::UncheckedState> {
4718 unsafe { LEAdvertisingChannels::new_in_state(self.storage.slice(0, self.storage.len())) }
4719 }
4720 pub fn channel_37(&mut self) -> emboss_runtime::BitFlag<1, 0, emboss_runtime::Null, S::SlicedMut<'_>, emboss_runtime::UncheckedState> {
4721 let len = (1) as usize;
4722 let storage = self.storage.slice_mut(0, len);
4723 emboss_runtime::BitFlag::<1, 0, emboss_runtime::Null, S::SlicedMut<'_>, emboss_runtime::UncheckedState>::new(storage)
4724 }
4725 pub fn channel_38(&mut self) -> emboss_runtime::BitFlag<1, 1, 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, 1, emboss_runtime::Null, S::SlicedMut<'_>, emboss_runtime::UncheckedState>::new(storage)
4729 }
4730 pub fn channel_39(&mut self) -> emboss_runtime::BitFlag<1, 2, 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, 2, emboss_runtime::Null, S::SlicedMut<'_>, emboss_runtime::UncheckedState>::new(storage)
4734 }
4735
4736}
4737
4738impl<S: emboss_runtime::MutStorage> emboss_runtime::IntoWriter for LEAdvertisingChannelsMut<S> {
4739 type Writer = LEAdvertisingChannelsWriter<S, emboss_runtime::UncheckedState>;
4740 fn into_writer(self) -> Self::Writer {
4741 LEAdvertisingChannelsWriter::new(self.storage)
4742 }
4743}
4744
4745pub struct LEAdvertisingChannelsWriter<S: emboss_runtime::MutStorage, ST: emboss_runtime::State = emboss_runtime::UncheckedState> {
4746 storage: S,
4747 _marker: core::marker::PhantomData<ST>,
4748}
4749
4750impl<S: emboss_runtime::MutStorage> LEAdvertisingChannelsWriter<S, emboss_runtime::UncheckedState> {
4751 pub fn new(storage: S) -> Self {
4752 Self {
4753 storage,
4754 _marker: core::marker::PhantomData,
4755 }
4756 }
4757}
4758
4759impl<S: emboss_runtime::MutStorage, ST: emboss_runtime::State> LEAdvertisingChannelsWriter<S, ST> {
4760 pub unsafe fn new_in_state(storage: S) -> Self {
4768 Self {
4769 storage,
4770 _marker: core::marker::PhantomData,
4771 }
4772 }
4773 pub fn into_storage(self) -> S {
4774 self.storage
4775 }
4776 pub fn into_view(self) -> LEAdvertisingChannels<S, ST> {
4778 unsafe { LEAdvertisingChannels::new_in_state(self.storage) }
4779 }
4780 pub fn as_view(&self) -> LEAdvertisingChannels<S::Sliced<'_>, ST> {
4782 unsafe { LEAdvertisingChannels::new_in_state(self.storage.slice(0, self.storage.len())) }
4783 }
4784
4785}
4786
4787impl<S: emboss_runtime::Storage, ST: emboss_runtime::State> emboss_runtime::View for LEAdvertisingChannels<S, ST> {
4788 fn size_in_bytes(&self) -> core::result::Result<usize, emboss_runtime::Error> {
4789 let view = self;
4790 core::result::Result::Ok((((3) + 7) / 8) as usize)
4791 }
4792}
4793
4794impl<S: emboss_runtime::MutStorage> emboss_runtime::View for LEAdvertisingChannelsMut<S> {
4795 fn size_in_bytes(&self) -> core::result::Result<usize, emboss_runtime::Error> {
4796 let view = self.as_view();
4797 <LEAdvertisingChannels<S::Sliced<'_>, emboss_runtime::UncheckedState> as emboss_runtime::View>::size_in_bytes(&view)
4798 }
4799}
4800
4801impl<S: emboss_runtime::MutStorage, ST: emboss_runtime::State> emboss_runtime::View for LEAdvertisingChannelsWriter<S, ST> {
4802 fn size_in_bytes(&self) -> core::result::Result<usize, emboss_runtime::Error> {
4803 let view = self.as_view();
4804 <LEAdvertisingChannels<S::Sliced<'_>, ST> as emboss_runtime::View>::size_in_bytes(&view)
4805 }
4806}
4807
4808impl<S: emboss_runtime::Storage> emboss_runtime::CheckComplete for LEAdvertisingChannels<S, emboss_runtime::UncheckedState> {
4809 type Completed = LEAdvertisingChannels<S, emboss_runtime::CompleteState>;
4810 fn check_complete(self) -> core::result::Result<Self::Completed, emboss_runtime::Error> {
4811 let required_size = <Self as emboss_runtime::View>::size_in_bytes(&self)?;
4812 if self.storage.len() < required_size {
4813 return core::result::Result::Err(emboss_runtime::Error::OutOfBounds);
4814 }
4815 core::result::Result::Ok(unsafe { LEAdvertisingChannels::new_in_state(self.storage) })
4816 }
4817}
4818
4819impl<S: emboss_runtime::MutStorage> emboss_runtime::CheckComplete for LEAdvertisingChannelsWriter<S, emboss_runtime::UncheckedState> {
4820 type Completed = LEAdvertisingChannelsWriter<S, emboss_runtime::CompleteState>;
4821 fn check_complete(self) -> core::result::Result<Self::Completed, emboss_runtime::Error> {
4822 let required_size = <Self as emboss_runtime::View>::size_in_bytes(&self)?;
4823 if self.storage.len() < required_size {
4824 return core::result::Result::Err(emboss_runtime::Error::OutOfBounds);
4825 }
4826 core::result::Result::Ok(unsafe { LEAdvertisingChannelsWriter::new_in_state(self.storage) })
4827 }
4828}
4829
4830impl<S: emboss_runtime::Storage> emboss_runtime::CheckOk for LEAdvertisingChannels<S, emboss_runtime::UncheckedState> {
4831 type Ok = LEAdvertisingChannels<S, emboss_runtime::OkState>;
4832 fn check_ok(self) -> core::result::Result<Self::Ok, emboss_runtime::Error> {
4833 let completed = emboss_runtime::CheckComplete::check_complete(self)?;
4834 core::result::Result::Ok(unsafe { LEAdvertisingChannels::new_in_state(completed.into_storage()) })
4835 }
4836}
4837
4838impl<S: emboss_runtime::Storage> emboss_runtime::CheckOk for LEAdvertisingChannels<S, emboss_runtime::CompleteState> {
4839 type Ok = LEAdvertisingChannels<S, emboss_runtime::OkState>;
4840 fn check_ok(self) -> core::result::Result<Self::Ok, emboss_runtime::Error> {
4841 core::result::Result::Ok(unsafe { LEAdvertisingChannels::new_in_state(self.into_storage()) })
4842 }
4843}
4844
4845impl<S: emboss_runtime::Storage> emboss_runtime::CheckOk for LEAdvertisingChannels<S, emboss_runtime::OkState> {
4846 type Ok = LEAdvertisingChannels<S, emboss_runtime::OkState>;
4847 fn check_ok(self) -> core::result::Result<Self::Ok, emboss_runtime::Error> {
4848 core::result::Result::Ok(self)
4849 }
4850}
4851
4852impl<S: emboss_runtime::MutStorage> emboss_runtime::CheckOk for LEAdvertisingChannelsWriter<S, emboss_runtime::UncheckedState> {
4853 type Ok = LEAdvertisingChannelsWriter<S, emboss_runtime::OkState>;
4854 fn check_ok(self) -> core::result::Result<Self::Ok, emboss_runtime::Error> {
4855 let completed = emboss_runtime::CheckComplete::check_complete(self)?;
4856 core::result::Result::Ok(unsafe { LEAdvertisingChannelsWriter::new_in_state(completed.into_storage()) })
4857 }
4858}
4859
4860impl<S: emboss_runtime::MutStorage> emboss_runtime::CheckOk for LEAdvertisingChannelsWriter<S, emboss_runtime::CompleteState> {
4861 type Ok = LEAdvertisingChannelsWriter<S, emboss_runtime::OkState>;
4862 fn check_ok(self) -> core::result::Result<Self::Ok, emboss_runtime::Error> {
4863 core::result::Result::Ok(unsafe { LEAdvertisingChannelsWriter::new_in_state(self.into_storage()) })
4864 }
4865}
4866
4867impl<S: emboss_runtime::MutStorage> emboss_runtime::CheckOk for LEAdvertisingChannelsWriter<S, emboss_runtime::OkState> {
4868 type Ok = LEAdvertisingChannelsWriter<S, emboss_runtime::OkState>;
4869 fn check_ok(self) -> core::result::Result<Self::Ok, emboss_runtime::Error> {
4870 core::result::Result::Ok(self)
4871 }
4872}
4873
4874pub mod l_e_advertising_channels {
4875 pub type View<S, ST = emboss_runtime::UncheckedState> = super::LEAdvertisingChannels<S, ST>;
4876 pub type ViewMut<S> = super::LEAdvertisingChannelsMut<S>;
4877 pub type Writer<S, ST = emboss_runtime::UncheckedState> = super::LEAdvertisingChannelsWriter<S, ST>;
4878
4879 pub const MIN_SIZE_IN_BYTES: usize = 1;
4880 pub const MAX_SIZE_IN_BYTES: usize = 1;
4881 pub const SIZE_IN_BYTES: usize = 1;
4882}#[derive(Copy, Clone, Debug, Eq, PartialEq)]
4883#[repr(u64)]
4884pub enum LEAdvertisingFilterPolicy {
4885 ALLOW_ALL = 0,
4886 ALLOW_ALL_CONNECTIONS_AND_USE_FILTER_ACCEPT_LIST_FOR_SCANS = 1,
4887 ALLOW_ALL_SCANS_AND_USE_FILTER_ACCEPT_LIST_FOR_CONNECTIONS = 2,
4888 ALLOW_FILTER_ACCEPT_LIST_ONLY = 3,
4889
4890}
4891
4892impl core::convert::From<LEAdvertisingFilterPolicy> for u8 { fn from(val: LEAdvertisingFilterPolicy) -> Self { val as u8 } }
4893impl core::convert::From<LEAdvertisingFilterPolicy> for u16 { fn from(val: LEAdvertisingFilterPolicy) -> Self { val as u16 } }
4894impl core::convert::From<LEAdvertisingFilterPolicy> for u32 { fn from(val: LEAdvertisingFilterPolicy) -> Self { val as u32 } }
4895impl core::convert::From<LEAdvertisingFilterPolicy> for u64 { fn from(val: LEAdvertisingFilterPolicy) -> Self { val as u64 } }
4896impl core::convert::From<LEAdvertisingFilterPolicy> for i8 { fn from(val: LEAdvertisingFilterPolicy) -> Self { val as i8 } }
4897impl core::convert::From<LEAdvertisingFilterPolicy> for i16 { fn from(val: LEAdvertisingFilterPolicy) -> Self { val as i16 } }
4898impl core::convert::From<LEAdvertisingFilterPolicy> for i32 { fn from(val: LEAdvertisingFilterPolicy) -> Self { val as i32 } }
4899impl core::convert::From<LEAdvertisingFilterPolicy> for i64 { fn from(val: LEAdvertisingFilterPolicy) -> Self { val as i64 } }
4900
4901impl emboss_runtime::SafeCmp<LEAdvertisingFilterPolicy> for LEAdvertisingFilterPolicy {
4902 fn safe_eq(&self, other: Self) -> bool { *self == other }
4903 fn safe_less(&self, other: Self) -> bool { (*self as u64) < (other as u64) }
4904}
4905
4906impl emboss_runtime::SafeCmp<u64> for LEAdvertisingFilterPolicy {
4907 fn safe_eq(&self, other: u64) -> bool { emboss_runtime::SafeCmp::safe_eq(&(*self as u64), other) }
4908 fn safe_less(&self, other: u64) -> bool { emboss_runtime::SafeCmp::safe_less(&(*self as u64), other) }
4909}
4910
4911impl emboss_runtime::SafeCmp<i64> for LEAdvertisingFilterPolicy {
4912 fn safe_eq(&self, other: i64) -> bool { emboss_runtime::SafeCmp::safe_eq(&(*self as u64), other) }
4913 fn safe_less(&self, other: i64) -> bool { emboss_runtime::SafeCmp::safe_less(&(*self as u64), other) }
4914}
4915
4916impl emboss_runtime::SafeCmp<i32> for LEAdvertisingFilterPolicy {
4917 fn safe_eq(&self, other: i32) -> bool { emboss_runtime::SafeCmp::safe_eq(&(*self as u64), other as i64) }
4918 fn safe_less(&self, other: i32) -> bool { emboss_runtime::SafeCmp::safe_less(&(*self as u64), other as i64) }
4919}
4920
4921impl emboss_runtime::SafeCmp<u32> for LEAdvertisingFilterPolicy {
4922 fn safe_eq(&self, other: u32) -> bool { emboss_runtime::SafeCmp::safe_eq(&(*self as u64), other as u64) }
4923 fn safe_less(&self, other: u32) -> bool { emboss_runtime::SafeCmp::safe_less(&(*self as u64), other as u64) }
4924}
4925
4926impl emboss_runtime::SafeCmp<LEAdvertisingFilterPolicy> for u64 {
4927 fn safe_eq(&self, other: LEAdvertisingFilterPolicy) -> bool { emboss_runtime::SafeCmp::safe_eq(self, other as u64) }
4928 fn safe_less(&self, other: LEAdvertisingFilterPolicy) -> bool { emboss_runtime::SafeCmp::safe_less(self, other as u64) }
4929}
4930
4931impl emboss_runtime::SafeCmp<LEAdvertisingFilterPolicy> for i64 {
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<V: core::convert::Into<u64> + core::marker::Copy> emboss_runtime::TryFromRaw<V> for LEAdvertisingFilterPolicy {
4937 fn try_from_raw(val: V) -> core::result::Result<Self, emboss_runtime::Error<V>> {
4938 let v_raw: u64 = val.into();
4939 match v_raw {
4940 0 => Ok(LEAdvertisingFilterPolicy::ALLOW_ALL),
4941 1 => Ok(LEAdvertisingFilterPolicy::ALLOW_ALL_CONNECTIONS_AND_USE_FILTER_ACCEPT_LIST_FOR_SCANS),
4942 2 => Ok(LEAdvertisingFilterPolicy::ALLOW_ALL_SCANS_AND_USE_FILTER_ACCEPT_LIST_FOR_CONNECTIONS),
4943 3 => Ok(LEAdvertisingFilterPolicy::ALLOW_FILTER_ACCEPT_LIST_ONLY),
4944
4945 _ => Err(emboss_runtime::Error::UnknownEnum(val)),
4946 }
4947 }
4948}
4949
4950impl LEAdvertisingFilterPolicy {
4951
4952}
4953#[derive(Copy, Clone, Debug, Eq, PartialEq)]
4954#[repr(u64)]
4955pub enum PageScanRepetitionMode {
4956 R0_ = 0,
4957 R1_ = 1,
4958 R2_ = 2,
4959
4960}
4961
4962impl core::convert::From<PageScanRepetitionMode> for u8 { fn from(val: PageScanRepetitionMode) -> Self { val as u8 } }
4963impl core::convert::From<PageScanRepetitionMode> for u16 { fn from(val: PageScanRepetitionMode) -> Self { val as u16 } }
4964impl core::convert::From<PageScanRepetitionMode> for u32 { fn from(val: PageScanRepetitionMode) -> Self { val as u32 } }
4965impl core::convert::From<PageScanRepetitionMode> for u64 { fn from(val: PageScanRepetitionMode) -> Self { val as u64 } }
4966impl core::convert::From<PageScanRepetitionMode> for i8 { fn from(val: PageScanRepetitionMode) -> Self { val as i8 } }
4967impl core::convert::From<PageScanRepetitionMode> for i16 { fn from(val: PageScanRepetitionMode) -> Self { val as i16 } }
4968impl core::convert::From<PageScanRepetitionMode> for i32 { fn from(val: PageScanRepetitionMode) -> Self { val as i32 } }
4969impl core::convert::From<PageScanRepetitionMode> for i64 { fn from(val: PageScanRepetitionMode) -> Self { val as i64 } }
4970
4971impl emboss_runtime::SafeCmp<PageScanRepetitionMode> for PageScanRepetitionMode {
4972 fn safe_eq(&self, other: Self) -> bool { *self == other }
4973 fn safe_less(&self, other: Self) -> bool { (*self as u64) < (other as u64) }
4974}
4975
4976impl emboss_runtime::SafeCmp<u64> for PageScanRepetitionMode {
4977 fn safe_eq(&self, other: u64) -> bool { emboss_runtime::SafeCmp::safe_eq(&(*self as u64), other) }
4978 fn safe_less(&self, other: u64) -> bool { emboss_runtime::SafeCmp::safe_less(&(*self as u64), other) }
4979}
4980
4981impl emboss_runtime::SafeCmp<i64> for PageScanRepetitionMode {
4982 fn safe_eq(&self, other: i64) -> bool { emboss_runtime::SafeCmp::safe_eq(&(*self as u64), other) }
4983 fn safe_less(&self, other: i64) -> bool { emboss_runtime::SafeCmp::safe_less(&(*self as u64), other) }
4984}
4985
4986impl emboss_runtime::SafeCmp<i32> for PageScanRepetitionMode {
4987 fn safe_eq(&self, other: i32) -> bool { emboss_runtime::SafeCmp::safe_eq(&(*self as u64), other as i64) }
4988 fn safe_less(&self, other: i32) -> bool { emboss_runtime::SafeCmp::safe_less(&(*self as u64), other as i64) }
4989}
4990
4991impl emboss_runtime::SafeCmp<u32> for PageScanRepetitionMode {
4992 fn safe_eq(&self, other: u32) -> bool { emboss_runtime::SafeCmp::safe_eq(&(*self as u64), other as u64) }
4993 fn safe_less(&self, other: u32) -> bool { emboss_runtime::SafeCmp::safe_less(&(*self as u64), other as u64) }
4994}
4995
4996impl emboss_runtime::SafeCmp<PageScanRepetitionMode> for u64 {
4997 fn safe_eq(&self, other: PageScanRepetitionMode) -> bool { emboss_runtime::SafeCmp::safe_eq(self, other as u64) }
4998 fn safe_less(&self, other: PageScanRepetitionMode) -> bool { emboss_runtime::SafeCmp::safe_less(self, other as u64) }
4999}
5000
5001impl emboss_runtime::SafeCmp<PageScanRepetitionMode> for i64 {
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<V: core::convert::Into<u64> + core::marker::Copy> emboss_runtime::TryFromRaw<V> for PageScanRepetitionMode {
5007 fn try_from_raw(val: V) -> core::result::Result<Self, emboss_runtime::Error<V>> {
5008 let v_raw: u64 = val.into();
5009 match v_raw {
5010 0 => Ok(PageScanRepetitionMode::R0_),
5011 1 => Ok(PageScanRepetitionMode::R1_),
5012 2 => Ok(PageScanRepetitionMode::R2_),
5013
5014 _ => Err(emboss_runtime::Error::UnknownEnum(val)),
5015 }
5016 }
5017}
5018
5019impl PageScanRepetitionMode {
5020
5021}
5022#[derive(Copy, Clone, Debug, Eq, PartialEq)]
5023#[repr(u64)]
5024pub enum CodingFormat {
5025 U_LAW = 0,
5026 A_LAW = 1,
5027 CVSD = 2,
5028 TRANSPARENT = 3,
5029 LINEAR_PCM = 4,
5030 MSBC = 5,
5031 LC3 = 6,
5032 G729A = 7,
5033 VENDOR_SPECIFIC = 255,
5034
5035}
5036
5037impl core::convert::From<CodingFormat> for u8 { fn from(val: CodingFormat) -> Self { val as u8 } }
5038impl core::convert::From<CodingFormat> for u16 { fn from(val: CodingFormat) -> Self { val as u16 } }
5039impl core::convert::From<CodingFormat> for u32 { fn from(val: CodingFormat) -> Self { val as u32 } }
5040impl core::convert::From<CodingFormat> for u64 { fn from(val: CodingFormat) -> Self { val as u64 } }
5041impl core::convert::From<CodingFormat> for i8 { fn from(val: CodingFormat) -> Self { val as i8 } }
5042impl core::convert::From<CodingFormat> for i16 { fn from(val: CodingFormat) -> Self { val as i16 } }
5043impl core::convert::From<CodingFormat> for i32 { fn from(val: CodingFormat) -> Self { val as i32 } }
5044impl core::convert::From<CodingFormat> for i64 { fn from(val: CodingFormat) -> Self { val as i64 } }
5045
5046impl emboss_runtime::SafeCmp<CodingFormat> for CodingFormat {
5047 fn safe_eq(&self, other: Self) -> bool { *self == other }
5048 fn safe_less(&self, other: Self) -> bool { (*self as u64) < (other as u64) }
5049}
5050
5051impl emboss_runtime::SafeCmp<u64> for CodingFormat {
5052 fn safe_eq(&self, other: u64) -> bool { emboss_runtime::SafeCmp::safe_eq(&(*self as u64), other) }
5053 fn safe_less(&self, other: u64) -> bool { emboss_runtime::SafeCmp::safe_less(&(*self as u64), other) }
5054}
5055
5056impl emboss_runtime::SafeCmp<i64> for CodingFormat {
5057 fn safe_eq(&self, other: i64) -> bool { emboss_runtime::SafeCmp::safe_eq(&(*self as u64), other) }
5058 fn safe_less(&self, other: i64) -> bool { emboss_runtime::SafeCmp::safe_less(&(*self as u64), other) }
5059}
5060
5061impl emboss_runtime::SafeCmp<i32> for CodingFormat {
5062 fn safe_eq(&self, other: i32) -> bool { emboss_runtime::SafeCmp::safe_eq(&(*self as u64), other as i64) }
5063 fn safe_less(&self, other: i32) -> bool { emboss_runtime::SafeCmp::safe_less(&(*self as u64), other as i64) }
5064}
5065
5066impl emboss_runtime::SafeCmp<u32> for CodingFormat {
5067 fn safe_eq(&self, other: u32) -> bool { emboss_runtime::SafeCmp::safe_eq(&(*self as u64), other as u64) }
5068 fn safe_less(&self, other: u32) -> bool { emboss_runtime::SafeCmp::safe_less(&(*self as u64), other as u64) }
5069}
5070
5071impl emboss_runtime::SafeCmp<CodingFormat> for u64 {
5072 fn safe_eq(&self, other: CodingFormat) -> bool { emboss_runtime::SafeCmp::safe_eq(self, other as u64) }
5073 fn safe_less(&self, other: CodingFormat) -> bool { emboss_runtime::SafeCmp::safe_less(self, other as u64) }
5074}
5075
5076impl emboss_runtime::SafeCmp<CodingFormat> for i64 {
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<V: core::convert::Into<u64> + core::marker::Copy> emboss_runtime::TryFromRaw<V> for CodingFormat {
5082 fn try_from_raw(val: V) -> core::result::Result<Self, emboss_runtime::Error<V>> {
5083 let v_raw: u64 = val.into();
5084 match v_raw {
5085 0 => Ok(CodingFormat::U_LAW),
5086 1 => Ok(CodingFormat::A_LAW),
5087 2 => Ok(CodingFormat::CVSD),
5088 3 => Ok(CodingFormat::TRANSPARENT),
5089 4 => Ok(CodingFormat::LINEAR_PCM),
5090 5 => Ok(CodingFormat::MSBC),
5091 6 => Ok(CodingFormat::LC3),
5092 7 => Ok(CodingFormat::G729A),
5093 255 => Ok(CodingFormat::VENDOR_SPECIFIC),
5094
5095 _ => Err(emboss_runtime::Error::UnknownEnum(val)),
5096 }
5097 }
5098}
5099
5100impl CodingFormat {
5101
5102}
5103#[derive(Copy, Clone, Debug, Eq, PartialEq)]
5104#[repr(u64)]
5105pub enum IoCapability {
5106 DISPLAY_ONLY = 0,
5107 DISPLAY_YES_NO = 1,
5108 KEYBOARD_ONLY = 2,
5109 NO_INPUT_NO_OUTPUT = 3,
5110 KEYBOARD_DISPLAY = 4,
5111
5112}
5113
5114impl core::convert::From<IoCapability> for u8 { fn from(val: IoCapability) -> Self { val as u8 } }
5115impl core::convert::From<IoCapability> for u16 { fn from(val: IoCapability) -> Self { val as u16 } }
5116impl core::convert::From<IoCapability> for u32 { fn from(val: IoCapability) -> Self { val as u32 } }
5117impl core::convert::From<IoCapability> for u64 { fn from(val: IoCapability) -> Self { val as u64 } }
5118impl core::convert::From<IoCapability> for i8 { fn from(val: IoCapability) -> Self { val as i8 } }
5119impl core::convert::From<IoCapability> for i16 { fn from(val: IoCapability) -> Self { val as i16 } }
5120impl core::convert::From<IoCapability> for i32 { fn from(val: IoCapability) -> Self { val as i32 } }
5121impl core::convert::From<IoCapability> for i64 { fn from(val: IoCapability) -> Self { val as i64 } }
5122
5123impl emboss_runtime::SafeCmp<IoCapability> for IoCapability {
5124 fn safe_eq(&self, other: Self) -> bool { *self == other }
5125 fn safe_less(&self, other: Self) -> bool { (*self as u64) < (other as u64) }
5126}
5127
5128impl emboss_runtime::SafeCmp<u64> for IoCapability {
5129 fn safe_eq(&self, other: u64) -> bool { emboss_runtime::SafeCmp::safe_eq(&(*self as u64), other) }
5130 fn safe_less(&self, other: u64) -> bool { emboss_runtime::SafeCmp::safe_less(&(*self as u64), other) }
5131}
5132
5133impl emboss_runtime::SafeCmp<i64> for IoCapability {
5134 fn safe_eq(&self, other: i64) -> bool { emboss_runtime::SafeCmp::safe_eq(&(*self as u64), other) }
5135 fn safe_less(&self, other: i64) -> bool { emboss_runtime::SafeCmp::safe_less(&(*self as u64), other) }
5136}
5137
5138impl emboss_runtime::SafeCmp<i32> for IoCapability {
5139 fn safe_eq(&self, other: i32) -> bool { emboss_runtime::SafeCmp::safe_eq(&(*self as u64), other as i64) }
5140 fn safe_less(&self, other: i32) -> bool { emboss_runtime::SafeCmp::safe_less(&(*self as u64), other as i64) }
5141}
5142
5143impl emboss_runtime::SafeCmp<u32> for IoCapability {
5144 fn safe_eq(&self, other: u32) -> bool { emboss_runtime::SafeCmp::safe_eq(&(*self as u64), other as u64) }
5145 fn safe_less(&self, other: u32) -> bool { emboss_runtime::SafeCmp::safe_less(&(*self as u64), other as u64) }
5146}
5147
5148impl emboss_runtime::SafeCmp<IoCapability> for u64 {
5149 fn safe_eq(&self, other: IoCapability) -> bool { emboss_runtime::SafeCmp::safe_eq(self, other as u64) }
5150 fn safe_less(&self, other: IoCapability) -> bool { emboss_runtime::SafeCmp::safe_less(self, other as u64) }
5151}
5152
5153impl emboss_runtime::SafeCmp<IoCapability> for i64 {
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<V: core::convert::Into<u64> + core::marker::Copy> emboss_runtime::TryFromRaw<V> for IoCapability {
5159 fn try_from_raw(val: V) -> core::result::Result<Self, emboss_runtime::Error<V>> {
5160 let v_raw: u64 = val.into();
5161 match v_raw {
5162 0 => Ok(IoCapability::DISPLAY_ONLY),
5163 1 => Ok(IoCapability::DISPLAY_YES_NO),
5164 2 => Ok(IoCapability::KEYBOARD_ONLY),
5165 3 => Ok(IoCapability::NO_INPUT_NO_OUTPUT),
5166 4 => Ok(IoCapability::KEYBOARD_DISPLAY),
5167
5168 _ => Err(emboss_runtime::Error::UnknownEnum(val)),
5169 }
5170 }
5171}
5172
5173impl IoCapability {
5174
5175}
5176#[derive(Copy, Clone, Debug, Eq, PartialEq)]
5177#[repr(u64)]
5178pub enum LESleepClockAccuracyRange {
5179 PPM_251_TO_500 = 0,
5180 PPM_151_TO_250 = 1,
5181 PPM_101_TO_150 = 2,
5182 PPM_76_TO_100 = 3,
5183 PPM_51_TO_75 = 4,
5184 PPM_31_TO_50 = 5,
5185 PPM_21_TO_30 = 6,
5186 PPM_0_TO_20 = 7,
5187
5188}
5189
5190impl core::convert::From<LESleepClockAccuracyRange> for u8 { fn from(val: LESleepClockAccuracyRange) -> Self { val as u8 } }
5191impl core::convert::From<LESleepClockAccuracyRange> for u16 { fn from(val: LESleepClockAccuracyRange) -> Self { val as u16 } }
5192impl core::convert::From<LESleepClockAccuracyRange> for u32 { fn from(val: LESleepClockAccuracyRange) -> Self { val as u32 } }
5193impl core::convert::From<LESleepClockAccuracyRange> for u64 { fn from(val: LESleepClockAccuracyRange) -> Self { val as u64 } }
5194impl core::convert::From<LESleepClockAccuracyRange> for i8 { fn from(val: LESleepClockAccuracyRange) -> Self { val as i8 } }
5195impl core::convert::From<LESleepClockAccuracyRange> for i16 { fn from(val: LESleepClockAccuracyRange) -> Self { val as i16 } }
5196impl core::convert::From<LESleepClockAccuracyRange> for i32 { fn from(val: LESleepClockAccuracyRange) -> Self { val as i32 } }
5197impl core::convert::From<LESleepClockAccuracyRange> for i64 { fn from(val: LESleepClockAccuracyRange) -> Self { val as i64 } }
5198
5199impl emboss_runtime::SafeCmp<LESleepClockAccuracyRange> for LESleepClockAccuracyRange {
5200 fn safe_eq(&self, other: Self) -> bool { *self == other }
5201 fn safe_less(&self, other: Self) -> bool { (*self as u64) < (other as u64) }
5202}
5203
5204impl emboss_runtime::SafeCmp<u64> for LESleepClockAccuracyRange {
5205 fn safe_eq(&self, other: u64) -> bool { emboss_runtime::SafeCmp::safe_eq(&(*self as u64), other) }
5206 fn safe_less(&self, other: u64) -> bool { emboss_runtime::SafeCmp::safe_less(&(*self as u64), other) }
5207}
5208
5209impl emboss_runtime::SafeCmp<i64> for LESleepClockAccuracyRange {
5210 fn safe_eq(&self, other: i64) -> bool { emboss_runtime::SafeCmp::safe_eq(&(*self as u64), other) }
5211 fn safe_less(&self, other: i64) -> bool { emboss_runtime::SafeCmp::safe_less(&(*self as u64), other) }
5212}
5213
5214impl emboss_runtime::SafeCmp<i32> for LESleepClockAccuracyRange {
5215 fn safe_eq(&self, other: i32) -> bool { emboss_runtime::SafeCmp::safe_eq(&(*self as u64), other as i64) }
5216 fn safe_less(&self, other: i32) -> bool { emboss_runtime::SafeCmp::safe_less(&(*self as u64), other as i64) }
5217}
5218
5219impl emboss_runtime::SafeCmp<u32> for LESleepClockAccuracyRange {
5220 fn safe_eq(&self, other: u32) -> bool { emboss_runtime::SafeCmp::safe_eq(&(*self as u64), other as u64) }
5221 fn safe_less(&self, other: u32) -> bool { emboss_runtime::SafeCmp::safe_less(&(*self as u64), other as u64) }
5222}
5223
5224impl emboss_runtime::SafeCmp<LESleepClockAccuracyRange> for u64 {
5225 fn safe_eq(&self, other: LESleepClockAccuracyRange) -> bool { emboss_runtime::SafeCmp::safe_eq(self, other as u64) }
5226 fn safe_less(&self, other: LESleepClockAccuracyRange) -> bool { emboss_runtime::SafeCmp::safe_less(self, other as u64) }
5227}
5228
5229impl emboss_runtime::SafeCmp<LESleepClockAccuracyRange> for i64 {
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<V: core::convert::Into<u64> + core::marker::Copy> emboss_runtime::TryFromRaw<V> for LESleepClockAccuracyRange {
5235 fn try_from_raw(val: V) -> core::result::Result<Self, emboss_runtime::Error<V>> {
5236 let v_raw: u64 = val.into();
5237 match v_raw {
5238 0 => Ok(LESleepClockAccuracyRange::PPM_251_TO_500),
5239 1 => Ok(LESleepClockAccuracyRange::PPM_151_TO_250),
5240 2 => Ok(LESleepClockAccuracyRange::PPM_101_TO_150),
5241 3 => Ok(LESleepClockAccuracyRange::PPM_76_TO_100),
5242 4 => Ok(LESleepClockAccuracyRange::PPM_51_TO_75),
5243 5 => Ok(LESleepClockAccuracyRange::PPM_31_TO_50),
5244 6 => Ok(LESleepClockAccuracyRange::PPM_21_TO_30),
5245 7 => Ok(LESleepClockAccuracyRange::PPM_0_TO_20),
5246
5247 _ => Err(emboss_runtime::Error::UnknownEnum(val)),
5248 }
5249 }
5250}
5251
5252impl LESleepClockAccuracyRange {
5253
5254}
5255#[derive(Copy, Clone, Debug, Eq, PartialEq)]
5256#[repr(u64)]
5257pub enum AuthenticationRequirements {
5258 NO_BONDING = 0,
5259 MITM_NO_BONDING = 1,
5260 DEDICATED_BONDING = 2,
5261 MITM_DEDICATED_BONDING = 3,
5262 GENERAL_BONDING = 4,
5263 MITM_GENERAL_BONDING = 5,
5264
5265}
5266
5267impl core::convert::From<AuthenticationRequirements> for u8 { fn from(val: AuthenticationRequirements) -> Self { val as u8 } }
5268impl core::convert::From<AuthenticationRequirements> for u16 { fn from(val: AuthenticationRequirements) -> Self { val as u16 } }
5269impl core::convert::From<AuthenticationRequirements> for u32 { fn from(val: AuthenticationRequirements) -> Self { val as u32 } }
5270impl core::convert::From<AuthenticationRequirements> for u64 { fn from(val: AuthenticationRequirements) -> Self { val as u64 } }
5271impl core::convert::From<AuthenticationRequirements> for i8 { fn from(val: AuthenticationRequirements) -> Self { val as i8 } }
5272impl core::convert::From<AuthenticationRequirements> for i16 { fn from(val: AuthenticationRequirements) -> Self { val as i16 } }
5273impl core::convert::From<AuthenticationRequirements> for i32 { fn from(val: AuthenticationRequirements) -> Self { val as i32 } }
5274impl core::convert::From<AuthenticationRequirements> for i64 { fn from(val: AuthenticationRequirements) -> Self { val as i64 } }
5275
5276impl emboss_runtime::SafeCmp<AuthenticationRequirements> for AuthenticationRequirements {
5277 fn safe_eq(&self, other: Self) -> bool { *self == other }
5278 fn safe_less(&self, other: Self) -> bool { (*self as u64) < (other as u64) }
5279}
5280
5281impl emboss_runtime::SafeCmp<u64> for AuthenticationRequirements {
5282 fn safe_eq(&self, other: u64) -> bool { emboss_runtime::SafeCmp::safe_eq(&(*self as u64), other) }
5283 fn safe_less(&self, other: u64) -> bool { emboss_runtime::SafeCmp::safe_less(&(*self as u64), other) }
5284}
5285
5286impl emboss_runtime::SafeCmp<i64> for AuthenticationRequirements {
5287 fn safe_eq(&self, other: i64) -> bool { emboss_runtime::SafeCmp::safe_eq(&(*self as u64), other) }
5288 fn safe_less(&self, other: i64) -> bool { emboss_runtime::SafeCmp::safe_less(&(*self as u64), other) }
5289}
5290
5291impl emboss_runtime::SafeCmp<i32> for AuthenticationRequirements {
5292 fn safe_eq(&self, other: i32) -> bool { emboss_runtime::SafeCmp::safe_eq(&(*self as u64), other as i64) }
5293 fn safe_less(&self, other: i32) -> bool { emboss_runtime::SafeCmp::safe_less(&(*self as u64), other as i64) }
5294}
5295
5296impl emboss_runtime::SafeCmp<u32> for AuthenticationRequirements {
5297 fn safe_eq(&self, other: u32) -> bool { emboss_runtime::SafeCmp::safe_eq(&(*self as u64), other as u64) }
5298 fn safe_less(&self, other: u32) -> bool { emboss_runtime::SafeCmp::safe_less(&(*self as u64), other as u64) }
5299}
5300
5301impl emboss_runtime::SafeCmp<AuthenticationRequirements> for u64 {
5302 fn safe_eq(&self, other: AuthenticationRequirements) -> bool { emboss_runtime::SafeCmp::safe_eq(self, other as u64) }
5303 fn safe_less(&self, other: AuthenticationRequirements) -> bool { emboss_runtime::SafeCmp::safe_less(self, other as u64) }
5304}
5305
5306impl emboss_runtime::SafeCmp<AuthenticationRequirements> for i64 {
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<V: core::convert::Into<u64> + core::marker::Copy> emboss_runtime::TryFromRaw<V> for AuthenticationRequirements {
5312 fn try_from_raw(val: V) -> core::result::Result<Self, emboss_runtime::Error<V>> {
5313 let v_raw: u64 = val.into();
5314 match v_raw {
5315 0 => Ok(AuthenticationRequirements::NO_BONDING),
5316 1 => Ok(AuthenticationRequirements::MITM_NO_BONDING),
5317 2 => Ok(AuthenticationRequirements::DEDICATED_BONDING),
5318 3 => Ok(AuthenticationRequirements::MITM_DEDICATED_BONDING),
5319 4 => Ok(AuthenticationRequirements::GENERAL_BONDING),
5320 5 => Ok(AuthenticationRequirements::MITM_GENERAL_BONDING),
5321
5322 _ => Err(emboss_runtime::Error::UnknownEnum(val)),
5323 }
5324 }
5325}
5326
5327impl AuthenticationRequirements {
5328
5329}
5330#[derive(Copy, Clone, Debug, Eq, PartialEq)]
5331#[repr(u64)]
5332pub enum PinType {
5333 VARIABLE = 0,
5334 FIXED = 1,
5335
5336}
5337
5338impl core::convert::From<PinType> for u8 { fn from(val: PinType) -> Self { val as u8 } }
5339impl core::convert::From<PinType> for u16 { fn from(val: PinType) -> Self { val as u16 } }
5340impl core::convert::From<PinType> for u32 { fn from(val: PinType) -> Self { val as u32 } }
5341impl core::convert::From<PinType> for u64 { fn from(val: PinType) -> Self { val as u64 } }
5342impl core::convert::From<PinType> for i8 { fn from(val: PinType) -> Self { val as i8 } }
5343impl core::convert::From<PinType> for i16 { fn from(val: PinType) -> Self { val as i16 } }
5344impl core::convert::From<PinType> for i32 { fn from(val: PinType) -> Self { val as i32 } }
5345impl core::convert::From<PinType> for i64 { fn from(val: PinType) -> Self { val as i64 } }
5346
5347impl emboss_runtime::SafeCmp<PinType> for PinType {
5348 fn safe_eq(&self, other: Self) -> bool { *self == other }
5349 fn safe_less(&self, other: Self) -> bool { (*self as u64) < (other as u64) }
5350}
5351
5352impl emboss_runtime::SafeCmp<u64> for PinType {
5353 fn safe_eq(&self, other: u64) -> bool { emboss_runtime::SafeCmp::safe_eq(&(*self as u64), other) }
5354 fn safe_less(&self, other: u64) -> bool { emboss_runtime::SafeCmp::safe_less(&(*self as u64), other) }
5355}
5356
5357impl emboss_runtime::SafeCmp<i64> for PinType {
5358 fn safe_eq(&self, other: i64) -> bool { emboss_runtime::SafeCmp::safe_eq(&(*self as u64), other) }
5359 fn safe_less(&self, other: i64) -> bool { emboss_runtime::SafeCmp::safe_less(&(*self as u64), other) }
5360}
5361
5362impl emboss_runtime::SafeCmp<i32> for PinType {
5363 fn safe_eq(&self, other: i32) -> bool { emboss_runtime::SafeCmp::safe_eq(&(*self as u64), other as i64) }
5364 fn safe_less(&self, other: i32) -> bool { emboss_runtime::SafeCmp::safe_less(&(*self as u64), other as i64) }
5365}
5366
5367impl emboss_runtime::SafeCmp<u32> for PinType {
5368 fn safe_eq(&self, other: u32) -> bool { emboss_runtime::SafeCmp::safe_eq(&(*self as u64), other as u64) }
5369 fn safe_less(&self, other: u32) -> bool { emboss_runtime::SafeCmp::safe_less(&(*self as u64), other as u64) }
5370}
5371
5372impl emboss_runtime::SafeCmp<PinType> for u64 {
5373 fn safe_eq(&self, other: PinType) -> bool { emboss_runtime::SafeCmp::safe_eq(self, other as u64) }
5374 fn safe_less(&self, other: PinType) -> bool { emboss_runtime::SafeCmp::safe_less(self, other as u64) }
5375}
5376
5377impl emboss_runtime::SafeCmp<PinType> for i64 {
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<V: core::convert::Into<u64> + core::marker::Copy> emboss_runtime::TryFromRaw<V> for PinType {
5383 fn try_from_raw(val: V) -> core::result::Result<Self, emboss_runtime::Error<V>> {
5384 let v_raw: u64 = val.into();
5385 match v_raw {
5386 0 => Ok(PinType::VARIABLE),
5387 1 => Ok(PinType::FIXED),
5388
5389 _ => Err(emboss_runtime::Error::UnknownEnum(val)),
5390 }
5391 }
5392}
5393
5394impl PinType {
5395
5396}
5397#[derive(Copy, Clone, Debug, Eq, PartialEq)]
5398#[repr(u64)]
5399pub enum InquiryScanType {
5400 STANDARD = 0,
5401 INTERLACED = 1,
5402
5403}
5404
5405impl core::convert::From<InquiryScanType> for u8 { fn from(val: InquiryScanType) -> Self { val as u8 } }
5406impl core::convert::From<InquiryScanType> for u16 { fn from(val: InquiryScanType) -> Self { val as u16 } }
5407impl core::convert::From<InquiryScanType> for u32 { fn from(val: InquiryScanType) -> Self { val as u32 } }
5408impl core::convert::From<InquiryScanType> for u64 { fn from(val: InquiryScanType) -> Self { val as u64 } }
5409impl core::convert::From<InquiryScanType> for i8 { fn from(val: InquiryScanType) -> Self { val as i8 } }
5410impl core::convert::From<InquiryScanType> for i16 { fn from(val: InquiryScanType) -> Self { val as i16 } }
5411impl core::convert::From<InquiryScanType> for i32 { fn from(val: InquiryScanType) -> Self { val as i32 } }
5412impl core::convert::From<InquiryScanType> for i64 { fn from(val: InquiryScanType) -> Self { val as i64 } }
5413
5414impl emboss_runtime::SafeCmp<InquiryScanType> for InquiryScanType {
5415 fn safe_eq(&self, other: Self) -> bool { *self == other }
5416 fn safe_less(&self, other: Self) -> bool { (*self as u64) < (other as u64) }
5417}
5418
5419impl emboss_runtime::SafeCmp<u64> for InquiryScanType {
5420 fn safe_eq(&self, other: u64) -> bool { emboss_runtime::SafeCmp::safe_eq(&(*self as u64), other) }
5421 fn safe_less(&self, other: u64) -> bool { emboss_runtime::SafeCmp::safe_less(&(*self as u64), other) }
5422}
5423
5424impl emboss_runtime::SafeCmp<i64> for InquiryScanType {
5425 fn safe_eq(&self, other: i64) -> bool { emboss_runtime::SafeCmp::safe_eq(&(*self as u64), other) }
5426 fn safe_less(&self, other: i64) -> bool { emboss_runtime::SafeCmp::safe_less(&(*self as u64), other) }
5427}
5428
5429impl emboss_runtime::SafeCmp<i32> for InquiryScanType {
5430 fn safe_eq(&self, other: i32) -> bool { emboss_runtime::SafeCmp::safe_eq(&(*self as u64), other as i64) }
5431 fn safe_less(&self, other: i32) -> bool { emboss_runtime::SafeCmp::safe_less(&(*self as u64), other as i64) }
5432}
5433
5434impl emboss_runtime::SafeCmp<u32> for InquiryScanType {
5435 fn safe_eq(&self, other: u32) -> bool { emboss_runtime::SafeCmp::safe_eq(&(*self as u64), other as u64) }
5436 fn safe_less(&self, other: u32) -> bool { emboss_runtime::SafeCmp::safe_less(&(*self as u64), other as u64) }
5437}
5438
5439impl emboss_runtime::SafeCmp<InquiryScanType> for u64 {
5440 fn safe_eq(&self, other: InquiryScanType) -> bool { emboss_runtime::SafeCmp::safe_eq(self, other as u64) }
5441 fn safe_less(&self, other: InquiryScanType) -> bool { emboss_runtime::SafeCmp::safe_less(self, other as u64) }
5442}
5443
5444impl emboss_runtime::SafeCmp<InquiryScanType> for i64 {
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<V: core::convert::Into<u64> + core::marker::Copy> emboss_runtime::TryFromRaw<V> for InquiryScanType {
5450 fn try_from_raw(val: V) -> core::result::Result<Self, emboss_runtime::Error<V>> {
5451 let v_raw: u64 = val.into();
5452 match v_raw {
5453 0 => Ok(InquiryScanType::STANDARD),
5454 1 => Ok(InquiryScanType::INTERLACED),
5455
5456 _ => Err(emboss_runtime::Error::UnknownEnum(val)),
5457 }
5458 }
5459}
5460
5461impl InquiryScanType {
5462
5463}
5464#[derive(Copy, Clone, Debug, Eq, PartialEq)]
5465#[repr(u64)]
5466pub enum InquiryMode {
5467 STANDARD = 0,
5468 RSSI = 1,
5469 EXTENDED = 2,
5470
5471}
5472
5473impl core::convert::From<InquiryMode> for u8 { fn from(val: InquiryMode) -> Self { val as u8 } }
5474impl core::convert::From<InquiryMode> for u16 { fn from(val: InquiryMode) -> Self { val as u16 } }
5475impl core::convert::From<InquiryMode> for u32 { fn from(val: InquiryMode) -> Self { val as u32 } }
5476impl core::convert::From<InquiryMode> for u64 { fn from(val: InquiryMode) -> Self { val as u64 } }
5477impl core::convert::From<InquiryMode> for i8 { fn from(val: InquiryMode) -> Self { val as i8 } }
5478impl core::convert::From<InquiryMode> for i16 { fn from(val: InquiryMode) -> Self { val as i16 } }
5479impl core::convert::From<InquiryMode> for i32 { fn from(val: InquiryMode) -> Self { val as i32 } }
5480impl core::convert::From<InquiryMode> for i64 { fn from(val: InquiryMode) -> Self { val as i64 } }
5481
5482impl emboss_runtime::SafeCmp<InquiryMode> for InquiryMode {
5483 fn safe_eq(&self, other: Self) -> bool { *self == other }
5484 fn safe_less(&self, other: Self) -> bool { (*self as u64) < (other as u64) }
5485}
5486
5487impl emboss_runtime::SafeCmp<u64> for InquiryMode {
5488 fn safe_eq(&self, other: u64) -> bool { emboss_runtime::SafeCmp::safe_eq(&(*self as u64), other) }
5489 fn safe_less(&self, other: u64) -> bool { emboss_runtime::SafeCmp::safe_less(&(*self as u64), other) }
5490}
5491
5492impl emboss_runtime::SafeCmp<i64> for InquiryMode {
5493 fn safe_eq(&self, other: i64) -> bool { emboss_runtime::SafeCmp::safe_eq(&(*self as u64), other) }
5494 fn safe_less(&self, other: i64) -> bool { emboss_runtime::SafeCmp::safe_less(&(*self as u64), other) }
5495}
5496
5497impl emboss_runtime::SafeCmp<i32> for InquiryMode {
5498 fn safe_eq(&self, other: i32) -> bool { emboss_runtime::SafeCmp::safe_eq(&(*self as u64), other as i64) }
5499 fn safe_less(&self, other: i32) -> bool { emboss_runtime::SafeCmp::safe_less(&(*self as u64), other as i64) }
5500}
5501
5502impl emboss_runtime::SafeCmp<u32> for InquiryMode {
5503 fn safe_eq(&self, other: u32) -> bool { emboss_runtime::SafeCmp::safe_eq(&(*self as u64), other as u64) }
5504 fn safe_less(&self, other: u32) -> bool { emboss_runtime::SafeCmp::safe_less(&(*self as u64), other as u64) }
5505}
5506
5507impl emboss_runtime::SafeCmp<InquiryMode> for u64 {
5508 fn safe_eq(&self, other: InquiryMode) -> bool { emboss_runtime::SafeCmp::safe_eq(self, other as u64) }
5509 fn safe_less(&self, other: InquiryMode) -> bool { emboss_runtime::SafeCmp::safe_less(self, other as u64) }
5510}
5511
5512impl emboss_runtime::SafeCmp<InquiryMode> for i64 {
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<V: core::convert::Into<u64> + core::marker::Copy> emboss_runtime::TryFromRaw<V> for InquiryMode {
5518 fn try_from_raw(val: V) -> core::result::Result<Self, emboss_runtime::Error<V>> {
5519 let v_raw: u64 = val.into();
5520 match v_raw {
5521 0 => Ok(InquiryMode::STANDARD),
5522 1 => Ok(InquiryMode::RSSI),
5523 2 => Ok(InquiryMode::EXTENDED),
5524
5525 _ => Err(emboss_runtime::Error::UnknownEnum(val)),
5526 }
5527 }
5528}
5529
5530impl InquiryMode {
5531
5532}
5533#[derive(Copy, Clone, Debug, Eq, PartialEq)]
5534#[repr(u64)]
5535pub enum PageScanType {
5536 STANDARD_SCAN = 0,
5537 INTERLACED_SCAN = 1,
5538
5539}
5540
5541impl core::convert::From<PageScanType> for u8 { fn from(val: PageScanType) -> Self { val as u8 } }
5542impl core::convert::From<PageScanType> for u16 { fn from(val: PageScanType) -> Self { val as u16 } }
5543impl core::convert::From<PageScanType> for u32 { fn from(val: PageScanType) -> Self { val as u32 } }
5544impl core::convert::From<PageScanType> for u64 { fn from(val: PageScanType) -> Self { val as u64 } }
5545impl core::convert::From<PageScanType> for i8 { fn from(val: PageScanType) -> Self { val as i8 } }
5546impl core::convert::From<PageScanType> for i16 { fn from(val: PageScanType) -> Self { val as i16 } }
5547impl core::convert::From<PageScanType> for i32 { fn from(val: PageScanType) -> Self { val as i32 } }
5548impl core::convert::From<PageScanType> for i64 { fn from(val: PageScanType) -> Self { val as i64 } }
5549
5550impl emboss_runtime::SafeCmp<PageScanType> for PageScanType {
5551 fn safe_eq(&self, other: Self) -> bool { *self == other }
5552 fn safe_less(&self, other: Self) -> bool { (*self as u64) < (other as u64) }
5553}
5554
5555impl emboss_runtime::SafeCmp<u64> for PageScanType {
5556 fn safe_eq(&self, other: u64) -> bool { emboss_runtime::SafeCmp::safe_eq(&(*self as u64), other) }
5557 fn safe_less(&self, other: u64) -> bool { emboss_runtime::SafeCmp::safe_less(&(*self as u64), other) }
5558}
5559
5560impl emboss_runtime::SafeCmp<i64> for PageScanType {
5561 fn safe_eq(&self, other: i64) -> bool { emboss_runtime::SafeCmp::safe_eq(&(*self as u64), other) }
5562 fn safe_less(&self, other: i64) -> bool { emboss_runtime::SafeCmp::safe_less(&(*self as u64), other) }
5563}
5564
5565impl emboss_runtime::SafeCmp<i32> for PageScanType {
5566 fn safe_eq(&self, other: i32) -> bool { emboss_runtime::SafeCmp::safe_eq(&(*self as u64), other as i64) }
5567 fn safe_less(&self, other: i32) -> bool { emboss_runtime::SafeCmp::safe_less(&(*self as u64), other as i64) }
5568}
5569
5570impl emboss_runtime::SafeCmp<u32> for PageScanType {
5571 fn safe_eq(&self, other: u32) -> bool { emboss_runtime::SafeCmp::safe_eq(&(*self as u64), other as u64) }
5572 fn safe_less(&self, other: u32) -> bool { emboss_runtime::SafeCmp::safe_less(&(*self as u64), other as u64) }
5573}
5574
5575impl emboss_runtime::SafeCmp<PageScanType> for u64 {
5576 fn safe_eq(&self, other: PageScanType) -> bool { emboss_runtime::SafeCmp::safe_eq(self, other as u64) }
5577 fn safe_less(&self, other: PageScanType) -> bool { emboss_runtime::SafeCmp::safe_less(self, other as u64) }
5578}
5579
5580impl emboss_runtime::SafeCmp<PageScanType> for i64 {
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<V: core::convert::Into<u64> + core::marker::Copy> emboss_runtime::TryFromRaw<V> for PageScanType {
5586 fn try_from_raw(val: V) -> core::result::Result<Self, emboss_runtime::Error<V>> {
5587 let v_raw: u64 = val.into();
5588 match v_raw {
5589 0 => Ok(PageScanType::STANDARD_SCAN),
5590 1 => Ok(PageScanType::INTERLACED_SCAN),
5591
5592 _ => Err(emboss_runtime::Error::UnknownEnum(val)),
5593 }
5594 }
5595}
5596
5597impl PageScanType {
5598
5599}
5600pub struct LinkKey_Value_ArrayView<S: emboss_runtime::Storage> {
5601 storage: S,
5602 element_count: usize,
5603}
5604
5605impl<S: emboss_runtime::Storage + core::clone::Clone> core::clone::Clone for LinkKey_Value_ArrayView<S> {
5606 fn clone(&self) -> Self {
5607 Self {
5608 storage: self.storage.clone(),
5609 element_count: self.element_count,
5610 }
5611 }
5612}
5613
5614impl<S: emboss_runtime::Storage> LinkKey_Value_ArrayView<S> {
5615 pub const ELEMENT_SIZE_BYTES: usize = 1;
5616 pub fn new(storage: S, element_count: usize) -> Self {
5617 Self { storage, element_count }
5618 }
5619 pub fn element_count(&self) -> usize {
5620 self.element_count
5621 }
5622 pub fn get(&self, index: usize) -> core::result::Result<emboss_runtime::UInt<8, emboss_runtime::LittleEndian, S::Sliced<'_>>
5623, emboss_runtime::Error> {
5624 if index >= self.element_count {
5625 return core::result::Result::Err(emboss_runtime::Error::OutOfBounds);
5626 }
5627 let offset = index * Self::ELEMENT_SIZE_BYTES;
5628 let storage = self.storage.slice(offset, Self::ELEMENT_SIZE_BYTES);
5629 core::result::Result::Ok(emboss_runtime::UInt::new(storage)
5630)
5631 }
5632}
5633
5634pub struct LinkKey_Value_ArrayViewMut<S: emboss_runtime::MutStorage> {
5635 storage: S,
5636 element_count: usize,
5637}
5638
5639impl<S: emboss_runtime::MutStorage> LinkKey_Value_ArrayViewMut<S> {
5640 pub const ELEMENT_SIZE_BYTES: usize = 1;
5641 pub fn new(storage: S, element_count: usize) -> Self {
5642 Self { storage, element_count }
5643 }
5644 pub fn element_count(&self) -> usize {
5645 self.element_count
5646 }
5647 pub fn get_mut(&mut self, index: usize) -> core::result::Result<emboss_runtime::UInt<8, emboss_runtime::LittleEndian, S::SlicedMut<'_>>
5648, emboss_runtime::Error> {
5649 if index >= self.element_count {
5650 return core::result::Result::Err(emboss_runtime::Error::OutOfBounds);
5651 }
5652 let offset = index * Self::ELEMENT_SIZE_BYTES;
5653 let storage = self.storage.slice_mut(offset, Self::ELEMENT_SIZE_BYTES);
5654 core::result::Result::Ok(emboss_runtime::UInt::new(storage)
5655)
5656 }
5657}
5658pub struct LinkKey<S: emboss_runtime::Storage, ST: emboss_runtime::State = emboss_runtime::UncheckedState> {
5659 storage: S,
5660 _marker: core::marker::PhantomData<ST>,
5661}
5662
5663impl<S: emboss_runtime::Storage> LinkKey<S, emboss_runtime::UncheckedState> {
5664 pub fn new(storage: S) -> Self {
5665 Self {
5666 storage,
5667 _marker: core::marker::PhantomData,
5668 }
5669 }
5670}
5671
5672impl<S: emboss_runtime::Storage + core::clone::Clone, ST: emboss_runtime::State> core::clone::Clone for LinkKey<S, ST> {
5673 fn clone(&self) -> Self {
5674 Self {
5675 storage: self.storage.clone(),
5676 _marker: core::marker::PhantomData,
5677 }
5678 }
5679}
5680
5681impl<S: emboss_runtime::Storage, ST: emboss_runtime::State> LinkKey<S, ST> {
5682 pub unsafe fn new_in_state(storage: S) -> Self {
5690 Self {
5691 storage,
5692 _marker: core::marker::PhantomData,
5693 }
5694 }
5695 pub fn into_storage(self) -> S {
5696 self.storage
5697 }
5698 pub fn value(&self) -> core::result::Result<LinkKey_Value_ArrayView<S::Sliced<'_>>, emboss_runtime::Error> {
5699 let offset_res = (|| -> core::result::Result<(usize, usize, usize), emboss_runtime::Error> {
5700 let offset = (0) as usize;
5701 let len = (16) as usize;
5702 let element_count = (len / (1)) as usize;
5703 core::result::Result::Ok((offset, len, element_count))
5704 })();
5705 match offset_res {
5706 core::result::Result::Ok((offset, len, element_count)) => {
5707 if len > 0 {
5708 let end = offset.checked_add(len).ok_or(emboss_runtime::Error::OutOfBounds)?;
5709 self.storage.try_read_byte(end - 1)?;
5710 }
5711 let storage = self.storage.slice(offset, len);
5712 core::result::Result::Ok(LinkKey_Value_ArrayView::new(storage, element_count))
5713 },
5714 core::result::Result::Err(e) => core::result::Result::Err(e),
5715 }
5716 }
5717
5718}
5719
5720pub struct LinkKeyMut<S: emboss_runtime::MutStorage> {
5721 storage: S,
5722}
5723
5724impl<S: emboss_runtime::MutStorage> LinkKeyMut<S> {
5725 pub fn new(storage: S) -> Self {
5726 Self {
5727 storage,
5728 }
5729 }
5730 pub fn into_writer(self) -> LinkKeyWriter<S, emboss_runtime::UncheckedState> {
5731 LinkKeyWriter::new(self.storage)
5732 }
5733 pub fn as_view(&self) -> LinkKey<S::Sliced<'_>, emboss_runtime::UncheckedState> {
5735 unsafe { LinkKey::new_in_state(self.storage.slice(0, self.storage.len())) }
5736 }
5737 pub fn value_mut(&mut self) -> core::result::Result<LinkKey_Value_ArrayViewMut<S::SlicedMut<'_>>, emboss_runtime::Error> {
5738 let offset_res = (|| -> core::result::Result<(usize, usize, usize), emboss_runtime::Error> {
5739 let offset = (0) as usize;
5740 let len = (16) as usize;
5741 let element_count = (len / (1)) as usize;
5742 core::result::Result::Ok((offset, len, element_count))
5743 })();
5744 match offset_res {
5745 core::result::Result::Ok((offset, len, element_count)) => {
5746 if len > 0 {
5747 let end = offset.checked_add(len).ok_or(emboss_runtime::Error::OutOfBounds)?;
5748 self.storage.try_read_byte(end - 1)?;
5749 }
5750 let storage = self.storage.slice_mut(offset, len);
5751 core::result::Result::Ok(LinkKey_Value_ArrayViewMut::new(storage, element_count))
5752 },
5753 core::result::Result::Err(e) => core::result::Result::Err(e),
5754 }
5755 }
5756
5757}
5758
5759impl<S: emboss_runtime::MutStorage> emboss_runtime::IntoWriter for LinkKeyMut<S> {
5760 type Writer = LinkKeyWriter<S, emboss_runtime::UncheckedState>;
5761 fn into_writer(self) -> Self::Writer {
5762 LinkKeyWriter::new(self.storage)
5763 }
5764}
5765
5766pub struct LinkKeyWriter<S: emboss_runtime::MutStorage, ST: emboss_runtime::State = emboss_runtime::UncheckedState> {
5767 storage: S,
5768 _marker: core::marker::PhantomData<ST>,
5769}
5770
5771impl<S: emboss_runtime::MutStorage> LinkKeyWriter<S, emboss_runtime::UncheckedState> {
5772 pub fn new(storage: S) -> Self {
5773 Self {
5774 storage,
5775 _marker: core::marker::PhantomData,
5776 }
5777 }
5778}
5779
5780impl<S: emboss_runtime::MutStorage, ST: emboss_runtime::State> LinkKeyWriter<S, ST> {
5781 pub unsafe fn new_in_state(storage: S) -> Self {
5789 Self {
5790 storage,
5791 _marker: core::marker::PhantomData,
5792 }
5793 }
5794 pub fn into_storage(self) -> S {
5795 self.storage
5796 }
5797 pub fn into_view(self) -> LinkKey<S, ST> {
5799 unsafe { LinkKey::new_in_state(self.storage) }
5800 }
5801 pub fn as_view(&self) -> LinkKey<S::Sliced<'_>, ST> {
5803 unsafe { LinkKey::new_in_state(self.storage.slice(0, self.storage.len())) }
5804 }
5805
5806}
5807
5808impl<S: emboss_runtime::Storage, ST: emboss_runtime::State> emboss_runtime::View for LinkKey<S, ST> {
5809 fn size_in_bytes(&self) -> core::result::Result<usize, emboss_runtime::Error> {
5810 let view = self;
5811 core::result::Result::Ok((16) as usize)
5812 }
5813}
5814
5815impl<S: emboss_runtime::MutStorage> emboss_runtime::View for LinkKeyMut<S> {
5816 fn size_in_bytes(&self) -> core::result::Result<usize, emboss_runtime::Error> {
5817 let view = self.as_view();
5818 <LinkKey<S::Sliced<'_>, emboss_runtime::UncheckedState> as emboss_runtime::View>::size_in_bytes(&view)
5819 }
5820}
5821
5822impl<S: emboss_runtime::MutStorage, ST: emboss_runtime::State> emboss_runtime::View for LinkKeyWriter<S, ST> {
5823 fn size_in_bytes(&self) -> core::result::Result<usize, emboss_runtime::Error> {
5824 let view = self.as_view();
5825 <LinkKey<S::Sliced<'_>, ST> as emboss_runtime::View>::size_in_bytes(&view)
5826 }
5827}
5828
5829impl<S: emboss_runtime::Storage> emboss_runtime::CheckComplete for LinkKey<S, emboss_runtime::UncheckedState> {
5830 type Completed = LinkKey<S, emboss_runtime::CompleteState>;
5831 fn check_complete(self) -> core::result::Result<Self::Completed, emboss_runtime::Error> {
5832 let required_size = <Self as emboss_runtime::View>::size_in_bytes(&self)?;
5833 if self.storage.len() < required_size {
5834 return core::result::Result::Err(emboss_runtime::Error::OutOfBounds);
5835 }
5836 core::result::Result::Ok(unsafe { LinkKey::new_in_state(self.storage) })
5837 }
5838}
5839
5840impl<S: emboss_runtime::MutStorage> emboss_runtime::CheckComplete for LinkKeyWriter<S, emboss_runtime::UncheckedState> {
5841 type Completed = LinkKeyWriter<S, emboss_runtime::CompleteState>;
5842 fn check_complete(self) -> core::result::Result<Self::Completed, emboss_runtime::Error> {
5843 let required_size = <Self as emboss_runtime::View>::size_in_bytes(&self)?;
5844 if self.storage.len() < required_size {
5845 return core::result::Result::Err(emboss_runtime::Error::OutOfBounds);
5846 }
5847 core::result::Result::Ok(unsafe { LinkKeyWriter::new_in_state(self.storage) })
5848 }
5849}
5850
5851impl<S: emboss_runtime::Storage> emboss_runtime::CheckOk for LinkKey<S, emboss_runtime::UncheckedState> {
5852 type Ok = LinkKey<S, emboss_runtime::OkState>;
5853 fn check_ok(self) -> core::result::Result<Self::Ok, emboss_runtime::Error> {
5854 let completed = emboss_runtime::CheckComplete::check_complete(self)?;
5855 core::result::Result::Ok(unsafe { LinkKey::new_in_state(completed.into_storage()) })
5856 }
5857}
5858
5859impl<S: emboss_runtime::Storage> emboss_runtime::CheckOk for LinkKey<S, emboss_runtime::CompleteState> {
5860 type Ok = LinkKey<S, emboss_runtime::OkState>;
5861 fn check_ok(self) -> core::result::Result<Self::Ok, emboss_runtime::Error> {
5862 core::result::Result::Ok(unsafe { LinkKey::new_in_state(self.into_storage()) })
5863 }
5864}
5865
5866impl<S: emboss_runtime::Storage> emboss_runtime::CheckOk for LinkKey<S, emboss_runtime::OkState> {
5867 type Ok = LinkKey<S, emboss_runtime::OkState>;
5868 fn check_ok(self) -> core::result::Result<Self::Ok, emboss_runtime::Error> {
5869 core::result::Result::Ok(self)
5870 }
5871}
5872
5873impl<S: emboss_runtime::MutStorage> emboss_runtime::CheckOk for LinkKeyWriter<S, emboss_runtime::UncheckedState> {
5874 type Ok = LinkKeyWriter<S, emboss_runtime::OkState>;
5875 fn check_ok(self) -> core::result::Result<Self::Ok, emboss_runtime::Error> {
5876 let completed = emboss_runtime::CheckComplete::check_complete(self)?;
5877 core::result::Result::Ok(unsafe { LinkKeyWriter::new_in_state(completed.into_storage()) })
5878 }
5879}
5880
5881impl<S: emboss_runtime::MutStorage> emboss_runtime::CheckOk for LinkKeyWriter<S, emboss_runtime::CompleteState> {
5882 type Ok = LinkKeyWriter<S, emboss_runtime::OkState>;
5883 fn check_ok(self) -> core::result::Result<Self::Ok, emboss_runtime::Error> {
5884 core::result::Result::Ok(unsafe { LinkKeyWriter::new_in_state(self.into_storage()) })
5885 }
5886}
5887
5888impl<S: emboss_runtime::MutStorage> emboss_runtime::CheckOk for LinkKeyWriter<S, emboss_runtime::OkState> {
5889 type Ok = LinkKeyWriter<S, emboss_runtime::OkState>;
5890 fn check_ok(self) -> core::result::Result<Self::Ok, emboss_runtime::Error> {
5891 core::result::Result::Ok(self)
5892 }
5893}
5894
5895pub mod link_key {
5896 pub type View<S, ST = emboss_runtime::UncheckedState> = super::LinkKey<S, ST>;
5897 pub type ViewMut<S> = super::LinkKeyMut<S>;
5898 pub type Writer<S, ST = emboss_runtime::UncheckedState> = super::LinkKeyWriter<S, ST>;
5899
5900 pub const MIN_SIZE_IN_BYTES: usize = 16;
5901 pub const MAX_SIZE_IN_BYTES: usize = 16;
5902 pub const SIZE_IN_BYTES: usize = 16;
5903}pub struct OpCodeBits<S: emboss_runtime::Storage, ST: emboss_runtime::State = emboss_runtime::UncheckedState> {
5904 storage: S,
5905 _marker: core::marker::PhantomData<ST>,
5906}
5907
5908impl<S: emboss_runtime::Storage> OpCodeBits<S, emboss_runtime::UncheckedState> {
5909 pub fn new(storage: S) -> Self {
5910 Self {
5911 storage,
5912 _marker: core::marker::PhantomData,
5913 }
5914 }
5915}
5916
5917impl<S: emboss_runtime::Storage + core::clone::Clone, ST: emboss_runtime::State> core::clone::Clone for OpCodeBits<S, ST> {
5918 fn clone(&self) -> Self {
5919 Self {
5920 storage: self.storage.clone(),
5921 _marker: core::marker::PhantomData,
5922 }
5923 }
5924}
5925
5926impl<S: emboss_runtime::Storage, ST: emboss_runtime::State> OpCodeBits<S, ST> {
5927 pub unsafe fn new_in_state(storage: S) -> Self {
5935 Self {
5936 storage,
5937 _marker: core::marker::PhantomData,
5938 }
5939 }
5940 pub fn into_storage(self) -> S {
5941 self.storage
5942 }
5943 pub fn ocf(&self) -> emboss_runtime::BitUInt<10, 0, emboss_runtime::Null, S::Sliced<'_>, ST> {
5944 let len = (2) as usize; let storage = self.storage.slice(0, len);
5946 emboss_runtime::BitUInt::<10, 0, emboss_runtime::Null, S::Sliced<'_>, ST>::new(storage)
5947 }
5948 pub fn ogf(&self) -> emboss_runtime::BitUInt<6, 10, emboss_runtime::Null, S::Sliced<'_>, ST> {
5949 let len = (2) as usize; let storage = self.storage.slice(0, len);
5951 emboss_runtime::BitUInt::<6, 10, emboss_runtime::Null, S::Sliced<'_>, ST>::new(storage)
5952 }
5953
5954}
5955
5956pub struct OpCodeBitsMut<S: emboss_runtime::MutStorage> {
5957 storage: S,
5958}
5959
5960impl<S: emboss_runtime::MutStorage> OpCodeBitsMut<S> {
5961 pub fn new(storage: S) -> Self {
5962 Self {
5963 storage,
5964 }
5965 }
5966 pub fn into_writer(self) -> OpCodeBitsWriter<S, emboss_runtime::UncheckedState> {
5967 OpCodeBitsWriter::new(self.storage)
5968 }
5969 pub fn as_view(&self) -> OpCodeBits<S::Sliced<'_>, emboss_runtime::UncheckedState> {
5971 unsafe { OpCodeBits::new_in_state(self.storage.slice(0, self.storage.len())) }
5972 }
5973 pub fn ocf(&mut self) -> emboss_runtime::BitUInt<10, 0, emboss_runtime::Null, S::SlicedMut<'_>, emboss_runtime::UncheckedState> {
5974 let len = (2) as usize;
5975 let storage = self.storage.slice_mut(0, len);
5976 emboss_runtime::BitUInt::<10, 0, emboss_runtime::Null, S::SlicedMut<'_>, emboss_runtime::UncheckedState>::new(storage)
5977 }
5978 pub fn ogf(&mut self) -> emboss_runtime::BitUInt<6, 10, 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::<6, 10, emboss_runtime::Null, S::SlicedMut<'_>, emboss_runtime::UncheckedState>::new(storage)
5982 }
5983
5984}
5985
5986impl<S: emboss_runtime::MutStorage> emboss_runtime::IntoWriter for OpCodeBitsMut<S> {
5987 type Writer = OpCodeBitsWriter<S, emboss_runtime::UncheckedState>;
5988 fn into_writer(self) -> Self::Writer {
5989 OpCodeBitsWriter::new(self.storage)
5990 }
5991}
5992
5993pub struct OpCodeBitsWriter<S: emboss_runtime::MutStorage, ST: emboss_runtime::State = emboss_runtime::UncheckedState> {
5994 storage: S,
5995 _marker: core::marker::PhantomData<ST>,
5996}
5997
5998impl<S: emboss_runtime::MutStorage> OpCodeBitsWriter<S, emboss_runtime::UncheckedState> {
5999 pub fn new(storage: S) -> Self {
6000 Self {
6001 storage,
6002 _marker: core::marker::PhantomData,
6003 }
6004 }
6005}
6006
6007impl<S: emboss_runtime::MutStorage, ST: emboss_runtime::State> OpCodeBitsWriter<S, ST> {
6008 pub unsafe fn new_in_state(storage: S) -> Self {
6016 Self {
6017 storage,
6018 _marker: core::marker::PhantomData,
6019 }
6020 }
6021 pub fn into_storage(self) -> S {
6022 self.storage
6023 }
6024 pub fn into_view(self) -> OpCodeBits<S, ST> {
6026 unsafe { OpCodeBits::new_in_state(self.storage) }
6027 }
6028 pub fn as_view(&self) -> OpCodeBits<S::Sliced<'_>, ST> {
6030 unsafe { OpCodeBits::new_in_state(self.storage.slice(0, self.storage.len())) }
6031 }
6032
6033}
6034
6035impl<S: emboss_runtime::Storage, ST: emboss_runtime::State> emboss_runtime::View for OpCodeBits<S, ST> {
6036 fn size_in_bytes(&self) -> core::result::Result<usize, emboss_runtime::Error> {
6037 let view = self;
6038 core::result::Result::Ok((((16) + 7) / 8) as usize)
6039 }
6040}
6041
6042impl<S: emboss_runtime::MutStorage> emboss_runtime::View for OpCodeBitsMut<S> {
6043 fn size_in_bytes(&self) -> core::result::Result<usize, emboss_runtime::Error> {
6044 let view = self.as_view();
6045 <OpCodeBits<S::Sliced<'_>, emboss_runtime::UncheckedState> as emboss_runtime::View>::size_in_bytes(&view)
6046 }
6047}
6048
6049impl<S: emboss_runtime::MutStorage, ST: emboss_runtime::State> emboss_runtime::View for OpCodeBitsWriter<S, ST> {
6050 fn size_in_bytes(&self) -> core::result::Result<usize, emboss_runtime::Error> {
6051 let view = self.as_view();
6052 <OpCodeBits<S::Sliced<'_>, ST> as emboss_runtime::View>::size_in_bytes(&view)
6053 }
6054}
6055
6056impl<S: emboss_runtime::Storage> emboss_runtime::CheckComplete for OpCodeBits<S, emboss_runtime::UncheckedState> {
6057 type Completed = OpCodeBits<S, emboss_runtime::CompleteState>;
6058 fn check_complete(self) -> core::result::Result<Self::Completed, emboss_runtime::Error> {
6059 let required_size = <Self as emboss_runtime::View>::size_in_bytes(&self)?;
6060 if self.storage.len() < required_size {
6061 return core::result::Result::Err(emboss_runtime::Error::OutOfBounds);
6062 }
6063 core::result::Result::Ok(unsafe { OpCodeBits::new_in_state(self.storage) })
6064 }
6065}
6066
6067impl<S: emboss_runtime::MutStorage> emboss_runtime::CheckComplete for OpCodeBitsWriter<S, emboss_runtime::UncheckedState> {
6068 type Completed = OpCodeBitsWriter<S, emboss_runtime::CompleteState>;
6069 fn check_complete(self) -> core::result::Result<Self::Completed, emboss_runtime::Error> {
6070 let required_size = <Self as emboss_runtime::View>::size_in_bytes(&self)?;
6071 if self.storage.len() < required_size {
6072 return core::result::Result::Err(emboss_runtime::Error::OutOfBounds);
6073 }
6074 core::result::Result::Ok(unsafe { OpCodeBitsWriter::new_in_state(self.storage) })
6075 }
6076}
6077
6078impl<S: emboss_runtime::Storage> emboss_runtime::CheckOk for OpCodeBits<S, emboss_runtime::UncheckedState> {
6079 type Ok = OpCodeBits<S, emboss_runtime::OkState>;
6080 fn check_ok(self) -> core::result::Result<Self::Ok, emboss_runtime::Error> {
6081 let completed = emboss_runtime::CheckComplete::check_complete(self)?;
6082 core::result::Result::Ok(unsafe { OpCodeBits::new_in_state(completed.into_storage()) })
6083 }
6084}
6085
6086impl<S: emboss_runtime::Storage> emboss_runtime::CheckOk for OpCodeBits<S, emboss_runtime::CompleteState> {
6087 type Ok = OpCodeBits<S, emboss_runtime::OkState>;
6088 fn check_ok(self) -> core::result::Result<Self::Ok, emboss_runtime::Error> {
6089 core::result::Result::Ok(unsafe { OpCodeBits::new_in_state(self.into_storage()) })
6090 }
6091}
6092
6093impl<S: emboss_runtime::Storage> emboss_runtime::CheckOk for OpCodeBits<S, emboss_runtime::OkState> {
6094 type Ok = OpCodeBits<S, emboss_runtime::OkState>;
6095 fn check_ok(self) -> core::result::Result<Self::Ok, emboss_runtime::Error> {
6096 core::result::Result::Ok(self)
6097 }
6098}
6099
6100impl<S: emboss_runtime::MutStorage> emboss_runtime::CheckOk for OpCodeBitsWriter<S, emboss_runtime::UncheckedState> {
6101 type Ok = OpCodeBitsWriter<S, emboss_runtime::OkState>;
6102 fn check_ok(self) -> core::result::Result<Self::Ok, emboss_runtime::Error> {
6103 let completed = emboss_runtime::CheckComplete::check_complete(self)?;
6104 core::result::Result::Ok(unsafe { OpCodeBitsWriter::new_in_state(completed.into_storage()) })
6105 }
6106}
6107
6108impl<S: emboss_runtime::MutStorage> emboss_runtime::CheckOk for OpCodeBitsWriter<S, emboss_runtime::CompleteState> {
6109 type Ok = OpCodeBitsWriter<S, emboss_runtime::OkState>;
6110 fn check_ok(self) -> core::result::Result<Self::Ok, emboss_runtime::Error> {
6111 core::result::Result::Ok(unsafe { OpCodeBitsWriter::new_in_state(self.into_storage()) })
6112 }
6113}
6114
6115impl<S: emboss_runtime::MutStorage> emboss_runtime::CheckOk for OpCodeBitsWriter<S, emboss_runtime::OkState> {
6116 type Ok = OpCodeBitsWriter<S, emboss_runtime::OkState>;
6117 fn check_ok(self) -> core::result::Result<Self::Ok, emboss_runtime::Error> {
6118 core::result::Result::Ok(self)
6119 }
6120}
6121
6122pub mod op_code_bits {
6123 pub type View<S, ST = emboss_runtime::UncheckedState> = super::OpCodeBits<S, ST>;
6124 pub type ViewMut<S> = super::OpCodeBitsMut<S>;
6125 pub type Writer<S, ST = emboss_runtime::UncheckedState> = super::OpCodeBitsWriter<S, ST>;
6126
6127 pub const MIN_SIZE_IN_BYTES: usize = 2;
6128 pub const MAX_SIZE_IN_BYTES: usize = 2;
6129 pub const SIZE_IN_BYTES: usize = 2;
6130}pub struct CommandHeader<S: emboss_runtime::Storage, ST: emboss_runtime::State = emboss_runtime::UncheckedState> {
6131 storage: S,
6132 _marker: core::marker::PhantomData<ST>,
6133}
6134
6135impl<S: emboss_runtime::Storage> CommandHeader<S, emboss_runtime::UncheckedState> {
6136 pub fn new(storage: S) -> Self {
6137 Self {
6138 storage,
6139 _marker: core::marker::PhantomData,
6140 }
6141 }
6142}
6143
6144impl<S: emboss_runtime::Storage + core::clone::Clone, ST: emboss_runtime::State> core::clone::Clone for CommandHeader<S, ST> {
6145 fn clone(&self) -> Self {
6146 Self {
6147 storage: self.storage.clone(),
6148 _marker: core::marker::PhantomData,
6149 }
6150 }
6151}
6152
6153impl<S: emboss_runtime::Storage, ST: emboss_runtime::State> CommandHeader<S, ST> {
6154 pub unsafe fn new_in_state(storage: S) -> Self {
6162 Self {
6163 storage,
6164 _marker: core::marker::PhantomData,
6165 }
6166 }
6167 pub fn into_storage(self) -> S {
6168 self.storage
6169 }
6170 pub fn opcode(&self) -> emboss_runtime::EnumView<OpCode, emboss_runtime::UInt<16, emboss_runtime::LittleEndian, S::Sliced<'_>, ST>> {
6171 let (offset, len) = (|| -> core::result::Result<(usize, usize), emboss_runtime::Error> {
6172 let offset = (0) as usize;
6173 let len = (2) as usize;
6174 core::result::Result::Ok((offset, len))
6175 })().unwrap_or((usize::MAX, 0));
6176 let storage = self.storage.slice(offset, len);
6177 emboss_runtime::EnumView::new(emboss_runtime::UInt::new(storage))
6178 }
6179 pub fn opcode_bits(&self) -> OpCodeBits<S::Sliced<'_>, emboss_runtime::UncheckedState> {
6180 let (offset, len) = (|| -> core::result::Result<(usize, usize), emboss_runtime::Error> {
6181 let offset = (0) as usize;
6182 let len = (2) as usize;
6183 core::result::Result::Ok((offset, len))
6184 })().unwrap_or((usize::MAX, 0));
6185 let storage = self.storage.slice(offset, len);
6186 unsafe { OpCodeBits::<S::Sliced<'_>, emboss_runtime::UncheckedState>::new_in_state(storage) }
6187 }
6188 pub fn parameter_total_size(&self) -> UInt<8, emboss_runtime::LittleEndian, S::Sliced<'_>, ST> {
6189 let (offset, len) = (|| -> core::result::Result<(usize, usize), emboss_runtime::Error> {
6190 let offset = (2) as usize;
6191 let len = (1) as usize;
6192 core::result::Result::Ok((offset, len))
6193 })().unwrap_or((usize::MAX, 0));
6194 let storage = self.storage.slice(offset, len);
6195 UInt::<8, emboss_runtime::LittleEndian, S::Sliced<'_>, ST>::new(storage)
6196 }
6197
6198}
6199
6200pub struct CommandHeaderMut<S: emboss_runtime::MutStorage> {
6201 storage: S,
6202}
6203
6204impl<S: emboss_runtime::MutStorage> CommandHeaderMut<S> {
6205 pub fn new(storage: S) -> Self {
6206 Self {
6207 storage,
6208 }
6209 }
6210 pub fn into_writer(self) -> CommandHeaderWriter<S, emboss_runtime::UncheckedState> {
6211 CommandHeaderWriter::new(self.storage)
6212 }
6213 pub fn as_view(&self) -> CommandHeader<S::Sliced<'_>, emboss_runtime::UncheckedState> {
6215 unsafe { CommandHeader::new_in_state(self.storage.slice(0, self.storage.len())) }
6216 }
6217 pub fn opcode(&mut self) -> emboss_runtime::EnumViewMut<OpCode, emboss_runtime::UInt<16, emboss_runtime::LittleEndian, S::SlicedMut<'_>, emboss_runtime::UncheckedState>> {
6218 let (offset, len) = (|| -> core::result::Result<(usize, usize), emboss_runtime::Error> {
6219 let offset = (0) as usize;
6220 let len = (2) as usize;
6221 core::result::Result::Ok((offset, len))
6222 })().unwrap_or((usize::MAX, 0));
6223 let storage = self.storage.slice_mut(offset, len);
6224 emboss_runtime::EnumViewMut::new(emboss_runtime::UInt::new(storage))
6225 }
6226 pub fn opcode_bits(&mut self) -> OpCodeBitsMut<S::SlicedMut<'_>> {
6227 let (offset, len) = (|| -> core::result::Result<(usize, usize), emboss_runtime::Error> {
6228 let offset = (0) as usize;
6229 let len = (2) as usize;
6230 core::result::Result::Ok((offset, len))
6231 })().unwrap_or((usize::MAX, 0));
6232 let storage = self.storage.slice_mut(offset, len);
6233 OpCodeBitsMut::<S::SlicedMut<'_>>::new(storage)
6234 }
6235 pub fn parameter_total_size(&mut self) -> UInt<8, emboss_runtime::LittleEndian, S::SlicedMut<'_>, emboss_runtime::UncheckedState> {
6236 let (offset, len) = (|| -> core::result::Result<(usize, usize), emboss_runtime::Error> {
6237 let offset = (2) as usize;
6238 let len = (1) as usize;
6239 core::result::Result::Ok((offset, len))
6240 })().unwrap_or((usize::MAX, 0));
6241 let storage = self.storage.slice_mut(offset, len);
6242 UInt::<8, emboss_runtime::LittleEndian, S::SlicedMut<'_>, emboss_runtime::UncheckedState>::new(storage)
6243 }
6244
6245}
6246
6247impl<S: emboss_runtime::MutStorage> emboss_runtime::IntoWriter for CommandHeaderMut<S> {
6248 type Writer = CommandHeaderWriter<S, emboss_runtime::UncheckedState>;
6249 fn into_writer(self) -> Self::Writer {
6250 CommandHeaderWriter::new(self.storage)
6251 }
6252}
6253
6254pub struct CommandHeaderWriter<S: emboss_runtime::MutStorage, ST: emboss_runtime::State = emboss_runtime::UncheckedState> {
6255 storage: S,
6256 _marker: core::marker::PhantomData<ST>,
6257}
6258
6259impl<S: emboss_runtime::MutStorage> CommandHeaderWriter<S, emboss_runtime::UncheckedState> {
6260 pub fn new(storage: S) -> Self {
6261 Self {
6262 storage,
6263 _marker: core::marker::PhantomData,
6264 }
6265 }
6266}
6267
6268impl<S: emboss_runtime::MutStorage, ST: emboss_runtime::State> CommandHeaderWriter<S, ST> {
6269 pub unsafe fn new_in_state(storage: S) -> Self {
6277 Self {
6278 storage,
6279 _marker: core::marker::PhantomData,
6280 }
6281 }
6282 pub fn into_storage(self) -> S {
6283 self.storage
6284 }
6285 pub fn into_view(self) -> CommandHeader<S, ST> {
6287 unsafe { CommandHeader::new_in_state(self.storage) }
6288 }
6289 pub fn as_view(&self) -> CommandHeader<S::Sliced<'_>, ST> {
6291 unsafe { CommandHeader::new_in_state(self.storage.slice(0, self.storage.len())) }
6292 }
6293 pub fn write_opcode(self, val: OpCode) -> CommandHeaderWriter<S, ST::OnValidMutation> {
6294 let view = self.into_view();
6295 let (offset, len) = (|| -> core::result::Result<(usize, usize), emboss_runtime::Error> {
6296 let offset = (0) as usize;
6297 let len = (2) as usize;
6298 core::result::Result::Ok((offset, len))
6299 })().expect("valid layout in complete state");
6300 let mut storage = view.into_storage();
6301 {
6302 let slice = storage.slice_mut(offset, len);
6303 let mut field_view = emboss_runtime::EnumViewMut::<OpCode, emboss_runtime::UInt<16, emboss_runtime::LittleEndian, _>>::new(emboss_runtime::UInt::new(slice));
6304 field_view.try_write(val).expect("valid write in complete state");
6305 }
6306 unsafe { CommandHeaderWriter::new_in_state(storage) }
6307 }
6308 pub fn write_parameter_total_size(self, val: <emboss_runtime::SizeSelector<8> as emboss_runtime::SmallestUInt>::T) -> CommandHeaderWriter<S, ST::OnLayoutMutation> {
6309 let view = self.into_view();
6310 let (offset, len) = (|| -> core::result::Result<(usize, usize), emboss_runtime::Error> {
6311 let offset = (2) as usize;
6312 let len = (1) as usize;
6313 core::result::Result::Ok((offset, len))
6314 })().expect("valid layout in complete state");
6315 let mut storage = view.into_storage();
6316 {
6317 let slice = storage.slice_mut(offset, len);
6318 let mut field_view = emboss_runtime::UInt::<8, emboss_runtime::LittleEndian, _>::new(slice);
6319 field_view.try_write(val).expect("valid write in complete state");
6320 }
6321 unsafe { CommandHeaderWriter::new_in_state(storage) }
6322 }
6323
6324}
6325
6326impl<S: emboss_runtime::Storage, ST: emboss_runtime::State> emboss_runtime::View for CommandHeader<S, ST> {
6327 fn size_in_bytes(&self) -> core::result::Result<usize, emboss_runtime::Error> {
6328 let view = self;
6329 core::result::Result::Ok((3) as usize)
6330 }
6331}
6332
6333impl<S: emboss_runtime::MutStorage> emboss_runtime::View for CommandHeaderMut<S> {
6334 fn size_in_bytes(&self) -> core::result::Result<usize, emboss_runtime::Error> {
6335 let view = self.as_view();
6336 <CommandHeader<S::Sliced<'_>, emboss_runtime::UncheckedState> as emboss_runtime::View>::size_in_bytes(&view)
6337 }
6338}
6339
6340impl<S: emboss_runtime::MutStorage, ST: emboss_runtime::State> emboss_runtime::View for CommandHeaderWriter<S, ST> {
6341 fn size_in_bytes(&self) -> core::result::Result<usize, emboss_runtime::Error> {
6342 let view = self.as_view();
6343 <CommandHeader<S::Sliced<'_>, ST> as emboss_runtime::View>::size_in_bytes(&view)
6344 }
6345}
6346
6347impl<S: emboss_runtime::Storage> emboss_runtime::CheckComplete for CommandHeader<S, emboss_runtime::UncheckedState> {
6348 type Completed = CommandHeader<S, emboss_runtime::CompleteState>;
6349 fn check_complete(self) -> core::result::Result<Self::Completed, emboss_runtime::Error> {
6350 let required_size = <Self as emboss_runtime::View>::size_in_bytes(&self)?;
6351 if self.storage.len() < required_size {
6352 return core::result::Result::Err(emboss_runtime::Error::OutOfBounds);
6353 }
6354 core::result::Result::Ok(unsafe { CommandHeader::new_in_state(self.storage) })
6355 }
6356}
6357
6358impl<S: emboss_runtime::MutStorage> emboss_runtime::CheckComplete for CommandHeaderWriter<S, emboss_runtime::UncheckedState> {
6359 type Completed = CommandHeaderWriter<S, emboss_runtime::CompleteState>;
6360 fn check_complete(self) -> core::result::Result<Self::Completed, emboss_runtime::Error> {
6361 let required_size = <Self as emboss_runtime::View>::size_in_bytes(&self)?;
6362 if self.storage.len() < required_size {
6363 return core::result::Result::Err(emboss_runtime::Error::OutOfBounds);
6364 }
6365 core::result::Result::Ok(unsafe { CommandHeaderWriter::new_in_state(self.storage) })
6366 }
6367}
6368
6369impl<S: emboss_runtime::Storage> emboss_runtime::CheckOk for CommandHeader<S, emboss_runtime::UncheckedState> {
6370 type Ok = CommandHeader<S, emboss_runtime::OkState>;
6371 fn check_ok(self) -> core::result::Result<Self::Ok, emboss_runtime::Error> {
6372 let completed = emboss_runtime::CheckComplete::check_complete(self)?;
6373 core::result::Result::Ok(unsafe { CommandHeader::new_in_state(completed.into_storage()) })
6374 }
6375}
6376
6377impl<S: emboss_runtime::Storage> emboss_runtime::CheckOk for CommandHeader<S, emboss_runtime::CompleteState> {
6378 type Ok = CommandHeader<S, emboss_runtime::OkState>;
6379 fn check_ok(self) -> core::result::Result<Self::Ok, emboss_runtime::Error> {
6380 core::result::Result::Ok(unsafe { CommandHeader::new_in_state(self.into_storage()) })
6381 }
6382}
6383
6384impl<S: emboss_runtime::Storage> emboss_runtime::CheckOk for CommandHeader<S, emboss_runtime::OkState> {
6385 type Ok = CommandHeader<S, emboss_runtime::OkState>;
6386 fn check_ok(self) -> core::result::Result<Self::Ok, emboss_runtime::Error> {
6387 core::result::Result::Ok(self)
6388 }
6389}
6390
6391impl<S: emboss_runtime::MutStorage> emboss_runtime::CheckOk for CommandHeaderWriter<S, emboss_runtime::UncheckedState> {
6392 type Ok = CommandHeaderWriter<S, emboss_runtime::OkState>;
6393 fn check_ok(self) -> core::result::Result<Self::Ok, emboss_runtime::Error> {
6394 let completed = emboss_runtime::CheckComplete::check_complete(self)?;
6395 core::result::Result::Ok(unsafe { CommandHeaderWriter::new_in_state(completed.into_storage()) })
6396 }
6397}
6398
6399impl<S: emboss_runtime::MutStorage> emboss_runtime::CheckOk for CommandHeaderWriter<S, emboss_runtime::CompleteState> {
6400 type Ok = CommandHeaderWriter<S, emboss_runtime::OkState>;
6401 fn check_ok(self) -> core::result::Result<Self::Ok, emboss_runtime::Error> {
6402 core::result::Result::Ok(unsafe { CommandHeaderWriter::new_in_state(self.into_storage()) })
6403 }
6404}
6405
6406impl<S: emboss_runtime::MutStorage> emboss_runtime::CheckOk for CommandHeaderWriter<S, emboss_runtime::OkState> {
6407 type Ok = CommandHeaderWriter<S, emboss_runtime::OkState>;
6408 fn check_ok(self) -> core::result::Result<Self::Ok, emboss_runtime::Error> {
6409 core::result::Result::Ok(self)
6410 }
6411}
6412
6413pub mod command_header {
6414 pub type View<S, ST = emboss_runtime::UncheckedState> = super::CommandHeader<S, ST>;
6415 pub type ViewMut<S> = super::CommandHeaderMut<S>;
6416 pub type Writer<S, ST = emboss_runtime::UncheckedState> = super::CommandHeaderWriter<S, ST>;
6417
6418 pub const MIN_SIZE_IN_BYTES: usize = 3;
6419 pub const MAX_SIZE_IN_BYTES: usize = 3;
6420 pub const SIZE_IN_BYTES: usize = 3;
6421}pub struct CommandPacket_Payload_ArrayView<S: emboss_runtime::Storage> {
6422 storage: S,
6423 element_count: usize,
6424}
6425
6426impl<S: emboss_runtime::Storage + core::clone::Clone> core::clone::Clone for CommandPacket_Payload_ArrayView<S> {
6427 fn clone(&self) -> Self {
6428 Self {
6429 storage: self.storage.clone(),
6430 element_count: self.element_count,
6431 }
6432 }
6433}
6434
6435impl<S: emboss_runtime::Storage> CommandPacket_Payload_ArrayView<S> {
6436 pub const ELEMENT_SIZE_BYTES: usize = 1;
6437 pub fn new(storage: S, element_count: usize) -> Self {
6438 Self { storage, element_count }
6439 }
6440 pub fn element_count(&self) -> usize {
6441 self.element_count
6442 }
6443 pub fn get(&self, index: usize) -> core::result::Result<emboss_runtime::UInt<8, emboss_runtime::LittleEndian, S::Sliced<'_>>
6444, emboss_runtime::Error> {
6445 if index >= self.element_count {
6446 return core::result::Result::Err(emboss_runtime::Error::OutOfBounds);
6447 }
6448 let offset = index * Self::ELEMENT_SIZE_BYTES;
6449 let storage = self.storage.slice(offset, Self::ELEMENT_SIZE_BYTES);
6450 core::result::Result::Ok(emboss_runtime::UInt::new(storage)
6451)
6452 }
6453}
6454
6455pub struct CommandPacket_Payload_ArrayViewMut<S: emboss_runtime::MutStorage> {
6456 storage: S,
6457 element_count: usize,
6458}
6459
6460impl<S: emboss_runtime::MutStorage> CommandPacket_Payload_ArrayViewMut<S> {
6461 pub const ELEMENT_SIZE_BYTES: usize = 1;
6462 pub fn new(storage: S, element_count: usize) -> Self {
6463 Self { storage, element_count }
6464 }
6465 pub fn element_count(&self) -> usize {
6466 self.element_count
6467 }
6468 pub fn get_mut(&mut self, index: usize) -> core::result::Result<emboss_runtime::UInt<8, emboss_runtime::LittleEndian, S::SlicedMut<'_>>
6469, emboss_runtime::Error> {
6470 if index >= self.element_count {
6471 return core::result::Result::Err(emboss_runtime::Error::OutOfBounds);
6472 }
6473 let offset = index * Self::ELEMENT_SIZE_BYTES;
6474 let storage = self.storage.slice_mut(offset, Self::ELEMENT_SIZE_BYTES);
6475 core::result::Result::Ok(emboss_runtime::UInt::new(storage)
6476)
6477 }
6478}
6479pub struct CommandPacket<S: emboss_runtime::Storage, ST: emboss_runtime::State = emboss_runtime::UncheckedState> {
6480 storage: S,
6481 _marker: core::marker::PhantomData<ST>,
6482}
6483
6484impl<S: emboss_runtime::Storage> CommandPacket<S, emboss_runtime::UncheckedState> {
6485 pub fn new(storage: S) -> Self {
6486 Self {
6487 storage,
6488 _marker: core::marker::PhantomData,
6489 }
6490 }
6491}
6492
6493impl<S: emboss_runtime::Storage + core::clone::Clone, ST: emboss_runtime::State> core::clone::Clone for CommandPacket<S, ST> {
6494 fn clone(&self) -> Self {
6495 Self {
6496 storage: self.storage.clone(),
6497 _marker: core::marker::PhantomData,
6498 }
6499 }
6500}
6501
6502impl<S: emboss_runtime::Storage, ST: emboss_runtime::State> CommandPacket<S, ST> {
6503 pub unsafe fn new_in_state(storage: S) -> Self {
6511 Self {
6512 storage,
6513 _marker: core::marker::PhantomData,
6514 }
6515 }
6516 pub fn into_storage(self) -> S {
6517 self.storage
6518 }
6519 pub fn hdr_size(&self) -> emboss_runtime::VirtualField<u64> {
6520 let value = (|| -> core::result::Result<u64, emboss_runtime::Error> {
6521 core::result::Result::Ok( (3) as u64 )
6522 })();
6523 emboss_runtime::VirtualField::new(value)
6524 }
6525 pub fn header(&self) -> CommandHeader<S::Sliced<'_>, emboss_runtime::UncheckedState> {
6526 let (offset, len) = (|| -> core::result::Result<(usize, usize), emboss_runtime::Error> {
6527 let offset = (0) as usize;
6528 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 })
6529) as usize;
6530 core::result::Result::Ok((offset, len))
6531 })().unwrap_or((usize::MAX, 0));
6532 let storage = self.storage.slice(offset, len);
6533 unsafe { CommandHeader::<S::Sliced<'_>, emboss_runtime::UncheckedState>::new_in_state(storage) }
6534 }
6535 pub fn length(&self) -> emboss_runtime::VirtualField<u64> {
6536 let value = (|| -> core::result::Result<u64, emboss_runtime::Error> {
6537 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 })
6538) as u64 )
6539 })();
6540 emboss_runtime::VirtualField::new(value)
6541 }
6542 pub fn payload(&self) -> core::result::Result<CommandPacket_Payload_ArrayView<S::Sliced<'_>>, emboss_runtime::Error> {
6543 let offset_res = (|| -> core::result::Result<(usize, usize, usize), emboss_runtime::Error> {
6544 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 })
6545) as i64 )
6546) as usize;
6547 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 })
6548) as usize;
6549 let element_count = (len / (1)) as usize;
6550 core::result::Result::Ok((offset, len, element_count))
6551 })();
6552 match offset_res {
6553 core::result::Result::Ok((offset, len, element_count)) => {
6554 if len > 0 {
6555 let end = offset.checked_add(len).ok_or(emboss_runtime::Error::OutOfBounds)?;
6556 self.storage.try_read_byte(end - 1)?;
6557 }
6558 let storage = self.storage.slice(offset, len);
6559 core::result::Result::Ok(CommandPacket_Payload_ArrayView::new(storage, element_count))
6560 },
6561 core::result::Result::Err(e) => core::result::Result::Err(e),
6562 }
6563 }
6564
6565}
6566
6567pub struct CommandPacketMut<S: emboss_runtime::MutStorage> {
6568 storage: S,
6569}
6570
6571impl<S: emboss_runtime::MutStorage> CommandPacketMut<S> {
6572 pub fn new(storage: S) -> Self {
6573 Self {
6574 storage,
6575 }
6576 }
6577 pub fn into_writer(self) -> CommandPacketWriter<S, emboss_runtime::UncheckedState> {
6578 CommandPacketWriter::new(self.storage)
6579 }
6580 pub fn as_view(&self) -> CommandPacket<S::Sliced<'_>, emboss_runtime::UncheckedState> {
6582 unsafe { CommandPacket::new_in_state(self.storage.slice(0, self.storage.len())) }
6583 }
6584 pub fn hdr_size(&mut self) -> emboss_runtime::VirtualField<u64> {
6585 let value = (|| -> core::result::Result<u64, emboss_runtime::Error> {
6586 core::result::Result::Ok( (3) as u64 )
6587 })();
6588 emboss_runtime::VirtualField::new(value)
6589 }
6590 pub fn header(&mut self) -> CommandHeaderMut<S::SlicedMut<'_>> {
6591 let (offset, len) = (|| -> core::result::Result<(usize, usize), emboss_runtime::Error> {
6592 let offset = (0) as usize;
6593 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 })
6594) as usize;
6595 core::result::Result::Ok((offset, len))
6596 })().unwrap_or((usize::MAX, 0));
6597 let storage = self.storage.slice_mut(offset, len);
6598 CommandHeaderMut::<S::SlicedMut<'_>>::new(storage)
6599 }
6600 pub fn length(&mut self) -> emboss_runtime::VirtualField<u64> {
6601 let value = (|| -> core::result::Result<u64, emboss_runtime::Error> {
6602 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 })
6603) as u64 )
6604 })();
6605 emboss_runtime::VirtualField::new(value)
6606 }
6607 pub fn payload_mut(&mut self) -> core::result::Result<CommandPacket_Payload_ArrayViewMut<S::SlicedMut<'_>>, emboss_runtime::Error> {
6608 let offset_res = (|| -> core::result::Result<(usize, usize, usize), emboss_runtime::Error> {
6609 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 })
6610) as i64 )
6611) as usize;
6612 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 })
6613) as usize;
6614 let element_count = (len / (1)) as usize;
6615 core::result::Result::Ok((offset, len, element_count))
6616 })();
6617 match offset_res {
6618 core::result::Result::Ok((offset, len, element_count)) => {
6619 if len > 0 {
6620 let end = offset.checked_add(len).ok_or(emboss_runtime::Error::OutOfBounds)?;
6621 self.storage.try_read_byte(end - 1)?;
6622 }
6623 let storage = self.storage.slice_mut(offset, len);
6624 core::result::Result::Ok(CommandPacket_Payload_ArrayViewMut::new(storage, element_count))
6625 },
6626 core::result::Result::Err(e) => core::result::Result::Err(e),
6627 }
6628 }
6629
6630}
6631
6632impl<S: emboss_runtime::MutStorage> emboss_runtime::IntoWriter for CommandPacketMut<S> {
6633 type Writer = CommandPacketWriter<S, emboss_runtime::UncheckedState>;
6634 fn into_writer(self) -> Self::Writer {
6635 CommandPacketWriter::new(self.storage)
6636 }
6637}
6638
6639pub struct CommandPacketWriter<S: emboss_runtime::MutStorage, ST: emboss_runtime::State = emboss_runtime::UncheckedState> {
6640 storage: S,
6641 _marker: core::marker::PhantomData<ST>,
6642}
6643
6644impl<S: emboss_runtime::MutStorage> CommandPacketWriter<S, emboss_runtime::UncheckedState> {
6645 pub fn new(storage: S) -> Self {
6646 Self {
6647 storage,
6648 _marker: core::marker::PhantomData,
6649 }
6650 }
6651}
6652
6653impl<S: emboss_runtime::MutStorage, ST: emboss_runtime::State> CommandPacketWriter<S, ST> {
6654 pub unsafe fn new_in_state(storage: S) -> Self {
6662 Self {
6663 storage,
6664 _marker: core::marker::PhantomData,
6665 }
6666 }
6667 pub fn into_storage(self) -> S {
6668 self.storage
6669 }
6670 pub fn into_view(self) -> CommandPacket<S, ST> {
6672 unsafe { CommandPacket::new_in_state(self.storage) }
6673 }
6674 pub fn as_view(&self) -> CommandPacket<S::Sliced<'_>, ST> {
6676 unsafe { CommandPacket::new_in_state(self.storage.slice(0, self.storage.len())) }
6677 }
6678
6679}
6680
6681impl<S: emboss_runtime::Storage, ST: emboss_runtime::State> emboss_runtime::View for CommandPacket<S, ST> {
6682 fn size_in_bytes(&self) -> core::result::Result<usize, emboss_runtime::Error> {
6683 let view = self;
6684 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 })
6685) as i64 )
6686 } else { 0 })
6687
6688) as i64)
6689) 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) 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 })
6692) as i64 )
6693 } else { 0 })
6694
6695) as i64)
6696) as usize)
6697 }
6698}
6699
6700impl<S: emboss_runtime::MutStorage> emboss_runtime::View for CommandPacketMut<S> {
6701 fn size_in_bytes(&self) -> core::result::Result<usize, emboss_runtime::Error> {
6702 let view = self.as_view();
6703 <CommandPacket<S::Sliced<'_>, emboss_runtime::UncheckedState> as emboss_runtime::View>::size_in_bytes(&view)
6704 }
6705}
6706
6707impl<S: emboss_runtime::MutStorage, ST: emboss_runtime::State> emboss_runtime::View for CommandPacketWriter<S, ST> {
6708 fn size_in_bytes(&self) -> core::result::Result<usize, emboss_runtime::Error> {
6709 let view = self.as_view();
6710 <CommandPacket<S::Sliced<'_>, ST> as emboss_runtime::View>::size_in_bytes(&view)
6711 }
6712}
6713
6714impl<S: emboss_runtime::Storage> emboss_runtime::CheckComplete for CommandPacket<S, emboss_runtime::UncheckedState> {
6715 type Completed = CommandPacket<S, emboss_runtime::CompleteState>;
6716 fn check_complete(self) -> core::result::Result<Self::Completed, emboss_runtime::Error> {
6717 let required_size = <Self as emboss_runtime::View>::size_in_bytes(&self)?;
6718 if self.storage.len() < required_size {
6719 return core::result::Result::Err(emboss_runtime::Error::OutOfBounds);
6720 }
6721 core::result::Result::Ok(unsafe { CommandPacket::new_in_state(self.storage) })
6722 }
6723}
6724
6725impl<S: emboss_runtime::MutStorage> emboss_runtime::CheckComplete for CommandPacketWriter<S, emboss_runtime::UncheckedState> {
6726 type Completed = CommandPacketWriter<S, emboss_runtime::CompleteState>;
6727 fn check_complete(self) -> core::result::Result<Self::Completed, emboss_runtime::Error> {
6728 let required_size = <Self as emboss_runtime::View>::size_in_bytes(&self)?;
6729 if self.storage.len() < required_size {
6730 return core::result::Result::Err(emboss_runtime::Error::OutOfBounds);
6731 }
6732 core::result::Result::Ok(unsafe { CommandPacketWriter::new_in_state(self.storage) })
6733 }
6734}
6735
6736impl<S: emboss_runtime::Storage> emboss_runtime::CheckOk for CommandPacket<S, emboss_runtime::UncheckedState> {
6737 type Ok = CommandPacket<S, emboss_runtime::OkState>;
6738 fn check_ok(self) -> core::result::Result<Self::Ok, emboss_runtime::Error> {
6739 let completed = emboss_runtime::CheckComplete::check_complete(self)?;
6740 core::result::Result::Ok(unsafe { CommandPacket::new_in_state(completed.into_storage()) })
6741 }
6742}
6743
6744impl<S: emboss_runtime::Storage> emboss_runtime::CheckOk for CommandPacket<S, emboss_runtime::CompleteState> {
6745 type Ok = CommandPacket<S, emboss_runtime::OkState>;
6746 fn check_ok(self) -> core::result::Result<Self::Ok, emboss_runtime::Error> {
6747 core::result::Result::Ok(unsafe { CommandPacket::new_in_state(self.into_storage()) })
6748 }
6749}
6750
6751impl<S: emboss_runtime::Storage> emboss_runtime::CheckOk for CommandPacket<S, emboss_runtime::OkState> {
6752 type Ok = CommandPacket<S, emboss_runtime::OkState>;
6753 fn check_ok(self) -> core::result::Result<Self::Ok, emboss_runtime::Error> {
6754 core::result::Result::Ok(self)
6755 }
6756}
6757
6758impl<S: emboss_runtime::MutStorage> emboss_runtime::CheckOk for CommandPacketWriter<S, emboss_runtime::UncheckedState> {
6759 type Ok = CommandPacketWriter<S, emboss_runtime::OkState>;
6760 fn check_ok(self) -> core::result::Result<Self::Ok, emboss_runtime::Error> {
6761 let completed = emboss_runtime::CheckComplete::check_complete(self)?;
6762 core::result::Result::Ok(unsafe { CommandPacketWriter::new_in_state(completed.into_storage()) })
6763 }
6764}
6765
6766impl<S: emboss_runtime::MutStorage> emboss_runtime::CheckOk for CommandPacketWriter<S, emboss_runtime::CompleteState> {
6767 type Ok = CommandPacketWriter<S, emboss_runtime::OkState>;
6768 fn check_ok(self) -> core::result::Result<Self::Ok, emboss_runtime::Error> {
6769 core::result::Result::Ok(unsafe { CommandPacketWriter::new_in_state(self.into_storage()) })
6770 }
6771}
6772
6773impl<S: emboss_runtime::MutStorage> emboss_runtime::CheckOk for CommandPacketWriter<S, emboss_runtime::OkState> {
6774 type Ok = CommandPacketWriter<S, emboss_runtime::OkState>;
6775 fn check_ok(self) -> core::result::Result<Self::Ok, emboss_runtime::Error> {
6776 core::result::Result::Ok(self)
6777 }
6778}
6779
6780pub mod command_packet {
6781 pub type View<S, ST = emboss_runtime::UncheckedState> = super::CommandPacket<S, ST>;
6782 pub type ViewMut<S> = super::CommandPacketMut<S>;
6783 pub type Writer<S, ST = emboss_runtime::UncheckedState> = super::CommandPacketWriter<S, ST>;
6784
6785 pub const MIN_SIZE_IN_BYTES: usize = 3;
6786 pub const MAX_SIZE_IN_BYTES: usize = 258;
6787}pub struct EventHeader<S: emboss_runtime::Storage, ST: emboss_runtime::State = emboss_runtime::UncheckedState> {
6788 storage: S,
6789 _marker: core::marker::PhantomData<ST>,
6790}
6791
6792impl<S: emboss_runtime::Storage> EventHeader<S, emboss_runtime::UncheckedState> {
6793 pub fn new(storage: S) -> Self {
6794 Self {
6795 storage,
6796 _marker: core::marker::PhantomData,
6797 }
6798 }
6799}
6800
6801impl<S: emboss_runtime::Storage + core::clone::Clone, ST: emboss_runtime::State> core::clone::Clone for EventHeader<S, ST> {
6802 fn clone(&self) -> Self {
6803 Self {
6804 storage: self.storage.clone(),
6805 _marker: core::marker::PhantomData,
6806 }
6807 }
6808}
6809
6810impl<S: emboss_runtime::Storage, ST: emboss_runtime::State> EventHeader<S, ST> {
6811 pub unsafe fn new_in_state(storage: S) -> Self {
6819 Self {
6820 storage,
6821 _marker: core::marker::PhantomData,
6822 }
6823 }
6824 pub fn into_storage(self) -> S {
6825 self.storage
6826 }
6827 pub fn event_code(&self) -> emboss_runtime::EnumView<EventCode, emboss_runtime::UInt<8, emboss_runtime::LittleEndian, S::Sliced<'_>, ST>> {
6828 let (offset, len) = (|| -> core::result::Result<(usize, usize), emboss_runtime::Error> {
6829 let offset = (0) as usize;
6830 let len = (1) as usize;
6831 core::result::Result::Ok((offset, len))
6832 })().unwrap_or((usize::MAX, 0));
6833 let storage = self.storage.slice(offset, len);
6834 emboss_runtime::EnumView::new(emboss_runtime::UInt::new(storage))
6835 }
6836 pub fn event_code_uint(&self) -> UInt<8, emboss_runtime::LittleEndian, S::Sliced<'_>, ST> {
6837 let (offset, len) = (|| -> core::result::Result<(usize, usize), emboss_runtime::Error> {
6838 let offset = (0) as usize;
6839 let len = (1) as usize;
6840 core::result::Result::Ok((offset, len))
6841 })().unwrap_or((usize::MAX, 0));
6842 let storage = self.storage.slice(offset, len);
6843 UInt::<8, emboss_runtime::LittleEndian, S::Sliced<'_>, ST>::new(storage)
6844 }
6845 pub fn parameter_total_size(&self) -> UInt<8, emboss_runtime::LittleEndian, S::Sliced<'_>, ST> {
6846 let (offset, len) = (|| -> core::result::Result<(usize, usize), emboss_runtime::Error> {
6847 let offset = (1) as usize;
6848 let len = (1) as usize;
6849 core::result::Result::Ok((offset, len))
6850 })().unwrap_or((usize::MAX, 0));
6851 let storage = self.storage.slice(offset, len);
6852 UInt::<8, emboss_runtime::LittleEndian, S::Sliced<'_>, ST>::new(storage)
6853 }
6854
6855}
6856
6857pub struct EventHeaderMut<S: emboss_runtime::MutStorage> {
6858 storage: S,
6859}
6860
6861impl<S: emboss_runtime::MutStorage> EventHeaderMut<S> {
6862 pub fn new(storage: S) -> Self {
6863 Self {
6864 storage,
6865 }
6866 }
6867 pub fn into_writer(self) -> EventHeaderWriter<S, emboss_runtime::UncheckedState> {
6868 EventHeaderWriter::new(self.storage)
6869 }
6870 pub fn as_view(&self) -> EventHeader<S::Sliced<'_>, emboss_runtime::UncheckedState> {
6872 unsafe { EventHeader::new_in_state(self.storage.slice(0, self.storage.len())) }
6873 }
6874 pub fn event_code(&mut self) -> emboss_runtime::EnumViewMut<EventCode, emboss_runtime::UInt<8, emboss_runtime::LittleEndian, S::SlicedMut<'_>, emboss_runtime::UncheckedState>> {
6875 let (offset, len) = (|| -> core::result::Result<(usize, usize), emboss_runtime::Error> {
6876 let offset = (0) as usize;
6877 let len = (1) as usize;
6878 core::result::Result::Ok((offset, len))
6879 })().unwrap_or((usize::MAX, 0));
6880 let storage = self.storage.slice_mut(offset, len);
6881 emboss_runtime::EnumViewMut::new(emboss_runtime::UInt::new(storage))
6882 }
6883 pub fn event_code_uint(&mut self) -> UInt<8, emboss_runtime::LittleEndian, S::SlicedMut<'_>, emboss_runtime::UncheckedState> {
6884 let (offset, len) = (|| -> core::result::Result<(usize, usize), emboss_runtime::Error> {
6885 let offset = (0) as usize;
6886 let len = (1) as usize;
6887 core::result::Result::Ok((offset, len))
6888 })().unwrap_or((usize::MAX, 0));
6889 let storage = self.storage.slice_mut(offset, len);
6890 UInt::<8, emboss_runtime::LittleEndian, S::SlicedMut<'_>, emboss_runtime::UncheckedState>::new(storage)
6891 }
6892 pub fn parameter_total_size(&mut self) -> UInt<8, emboss_runtime::LittleEndian, S::SlicedMut<'_>, emboss_runtime::UncheckedState> {
6893 let (offset, len) = (|| -> core::result::Result<(usize, usize), emboss_runtime::Error> {
6894 let offset = (1) as usize;
6895 let len = (1) as usize;
6896 core::result::Result::Ok((offset, len))
6897 })().unwrap_or((usize::MAX, 0));
6898 let storage = self.storage.slice_mut(offset, len);
6899 UInt::<8, emboss_runtime::LittleEndian, S::SlicedMut<'_>, emboss_runtime::UncheckedState>::new(storage)
6900 }
6901
6902}
6903
6904impl<S: emboss_runtime::MutStorage> emboss_runtime::IntoWriter for EventHeaderMut<S> {
6905 type Writer = EventHeaderWriter<S, emboss_runtime::UncheckedState>;
6906 fn into_writer(self) -> Self::Writer {
6907 EventHeaderWriter::new(self.storage)
6908 }
6909}
6910
6911pub struct EventHeaderWriter<S: emboss_runtime::MutStorage, ST: emboss_runtime::State = emboss_runtime::UncheckedState> {
6912 storage: S,
6913 _marker: core::marker::PhantomData<ST>,
6914}
6915
6916impl<S: emboss_runtime::MutStorage> EventHeaderWriter<S, emboss_runtime::UncheckedState> {
6917 pub fn new(storage: S) -> Self {
6918 Self {
6919 storage,
6920 _marker: core::marker::PhantomData,
6921 }
6922 }
6923}
6924
6925impl<S: emboss_runtime::MutStorage, ST: emboss_runtime::State> EventHeaderWriter<S, ST> {
6926 pub unsafe fn new_in_state(storage: S) -> Self {
6934 Self {
6935 storage,
6936 _marker: core::marker::PhantomData,
6937 }
6938 }
6939 pub fn into_storage(self) -> S {
6940 self.storage
6941 }
6942 pub fn into_view(self) -> EventHeader<S, ST> {
6944 unsafe { EventHeader::new_in_state(self.storage) }
6945 }
6946 pub fn as_view(&self) -> EventHeader<S::Sliced<'_>, ST> {
6948 unsafe { EventHeader::new_in_state(self.storage.slice(0, self.storage.len())) }
6949 }
6950 pub fn write_event_code(self, val: EventCode) -> EventHeaderWriter<S, ST::OnValidMutation> {
6951 let view = self.into_view();
6952 let (offset, len) = (|| -> core::result::Result<(usize, usize), emboss_runtime::Error> {
6953 let offset = (0) as usize;
6954 let len = (1) as usize;
6955 core::result::Result::Ok((offset, len))
6956 })().expect("valid layout in complete state");
6957 let mut storage = view.into_storage();
6958 {
6959 let slice = storage.slice_mut(offset, len);
6960 let mut field_view = emboss_runtime::EnumViewMut::<EventCode, emboss_runtime::UInt<8, emboss_runtime::LittleEndian, _>>::new(emboss_runtime::UInt::new(slice));
6961 field_view.try_write(val).expect("valid write in complete state");
6962 }
6963 unsafe { EventHeaderWriter::new_in_state(storage) }
6964 }
6965 pub fn write_event_code_uint(self, val: <emboss_runtime::SizeSelector<8> as emboss_runtime::SmallestUInt>::T) -> EventHeaderWriter<S, ST::OnValidMutation> {
6966 let view = self.into_view();
6967 let (offset, len) = (|| -> core::result::Result<(usize, usize), emboss_runtime::Error> {
6968 let offset = (0) as usize;
6969 let len = (1) as usize;
6970 core::result::Result::Ok((offset, len))
6971 })().expect("valid layout in complete state");
6972 let mut storage = view.into_storage();
6973 {
6974 let slice = storage.slice_mut(offset, len);
6975 let mut field_view = emboss_runtime::UInt::<8, emboss_runtime::LittleEndian, _>::new(slice);
6976 field_view.try_write(val).expect("valid write in complete state");
6977 }
6978 unsafe { EventHeaderWriter::new_in_state(storage) }
6979 }
6980 pub fn write_parameter_total_size(self, val: <emboss_runtime::SizeSelector<8> as emboss_runtime::SmallestUInt>::T) -> EventHeaderWriter<S, ST::OnValidMutation> {
6981 let view = self.into_view();
6982 let (offset, len) = (|| -> core::result::Result<(usize, usize), emboss_runtime::Error> {
6983 let offset = (1) as usize;
6984 let len = (1) as usize;
6985 core::result::Result::Ok((offset, len))
6986 })().expect("valid layout in complete state");
6987 let mut storage = view.into_storage();
6988 {
6989 let slice = storage.slice_mut(offset, len);
6990 let mut field_view = emboss_runtime::UInt::<8, emboss_runtime::LittleEndian, _>::new(slice);
6991 field_view.try_write(val).expect("valid write in complete state");
6992 }
6993 unsafe { EventHeaderWriter::new_in_state(storage) }
6994 }
6995
6996}
6997
6998impl<S: emboss_runtime::Storage, ST: emboss_runtime::State> emboss_runtime::View for EventHeader<S, ST> {
6999 fn size_in_bytes(&self) -> core::result::Result<usize, emboss_runtime::Error> {
7000 let view = self;
7001 core::result::Result::Ok((2) as usize)
7002 }
7003}
7004
7005impl<S: emboss_runtime::MutStorage> emboss_runtime::View for EventHeaderMut<S> {
7006 fn size_in_bytes(&self) -> core::result::Result<usize, emboss_runtime::Error> {
7007 let view = self.as_view();
7008 <EventHeader<S::Sliced<'_>, emboss_runtime::UncheckedState> as emboss_runtime::View>::size_in_bytes(&view)
7009 }
7010}
7011
7012impl<S: emboss_runtime::MutStorage, ST: emboss_runtime::State> emboss_runtime::View for EventHeaderWriter<S, ST> {
7013 fn size_in_bytes(&self) -> core::result::Result<usize, emboss_runtime::Error> {
7014 let view = self.as_view();
7015 <EventHeader<S::Sliced<'_>, ST> as emboss_runtime::View>::size_in_bytes(&view)
7016 }
7017}
7018
7019impl<S: emboss_runtime::Storage> emboss_runtime::CheckComplete for EventHeader<S, emboss_runtime::UncheckedState> {
7020 type Completed = EventHeader<S, emboss_runtime::CompleteState>;
7021 fn check_complete(self) -> core::result::Result<Self::Completed, emboss_runtime::Error> {
7022 let required_size = <Self as emboss_runtime::View>::size_in_bytes(&self)?;
7023 if self.storage.len() < required_size {
7024 return core::result::Result::Err(emboss_runtime::Error::OutOfBounds);
7025 }
7026 core::result::Result::Ok(unsafe { EventHeader::new_in_state(self.storage) })
7027 }
7028}
7029
7030impl<S: emboss_runtime::MutStorage> emboss_runtime::CheckComplete for EventHeaderWriter<S, emboss_runtime::UncheckedState> {
7031 type Completed = EventHeaderWriter<S, emboss_runtime::CompleteState>;
7032 fn check_complete(self) -> core::result::Result<Self::Completed, emboss_runtime::Error> {
7033 let required_size = <Self as emboss_runtime::View>::size_in_bytes(&self)?;
7034 if self.storage.len() < required_size {
7035 return core::result::Result::Err(emboss_runtime::Error::OutOfBounds);
7036 }
7037 core::result::Result::Ok(unsafe { EventHeaderWriter::new_in_state(self.storage) })
7038 }
7039}
7040
7041impl<S: emboss_runtime::Storage> emboss_runtime::CheckOk for EventHeader<S, emboss_runtime::UncheckedState> {
7042 type Ok = EventHeader<S, emboss_runtime::OkState>;
7043 fn check_ok(self) -> core::result::Result<Self::Ok, emboss_runtime::Error> {
7044 let completed = emboss_runtime::CheckComplete::check_complete(self)?;
7045 core::result::Result::Ok(unsafe { EventHeader::new_in_state(completed.into_storage()) })
7046 }
7047}
7048
7049impl<S: emboss_runtime::Storage> emboss_runtime::CheckOk for EventHeader<S, emboss_runtime::CompleteState> {
7050 type Ok = EventHeader<S, emboss_runtime::OkState>;
7051 fn check_ok(self) -> core::result::Result<Self::Ok, emboss_runtime::Error> {
7052 core::result::Result::Ok(unsafe { EventHeader::new_in_state(self.into_storage()) })
7053 }
7054}
7055
7056impl<S: emboss_runtime::Storage> emboss_runtime::CheckOk for EventHeader<S, emboss_runtime::OkState> {
7057 type Ok = EventHeader<S, emboss_runtime::OkState>;
7058 fn check_ok(self) -> core::result::Result<Self::Ok, emboss_runtime::Error> {
7059 core::result::Result::Ok(self)
7060 }
7061}
7062
7063impl<S: emboss_runtime::MutStorage> emboss_runtime::CheckOk for EventHeaderWriter<S, emboss_runtime::UncheckedState> {
7064 type Ok = EventHeaderWriter<S, emboss_runtime::OkState>;
7065 fn check_ok(self) -> core::result::Result<Self::Ok, emboss_runtime::Error> {
7066 let completed = emboss_runtime::CheckComplete::check_complete(self)?;
7067 core::result::Result::Ok(unsafe { EventHeaderWriter::new_in_state(completed.into_storage()) })
7068 }
7069}
7070
7071impl<S: emboss_runtime::MutStorage> emboss_runtime::CheckOk for EventHeaderWriter<S, emboss_runtime::CompleteState> {
7072 type Ok = EventHeaderWriter<S, emboss_runtime::OkState>;
7073 fn check_ok(self) -> core::result::Result<Self::Ok, emboss_runtime::Error> {
7074 core::result::Result::Ok(unsafe { EventHeaderWriter::new_in_state(self.into_storage()) })
7075 }
7076}
7077
7078impl<S: emboss_runtime::MutStorage> emboss_runtime::CheckOk for EventHeaderWriter<S, emboss_runtime::OkState> {
7079 type Ok = EventHeaderWriter<S, emboss_runtime::OkState>;
7080 fn check_ok(self) -> core::result::Result<Self::Ok, emboss_runtime::Error> {
7081 core::result::Result::Ok(self)
7082 }
7083}
7084
7085pub mod event_header {
7086 pub type View<S, ST = emboss_runtime::UncheckedState> = super::EventHeader<S, ST>;
7087 pub type ViewMut<S> = super::EventHeaderMut<S>;
7088 pub type Writer<S, ST = emboss_runtime::UncheckedState> = super::EventHeaderWriter<S, ST>;
7089
7090 pub const MIN_SIZE_IN_BYTES: usize = 2;
7091 pub const MAX_SIZE_IN_BYTES: usize = 2;
7092 pub const SIZE_IN_BYTES: usize = 2;
7093}pub struct EventPacket_Payload_ArrayView<S: emboss_runtime::Storage> {
7094 storage: S,
7095 element_count: usize,
7096}
7097
7098impl<S: emboss_runtime::Storage + core::clone::Clone> core::clone::Clone for EventPacket_Payload_ArrayView<S> {
7099 fn clone(&self) -> Self {
7100 Self {
7101 storage: self.storage.clone(),
7102 element_count: self.element_count,
7103 }
7104 }
7105}
7106
7107impl<S: emboss_runtime::Storage> EventPacket_Payload_ArrayView<S> {
7108 pub const ELEMENT_SIZE_BYTES: usize = 1;
7109 pub fn new(storage: S, element_count: usize) -> Self {
7110 Self { storage, element_count }
7111 }
7112 pub fn element_count(&self) -> usize {
7113 self.element_count
7114 }
7115 pub fn get(&self, index: usize) -> core::result::Result<emboss_runtime::UInt<8, emboss_runtime::LittleEndian, S::Sliced<'_>>
7116, emboss_runtime::Error> {
7117 if index >= self.element_count {
7118 return core::result::Result::Err(emboss_runtime::Error::OutOfBounds);
7119 }
7120 let offset = index * Self::ELEMENT_SIZE_BYTES;
7121 let storage = self.storage.slice(offset, Self::ELEMENT_SIZE_BYTES);
7122 core::result::Result::Ok(emboss_runtime::UInt::new(storage)
7123)
7124 }
7125}
7126
7127pub struct EventPacket_Payload_ArrayViewMut<S: emboss_runtime::MutStorage> {
7128 storage: S,
7129 element_count: usize,
7130}
7131
7132impl<S: emboss_runtime::MutStorage> EventPacket_Payload_ArrayViewMut<S> {
7133 pub const ELEMENT_SIZE_BYTES: usize = 1;
7134 pub fn new(storage: S, element_count: usize) -> Self {
7135 Self { storage, element_count }
7136 }
7137 pub fn element_count(&self) -> usize {
7138 self.element_count
7139 }
7140 pub fn get_mut(&mut self, index: usize) -> core::result::Result<emboss_runtime::UInt<8, emboss_runtime::LittleEndian, S::SlicedMut<'_>>
7141, emboss_runtime::Error> {
7142 if index >= self.element_count {
7143 return core::result::Result::Err(emboss_runtime::Error::OutOfBounds);
7144 }
7145 let offset = index * Self::ELEMENT_SIZE_BYTES;
7146 let storage = self.storage.slice_mut(offset, Self::ELEMENT_SIZE_BYTES);
7147 core::result::Result::Ok(emboss_runtime::UInt::new(storage)
7148)
7149 }
7150}
7151pub struct EventPacket<S: emboss_runtime::Storage, ST: emboss_runtime::State = emboss_runtime::UncheckedState> {
7152 storage: S,
7153 _marker: core::marker::PhantomData<ST>,
7154}
7155
7156impl<S: emboss_runtime::Storage> EventPacket<S, emboss_runtime::UncheckedState> {
7157 pub fn new(storage: S) -> Self {
7158 Self {
7159 storage,
7160 _marker: core::marker::PhantomData,
7161 }
7162 }
7163}
7164
7165impl<S: emboss_runtime::Storage + core::clone::Clone, ST: emboss_runtime::State> core::clone::Clone for EventPacket<S, ST> {
7166 fn clone(&self) -> Self {
7167 Self {
7168 storage: self.storage.clone(),
7169 _marker: core::marker::PhantomData,
7170 }
7171 }
7172}
7173
7174impl<S: emboss_runtime::Storage, ST: emboss_runtime::State> EventPacket<S, ST> {
7175 pub unsafe fn new_in_state(storage: S) -> Self {
7183 Self {
7184 storage,
7185 _marker: core::marker::PhantomData,
7186 }
7187 }
7188 pub fn into_storage(self) -> S {
7189 self.storage
7190 }
7191 pub fn hdr_size(&self) -> emboss_runtime::VirtualField<u64> {
7192 let value = (|| -> core::result::Result<u64, emboss_runtime::Error> {
7193 core::result::Result::Ok( (2) as u64 )
7194 })();
7195 emboss_runtime::VirtualField::new(value)
7196 }
7197 pub fn header(&self) -> EventHeader<S::Sliced<'_>, emboss_runtime::UncheckedState> {
7198 let (offset, len) = (|| -> core::result::Result<(usize, usize), emboss_runtime::Error> {
7199 let offset = (0) as usize;
7200 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 })
7201) as usize;
7202 core::result::Result::Ok((offset, len))
7203 })().unwrap_or((usize::MAX, 0));
7204 let storage = self.storage.slice(offset, len);
7205 unsafe { EventHeader::<S::Sliced<'_>, emboss_runtime::UncheckedState>::new_in_state(storage) }
7206 }
7207 pub fn length(&self) -> emboss_runtime::VirtualField<u64> {
7208 let value = (|| -> core::result::Result<u64, emboss_runtime::Error> {
7209 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 })
7210) as u64 )
7211 })();
7212 emboss_runtime::VirtualField::new(value)
7213 }
7214 pub fn payload(&self) -> core::result::Result<EventPacket_Payload_ArrayView<S::Sliced<'_>>, emboss_runtime::Error> {
7215 let offset_res = (|| -> core::result::Result<(usize, usize, usize), emboss_runtime::Error> {
7216 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 })
7217) as i64 )
7218) as usize;
7219 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 })
7220) as usize;
7221 let element_count = (len / (1)) as usize;
7222 core::result::Result::Ok((offset, len, element_count))
7223 })();
7224 match offset_res {
7225 core::result::Result::Ok((offset, len, element_count)) => {
7226 if len > 0 {
7227 let end = offset.checked_add(len).ok_or(emboss_runtime::Error::OutOfBounds)?;
7228 self.storage.try_read_byte(end - 1)?;
7229 }
7230 let storage = self.storage.slice(offset, len);
7231 core::result::Result::Ok(EventPacket_Payload_ArrayView::new(storage, element_count))
7232 },
7233 core::result::Result::Err(e) => core::result::Result::Err(e),
7234 }
7235 }
7236
7237}
7238
7239pub struct EventPacketMut<S: emboss_runtime::MutStorage> {
7240 storage: S,
7241}
7242
7243impl<S: emboss_runtime::MutStorage> EventPacketMut<S> {
7244 pub fn new(storage: S) -> Self {
7245 Self {
7246 storage,
7247 }
7248 }
7249 pub fn into_writer(self) -> EventPacketWriter<S, emboss_runtime::UncheckedState> {
7250 EventPacketWriter::new(self.storage)
7251 }
7252 pub fn as_view(&self) -> EventPacket<S::Sliced<'_>, emboss_runtime::UncheckedState> {
7254 unsafe { EventPacket::new_in_state(self.storage.slice(0, self.storage.len())) }
7255 }
7256 pub fn hdr_size(&mut self) -> emboss_runtime::VirtualField<u64> {
7257 let value = (|| -> core::result::Result<u64, emboss_runtime::Error> {
7258 core::result::Result::Ok( (2) as u64 )
7259 })();
7260 emboss_runtime::VirtualField::new(value)
7261 }
7262 pub fn header(&mut self) -> EventHeaderMut<S::SlicedMut<'_>> {
7263 let (offset, len) = (|| -> core::result::Result<(usize, usize), emboss_runtime::Error> {
7264 let offset = (0) as usize;
7265 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 })
7266) as usize;
7267 core::result::Result::Ok((offset, len))
7268 })().unwrap_or((usize::MAX, 0));
7269 let storage = self.storage.slice_mut(offset, len);
7270 EventHeaderMut::<S::SlicedMut<'_>>::new(storage)
7271 }
7272 pub fn length(&mut self) -> emboss_runtime::VirtualField<u64> {
7273 let value = (|| -> core::result::Result<u64, emboss_runtime::Error> {
7274 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 })
7275) as u64 )
7276 })();
7277 emboss_runtime::VirtualField::new(value)
7278 }
7279 pub fn payload_mut(&mut self) -> core::result::Result<EventPacket_Payload_ArrayViewMut<S::SlicedMut<'_>>, emboss_runtime::Error> {
7280 let offset_res = (|| -> core::result::Result<(usize, usize, usize), emboss_runtime::Error> {
7281 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 })
7282) as i64 )
7283) as usize;
7284 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 })
7285) as usize;
7286 let element_count = (len / (1)) as usize;
7287 core::result::Result::Ok((offset, len, element_count))
7288 })();
7289 match offset_res {
7290 core::result::Result::Ok((offset, len, element_count)) => {
7291 if len > 0 {
7292 let end = offset.checked_add(len).ok_or(emboss_runtime::Error::OutOfBounds)?;
7293 self.storage.try_read_byte(end - 1)?;
7294 }
7295 let storage = self.storage.slice_mut(offset, len);
7296 core::result::Result::Ok(EventPacket_Payload_ArrayViewMut::new(storage, element_count))
7297 },
7298 core::result::Result::Err(e) => core::result::Result::Err(e),
7299 }
7300 }
7301
7302}
7303
7304impl<S: emboss_runtime::MutStorage> emboss_runtime::IntoWriter for EventPacketMut<S> {
7305 type Writer = EventPacketWriter<S, emboss_runtime::UncheckedState>;
7306 fn into_writer(self) -> Self::Writer {
7307 EventPacketWriter::new(self.storage)
7308 }
7309}
7310
7311pub struct EventPacketWriter<S: emboss_runtime::MutStorage, ST: emboss_runtime::State = emboss_runtime::UncheckedState> {
7312 storage: S,
7313 _marker: core::marker::PhantomData<ST>,
7314}
7315
7316impl<S: emboss_runtime::MutStorage> EventPacketWriter<S, emboss_runtime::UncheckedState> {
7317 pub fn new(storage: S) -> Self {
7318 Self {
7319 storage,
7320 _marker: core::marker::PhantomData,
7321 }
7322 }
7323}
7324
7325impl<S: emboss_runtime::MutStorage, ST: emboss_runtime::State> EventPacketWriter<S, ST> {
7326 pub unsafe fn new_in_state(storage: S) -> Self {
7334 Self {
7335 storage,
7336 _marker: core::marker::PhantomData,
7337 }
7338 }
7339 pub fn into_storage(self) -> S {
7340 self.storage
7341 }
7342 pub fn into_view(self) -> EventPacket<S, ST> {
7344 unsafe { EventPacket::new_in_state(self.storage) }
7345 }
7346 pub fn as_view(&self) -> EventPacket<S::Sliced<'_>, ST> {
7348 unsafe { EventPacket::new_in_state(self.storage.slice(0, self.storage.len())) }
7349 }
7350
7351}
7352
7353impl<S: emboss_runtime::Storage, ST: emboss_runtime::State> emboss_runtime::View for EventPacket<S, ST> {
7354 fn size_in_bytes(&self) -> core::result::Result<usize, emboss_runtime::Error> {
7355 let view = self;
7356 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 })
7357) as i64 )
7358 } else { 0 })
7359
7360) as i64)
7361) 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) 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 })
7364) as i64 )
7365 } else { 0 })
7366
7367) as i64)
7368) as usize)
7369 }
7370}
7371
7372impl<S: emboss_runtime::MutStorage> emboss_runtime::View for EventPacketMut<S> {
7373 fn size_in_bytes(&self) -> core::result::Result<usize, emboss_runtime::Error> {
7374 let view = self.as_view();
7375 <EventPacket<S::Sliced<'_>, emboss_runtime::UncheckedState> as emboss_runtime::View>::size_in_bytes(&view)
7376 }
7377}
7378
7379impl<S: emboss_runtime::MutStorage, ST: emboss_runtime::State> emboss_runtime::View for EventPacketWriter<S, ST> {
7380 fn size_in_bytes(&self) -> core::result::Result<usize, emboss_runtime::Error> {
7381 let view = self.as_view();
7382 <EventPacket<S::Sliced<'_>, ST> as emboss_runtime::View>::size_in_bytes(&view)
7383 }
7384}
7385
7386impl<S: emboss_runtime::Storage> emboss_runtime::CheckComplete for EventPacket<S, emboss_runtime::UncheckedState> {
7387 type Completed = EventPacket<S, emboss_runtime::CompleteState>;
7388 fn check_complete(self) -> core::result::Result<Self::Completed, emboss_runtime::Error> {
7389 let required_size = <Self as emboss_runtime::View>::size_in_bytes(&self)?;
7390 if self.storage.len() < required_size {
7391 return core::result::Result::Err(emboss_runtime::Error::OutOfBounds);
7392 }
7393 core::result::Result::Ok(unsafe { EventPacket::new_in_state(self.storage) })
7394 }
7395}
7396
7397impl<S: emboss_runtime::MutStorage> emboss_runtime::CheckComplete for EventPacketWriter<S, emboss_runtime::UncheckedState> {
7398 type Completed = EventPacketWriter<S, emboss_runtime::CompleteState>;
7399 fn check_complete(self) -> core::result::Result<Self::Completed, emboss_runtime::Error> {
7400 let required_size = <Self as emboss_runtime::View>::size_in_bytes(&self)?;
7401 if self.storage.len() < required_size {
7402 return core::result::Result::Err(emboss_runtime::Error::OutOfBounds);
7403 }
7404 core::result::Result::Ok(unsafe { EventPacketWriter::new_in_state(self.storage) })
7405 }
7406}
7407
7408impl<S: emboss_runtime::Storage> emboss_runtime::CheckOk for EventPacket<S, emboss_runtime::UncheckedState> {
7409 type Ok = EventPacket<S, emboss_runtime::OkState>;
7410 fn check_ok(self) -> core::result::Result<Self::Ok, emboss_runtime::Error> {
7411 let completed = emboss_runtime::CheckComplete::check_complete(self)?;
7412 core::result::Result::Ok(unsafe { EventPacket::new_in_state(completed.into_storage()) })
7413 }
7414}
7415
7416impl<S: emboss_runtime::Storage> emboss_runtime::CheckOk for EventPacket<S, emboss_runtime::CompleteState> {
7417 type Ok = EventPacket<S, emboss_runtime::OkState>;
7418 fn check_ok(self) -> core::result::Result<Self::Ok, emboss_runtime::Error> {
7419 core::result::Result::Ok(unsafe { EventPacket::new_in_state(self.into_storage()) })
7420 }
7421}
7422
7423impl<S: emboss_runtime::Storage> emboss_runtime::CheckOk for EventPacket<S, emboss_runtime::OkState> {
7424 type Ok = EventPacket<S, emboss_runtime::OkState>;
7425 fn check_ok(self) -> core::result::Result<Self::Ok, emboss_runtime::Error> {
7426 core::result::Result::Ok(self)
7427 }
7428}
7429
7430impl<S: emboss_runtime::MutStorage> emboss_runtime::CheckOk for EventPacketWriter<S, emboss_runtime::UncheckedState> {
7431 type Ok = EventPacketWriter<S, emboss_runtime::OkState>;
7432 fn check_ok(self) -> core::result::Result<Self::Ok, emboss_runtime::Error> {
7433 let completed = emboss_runtime::CheckComplete::check_complete(self)?;
7434 core::result::Result::Ok(unsafe { EventPacketWriter::new_in_state(completed.into_storage()) })
7435 }
7436}
7437
7438impl<S: emboss_runtime::MutStorage> emboss_runtime::CheckOk for EventPacketWriter<S, emboss_runtime::CompleteState> {
7439 type Ok = EventPacketWriter<S, emboss_runtime::OkState>;
7440 fn check_ok(self) -> core::result::Result<Self::Ok, emboss_runtime::Error> {
7441 core::result::Result::Ok(unsafe { EventPacketWriter::new_in_state(self.into_storage()) })
7442 }
7443}
7444
7445impl<S: emboss_runtime::MutStorage> emboss_runtime::CheckOk for EventPacketWriter<S, emboss_runtime::OkState> {
7446 type Ok = EventPacketWriter<S, emboss_runtime::OkState>;
7447 fn check_ok(self) -> core::result::Result<Self::Ok, emboss_runtime::Error> {
7448 core::result::Result::Ok(self)
7449 }
7450}
7451
7452pub mod event_packet {
7453 pub type View<S, ST = emboss_runtime::UncheckedState> = super::EventPacket<S, ST>;
7454 pub type ViewMut<S> = super::EventPacketMut<S>;
7455 pub type Writer<S, ST = emboss_runtime::UncheckedState> = super::EventPacketWriter<S, ST>;
7456
7457 pub const MIN_SIZE_IN_BYTES: usize = 2;
7458 pub const MAX_SIZE_IN_BYTES: usize = 257;
7459}pub struct CommandCompleteEvent<S: emboss_runtime::Storage, ST: emboss_runtime::State = emboss_runtime::UncheckedState> {
7460 storage: S,
7461 _marker: core::marker::PhantomData<ST>,
7462}
7463
7464impl<S: emboss_runtime::Storage> CommandCompleteEvent<S, emboss_runtime::UncheckedState> {
7465 pub fn new(storage: S) -> Self {
7466 Self {
7467 storage,
7468 _marker: core::marker::PhantomData,
7469 }
7470 }
7471}
7472
7473impl<S: emboss_runtime::Storage + core::clone::Clone, ST: emboss_runtime::State> core::clone::Clone for CommandCompleteEvent<S, ST> {
7474 fn clone(&self) -> Self {
7475 Self {
7476 storage: self.storage.clone(),
7477 _marker: core::marker::PhantomData,
7478 }
7479 }
7480}
7481
7482impl<S: emboss_runtime::Storage, ST: emboss_runtime::State> CommandCompleteEvent<S, ST> {
7483 pub unsafe fn new_in_state(storage: S) -> Self {
7491 Self {
7492 storage,
7493 _marker: core::marker::PhantomData,
7494 }
7495 }
7496 pub fn into_storage(self) -> S {
7497 self.storage
7498 }
7499 pub fn hdr_size(&self) -> emboss_runtime::VirtualField<u64> {
7500 let value = (|| -> core::result::Result<u64, emboss_runtime::Error> {
7501 core::result::Result::Ok( (2) as u64 )
7502 })();
7503 emboss_runtime::VirtualField::new(value)
7504 }
7505 pub fn header(&self) -> EventHeader<S::Sliced<'_>, emboss_runtime::UncheckedState> {
7506 let (offset, len) = (|| -> core::result::Result<(usize, usize), emboss_runtime::Error> {
7507 let offset = (0) as usize;
7508 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 })
7509) as usize;
7510 core::result::Result::Ok((offset, len))
7511 })().unwrap_or((usize::MAX, 0));
7512 let storage = self.storage.slice(offset, len);
7513 unsafe { EventHeader::<S::Sliced<'_>, emboss_runtime::UncheckedState>::new_in_state(storage) }
7514 }
7515 pub fn num_hci_command_packets(&self) -> UInt<8, emboss_runtime::LittleEndian, S::Sliced<'_>, ST> {
7516 let (offset, len) = (|| -> core::result::Result<(usize, usize), emboss_runtime::Error> {
7517 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 })
7518) as usize;
7519 let len = (1) as usize;
7520 core::result::Result::Ok((offset, len))
7521 })().unwrap_or((usize::MAX, 0));
7522 let storage = self.storage.slice(offset, len);
7523 UInt::<8, emboss_runtime::LittleEndian, S::Sliced<'_>, ST>::new(storage)
7524 }
7525 pub fn command_opcode(&self) -> emboss_runtime::EnumView<OpCode, emboss_runtime::UInt<16, emboss_runtime::LittleEndian, S::Sliced<'_>, ST>> {
7526 let (offset, len) = (|| -> core::result::Result<(usize, usize), emboss_runtime::Error> {
7527 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 })
7528) as i64 + (1) as i64 )
7529) as usize;
7530 let len = (2) as usize;
7531 core::result::Result::Ok((offset, len))
7532 })().unwrap_or((usize::MAX, 0));
7533 let storage = self.storage.slice(offset, len);
7534 emboss_runtime::EnumView::new(emboss_runtime::UInt::new(storage))
7535 }
7536 pub fn command_opcode_bits(&self) -> OpCodeBits<S::Sliced<'_>, emboss_runtime::UncheckedState> {
7537 let (offset, len) = (|| -> core::result::Result<(usize, usize), emboss_runtime::Error> {
7538 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 })
7539) as i64 + (1) as i64 )
7540) as usize;
7541 let len = (2) as usize;
7542 core::result::Result::Ok((offset, len))
7543 })().unwrap_or((usize::MAX, 0));
7544 let storage = self.storage.slice(offset, len);
7545 unsafe { OpCodeBits::<S::Sliced<'_>, emboss_runtime::UncheckedState>::new_in_state(storage) }
7546 }
7547 pub fn command_opcode_uint(&self) -> UInt<16, emboss_runtime::LittleEndian, S::Sliced<'_>, ST> {
7548 let (offset, len) = (|| -> core::result::Result<(usize, usize), emboss_runtime::Error> {
7549 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 })
7550) as i64 + (1) as i64 )
7551) as usize;
7552 let len = (2) as usize;
7553 core::result::Result::Ok((offset, len))
7554 })().unwrap_or((usize::MAX, 0));
7555 let storage = self.storage.slice(offset, len);
7556 UInt::<16, emboss_runtime::LittleEndian, S::Sliced<'_>, ST>::new(storage)
7557 }
7558
7559}
7560
7561pub struct CommandCompleteEventMut<S: emboss_runtime::MutStorage> {
7562 storage: S,
7563}
7564
7565impl<S: emboss_runtime::MutStorage> CommandCompleteEventMut<S> {
7566 pub fn new(storage: S) -> Self {
7567 Self {
7568 storage,
7569 }
7570 }
7571 pub fn into_writer(self) -> CommandCompleteEventWriter<S, emboss_runtime::UncheckedState> {
7572 CommandCompleteEventWriter::new(self.storage)
7573 }
7574 pub fn as_view(&self) -> CommandCompleteEvent<S::Sliced<'_>, emboss_runtime::UncheckedState> {
7576 unsafe { CommandCompleteEvent::new_in_state(self.storage.slice(0, self.storage.len())) }
7577 }
7578 pub fn hdr_size(&mut self) -> emboss_runtime::VirtualField<u64> {
7579 let value = (|| -> core::result::Result<u64, emboss_runtime::Error> {
7580 core::result::Result::Ok( (2) as u64 )
7581 })();
7582 emboss_runtime::VirtualField::new(value)
7583 }
7584 pub fn header(&mut self) -> EventHeaderMut<S::SlicedMut<'_>> {
7585 let (offset, len) = (|| -> core::result::Result<(usize, usize), emboss_runtime::Error> {
7586 let offset = (0) as usize;
7587 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 })
7588) as usize;
7589 core::result::Result::Ok((offset, len))
7590 })().unwrap_or((usize::MAX, 0));
7591 let storage = self.storage.slice_mut(offset, len);
7592 EventHeaderMut::<S::SlicedMut<'_>>::new(storage)
7593 }
7594 pub fn num_hci_command_packets(&mut self) -> UInt<8, emboss_runtime::LittleEndian, S::SlicedMut<'_>, emboss_runtime::UncheckedState> {
7595 let (offset, len) = (|| -> core::result::Result<(usize, usize), emboss_runtime::Error> {
7596 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 })
7597) as usize;
7598 let len = (1) as usize;
7599 core::result::Result::Ok((offset, len))
7600 })().unwrap_or((usize::MAX, 0));
7601 let storage = self.storage.slice_mut(offset, len);
7602 UInt::<8, emboss_runtime::LittleEndian, S::SlicedMut<'_>, emboss_runtime::UncheckedState>::new(storage)
7603 }
7604 pub fn command_opcode(&mut self) -> emboss_runtime::EnumViewMut<OpCode, emboss_runtime::UInt<16, emboss_runtime::LittleEndian, S::SlicedMut<'_>, emboss_runtime::UncheckedState>> {
7605 let (offset, len) = (|| -> core::result::Result<(usize, usize), emboss_runtime::Error> {
7606 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 })
7607) as i64 + (1) as i64 )
7608) as usize;
7609 let len = (2) as usize;
7610 core::result::Result::Ok((offset, len))
7611 })().unwrap_or((usize::MAX, 0));
7612 let storage = self.storage.slice_mut(offset, len);
7613 emboss_runtime::EnumViewMut::new(emboss_runtime::UInt::new(storage))
7614 }
7615 pub fn command_opcode_bits(&mut self) -> OpCodeBitsMut<S::SlicedMut<'_>> {
7616 let (offset, len) = (|| -> core::result::Result<(usize, usize), emboss_runtime::Error> {
7617 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 })
7618) as i64 + (1) as i64 )
7619) as usize;
7620 let len = (2) as usize;
7621 core::result::Result::Ok((offset, len))
7622 })().unwrap_or((usize::MAX, 0));
7623 let storage = self.storage.slice_mut(offset, len);
7624 OpCodeBitsMut::<S::SlicedMut<'_>>::new(storage)
7625 }
7626 pub fn command_opcode_uint(&mut self) -> UInt<16, emboss_runtime::LittleEndian, S::SlicedMut<'_>, emboss_runtime::UncheckedState> {
7627 let (offset, len) = (|| -> core::result::Result<(usize, usize), emboss_runtime::Error> {
7628 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 })
7629) as i64 + (1) as i64 )
7630) as usize;
7631 let len = (2) as usize;
7632 core::result::Result::Ok((offset, len))
7633 })().unwrap_or((usize::MAX, 0));
7634 let storage = self.storage.slice_mut(offset, len);
7635 UInt::<16, emboss_runtime::LittleEndian, S::SlicedMut<'_>, emboss_runtime::UncheckedState>::new(storage)
7636 }
7637
7638}
7639
7640impl<S: emboss_runtime::MutStorage> emboss_runtime::IntoWriter for CommandCompleteEventMut<S> {
7641 type Writer = CommandCompleteEventWriter<S, emboss_runtime::UncheckedState>;
7642 fn into_writer(self) -> Self::Writer {
7643 CommandCompleteEventWriter::new(self.storage)
7644 }
7645}
7646
7647pub struct CommandCompleteEventWriter<S: emboss_runtime::MutStorage, ST: emboss_runtime::State = emboss_runtime::UncheckedState> {
7648 storage: S,
7649 _marker: core::marker::PhantomData<ST>,
7650}
7651
7652impl<S: emboss_runtime::MutStorage> CommandCompleteEventWriter<S, emboss_runtime::UncheckedState> {
7653 pub fn new(storage: S) -> Self {
7654 Self {
7655 storage,
7656 _marker: core::marker::PhantomData,
7657 }
7658 }
7659}
7660
7661impl<S: emboss_runtime::MutStorage, ST: emboss_runtime::State> CommandCompleteEventWriter<S, ST> {
7662 pub unsafe fn new_in_state(storage: S) -> Self {
7670 Self {
7671 storage,
7672 _marker: core::marker::PhantomData,
7673 }
7674 }
7675 pub fn into_storage(self) -> S {
7676 self.storage
7677 }
7678 pub fn into_view(self) -> CommandCompleteEvent<S, ST> {
7680 unsafe { CommandCompleteEvent::new_in_state(self.storage) }
7681 }
7682 pub fn as_view(&self) -> CommandCompleteEvent<S::Sliced<'_>, ST> {
7684 unsafe { CommandCompleteEvent::new_in_state(self.storage.slice(0, self.storage.len())) }
7685 }
7686 pub fn write_num_hci_command_packets(self, val: <emboss_runtime::SizeSelector<8> as emboss_runtime::SmallestUInt>::T) -> CommandCompleteEventWriter<S, ST::OnValidMutation> {
7687 let view = self.into_view();
7688 let (offset, len) = (|| -> core::result::Result<(usize, usize), emboss_runtime::Error> {
7689 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 })
7690) as usize;
7691 let len = (1) as usize;
7692 core::result::Result::Ok((offset, len))
7693 })().expect("valid layout in complete state");
7694 let mut storage = view.into_storage();
7695 {
7696 let slice = storage.slice_mut(offset, len);
7697 let mut field_view = emboss_runtime::UInt::<8, emboss_runtime::LittleEndian, _>::new(slice);
7698 field_view.try_write(val).expect("valid write in complete state");
7699 }
7700 unsafe { CommandCompleteEventWriter::new_in_state(storage) }
7701 }
7702 pub fn write_command_opcode(self, val: OpCode) -> CommandCompleteEventWriter<S, ST::OnValidMutation> {
7703 let view = self.into_view();
7704 let (offset, len) = (|| -> core::result::Result<(usize, usize), emboss_runtime::Error> {
7705 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 })
7706) as i64 + (1) as i64 )
7707) as usize;
7708 let len = (2) as usize;
7709 core::result::Result::Ok((offset, len))
7710 })().expect("valid layout in complete state");
7711 let mut storage = view.into_storage();
7712 {
7713 let slice = storage.slice_mut(offset, len);
7714 let mut field_view = emboss_runtime::EnumViewMut::<OpCode, emboss_runtime::UInt<16, emboss_runtime::LittleEndian, _>>::new(emboss_runtime::UInt::new(slice));
7715 field_view.try_write(val).expect("valid write in complete state");
7716 }
7717 unsafe { CommandCompleteEventWriter::new_in_state(storage) }
7718 }
7719 pub fn write_command_opcode_uint(self, val: <emboss_runtime::SizeSelector<16> as emboss_runtime::SmallestUInt>::T) -> CommandCompleteEventWriter<S, ST::OnValidMutation> {
7720 let view = self.into_view();
7721 let (offset, len) = (|| -> core::result::Result<(usize, usize), emboss_runtime::Error> {
7722 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 })
7723) as i64 + (1) as i64 )
7724) as usize;
7725 let len = (2) as usize;
7726 core::result::Result::Ok((offset, len))
7727 })().expect("valid layout in complete state");
7728 let mut storage = view.into_storage();
7729 {
7730 let slice = storage.slice_mut(offset, len);
7731 let mut field_view = emboss_runtime::UInt::<16, emboss_runtime::LittleEndian, _>::new(slice);
7732 field_view.try_write(val).expect("valid write in complete state");
7733 }
7734 unsafe { CommandCompleteEventWriter::new_in_state(storage) }
7735 }
7736
7737}
7738
7739impl<S: emboss_runtime::Storage, ST: emboss_runtime::State> emboss_runtime::View for CommandCompleteEvent<S, ST> {
7740 fn size_in_bytes(&self) -> core::result::Result<usize, emboss_runtime::Error> {
7741 let view = self;
7742 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 })
7743) as i64 )
7744 } else { 0 })
7745
7746) as i64)
7747) 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 })
7748) as i64 + (1) 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) as i64 + (2) as i64 )
7755 } else { 0 })
7756
7757) as i64)
7758) 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 })
7759) as i64 + (1) as i64 )
7760) as i64 + (2) as i64 )
7761 } else { 0 })
7762
7763) as i64)
7764) 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 })
7765) as i64 + (1) as i64 )
7766) as i64 + (2) as i64 )
7767 } else { 0 })
7768
7769) as i64)
7770) as usize)
7771 }
7772}
7773
7774impl<S: emboss_runtime::MutStorage> emboss_runtime::View for CommandCompleteEventMut<S> {
7775 fn size_in_bytes(&self) -> core::result::Result<usize, emboss_runtime::Error> {
7776 let view = self.as_view();
7777 <CommandCompleteEvent<S::Sliced<'_>, emboss_runtime::UncheckedState> as emboss_runtime::View>::size_in_bytes(&view)
7778 }
7779}
7780
7781impl<S: emboss_runtime::MutStorage, ST: emboss_runtime::State> emboss_runtime::View for CommandCompleteEventWriter<S, ST> {
7782 fn size_in_bytes(&self) -> core::result::Result<usize, emboss_runtime::Error> {
7783 let view = self.as_view();
7784 <CommandCompleteEvent<S::Sliced<'_>, ST> as emboss_runtime::View>::size_in_bytes(&view)
7785 }
7786}
7787
7788impl<S: emboss_runtime::Storage> emboss_runtime::CheckComplete for CommandCompleteEvent<S, emboss_runtime::UncheckedState> {
7789 type Completed = CommandCompleteEvent<S, emboss_runtime::CompleteState>;
7790 fn check_complete(self) -> core::result::Result<Self::Completed, emboss_runtime::Error> {
7791 let required_size = <Self as emboss_runtime::View>::size_in_bytes(&self)?;
7792 if self.storage.len() < required_size {
7793 return core::result::Result::Err(emboss_runtime::Error::OutOfBounds);
7794 }
7795 core::result::Result::Ok(unsafe { CommandCompleteEvent::new_in_state(self.storage) })
7796 }
7797}
7798
7799impl<S: emboss_runtime::MutStorage> emboss_runtime::CheckComplete for CommandCompleteEventWriter<S, emboss_runtime::UncheckedState> {
7800 type Completed = CommandCompleteEventWriter<S, emboss_runtime::CompleteState>;
7801 fn check_complete(self) -> core::result::Result<Self::Completed, emboss_runtime::Error> {
7802 let required_size = <Self as emboss_runtime::View>::size_in_bytes(&self)?;
7803 if self.storage.len() < required_size {
7804 return core::result::Result::Err(emboss_runtime::Error::OutOfBounds);
7805 }
7806 core::result::Result::Ok(unsafe { CommandCompleteEventWriter::new_in_state(self.storage) })
7807 }
7808}
7809
7810impl<S: emboss_runtime::Storage> emboss_runtime::CheckOk for CommandCompleteEvent<S, emboss_runtime::UncheckedState> {
7811 type Ok = CommandCompleteEvent<S, emboss_runtime::OkState>;
7812 fn check_ok(self) -> core::result::Result<Self::Ok, emboss_runtime::Error> {
7813 let completed = emboss_runtime::CheckComplete::check_complete(self)?;
7814 core::result::Result::Ok(unsafe { CommandCompleteEvent::new_in_state(completed.into_storage()) })
7815 }
7816}
7817
7818impl<S: emboss_runtime::Storage> emboss_runtime::CheckOk for CommandCompleteEvent<S, emboss_runtime::CompleteState> {
7819 type Ok = CommandCompleteEvent<S, emboss_runtime::OkState>;
7820 fn check_ok(self) -> core::result::Result<Self::Ok, emboss_runtime::Error> {
7821 core::result::Result::Ok(unsafe { CommandCompleteEvent::new_in_state(self.into_storage()) })
7822 }
7823}
7824
7825impl<S: emboss_runtime::Storage> emboss_runtime::CheckOk for CommandCompleteEvent<S, emboss_runtime::OkState> {
7826 type Ok = CommandCompleteEvent<S, emboss_runtime::OkState>;
7827 fn check_ok(self) -> core::result::Result<Self::Ok, emboss_runtime::Error> {
7828 core::result::Result::Ok(self)
7829 }
7830}
7831
7832impl<S: emboss_runtime::MutStorage> emboss_runtime::CheckOk for CommandCompleteEventWriter<S, emboss_runtime::UncheckedState> {
7833 type Ok = CommandCompleteEventWriter<S, emboss_runtime::OkState>;
7834 fn check_ok(self) -> core::result::Result<Self::Ok, emboss_runtime::Error> {
7835 let completed = emboss_runtime::CheckComplete::check_complete(self)?;
7836 core::result::Result::Ok(unsafe { CommandCompleteEventWriter::new_in_state(completed.into_storage()) })
7837 }
7838}
7839
7840impl<S: emboss_runtime::MutStorage> emboss_runtime::CheckOk for CommandCompleteEventWriter<S, emboss_runtime::CompleteState> {
7841 type Ok = CommandCompleteEventWriter<S, emboss_runtime::OkState>;
7842 fn check_ok(self) -> core::result::Result<Self::Ok, emboss_runtime::Error> {
7843 core::result::Result::Ok(unsafe { CommandCompleteEventWriter::new_in_state(self.into_storage()) })
7844 }
7845}
7846
7847impl<S: emboss_runtime::MutStorage> emboss_runtime::CheckOk for CommandCompleteEventWriter<S, emboss_runtime::OkState> {
7848 type Ok = CommandCompleteEventWriter<S, emboss_runtime::OkState>;
7849 fn check_ok(self) -> core::result::Result<Self::Ok, emboss_runtime::Error> {
7850 core::result::Result::Ok(self)
7851 }
7852}
7853
7854pub mod command_complete_event {
7855 pub type View<S, ST = emboss_runtime::UncheckedState> = super::CommandCompleteEvent<S, ST>;
7856 pub type ViewMut<S> = super::CommandCompleteEventMut<S>;
7857 pub type Writer<S, ST = emboss_runtime::UncheckedState> = super::CommandCompleteEventWriter<S, ST>;
7858
7859 pub const MIN_SIZE_IN_BYTES: usize = 5;
7860 pub const MAX_SIZE_IN_BYTES: usize = 5;
7861 pub const SIZE_IN_BYTES: usize = 5;
7862}pub struct VendorDebugEvent<S: emboss_runtime::Storage, ST: emboss_runtime::State = emboss_runtime::UncheckedState> {
7863 storage: S,
7864 _marker: core::marker::PhantomData<ST>,
7865}
7866
7867impl<S: emboss_runtime::Storage> VendorDebugEvent<S, emboss_runtime::UncheckedState> {
7868 pub fn new(storage: S) -> Self {
7869 Self {
7870 storage,
7871 _marker: core::marker::PhantomData,
7872 }
7873 }
7874}
7875
7876impl<S: emboss_runtime::Storage + core::clone::Clone, ST: emboss_runtime::State> core::clone::Clone for VendorDebugEvent<S, ST> {
7877 fn clone(&self) -> Self {
7878 Self {
7879 storage: self.storage.clone(),
7880 _marker: core::marker::PhantomData,
7881 }
7882 }
7883}
7884
7885impl<S: emboss_runtime::Storage, ST: emboss_runtime::State> VendorDebugEvent<S, ST> {
7886 pub unsafe fn new_in_state(storage: S) -> Self {
7894 Self {
7895 storage,
7896 _marker: core::marker::PhantomData,
7897 }
7898 }
7899 pub fn into_storage(self) -> S {
7900 self.storage
7901 }
7902 pub fn hdr_size(&self) -> emboss_runtime::VirtualField<u64> {
7903 let value = (|| -> core::result::Result<u64, emboss_runtime::Error> {
7904 core::result::Result::Ok( (2) as u64 )
7905 })();
7906 emboss_runtime::VirtualField::new(value)
7907 }
7908 pub fn header(&self) -> EventHeader<S::Sliced<'_>, emboss_runtime::UncheckedState> {
7909 let (offset, len) = (|| -> core::result::Result<(usize, usize), emboss_runtime::Error> {
7910 let offset = (0) as usize;
7911 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 })
7912) as usize;
7913 core::result::Result::Ok((offset, len))
7914 })().unwrap_or((usize::MAX, 0));
7915 let storage = self.storage.slice(offset, len);
7916 unsafe { EventHeader::<S::Sliced<'_>, emboss_runtime::UncheckedState>::new_in_state(storage) }
7917 }
7918 pub fn subevent_code(&self) -> UInt<8, emboss_runtime::LittleEndian, S::Sliced<'_>, ST> {
7919 let (offset, len) = (|| -> core::result::Result<(usize, usize), emboss_runtime::Error> {
7920 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 })
7921) as i64 )
7922) as usize;
7923 let len = (1) as usize;
7924 core::result::Result::Ok((offset, len))
7925 })().unwrap_or((usize::MAX, 0));
7926 let storage = self.storage.slice(offset, len);
7927 UInt::<8, emboss_runtime::LittleEndian, S::Sliced<'_>, ST>::new(storage)
7928 }
7929
7930}
7931
7932pub struct VendorDebugEventMut<S: emboss_runtime::MutStorage> {
7933 storage: S,
7934}
7935
7936impl<S: emboss_runtime::MutStorage> VendorDebugEventMut<S> {
7937 pub fn new(storage: S) -> Self {
7938 Self {
7939 storage,
7940 }
7941 }
7942 pub fn into_writer(self) -> VendorDebugEventWriter<S, emboss_runtime::UncheckedState> {
7943 VendorDebugEventWriter::new(self.storage)
7944 }
7945 pub fn as_view(&self) -> VendorDebugEvent<S::Sliced<'_>, emboss_runtime::UncheckedState> {
7947 unsafe { VendorDebugEvent::new_in_state(self.storage.slice(0, self.storage.len())) }
7948 }
7949 pub fn hdr_size(&mut self) -> emboss_runtime::VirtualField<u64> {
7950 let value = (|| -> core::result::Result<u64, emboss_runtime::Error> {
7951 core::result::Result::Ok( (2) as u64 )
7952 })();
7953 emboss_runtime::VirtualField::new(value)
7954 }
7955 pub fn header(&mut self) -> EventHeaderMut<S::SlicedMut<'_>> {
7956 let (offset, len) = (|| -> core::result::Result<(usize, usize), emboss_runtime::Error> {
7957 let offset = (0) as usize;
7958 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 })
7959) as usize;
7960 core::result::Result::Ok((offset, len))
7961 })().unwrap_or((usize::MAX, 0));
7962 let storage = self.storage.slice_mut(offset, len);
7963 EventHeaderMut::<S::SlicedMut<'_>>::new(storage)
7964 }
7965 pub fn subevent_code(&mut self) -> UInt<8, emboss_runtime::LittleEndian, S::SlicedMut<'_>, emboss_runtime::UncheckedState> {
7966 let (offset, len) = (|| -> core::result::Result<(usize, usize), emboss_runtime::Error> {
7967 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 })
7968) as i64 )
7969) as usize;
7970 let len = (1) as usize;
7971 core::result::Result::Ok((offset, len))
7972 })().unwrap_or((usize::MAX, 0));
7973 let storage = self.storage.slice_mut(offset, len);
7974 UInt::<8, emboss_runtime::LittleEndian, S::SlicedMut<'_>, emboss_runtime::UncheckedState>::new(storage)
7975 }
7976
7977}
7978
7979impl<S: emboss_runtime::MutStorage> emboss_runtime::IntoWriter for VendorDebugEventMut<S> {
7980 type Writer = VendorDebugEventWriter<S, emboss_runtime::UncheckedState>;
7981 fn into_writer(self) -> Self::Writer {
7982 VendorDebugEventWriter::new(self.storage)
7983 }
7984}
7985
7986pub struct VendorDebugEventWriter<S: emboss_runtime::MutStorage, ST: emboss_runtime::State = emboss_runtime::UncheckedState> {
7987 storage: S,
7988 _marker: core::marker::PhantomData<ST>,
7989}
7990
7991impl<S: emboss_runtime::MutStorage> VendorDebugEventWriter<S, emboss_runtime::UncheckedState> {
7992 pub fn new(storage: S) -> Self {
7993 Self {
7994 storage,
7995 _marker: core::marker::PhantomData,
7996 }
7997 }
7998}
7999
8000impl<S: emboss_runtime::MutStorage, ST: emboss_runtime::State> VendorDebugEventWriter<S, ST> {
8001 pub unsafe fn new_in_state(storage: S) -> Self {
8009 Self {
8010 storage,
8011 _marker: core::marker::PhantomData,
8012 }
8013 }
8014 pub fn into_storage(self) -> S {
8015 self.storage
8016 }
8017 pub fn into_view(self) -> VendorDebugEvent<S, ST> {
8019 unsafe { VendorDebugEvent::new_in_state(self.storage) }
8020 }
8021 pub fn as_view(&self) -> VendorDebugEvent<S::Sliced<'_>, ST> {
8023 unsafe { VendorDebugEvent::new_in_state(self.storage.slice(0, self.storage.len())) }
8024 }
8025 pub fn write_subevent_code(self, val: <emboss_runtime::SizeSelector<8> as emboss_runtime::SmallestUInt>::T) -> VendorDebugEventWriter<S, ST::OnValidMutation> {
8026 let view = self.into_view();
8027 let (offset, len) = (|| -> core::result::Result<(usize, usize), emboss_runtime::Error> {
8028 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 })
8029) as i64 )
8030) as usize;
8031 let len = (1) as usize;
8032 core::result::Result::Ok((offset, len))
8033 })().expect("valid layout in complete state");
8034 let mut storage = view.into_storage();
8035 {
8036 let slice = storage.slice_mut(offset, len);
8037 let mut field_view = emboss_runtime::UInt::<8, emboss_runtime::LittleEndian, _>::new(slice);
8038 field_view.try_write(val).expect("valid write in complete state");
8039 }
8040 unsafe { VendorDebugEventWriter::new_in_state(storage) }
8041 }
8042
8043}
8044
8045impl<S: emboss_runtime::Storage, ST: emboss_runtime::State> emboss_runtime::View for VendorDebugEvent<S, ST> {
8046 fn size_in_bytes(&self) -> core::result::Result<usize, emboss_runtime::Error> {
8047 let view = self;
8048 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 })
8049) as i64 )
8050 } else { 0 })
8051
8052) as i64)
8053) 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) as i64 + (1) as i64 )
8056 } else { 0 })
8057
8058) as i64)
8059) as usize)
8060 }
8061}
8062
8063impl<S: emboss_runtime::MutStorage> emboss_runtime::View for VendorDebugEventMut<S> {
8064 fn size_in_bytes(&self) -> core::result::Result<usize, emboss_runtime::Error> {
8065 let view = self.as_view();
8066 <VendorDebugEvent<S::Sliced<'_>, emboss_runtime::UncheckedState> as emboss_runtime::View>::size_in_bytes(&view)
8067 }
8068}
8069
8070impl<S: emboss_runtime::MutStorage, ST: emboss_runtime::State> emboss_runtime::View for VendorDebugEventWriter<S, ST> {
8071 fn size_in_bytes(&self) -> core::result::Result<usize, emboss_runtime::Error> {
8072 let view = self.as_view();
8073 <VendorDebugEvent<S::Sliced<'_>, ST> as emboss_runtime::View>::size_in_bytes(&view)
8074 }
8075}
8076
8077impl<S: emboss_runtime::Storage> emboss_runtime::CheckComplete for VendorDebugEvent<S, emboss_runtime::UncheckedState> {
8078 type Completed = VendorDebugEvent<S, emboss_runtime::CompleteState>;
8079 fn check_complete(self) -> core::result::Result<Self::Completed, emboss_runtime::Error> {
8080 let required_size = <Self as emboss_runtime::View>::size_in_bytes(&self)?;
8081 if self.storage.len() < required_size {
8082 return core::result::Result::Err(emboss_runtime::Error::OutOfBounds);
8083 }
8084 core::result::Result::Ok(unsafe { VendorDebugEvent::new_in_state(self.storage) })
8085 }
8086}
8087
8088impl<S: emboss_runtime::MutStorage> emboss_runtime::CheckComplete for VendorDebugEventWriter<S, emboss_runtime::UncheckedState> {
8089 type Completed = VendorDebugEventWriter<S, emboss_runtime::CompleteState>;
8090 fn check_complete(self) -> core::result::Result<Self::Completed, emboss_runtime::Error> {
8091 let required_size = <Self as emboss_runtime::View>::size_in_bytes(&self)?;
8092 if self.storage.len() < required_size {
8093 return core::result::Result::Err(emboss_runtime::Error::OutOfBounds);
8094 }
8095 core::result::Result::Ok(unsafe { VendorDebugEventWriter::new_in_state(self.storage) })
8096 }
8097}
8098
8099impl<S: emboss_runtime::Storage> emboss_runtime::CheckOk for VendorDebugEvent<S, emboss_runtime::UncheckedState> {
8100 type Ok = VendorDebugEvent<S, emboss_runtime::OkState>;
8101 fn check_ok(self) -> core::result::Result<Self::Ok, emboss_runtime::Error> {
8102 let completed = emboss_runtime::CheckComplete::check_complete(self)?;
8103 core::result::Result::Ok(unsafe { VendorDebugEvent::new_in_state(completed.into_storage()) })
8104 }
8105}
8106
8107impl<S: emboss_runtime::Storage> emboss_runtime::CheckOk for VendorDebugEvent<S, emboss_runtime::CompleteState> {
8108 type Ok = VendorDebugEvent<S, emboss_runtime::OkState>;
8109 fn check_ok(self) -> core::result::Result<Self::Ok, emboss_runtime::Error> {
8110 core::result::Result::Ok(unsafe { VendorDebugEvent::new_in_state(self.into_storage()) })
8111 }
8112}
8113
8114impl<S: emboss_runtime::Storage> emboss_runtime::CheckOk for VendorDebugEvent<S, emboss_runtime::OkState> {
8115 type Ok = VendorDebugEvent<S, emboss_runtime::OkState>;
8116 fn check_ok(self) -> core::result::Result<Self::Ok, emboss_runtime::Error> {
8117 core::result::Result::Ok(self)
8118 }
8119}
8120
8121impl<S: emboss_runtime::MutStorage> emboss_runtime::CheckOk for VendorDebugEventWriter<S, emboss_runtime::UncheckedState> {
8122 type Ok = VendorDebugEventWriter<S, emboss_runtime::OkState>;
8123 fn check_ok(self) -> core::result::Result<Self::Ok, emboss_runtime::Error> {
8124 let completed = emboss_runtime::CheckComplete::check_complete(self)?;
8125 core::result::Result::Ok(unsafe { VendorDebugEventWriter::new_in_state(completed.into_storage()) })
8126 }
8127}
8128
8129impl<S: emboss_runtime::MutStorage> emboss_runtime::CheckOk for VendorDebugEventWriter<S, emboss_runtime::CompleteState> {
8130 type Ok = VendorDebugEventWriter<S, emboss_runtime::OkState>;
8131 fn check_ok(self) -> core::result::Result<Self::Ok, emboss_runtime::Error> {
8132 core::result::Result::Ok(unsafe { VendorDebugEventWriter::new_in_state(self.into_storage()) })
8133 }
8134}
8135
8136impl<S: emboss_runtime::MutStorage> emboss_runtime::CheckOk for VendorDebugEventWriter<S, emboss_runtime::OkState> {
8137 type Ok = VendorDebugEventWriter<S, emboss_runtime::OkState>;
8138 fn check_ok(self) -> core::result::Result<Self::Ok, emboss_runtime::Error> {
8139 core::result::Result::Ok(self)
8140 }
8141}
8142
8143pub mod vendor_debug_event {
8144 pub type View<S, ST = emboss_runtime::UncheckedState> = super::VendorDebugEvent<S, ST>;
8145 pub type ViewMut<S> = super::VendorDebugEventMut<S>;
8146 pub type Writer<S, ST = emboss_runtime::UncheckedState> = super::VendorDebugEventWriter<S, ST>;
8147
8148 pub const MIN_SIZE_IN_BYTES: usize = 3;
8149 pub const MAX_SIZE_IN_BYTES: usize = 3;
8150 pub const SIZE_IN_BYTES: usize = 3;
8151}pub struct PacketType<S: emboss_runtime::Storage, ST: emboss_runtime::State = emboss_runtime::UncheckedState> {
8152 storage: S,
8153 _marker: core::marker::PhantomData<ST>,
8154}
8155
8156impl<S: emboss_runtime::Storage> PacketType<S, emboss_runtime::UncheckedState> {
8157 pub fn new(storage: S) -> Self {
8158 Self {
8159 storage,
8160 _marker: core::marker::PhantomData,
8161 }
8162 }
8163}
8164
8165impl<S: emboss_runtime::Storage + core::clone::Clone, ST: emboss_runtime::State> core::clone::Clone for PacketType<S, ST> {
8166 fn clone(&self) -> Self {
8167 Self {
8168 storage: self.storage.clone(),
8169 _marker: core::marker::PhantomData,
8170 }
8171 }
8172}
8173
8174impl<S: emboss_runtime::Storage, ST: emboss_runtime::State> PacketType<S, ST> {
8175 pub unsafe fn new_in_state(storage: S) -> Self {
8183 Self {
8184 storage,
8185 _marker: core::marker::PhantomData,
8186 }
8187 }
8188 pub fn into_storage(self) -> S {
8189 self.storage
8190 }
8191 pub fn disable_2_dh1(&self) -> emboss_runtime::BitFlag<1, 1, emboss_runtime::Null, S::Sliced<'_>, ST> {
8192 let len = (1) as usize; let storage = self.storage.slice(0, len);
8194 emboss_runtime::BitFlag::<1, 1, emboss_runtime::Null, S::Sliced<'_>, ST>::new(storage)
8195 }
8196 pub fn disable_3_dh1(&self) -> emboss_runtime::BitFlag<1, 2, emboss_runtime::Null, S::Sliced<'_>, ST> {
8197 let len = (1) as usize; let storage = self.storage.slice(0, len);
8199 emboss_runtime::BitFlag::<1, 2, emboss_runtime::Null, S::Sliced<'_>, ST>::new(storage)
8200 }
8201 pub fn enable_dm1(&self) -> emboss_runtime::BitFlag<1, 3, emboss_runtime::Null, S::Sliced<'_>, ST> {
8202 let len = (1) as usize; let storage = self.storage.slice(0, len);
8204 emboss_runtime::BitFlag::<1, 3, emboss_runtime::Null, S::Sliced<'_>, ST>::new(storage)
8205 }
8206 pub fn enable_dh1(&self) -> emboss_runtime::BitFlag<1, 4, emboss_runtime::Null, S::Sliced<'_>, ST> {
8207 let len = (1) as usize; let storage = self.storage.slice(0, len);
8209 emboss_runtime::BitFlag::<1, 4, emboss_runtime::Null, S::Sliced<'_>, ST>::new(storage)
8210 }
8211 pub fn disable_2_dh3(&self) -> emboss_runtime::BitFlag<1, 8, emboss_runtime::Null, S::Sliced<'_>, ST> {
8212 let len = (2) as usize; let storage = self.storage.slice(0, len);
8214 emboss_runtime::BitFlag::<1, 8, emboss_runtime::Null, S::Sliced<'_>, ST>::new(storage)
8215 }
8216 pub fn disable_3_dh3(&self) -> emboss_runtime::BitFlag<1, 9, emboss_runtime::Null, S::Sliced<'_>, ST> {
8217 let len = (2) as usize; let storage = self.storage.slice(0, len);
8219 emboss_runtime::BitFlag::<1, 9, emboss_runtime::Null, S::Sliced<'_>, ST>::new(storage)
8220 }
8221 pub fn enable_dm3(&self) -> emboss_runtime::BitFlag<1, 10, emboss_runtime::Null, S::Sliced<'_>, ST> {
8222 let len = (2) as usize; let storage = self.storage.slice(0, len);
8224 emboss_runtime::BitFlag::<1, 10, emboss_runtime::Null, S::Sliced<'_>, ST>::new(storage)
8225 }
8226 pub fn enable_dh3(&self) -> emboss_runtime::BitFlag<1, 11, emboss_runtime::Null, S::Sliced<'_>, ST> {
8227 let len = (2) as usize; let storage = self.storage.slice(0, len);
8229 emboss_runtime::BitFlag::<1, 11, emboss_runtime::Null, S::Sliced<'_>, ST>::new(storage)
8230 }
8231 pub fn disable_2_dh5(&self) -> emboss_runtime::BitFlag<1, 12, emboss_runtime::Null, S::Sliced<'_>, ST> {
8232 let len = (2) as usize; let storage = self.storage.slice(0, len);
8234 emboss_runtime::BitFlag::<1, 12, emboss_runtime::Null, S::Sliced<'_>, ST>::new(storage)
8235 }
8236 pub fn disable_3_dh5(&self) -> emboss_runtime::BitFlag<1, 13, emboss_runtime::Null, S::Sliced<'_>, ST> {
8237 let len = (2) as usize; let storage = self.storage.slice(0, len);
8239 emboss_runtime::BitFlag::<1, 13, emboss_runtime::Null, S::Sliced<'_>, ST>::new(storage)
8240 }
8241 pub fn enable_dm5(&self) -> emboss_runtime::BitFlag<1, 14, emboss_runtime::Null, S::Sliced<'_>, ST> {
8242 let len = (2) as usize; let storage = self.storage.slice(0, len);
8244 emboss_runtime::BitFlag::<1, 14, emboss_runtime::Null, S::Sliced<'_>, ST>::new(storage)
8245 }
8246 pub fn enable_dh5(&self) -> emboss_runtime::BitFlag<1, 15, emboss_runtime::Null, S::Sliced<'_>, ST> {
8247 let len = (2) as usize; let storage = self.storage.slice(0, len);
8249 emboss_runtime::BitFlag::<1, 15, emboss_runtime::Null, S::Sliced<'_>, ST>::new(storage)
8250 }
8251
8252}
8253
8254pub struct PacketTypeMut<S: emboss_runtime::MutStorage> {
8255 storage: S,
8256}
8257
8258impl<S: emboss_runtime::MutStorage> PacketTypeMut<S> {
8259 pub fn new(storage: S) -> Self {
8260 Self {
8261 storage,
8262 }
8263 }
8264 pub fn into_writer(self) -> PacketTypeWriter<S, emboss_runtime::UncheckedState> {
8265 PacketTypeWriter::new(self.storage)
8266 }
8267 pub fn as_view(&self) -> PacketType<S::Sliced<'_>, emboss_runtime::UncheckedState> {
8269 unsafe { PacketType::new_in_state(self.storage.slice(0, self.storage.len())) }
8270 }
8271 pub fn disable_2_dh1(&mut self) -> emboss_runtime::BitFlag<1, 1, emboss_runtime::Null, S::SlicedMut<'_>, emboss_runtime::UncheckedState> {
8272 let len = (1) as usize;
8273 let storage = self.storage.slice_mut(0, len);
8274 emboss_runtime::BitFlag::<1, 1, emboss_runtime::Null, S::SlicedMut<'_>, emboss_runtime::UncheckedState>::new(storage)
8275 }
8276 pub fn disable_3_dh1(&mut self) -> emboss_runtime::BitFlag<1, 2, emboss_runtime::Null, S::SlicedMut<'_>, emboss_runtime::UncheckedState> {
8277 let len = (1) as usize;
8278 let storage = self.storage.slice_mut(0, len);
8279 emboss_runtime::BitFlag::<1, 2, emboss_runtime::Null, S::SlicedMut<'_>, emboss_runtime::UncheckedState>::new(storage)
8280 }
8281 pub fn enable_dm1(&mut self) -> emboss_runtime::BitFlag<1, 3, emboss_runtime::Null, S::SlicedMut<'_>, emboss_runtime::UncheckedState> {
8282 let len = (1) as usize;
8283 let storage = self.storage.slice_mut(0, len);
8284 emboss_runtime::BitFlag::<1, 3, emboss_runtime::Null, S::SlicedMut<'_>, emboss_runtime::UncheckedState>::new(storage)
8285 }
8286 pub fn enable_dh1(&mut self) -> emboss_runtime::BitFlag<1, 4, emboss_runtime::Null, S::SlicedMut<'_>, emboss_runtime::UncheckedState> {
8287 let len = (1) as usize;
8288 let storage = self.storage.slice_mut(0, len);
8289 emboss_runtime::BitFlag::<1, 4, emboss_runtime::Null, S::SlicedMut<'_>, emboss_runtime::UncheckedState>::new(storage)
8290 }
8291 pub fn disable_2_dh3(&mut self) -> emboss_runtime::BitFlag<1, 8, emboss_runtime::Null, S::SlicedMut<'_>, emboss_runtime::UncheckedState> {
8292 let len = (2) as usize;
8293 let storage = self.storage.slice_mut(0, len);
8294 emboss_runtime::BitFlag::<1, 8, emboss_runtime::Null, S::SlicedMut<'_>, emboss_runtime::UncheckedState>::new(storage)
8295 }
8296 pub fn disable_3_dh3(&mut self) -> emboss_runtime::BitFlag<1, 9, emboss_runtime::Null, S::SlicedMut<'_>, emboss_runtime::UncheckedState> {
8297 let len = (2) as usize;
8298 let storage = self.storage.slice_mut(0, len);
8299 emboss_runtime::BitFlag::<1, 9, emboss_runtime::Null, S::SlicedMut<'_>, emboss_runtime::UncheckedState>::new(storage)
8300 }
8301 pub fn enable_dm3(&mut self) -> emboss_runtime::BitFlag<1, 10, emboss_runtime::Null, S::SlicedMut<'_>, emboss_runtime::UncheckedState> {
8302 let len = (2) as usize;
8303 let storage = self.storage.slice_mut(0, len);
8304 emboss_runtime::BitFlag::<1, 10, emboss_runtime::Null, S::SlicedMut<'_>, emboss_runtime::UncheckedState>::new(storage)
8305 }
8306 pub fn enable_dh3(&mut self) -> emboss_runtime::BitFlag<1, 11, emboss_runtime::Null, S::SlicedMut<'_>, emboss_runtime::UncheckedState> {
8307 let len = (2) as usize;
8308 let storage = self.storage.slice_mut(0, len);
8309 emboss_runtime::BitFlag::<1, 11, emboss_runtime::Null, S::SlicedMut<'_>, emboss_runtime::UncheckedState>::new(storage)
8310 }
8311 pub fn disable_2_dh5(&mut self) -> emboss_runtime::BitFlag<1, 12, emboss_runtime::Null, S::SlicedMut<'_>, emboss_runtime::UncheckedState> {
8312 let len = (2) as usize;
8313 let storage = self.storage.slice_mut(0, len);
8314 emboss_runtime::BitFlag::<1, 12, emboss_runtime::Null, S::SlicedMut<'_>, emboss_runtime::UncheckedState>::new(storage)
8315 }
8316 pub fn disable_3_dh5(&mut self) -> emboss_runtime::BitFlag<1, 13, emboss_runtime::Null, S::SlicedMut<'_>, emboss_runtime::UncheckedState> {
8317 let len = (2) as usize;
8318 let storage = self.storage.slice_mut(0, len);
8319 emboss_runtime::BitFlag::<1, 13, emboss_runtime::Null, S::SlicedMut<'_>, emboss_runtime::UncheckedState>::new(storage)
8320 }
8321 pub fn enable_dm5(&mut self) -> emboss_runtime::BitFlag<1, 14, emboss_runtime::Null, S::SlicedMut<'_>, emboss_runtime::UncheckedState> {
8322 let len = (2) as usize;
8323 let storage = self.storage.slice_mut(0, len);
8324 emboss_runtime::BitFlag::<1, 14, emboss_runtime::Null, S::SlicedMut<'_>, emboss_runtime::UncheckedState>::new(storage)
8325 }
8326 pub fn enable_dh5(&mut self) -> emboss_runtime::BitFlag<1, 15, 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, 15, emboss_runtime::Null, S::SlicedMut<'_>, emboss_runtime::UncheckedState>::new(storage)
8330 }
8331
8332}
8333
8334impl<S: emboss_runtime::MutStorage> emboss_runtime::IntoWriter for PacketTypeMut<S> {
8335 type Writer = PacketTypeWriter<S, emboss_runtime::UncheckedState>;
8336 fn into_writer(self) -> Self::Writer {
8337 PacketTypeWriter::new(self.storage)
8338 }
8339}
8340
8341pub struct PacketTypeWriter<S: emboss_runtime::MutStorage, ST: emboss_runtime::State = emboss_runtime::UncheckedState> {
8342 storage: S,
8343 _marker: core::marker::PhantomData<ST>,
8344}
8345
8346impl<S: emboss_runtime::MutStorage> PacketTypeWriter<S, emboss_runtime::UncheckedState> {
8347 pub fn new(storage: S) -> Self {
8348 Self {
8349 storage,
8350 _marker: core::marker::PhantomData,
8351 }
8352 }
8353}
8354
8355impl<S: emboss_runtime::MutStorage, ST: emboss_runtime::State> PacketTypeWriter<S, ST> {
8356 pub unsafe fn new_in_state(storage: S) -> Self {
8364 Self {
8365 storage,
8366 _marker: core::marker::PhantomData,
8367 }
8368 }
8369 pub fn into_storage(self) -> S {
8370 self.storage
8371 }
8372 pub fn into_view(self) -> PacketType<S, ST> {
8374 unsafe { PacketType::new_in_state(self.storage) }
8375 }
8376 pub fn as_view(&self) -> PacketType<S::Sliced<'_>, ST> {
8378 unsafe { PacketType::new_in_state(self.storage.slice(0, self.storage.len())) }
8379 }
8380
8381}
8382
8383impl<S: emboss_runtime::Storage, ST: emboss_runtime::State> emboss_runtime::View for PacketType<S, ST> {
8384 fn size_in_bytes(&self) -> core::result::Result<usize, emboss_runtime::Error> {
8385 let view = self;
8386 core::result::Result::Ok((((16) + 7) / 8) as usize)
8387 }
8388}
8389
8390impl<S: emboss_runtime::MutStorage> emboss_runtime::View for PacketTypeMut<S> {
8391 fn size_in_bytes(&self) -> core::result::Result<usize, emboss_runtime::Error> {
8392 let view = self.as_view();
8393 <PacketType<S::Sliced<'_>, emboss_runtime::UncheckedState> as emboss_runtime::View>::size_in_bytes(&view)
8394 }
8395}
8396
8397impl<S: emboss_runtime::MutStorage, ST: emboss_runtime::State> emboss_runtime::View for PacketTypeWriter<S, ST> {
8398 fn size_in_bytes(&self) -> core::result::Result<usize, emboss_runtime::Error> {
8399 let view = self.as_view();
8400 <PacketType<S::Sliced<'_>, ST> as emboss_runtime::View>::size_in_bytes(&view)
8401 }
8402}
8403
8404impl<S: emboss_runtime::Storage> emboss_runtime::CheckComplete for PacketType<S, emboss_runtime::UncheckedState> {
8405 type Completed = PacketType<S, emboss_runtime::CompleteState>;
8406 fn check_complete(self) -> core::result::Result<Self::Completed, emboss_runtime::Error> {
8407 let required_size = <Self as emboss_runtime::View>::size_in_bytes(&self)?;
8408 if self.storage.len() < required_size {
8409 return core::result::Result::Err(emboss_runtime::Error::OutOfBounds);
8410 }
8411 core::result::Result::Ok(unsafe { PacketType::new_in_state(self.storage) })
8412 }
8413}
8414
8415impl<S: emboss_runtime::MutStorage> emboss_runtime::CheckComplete for PacketTypeWriter<S, emboss_runtime::UncheckedState> {
8416 type Completed = PacketTypeWriter<S, emboss_runtime::CompleteState>;
8417 fn check_complete(self) -> core::result::Result<Self::Completed, emboss_runtime::Error> {
8418 let required_size = <Self as emboss_runtime::View>::size_in_bytes(&self)?;
8419 if self.storage.len() < required_size {
8420 return core::result::Result::Err(emboss_runtime::Error::OutOfBounds);
8421 }
8422 core::result::Result::Ok(unsafe { PacketTypeWriter::new_in_state(self.storage) })
8423 }
8424}
8425
8426impl<S: emboss_runtime::Storage> emboss_runtime::CheckOk for PacketType<S, emboss_runtime::UncheckedState> {
8427 type Ok = PacketType<S, emboss_runtime::OkState>;
8428 fn check_ok(self) -> core::result::Result<Self::Ok, emboss_runtime::Error> {
8429 let completed = emboss_runtime::CheckComplete::check_complete(self)?;
8430 core::result::Result::Ok(unsafe { PacketType::new_in_state(completed.into_storage()) })
8431 }
8432}
8433
8434impl<S: emboss_runtime::Storage> emboss_runtime::CheckOk for PacketType<S, emboss_runtime::CompleteState> {
8435 type Ok = PacketType<S, emboss_runtime::OkState>;
8436 fn check_ok(self) -> core::result::Result<Self::Ok, emboss_runtime::Error> {
8437 core::result::Result::Ok(unsafe { PacketType::new_in_state(self.into_storage()) })
8438 }
8439}
8440
8441impl<S: emboss_runtime::Storage> emboss_runtime::CheckOk for PacketType<S, emboss_runtime::OkState> {
8442 type Ok = PacketType<S, emboss_runtime::OkState>;
8443 fn check_ok(self) -> core::result::Result<Self::Ok, emboss_runtime::Error> {
8444 core::result::Result::Ok(self)
8445 }
8446}
8447
8448impl<S: emboss_runtime::MutStorage> emboss_runtime::CheckOk for PacketTypeWriter<S, emboss_runtime::UncheckedState> {
8449 type Ok = PacketTypeWriter<S, emboss_runtime::OkState>;
8450 fn check_ok(self) -> core::result::Result<Self::Ok, emboss_runtime::Error> {
8451 let completed = emboss_runtime::CheckComplete::check_complete(self)?;
8452 core::result::Result::Ok(unsafe { PacketTypeWriter::new_in_state(completed.into_storage()) })
8453 }
8454}
8455
8456impl<S: emboss_runtime::MutStorage> emboss_runtime::CheckOk for PacketTypeWriter<S, emboss_runtime::CompleteState> {
8457 type Ok = PacketTypeWriter<S, emboss_runtime::OkState>;
8458 fn check_ok(self) -> core::result::Result<Self::Ok, emboss_runtime::Error> {
8459 core::result::Result::Ok(unsafe { PacketTypeWriter::new_in_state(self.into_storage()) })
8460 }
8461}
8462
8463impl<S: emboss_runtime::MutStorage> emboss_runtime::CheckOk for PacketTypeWriter<S, emboss_runtime::OkState> {
8464 type Ok = PacketTypeWriter<S, emboss_runtime::OkState>;
8465 fn check_ok(self) -> core::result::Result<Self::Ok, emboss_runtime::Error> {
8466 core::result::Result::Ok(self)
8467 }
8468}
8469
8470pub mod packet_type {
8471 pub type View<S, ST = emboss_runtime::UncheckedState> = super::PacketType<S, ST>;
8472 pub type ViewMut<S> = super::PacketTypeMut<S>;
8473 pub type Writer<S, ST = emboss_runtime::UncheckedState> = super::PacketTypeWriter<S, ST>;
8474
8475 pub const MIN_SIZE_IN_BYTES: usize = 2;
8476 pub const MAX_SIZE_IN_BYTES: usize = 2;
8477 pub const SIZE_IN_BYTES: usize = 2;
8478}