lock_order::wrap

Trait LockedWrapper

Source
pub trait LockedWrapper<T, L>
where T: Deref,
{ type AtLockLevel<'l, M>: LockedWrapper<&'l T::Target, M> where M: 'l, T: 'l; type CastWrapper<X>: LockedWrapper<X, L> where X: Deref, X::Target: Sized; // Required methods fn wrap<'l, M>(locked: Locked<&'l T::Target, M>) -> Self::AtLockLevel<'l, M> where M: 'l, T: 'l; fn wrap_cast<R: Deref>(locked: Locked<R, L>) -> Self::CastWrapper<R> where R::Target: Sized; fn get_mut(&mut self) -> &mut Locked<T, L>; fn get(&self) -> &Locked<T, L>; }
Expand description

A trait implemented by newtypes on Locked

Required Associated Types§

Source

type AtLockLevel<'l, M>: LockedWrapper<&'l T::Target, M> where M: 'l, T: 'l

The same wrapper at a different lock level.

Source

type CastWrapper<X>: LockedWrapper<X, L> where X: Deref, X::Target: Sized

The same wrapper with a different locked state.

Required Methods§

Source

fn wrap<'l, M>(locked: Locked<&'l T::Target, M>) -> Self::AtLockLevel<'l, M>
where M: 'l, T: 'l,

Wraps Locked into a newtype.

Source

fn wrap_cast<R: Deref>(locked: Locked<R, L>) -> Self::CastWrapper<R>
where R::Target: Sized,

Wraps a Locked into a different wrapper implementation.

Source

fn get_mut(&mut self) -> &mut Locked<T, L>

Gets a mutable reference to the wrapped Locked.

Source

fn get(&self) -> &Locked<T, L>

Gets an immutable reference to the wrapped Locked.

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.

Implementors§

Source§

impl<T, L> LockedWrapper<T, L> for Locked<T, L>
where T: Deref, T::Target: Sized,

Source§

type AtLockLevel<'l, M> = Locked<&'l <T as Deref>::Target, M> where M: 'l, T: 'l

Source§

type CastWrapper<X> = Locked<X, L> where X: Deref, X::Target: Sized