Trait r3::sync::source::Source

source ·
pub trait Source<System> {
    type Target: 'static;

    // Required method
    fn into_unsafe_cell_hunk<C>(
        self,
        cfg: &mut Cfg<'_, C>
    ) -> Hunk<System, UnsafeCell<MaybeUninit<Self::Target>>>
       where C: CfgBase<System = System>;
}
Available on crate feature sync only.
Expand description

Abstracts the various ways to provide an initial value to static cell types (e.g., Mutex). It’s mostly used through their definer types.

Stability

This trait is unstable.

Required Associated Types§

source

type Target: 'static

Required Methods§

source

fn into_unsafe_cell_hunk<C>( self, cfg: &mut Cfg<'_, C> ) -> Hunk<System, UnsafeCell<MaybeUninit<Self::Target>>>where C: CfgBase<System = System>,

Construct a Hunk to store the value.

Self::Target in the returned Hunk is safe to access from executable objects through MaybeUninit. The client may grant mutable access to Self::Target through UnsafeCell while observing the borrow rules.

Implementors§

source§

impl<System, Binder, Func> Source<System> for NewBindSource<Binder, Func>where System: KernelBase + KernelStatic, Func: FnBind<Binder>, Func::Output: Send,

§

type Target = <Func as FnBind<Binder>>::Output

source§

impl<System, T> Source<System> for DefaultSource<T>where System: KernelBase + KernelStatic, T: 'static + Default + Send,

§

type Target = T

source§

impl<System, T> Source<System> for HunkSource<System, T>where T: 'static,

§

type Target = T

source§

impl<System, T> Source<System> for TakeBindSource<'_, System, T>where System: KernelBase + KernelStatic, T: 'static + Send,

§

type Target = T