Skip to main content

WrapRef

Trait WrapRef 

Source
pub trait WrapRef {
    type WrapRef<'a, T: ?Sized + 'a>: Deref<Target = T>;
}
Expand description

Generic immutable/shared reference type wrappers

Specialized version of Wrap that requires Deref, so you can read the underlying T even if the wrapper type is polymorphic.

If your wrapper type doesn’t implement Deref, you should implement the Wrap trait instead.

Required Associated Types§

Source

type WrapRef<'a, T: ?Sized + 'a>: Deref<Target = T>

Dyn Compatibility§

This trait is not dyn compatible.

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

Implementors§

Source§

impl WrapRef for WArc

Wrap with Arc

Source§

type WrapRef<'a, T: ?Sized + 'a> = Arc<T>

Source§

impl WrapRef for WRc

Wrap with Rc

Source§

type WrapRef<'a, T: ?Sized + 'a> = Rc<T>

Source§

impl WrapRef for WRef

Wrap with &

Source§

type WrapRef<'a, T: ?Sized + 'a> = &'a T

Source§

impl WrapRef for WRefCell

Wrap with Ref

Source§

type WrapRef<'a, T: ?Sized + 'a> = Ref<'a, T>

Source§

impl<R: WrapMut> WrapRef for R

Anything implementing WrapMut trivially implements WrapRef.

Source§

type WrapRef<'a, T: ?Sized + 'a> = <R as WrapMut>::WrapMut<'a, T>