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
//! Initialization traits for unsized types with compile-time size guarantees.
//!
//! This module provides traits for initializing unsized types from statically-sized arguments,
//! enabling safe initialization of dynamically-sized data structures with known initialization
//! requirements. The `UnsizedInit` trait ensures memory allocation is predictable at compile-time.
use UnsizedType;
use crateResult;
use Zeroable;
/// An [`UnsizedType`] that can be initialized with a statically sized `InitArg`.
/// Allows implementing `UnsizedInit<DefaultInit>` for [`bytemuck`] types.
///
/// We have a blanket implementation for types that implement [`Zeroable`], so this can only be implemented
/// for types that don't.
/// Argument for initializing a type to a default value.
;