Skip to main content

Output

Trait Output 

Source
pub unsafe trait Output<T>: Sized + Sealed<T> {
    // Required method
    fn write(self, item: T);
}
Expand description

§Safety

By using this trait, implementors of functions are promising to call write, so that when the function returns, there is a value written to the output. For example, users can pass a reference to MaybeUninit and rely on the fact that it got initialised to safely call assume_init.

idk how to enforce the above properly using unsafe etc.

Required Methods§

Source

fn write(self, item: T)

Stores a value

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementations on Foreign Types§

Source§

impl<T> Output<T> for &mut MaybeUninit<T>

Source§

fn write(self, item: T)

Source§

impl<T> Output<T> for &mut Option<T>

Source§

fn write(self, item: T)

Source§

impl<T> Output<T> for &mut T

Source§

fn write(self, item: T)

Implementors§