pub trait ImagoAsRef<'a, T: ?Sized> {
// Required method
fn as_ref(&self) -> &'a T;
}Expand description
Similar to AsRef, but for types where AsRef is not implemented.
When we need AsRef for a type but it is not implemented in its origin crate, there is no way
but to provide a local trait that we can implement here. Because there are no negative trait
bounds, we cannot implement this for AsRef (to have a common trait).
Also includes a lifetime so that it is possible to borrow things for longer.
Required Methods§
Implementations on Foreign Types§
Source§impl<'a, B: BitmapSlice> ImagoAsRef<'a, VolatileSlice<'a, B>> for &'a VolatileSlice<'a, B>
Available on crate feature vm-memory only.
impl<'a, B: BitmapSlice> ImagoAsRef<'a, VolatileSlice<'a, B>> for &'a VolatileSlice<'a, B>
Available on crate feature
vm-memory only.Source§impl<'a, T: ?Sized, U: ImagoAsRef<'a, T>> ImagoAsRef<'a, T> for &'a U
Available on crate feature vm-memory only.
impl<'a, T: ?Sized, U: ImagoAsRef<'a, T>> ImagoAsRef<'a, T> for &'a U
Available on crate feature
vm-memory only.