Trait Output

Source
pub unsafe trait Output<T>: Sized + OutputSealed<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", so this trait is not object safe.

Implementations on Foreign Types§

Source§

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

Source§

fn write(self, item: T)

Implementors§

Source§

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

Source§

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

Source§

impl<T, O> Output<T> for OutputDebug<T, O>
where O: Output<T>,