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.

Required Associated Types§

The type of the values with the initialization status described by Self.

Required Methods§

Initialize the given element.

Retrieve a reference to the element, assuming that it is initialized.

Safety

This is unsound if the referenced value isn’t initialized.

Retrieve a mutable reference to the element, assuming that it is initialized.

Safety

This is unsound if the referenced value isn’t initialized.

Implementors§