any_ref-0.1.0 has been yanked.
Please take a look at owning_ref before using this crate,
which is excellent and more suitable for simple usage. One of the shortages of owning_ref
is that owning_ref
can
only keeps reference and cannot keeps arbitrary struct with lifetime annotation. any_ref
is here
to resolve this problem.
Pre-made types:
make_any_ref!(
pub type Reference<T:'static + ?Sized> = for<'a> &'a T;
pub type ReferenceMut<T:'static + ?Sized> = for<'a> &'a mut T;
);
Example
use ;
make_any_ref!
let moved_ar;
assert_eq!;
let moved_ar;
assert_eq!;