Skip to main content

Wrap

Trait Wrap 

Source
pub trait Wrap {
    type Wrap<'a, T: ?Sized + 'a>;
}
Expand description

Generic reference type wrappers

This is a generalized version of WrapRef that doesn’t require Deref, so you can use wrappers that may not have the type they’re wrapping.

If your wrapper type implements Deref, you should implement the WrapRef trait instead, and you’ll get a Wrap impl for free.

Required Associated Types§

Source

type Wrap<'a, T: ?Sized + 'a>

Dyn Compatibility§

This trait is not dyn compatible.

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

Implementors§

Source§

impl Wrap for WPhantomData

Wrap with PhantomData

Source§

type Wrap<'a, T: ?Sized + 'a> = PhantomData<T>

Source§

impl<R: WrapRef> Wrap for R

Anything implementing WrapRef trivially implements Wrap.

Source§

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