Trait nalgebra::base::uninit::InitStatus [−][src]
pub unsafe trait InitStatus<T>: Copy {
type Value;
fn init(out: &mut Self::Value, t: T);
unsafe fn assume_init_ref(t: &Self::Value) -> &T;
unsafe fn assume_init_mut(t: &mut Self::Value) -> &mut T;
}
Expand description
This trait is used to write code that may work on matrices that may or may not be initialized.
This trait is used to describe how a value must be accessed to initialize it or
to retrieve a reference or mutable reference. Typically, a function accepting
both initialized and uninitialized inputs should have a Status: InitStatus<T>
type parameter. Then the methods of the Status
can be used to access the element.
Safety
This trait must not be implemented outside of this crate.
Associated Types
Required methods
unsafe fn assume_init_ref(t: &Self::Value) -> &T
unsafe fn assume_init_ref(t: &Self::Value) -> &T
Retrieve a reference to the element, assuming that it is initialized.
Safety
This is unsound if the referenced value isn’t initialized.
unsafe fn assume_init_mut(t: &mut Self::Value) -> &mut T
unsafe fn assume_init_mut(t: &mut Self::Value) -> &mut T
Retrieve a mutable reference to the element, assuming that it is initialized.
Safety
This is unsound if the referenced value isn’t initialized.