oct 0.37.0

Octonary utilities.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
// Copyright 2024-2026 Gabriel Bjørnager Jensen.
//
// SPDX: MIT OR Apache-2.0

//! The [`IntoOctets`] trait.

mod test;

use core::cell::{Cell, UnsafeCell};
use core::cmp::{self, Reverse};
use core::convert::Infallible;
use core::marker::{PhantomData, PhantomPinned};
use core::mem::ManuallyDrop;
use core::num::{NonZero, Saturating, Wrapping};
use oct::{FromOctets, Immutable, octets_of, octets_of_mut};

#[cfg(feature = "ascii")]
use core::ascii;

#[cfg(feature = "bstr")]
use core::bstr::ByteStr;

#[cfg(feature = "simd")]
use core::simd::{Simd, SimdElement};

#[cfg(any(target_arch = "aarch64", target_arch = "arm64ec"))]
use core::arch::aarch64 as arch;

#[cfg(target_arch = "wasm32")]
use core::arch::wasm32 as arch;

#[cfg(target_arch = "x86")]
use core::arch::x86 as arch;

#[cfg(target_arch = "x86_64")]
use core::arch::x86_64 as arch;

#[cfg(all(target_has_atomic = "128", feature = "atomic_u128_i128"))]
use core::sync::atomic::{AtomicI128, AtomicU128};

#[cfg(target_has_atomic = "16")]
use core::sync::atomic::{AtomicI16, AtomicU16};

#[cfg(target_has_atomic = "32")]
use core::sync::atomic::{AtomicI32, AtomicU32};

#[cfg(target_has_atomic = "64")]
use core::sync::atomic::{AtomicI64, AtomicU64};

#[cfg(target_has_atomic = "8")]
use core::sync::atomic::{AtomicBool, AtomicI8, AtomicU8};

#[cfg(target_has_atomic = "ptr")]
use core::sync::atomic::{AtomicIsize, AtomicUsize};

/// Denotes a type representable as octets (bytes.)
///
/// A type that implements this trait is a type that
/// has a well-defined octet representation, i.e.
/// which can soundly be converted into an octet
/// array. Theoretically, any allocated Rust object
/// has such representation; however, this trait
/// specifically requires that the type of any such
/// object only permits objects that are fully
/// initialised within their allocation.
///
/// This trait is mainly useful for cases where the
/// raw representation must be modified indirectly
/// of the formal object value.
///
/// # Safety
///
/// Only types that always guarantee a
/// fully-initialised state may implement this trait.
///
/// Formally, a type may implement this trait if the
/// following conditions are met:
///
/// * For all non-constructable types, the type may
///   always implement this trait.
/// * For structures and unions, the type may
///   implement this trait if all fields support the
///   same semantics and the cumulative size of
///   these fields equals the size of any object of
///   that type (i.e. the type may never contain
///   padding bytes.)
/// * For enumerations, the type may implement this
///   trait if all variant fields support the same
///   semantics, the discriminant is absent, and
///   trait if the cumulated sizes of all variant
///   fields, added to the discriminant's size, equals the
///
/// A type that does not meet the above requirements
/// may not implement this trait, unless the above
/// logic is non-exhaustive (in which case a bug
/// report is requested.)
#[doc(alias = "IntoBytes")]
pub unsafe trait IntoOctets {
	/// Reinterprets the object as a slice of octets.
	///
	/// *This operation is semantically identical to the
	/// [`octets_of`] global function.*
	#[doc(alias = "as_bytes")]
	#[inline]
	#[must_use]
	fn as_octets(&self) -> &[u8]
	where
		Self: Immutable,
	{
		octets_of(self)
	}

	/// Reinterprets the object as a mutable slice of
	/// octets.
	///
	/// *This operation is semantically identical to the
	/// [`octets_of_mut`] global function.*
	#[doc(alias = "as_bytes_mut")]
	#[doc(alias = "as_mut_bytes")]
	#[doc(alias = "as_mut_octets")]
	#[inline]
	#[must_use]
	fn as_octets_mut(&mut self) -> &mut [u8]
	where
		Self: FromOctets,
	{
		octets_of_mut(self)
	}
}

unsafe impl<T: IntoOctets, const N: usize> IntoOctets for [T; N] {}

#[cfg(target_has_atomic = "8")]
unsafe impl IntoOctets for AtomicBool {}

#[cfg(all(target_has_atomic = "128", feature = "atomic_u128_i128"))]
unsafe impl IntoOctets for AtomicI128 {}

#[cfg(target_has_atomic = "16")]
unsafe impl IntoOctets for AtomicI16 {}

#[cfg(target_has_atomic = "32")]
unsafe impl IntoOctets for AtomicI32 {}

#[cfg(target_has_atomic = "64")]
unsafe impl IntoOctets for AtomicI64 {}

#[cfg(target_has_atomic = "8")]
unsafe impl IntoOctets for AtomicI8 {}

#[cfg(target_has_atomic = "ptr")]
unsafe impl IntoOctets for AtomicIsize {}

#[cfg(all(target_has_atomic = "128", feature = "atomic_u128_i128"))]
unsafe impl IntoOctets for AtomicU128 {}

#[cfg(target_has_atomic = "16")]
unsafe impl IntoOctets for AtomicU16 {}

#[cfg(target_has_atomic = "32")]
unsafe impl IntoOctets for AtomicU32 {}

#[cfg(target_has_atomic = "64")]
unsafe impl IntoOctets for AtomicU64 {}

#[cfg(target_has_atomic = "8")]
unsafe impl IntoOctets for AtomicU8 {}

#[cfg(target_has_atomic = "ptr")]
unsafe impl IntoOctets for AtomicUsize {}

unsafe impl IntoOctets for bool {}

#[cfg(feature = "bstr")]
unsafe impl IntoOctets for ByteStr {}

unsafe impl<T: IntoOctets> IntoOctets for Cell<T> {}

unsafe impl IntoOctets for char {}

#[cfg(feature = "ascii")]
unsafe impl IntoOctets for ascii::Char {}

#[cfg(feature = "f128")]
unsafe impl IntoOctets for f128 {}

#[cfg(feature = "f16")]
unsafe impl IntoOctets for f16 {}

unsafe impl IntoOctets for f32 {}

unsafe impl IntoOctets for f64 {}

#[cfg(any(target_arch = "aarch64", target_arch = "arm64ec", target_feature = "v7"))]
#[rustversion::since(1.94)]
unsafe impl IntoOctets for arch::float16x4_t {}

#[cfg(any(target_arch = "aarch64", target_arch = "arm64ec", target_feature = "v7"))]
#[rustversion::since(1.94)]
unsafe impl IntoOctets for arch::float16x4x2_t {}

#[cfg(any(target_arch = "aarch64", target_arch = "arm64ec", target_feature = "v7"))]
#[rustversion::since(1.94)]
unsafe impl IntoOctets for arch::float16x4x3_t {}

#[cfg(any(target_arch = "aarch64", target_arch = "arm64ec", target_feature = "v7"))]
#[rustversion::since(1.94)]
unsafe impl IntoOctets for arch::float16x4x4_t {}

#[cfg(any(target_arch = "aarch64", target_arch = "arm64ec", target_feature = "v7"))]
#[rustversion::since(1.94)]
unsafe impl IntoOctets for arch::float16x8_t {}

#[cfg(any(target_arch = "aarch64", target_arch = "arm64ec", target_feature = "v7"))]
#[rustversion::since(1.94)]
unsafe impl IntoOctets for arch::float16x8x2_t {}

#[cfg(any(target_arch = "aarch64", target_arch = "arm64ec", target_feature = "v7"))]
#[rustversion::since(1.94)]
unsafe impl IntoOctets for arch::float16x8x3_t {}

#[cfg(any(target_arch = "aarch64", target_arch = "arm64ec", target_feature = "v7"))]
#[rustversion::since(1.94)]
unsafe impl IntoOctets for arch::float16x8x4_t {}

#[cfg(any(target_arch = "aarch64", target_arch = "arm64ec", target_feature = "v7"))]
unsafe impl IntoOctets for arch::float32x2_t {}

#[cfg(any(target_arch = "aarch64", target_arch = "arm64ec", target_feature = "v7"))]
unsafe impl IntoOctets for arch::float32x2x2_t {}

#[cfg(any(target_arch = "aarch64", target_arch = "arm64ec", target_feature = "v7"))]
unsafe impl IntoOctets for arch::float32x2x3_t {}

#[cfg(any(target_arch = "aarch64", target_arch = "arm64ec", target_feature = "v7"))]
unsafe impl IntoOctets for arch::float32x2x4_t {}

#[cfg(any(target_arch = "aarch64", target_arch = "arm64ec", target_feature = "v7"))]
unsafe impl IntoOctets for arch::float32x4_t {}

#[cfg(any(target_arch = "aarch64", target_arch = "arm64ec", target_feature = "v7"))]
unsafe impl IntoOctets for arch::float32x4x2_t {}

#[cfg(any(target_arch = "aarch64", target_arch = "arm64ec", target_feature = "v7"))]
unsafe impl IntoOctets for arch::float32x4x3_t {}

#[cfg(any(target_arch = "aarch64", target_arch = "arm64ec", target_feature = "v7"))]
unsafe impl IntoOctets for arch::float32x4x4_t {}

#[cfg(any(target_arch = "aarch64", target_arch = "arm64ec"))]
unsafe impl IntoOctets for arch::float64x1_t {}

#[cfg(any(target_arch = "aarch64", target_arch = "arm64ec"))]
unsafe impl IntoOctets for arch::float64x1x2_t {}

#[cfg(any(target_arch = "aarch64", target_arch = "arm64ec"))]
unsafe impl IntoOctets for arch::float64x1x3_t {}

#[cfg(any(target_arch = "aarch64", target_arch = "arm64ec"))]
unsafe impl IntoOctets for arch::float64x1x4_t {}

#[cfg(any(target_arch = "aarch64", target_arch = "arm64ec"))]
unsafe impl IntoOctets for arch::float64x2_t {}

#[cfg(any(target_arch = "aarch64", target_arch = "arm64ec"))]
unsafe impl IntoOctets for arch::float64x2x2_t {}

#[cfg(any(target_arch = "aarch64", target_arch = "arm64ec"))]
unsafe impl IntoOctets for arch::float64x2x3_t {}

#[cfg(any(target_arch = "aarch64", target_arch = "arm64ec"))]
unsafe impl IntoOctets for arch::float64x2x4_t {}

unsafe impl IntoOctets for i128 {}

unsafe impl IntoOctets for i16 {}

unsafe impl IntoOctets for i32 {}

unsafe impl IntoOctets for i64 {}

unsafe impl IntoOctets for i8 {}

// SAFETY: `Infallible` cannot be constructed, so
// its actual representation is irrelevant.
unsafe impl IntoOctets for Infallible {}

#[cfg(any(target_arch = "aarch64", target_arch = "arm64ec", target_feature = "v7"))]
unsafe impl IntoOctets for arch::int16x4_t {}

#[cfg(any(target_arch = "aarch64", target_arch = "arm64ec", target_feature = "v7"))]
unsafe impl IntoOctets for arch::int16x4x2_t {}

#[cfg(any(target_arch = "aarch64", target_arch = "arm64ec", target_feature = "v7"))]
unsafe impl IntoOctets for arch::int16x4x3_t {}

#[cfg(any(target_arch = "aarch64", target_arch = "arm64ec", target_feature = "v7"))]
unsafe impl IntoOctets for arch::int16x4x4_t {}

#[cfg(any(target_arch = "aarch64", target_arch = "arm64ec", target_feature = "v7"))]
unsafe impl IntoOctets for arch::int16x8_t {}

#[cfg(any(target_arch = "aarch64", target_arch = "arm64ec", target_feature = "v7"))]
unsafe impl IntoOctets for arch::int16x8x2_t {}

#[cfg(any(target_arch = "aarch64", target_arch = "arm64ec", target_feature = "v7"))]
unsafe impl IntoOctets for arch::int16x8x3_t {}

#[cfg(any(target_arch = "aarch64", target_arch = "arm64ec", target_feature = "v7"))]
unsafe impl IntoOctets for arch::int16x8x4_t {}

#[cfg(any(target_arch = "aarch64", target_arch = "arm64ec", target_feature = "v7"))]
unsafe impl IntoOctets for arch::int32x2_t {}

#[cfg(any(target_arch = "aarch64", target_arch = "arm64ec", target_feature = "v7"))]
unsafe impl IntoOctets for arch::int32x2x2_t {}

#[cfg(any(target_arch = "aarch64", target_arch = "arm64ec", target_feature = "v7"))]
unsafe impl IntoOctets for arch::int32x2x3_t {}

#[cfg(any(target_arch = "aarch64", target_arch = "arm64ec", target_feature = "v7"))]
unsafe impl IntoOctets for arch::int32x2x4_t {}

#[cfg(any(target_arch = "aarch64", target_arch = "arm64ec", target_feature = "v7"))]
unsafe impl IntoOctets for arch::int32x4_t {}

#[cfg(any(target_arch = "aarch64", target_arch = "arm64ec", target_feature = "v7"))]
unsafe impl IntoOctets for arch::int32x4x2_t {}

#[cfg(any(target_arch = "aarch64", target_arch = "arm64ec", target_feature = "v7"))]
unsafe impl IntoOctets for arch::int32x4x3_t {}

#[cfg(any(target_arch = "aarch64", target_arch = "arm64ec", target_feature = "v7"))]
unsafe impl IntoOctets for arch::int32x4x4_t {}

#[cfg(any(target_arch = "aarch64", target_arch = "arm64ec", target_feature = "v7"))]
unsafe impl IntoOctets for arch::int64x1_t {}

#[cfg(any(target_arch = "aarch64", target_arch = "arm64ec", target_feature = "v7"))]
unsafe impl IntoOctets for arch::int64x1x2_t {}

#[cfg(any(target_arch = "aarch64", target_arch = "arm64ec", target_feature = "v7"))]
unsafe impl IntoOctets for arch::int64x1x3_t {}

#[cfg(any(target_arch = "aarch64", target_arch = "arm64ec", target_feature = "v7"))]
unsafe impl IntoOctets for arch::int64x1x4_t {}

#[cfg(any(target_arch = "aarch64", target_arch = "arm64ec", target_feature = "v7"))]
unsafe impl IntoOctets for arch::int64x2_t {}

#[cfg(any(target_arch = "aarch64", target_arch = "arm64ec", target_feature = "v7"))]
unsafe impl IntoOctets for arch::int64x2x2_t {}

#[cfg(any(target_arch = "aarch64", target_arch = "arm64ec", target_feature = "v7"))]
unsafe impl IntoOctets for arch::int64x2x3_t {}

#[cfg(any(target_arch = "aarch64", target_arch = "arm64ec", target_feature = "v7"))]
unsafe impl IntoOctets for arch::int64x2x4_t {}

#[cfg(any(target_arch = "aarch64", target_arch = "arm64ec", target_feature = "v7"))]
unsafe impl IntoOctets for arch::int8x16_t {}

#[cfg(any(target_arch = "aarch64", target_arch = "arm64ec", target_feature = "v7"))]
unsafe impl IntoOctets for arch::int8x16x2_t {}

#[cfg(any(target_arch = "aarch64", target_arch = "arm64ec", target_feature = "v7"))]
unsafe impl IntoOctets for arch::int8x16x3_t {}

#[cfg(any(target_arch = "aarch64", target_arch = "arm64ec", target_feature = "v7"))]
unsafe impl IntoOctets for arch::int8x16x4_t {}

#[cfg(any(target_arch = "aarch64", target_arch = "arm64ec", target_feature = "v7"))]
unsafe impl IntoOctets for arch::int8x8_t {}

#[cfg(any(target_arch = "aarch64", target_arch = "arm64ec", target_feature = "v7"))]
unsafe impl IntoOctets for arch::int8x8x2_t {}

#[cfg(any(target_arch = "aarch64", target_arch = "arm64ec", target_feature = "v7"))]
unsafe impl IntoOctets for arch::int8x8x3_t {}

#[cfg(any(target_arch = "aarch64", target_arch = "arm64ec", target_feature = "v7"))]
unsafe impl IntoOctets for arch::int8x8x4_t {}

unsafe impl IntoOctets for isize {}

#[cfg(any(target_arch = "x86", target_arch = "x86_64"))]
unsafe impl IntoOctets for arch::__m128 {}

#[cfg(any(target_arch = "x86", target_arch = "x86_64"))]
#[rustversion::since(1.89)]
unsafe impl IntoOctets for arch::__m128bh {}

#[cfg(any(target_arch = "x86", target_arch = "x86_64"))]
unsafe impl IntoOctets for arch::__m128d {}

#[cfg(any(target_arch = "x86", target_arch = "x86_64"))]
#[rustversion::since(1.94)]
unsafe impl IntoOctets for arch::__m128h {}

#[cfg(any(target_arch = "x86", target_arch = "x86_64"))]
unsafe impl IntoOctets for arch::__m128i {}

#[cfg(any(target_arch = "x86", target_arch = "x86_64"))]
unsafe impl IntoOctets for arch::__m256 {}

#[cfg(any(target_arch = "x86", target_arch = "x86_64"))]
#[rustversion::since(1.89)]
unsafe impl IntoOctets for arch::__m256bh {}

#[cfg(any(target_arch = "x86", target_arch = "x86_64"))]
unsafe impl IntoOctets for arch::__m256d {}

#[cfg(any(target_arch = "x86", target_arch = "x86_64"))]
#[rustversion::since(1.94)]
unsafe impl IntoOctets for arch::__m256h {}

#[cfg(any(target_arch = "x86", target_arch = "x86_64"))]
unsafe impl IntoOctets for arch::__m256i {}

#[cfg(any(target_arch = "x86", target_arch = "x86_64"))]
unsafe impl IntoOctets for arch::__m512 {}

#[cfg(any(target_arch = "x86", target_arch = "x86_64"))]
#[rustversion::since(1.89)]
unsafe impl IntoOctets for arch::__m512bh {}

#[cfg(any(target_arch = "x86", target_arch = "x86_64"))]
unsafe impl IntoOctets for arch::__m512d {}

#[cfg(any(target_arch = "x86", target_arch = "x86_64"))]
#[rustversion::since(1.94)]
unsafe impl IntoOctets for arch::__m512h {}

#[cfg(any(target_arch = "x86", target_arch = "x86_64"))]
unsafe impl IntoOctets for arch::__m512i {}

unsafe impl<T: IntoOctets> IntoOctets for ManuallyDrop<T> {}

// unsafe impl IntoOctets for ! {}

unsafe impl IntoOctets for NonZero<i128> {}

unsafe impl IntoOctets for NonZero<i16> {}

unsafe impl IntoOctets for NonZero<i32> {}

unsafe impl IntoOctets for NonZero<i64> {}

unsafe impl IntoOctets for NonZero<i8> {}

unsafe impl IntoOctets for NonZero<isize> {}

unsafe impl IntoOctets for NonZero<u128> {}

unsafe impl IntoOctets for NonZero<u16> {}

unsafe impl IntoOctets for NonZero<u32> {}

unsafe impl IntoOctets for NonZero<u64> {}

unsafe impl IntoOctets for NonZero<u8> {}

unsafe impl IntoOctets for NonZero<usize> {}

unsafe impl IntoOctets for Option<NonZero<i128>> {}

unsafe impl IntoOctets for Option<NonZero<i16>> {}

unsafe impl IntoOctets for Option<NonZero<i32>> {}

unsafe impl IntoOctets for Option<NonZero<i64>> {}

unsafe impl IntoOctets for Option<NonZero<i8>> {}

unsafe impl IntoOctets for Option<NonZero<isize>> {}

unsafe impl IntoOctets for Option<NonZero<u128>> {}

unsafe impl IntoOctets for Option<NonZero<u16>> {}

unsafe impl IntoOctets for Option<NonZero<u32>> {}

unsafe impl IntoOctets for Option<NonZero<u64>> {}

unsafe impl IntoOctets for Option<NonZero<u8>> {}

unsafe impl IntoOctets for Option<NonZero<usize>> {}

unsafe impl IntoOctets for cmp::Ordering {}

unsafe impl<T: ?Sized> IntoOctets for PhantomData<T> {}

unsafe impl IntoOctets for PhantomPinned {}

#[cfg(any(target_arch = "aarch64", target_arch = "arm64ec", target_feature = "v7"))]
unsafe impl IntoOctets for arch::poly16x4_t {}

#[cfg(any(target_arch = "aarch64", target_arch = "arm64ec", target_feature = "v7"))]
unsafe impl IntoOctets for arch::poly16x4x2_t {}

#[cfg(any(target_arch = "aarch64", target_arch = "arm64ec", target_feature = "v7"))]
unsafe impl IntoOctets for arch::poly16x4x3_t {}

#[cfg(any(target_arch = "aarch64", target_arch = "arm64ec", target_feature = "v7"))]
unsafe impl IntoOctets for arch::poly16x4x4_t {}

#[cfg(any(target_arch = "aarch64", target_arch = "arm64ec", target_feature = "v7"))]
unsafe impl IntoOctets for arch::poly16x8_t {}

#[cfg(any(target_arch = "aarch64", target_arch = "arm64ec", target_feature = "v7"))]
unsafe impl IntoOctets for arch::poly16x8x2_t {}

#[cfg(any(target_arch = "aarch64", target_arch = "arm64ec", target_feature = "v7"))]
unsafe impl IntoOctets for arch::poly16x8x3_t {}

#[cfg(any(target_arch = "aarch64", target_arch = "arm64ec", target_feature = "v7"))]
unsafe impl IntoOctets for arch::poly16x8x4_t {}

#[cfg(any(target_arch = "aarch64", target_arch = "arm64ec", target_feature = "v7"))]
unsafe impl IntoOctets for arch::poly64x1_t {}

#[cfg(any(target_arch = "aarch64", target_arch = "arm64ec", target_feature = "v7"))]
unsafe impl IntoOctets for arch::poly64x1x2_t {}

#[cfg(any(target_arch = "aarch64", target_arch = "arm64ec", target_feature = "v7"))]
unsafe impl IntoOctets for arch::poly64x1x3_t {}

#[cfg(any(target_arch = "aarch64", target_arch = "arm64ec", target_feature = "v7"))]
unsafe impl IntoOctets for arch::poly64x1x4_t {}

#[cfg(any(target_arch = "aarch64", target_arch = "arm64ec", target_feature = "v7"))]
unsafe impl IntoOctets for arch::poly64x2_t {}

#[cfg(any(target_arch = "aarch64", target_arch = "arm64ec", target_feature = "v7"))]
unsafe impl IntoOctets for arch::poly64x2x2_t {}

#[cfg(any(target_arch = "aarch64", target_arch = "arm64ec", target_feature = "v7"))]
unsafe impl IntoOctets for arch::poly64x2x3_t {}

#[cfg(any(target_arch = "aarch64", target_arch = "arm64ec", target_feature = "v7"))]
unsafe impl IntoOctets for arch::poly64x2x4_t {}

#[cfg(any(target_arch = "aarch64", target_arch = "arm64ec", target_feature = "v7"))]
unsafe impl IntoOctets for arch::poly8x16_t {}

#[cfg(any(target_arch = "aarch64", target_arch = "arm64ec", target_feature = "v7"))]
unsafe impl IntoOctets for arch::poly8x16x2_t {}

#[cfg(any(target_arch = "aarch64", target_arch = "arm64ec", target_feature = "v7"))]
unsafe impl IntoOctets for arch::poly8x16x3_t {}

#[cfg(any(target_arch = "aarch64", target_arch = "arm64ec", target_feature = "v7"))]
unsafe impl IntoOctets for arch::poly8x16x4_t {}

#[cfg(any(target_arch = "aarch64", target_arch = "arm64ec", target_feature = "v7"))]
unsafe impl IntoOctets for arch::poly8x8_t {}

#[cfg(any(target_arch = "aarch64", target_arch = "arm64ec", target_feature = "v7"))]
unsafe impl IntoOctets for arch::poly8x8x2_t {}

#[cfg(any(target_arch = "aarch64", target_arch = "arm64ec", target_feature = "v7"))]
unsafe impl IntoOctets for arch::poly8x8x3_t {}

#[cfg(any(target_arch = "aarch64", target_arch = "arm64ec", target_feature = "v7"))]
unsafe impl IntoOctets for arch::poly8x8x4_t {}

unsafe impl<T: IntoOctets> IntoOctets for Reverse<T> {}

unsafe impl<T: IntoOctets> IntoOctets for Saturating<T> {}

#[cfg(feature = "simd")]
unsafe impl<T: SimdElement + IntoOctets, const N: usize> IntoOctets for Simd<T, N> {}

unsafe impl<T: IntoOctets> IntoOctets for [T] {}

unsafe impl IntoOctets for str {}

/// Implemented for homogeneous tuples with up to
/// twelve members.
#[cfg_attr(feature = "unstable_docs", doc(fake_variadic))]
unsafe impl<T: IntoOctets> IntoOctets for (T,) {}

#[doc(hidden)]
unsafe impl<T: IntoOctets> IntoOctets for (T, T) {}

#[doc(hidden)]
unsafe impl<T: IntoOctets> IntoOctets for (T, T, T) {}

#[doc(hidden)]
unsafe impl<T: IntoOctets> IntoOctets for (T, T, T, T) {}

#[doc(hidden)]
unsafe impl<T: IntoOctets> IntoOctets for (T, T, T, T, T) {}

#[doc(hidden)]
unsafe impl<T: IntoOctets> IntoOctets for (T, T, T, T, T, T) {}

#[doc(hidden)]
unsafe impl<T: IntoOctets> IntoOctets for (T, T, T, T, T, T, T) {}

#[doc(hidden)]
unsafe impl<T: IntoOctets> IntoOctets for (T, T, T, T, T, T, T, T) {}

#[doc(hidden)]
unsafe impl<T: IntoOctets> IntoOctets for (T, T, T, T, T, T, T, T, T) {}

#[doc(hidden)]
unsafe impl<T: IntoOctets> IntoOctets for (T, T, T, T, T, T, T, T, T, T) {}

#[doc(hidden)]
unsafe impl<T: IntoOctets> IntoOctets for (T, T, T, T, T, T, T, T, T, T, T) {}

#[doc(hidden)]
unsafe impl<T: IntoOctets> IntoOctets for (T, T, T, T, T, T, T, T, T, T, T, T) {}

unsafe impl IntoOctets for u128 {}

unsafe impl IntoOctets for u16 {}

unsafe impl IntoOctets for u32 {}

unsafe impl IntoOctets for u64 {}

unsafe impl IntoOctets for u8 {}

#[cfg(any(target_arch = "aarch64", target_arch = "arm64ec", target_feature = "v7"))]
unsafe impl IntoOctets for arch::uint16x4_t {}

#[cfg(any(target_arch = "aarch64", target_arch = "arm64ec", target_feature = "v7"))]
unsafe impl IntoOctets for arch::uint16x4x2_t {}

#[cfg(any(target_arch = "aarch64", target_arch = "arm64ec", target_feature = "v7"))]
unsafe impl IntoOctets for arch::uint16x4x3_t {}

#[cfg(any(target_arch = "aarch64", target_arch = "arm64ec", target_feature = "v7"))]
unsafe impl IntoOctets for arch::uint16x4x4_t {}

#[cfg(any(target_arch = "aarch64", target_arch = "arm64ec", target_feature = "v7"))]
unsafe impl IntoOctets for arch::uint16x8_t {}

#[cfg(any(target_arch = "aarch64", target_arch = "arm64ec", target_feature = "v7"))]
unsafe impl IntoOctets for arch::uint16x8x2_t {}

#[cfg(any(target_arch = "aarch64", target_arch = "arm64ec", target_feature = "v7"))]
unsafe impl IntoOctets for arch::uint16x8x3_t {}

#[cfg(any(target_arch = "aarch64", target_arch = "arm64ec", target_feature = "v7"))]
unsafe impl IntoOctets for arch::uint16x8x4_t {}

#[cfg(any(target_arch = "aarch64", target_arch = "arm64ec", target_feature = "v7"))]
unsafe impl IntoOctets for arch::uint32x2_t {}

#[cfg(any(target_arch = "aarch64", target_arch = "arm64ec", target_feature = "v7"))]
unsafe impl IntoOctets for arch::uint32x2x2_t {}

#[cfg(any(target_arch = "aarch64", target_arch = "arm64ec", target_feature = "v7"))]
unsafe impl IntoOctets for arch::uint32x2x3_t {}

#[cfg(any(target_arch = "aarch64", target_arch = "arm64ec", target_feature = "v7"))]
unsafe impl IntoOctets for arch::uint32x2x4_t {}

#[cfg(any(target_arch = "aarch64", target_arch = "arm64ec", target_feature = "v7"))]
unsafe impl IntoOctets for arch::uint32x4_t {}

#[cfg(any(target_arch = "aarch64", target_arch = "arm64ec", target_feature = "v7"))]
unsafe impl IntoOctets for arch::uint32x4x2_t {}

#[cfg(any(target_arch = "aarch64", target_arch = "arm64ec", target_feature = "v7"))]
unsafe impl IntoOctets for arch::uint32x4x3_t {}

#[cfg(any(target_arch = "aarch64", target_arch = "arm64ec", target_feature = "v7"))]
unsafe impl IntoOctets for arch::uint32x4x4_t {}

#[cfg(any(target_arch = "aarch64", target_arch = "arm64ec", target_feature = "v7"))]
unsafe impl IntoOctets for arch::uint64x1_t {}

#[cfg(any(target_arch = "aarch64", target_arch = "arm64ec", target_feature = "v7"))]
unsafe impl IntoOctets for arch::uint64x1x2_t {}

#[cfg(any(target_arch = "aarch64", target_arch = "arm64ec", target_feature = "v7"))]
unsafe impl IntoOctets for arch::uint64x1x3_t {}

#[cfg(any(target_arch = "aarch64", target_arch = "arm64ec", target_feature = "v7"))]
unsafe impl IntoOctets for arch::uint64x1x4_t {}

#[cfg(any(target_arch = "aarch64", target_arch = "arm64ec", target_feature = "v7"))]
unsafe impl IntoOctets for arch::uint64x2_t {}

#[cfg(any(target_arch = "aarch64", target_arch = "arm64ec", target_feature = "v7"))]
unsafe impl IntoOctets for arch::uint64x2x2_t {}

#[cfg(any(target_arch = "aarch64", target_arch = "arm64ec", target_feature = "v7"))]
unsafe impl IntoOctets for arch::uint64x2x3_t {}

#[cfg(any(target_arch = "aarch64", target_arch = "arm64ec", target_feature = "v7"))]
unsafe impl IntoOctets for arch::uint64x2x4_t {}

#[cfg(any(target_arch = "aarch64", target_arch = "arm64ec", target_feature = "v7"))]
unsafe impl IntoOctets for arch::uint8x16_t {}

#[cfg(any(target_arch = "aarch64", target_arch = "arm64ec", target_feature = "v7"))]
unsafe impl IntoOctets for arch::uint8x16x2_t {}

#[cfg(any(target_arch = "aarch64", target_arch = "arm64ec", target_feature = "v7"))]
unsafe impl IntoOctets for arch::uint8x16x3_t {}

#[cfg(any(target_arch = "aarch64", target_arch = "arm64ec", target_feature = "v7"))]
unsafe impl IntoOctets for arch::uint8x16x4_t {}

#[cfg(any(target_arch = "aarch64", target_arch = "arm64ec", target_feature = "v7"))]
unsafe impl IntoOctets for arch::uint8x8_t {}

#[cfg(any(target_arch = "aarch64", target_arch = "arm64ec", target_feature = "v7"))]
unsafe impl IntoOctets for arch::uint8x8x2_t {}

#[cfg(any(target_arch = "aarch64", target_arch = "arm64ec", target_feature = "v7"))]
unsafe impl IntoOctets for arch::uint8x8x3_t {}

#[cfg(any(target_arch = "aarch64", target_arch = "arm64ec", target_feature = "v7"))]
unsafe impl IntoOctets for arch::uint8x8x4_t {}

unsafe impl IntoOctets for () {}

unsafe impl<T: IntoOctets> IntoOctets for UnsafeCell<T> {}

unsafe impl IntoOctets for usize {}

#[cfg(target_arch = "wasm32")]
unsafe impl IntoOctets for arch::v128 {}

unsafe impl<T: IntoOctets> IntoOctets for Wrapping<T> {}