#[non_exhaustive]pub struct LateLayoutInitToken;Expand description
A marker type indicating that the layouts for all late_struct!s
throughout the compiled artifact have been determined at runtime.
This initialization process happens automatically upon the first instantiation of a
LateInstance. Indeed, you can use the init_token
method of a LateInstance to obtain an instance of this struct for free.
Implementations§
Source§impl LateLayoutInitToken
impl LateLayoutInitToken
Sourcepub fn new() -> Self
pub fn new() -> Self
Resolves all late-initialized structures in the compiled artifact and returns a token attesting to this fact. The late initialization process only happens once during the program’s lifetime.
The late-initialization routine does not makes uncontrolled calls to user-controlled functions.
Sourcepub const unsafe fn new_unchecked() -> Self
pub const unsafe fn new_unchecked() -> Self
Unsafely asserts that the layout for all late-initialized structures in the compiled artifact have already been resolved.
Unless you have specific performance reasons to do so, you should probably be using
LateLayoutInitToken::new.
§Safety
Although this method cannot, by itself, cause undefined behavior, passing this object to a method which expects the layout of late-initialized structure to already be resolved when the layouts are not yet resolved could easily cause undefined behavior.
Trait Implementations§
Source§impl Clone for LateLayoutInitToken
impl Clone for LateLayoutInitToken
Source§fn clone(&self) -> LateLayoutInitToken
fn clone(&self) -> LateLayoutInitToken
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more