wiwi::chain

Trait OutputStorage

Source
pub unsafe trait OutputStorage<T>
where Self: Sized + OutputStorageSealed<T>,
{ // Required method unsafe fn store(self, item: T); }
Expand description

Trait for output locations that can be passed to a chainer

§Safety

Consumers of this trait must call store before they return again, implementors must make sure that self is written to when called, so users can rely on the fact that the output location was written to. For example, users can pass a reference to MaybeUninit and rely on the fact that it got initialised, and safely call assume_init.

Required Methods§

Source

unsafe fn store(self, item: T)

§Safety

This can and should only be called once, and you must call it before returning, so users can rely on the fact that something got stored in self

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> OutputStorage<T> for &mut T

Source§

unsafe fn store(self, item: T)

Implementors§

Source§

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

Source§

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