common:: utils:: StaticUninitializedBuffer
StaticUninitializedBuffer type represents a statically allocated
buffer that can be converted to another type once it has been initialized.
Upon initialization, a static mutable reference is returned and the
StaticUninitializedBuffer is consumed.
This type is implemented as a wrapper containing a static mutable reference to
UninitializedBuffer. This guarantees that the memory pointed to by the
reference has not already been initialized.
StaticUninitializedBuffer provides one operation:
initialize() that returns a
&'static mut T reference. This is the only way to get the reference, and
ensures that the underlying uninitialized buffer is properly initialized.
The wrapper is also consumed when
initialize() is called, ensuring that
the underlying memory cannot be subsequently re-initialized.
pub fn new(buf: &'static mut UninitializedBuffer<T>) -> Self[src]
This function is not intended to be called publicly. It's only meant to
be called within
static_buf! macro, but Rust's visibility rules
require it to be public, so that the macro's body can be instantiated.
pub unsafe fn initialize(self, value: T) -> &'static mut T[src]
This function consumes an uninitialized static buffer, initializes it
to some value, and returns a static mutable reference to it. This
allows for runtime initialization of
static values that do not have a
Auto Trait Implementations
impl<T> Send for StaticUninitializedBuffer<T> where
impl<T> Sync for StaticUninitializedBuffer<T> where
impl<T> Unpin for StaticUninitializedBuffer<T>
type Error = Infallible
The type returned in the event of a conversion error.