pub type GcRef<'a, T> = Borrow<'a, GcPtr<T>>;
Aliased Type§
struct GcRef<'a, T>(/* private fields */);
Implementations§
source§impl<'gc, T> Borrow<'gc, T>
impl<'gc, T> Borrow<'gc, T>
pub fn new(value: &'gc T) -> Borrow<'gc, T::Value>where T: CloneUnrooted,
pub fn from_static(value: T) -> Selfwhere T: 'static,
pub fn map<U>(&self, f: impl FnOnce(&T) -> &U) -> Borrow<'gc, U::Value>where U: CloneUnrooted,
pub unsafe fn map_unrooted<U>(self, f: impl FnOnce(T) -> U) -> Borrow<'gc, U>
pub unsafe fn unrooted(self) -> T
pub fn as_lifetime(&self) -> &'gc ()
Trait Implementations§
source§impl<T> CloneUnrooted for Borrow<'_, T>where
T: CloneUnrooted,
impl<T> CloneUnrooted for Borrow<'_, T>where T: CloneUnrooted,
type Value = <T as CloneUnrooted>::Value
source§unsafe fn clone_unrooted(&self) -> Self::Value
unsafe fn clone_unrooted(&self) -> Self::Value
Creates a clone of the value that is not rooted. To ensure safety the value must be
forgotten or rooted before the next garbage collection
source§impl<'a, T> DataDef for Borrow<'a, T>where
T: DataDef,
T::Value: Sized,
impl<'a, T> DataDef for Borrow<'a, T>where T: DataDef, T::Value: Sized,
source§impl<'gc, T: ?Sized> From<Borrow<'gc, OwnedPtr<T>>> for GcRef<'gc, T>
impl<'gc, T: ?Sized> From<Borrow<'gc, OwnedPtr<T>>> for GcRef<'gc, T>
source§fn from(ptr: OwnedGcRef<'gc, T>) -> Self
fn from(ptr: OwnedGcRef<'gc, T>) -> Self
Freezes self
into a shared pointer