Type Alias gluon_vm::gc::OwnedGcRef
source · pub type OwnedGcRef<'a, T> = Borrow<'a, OwnedPtr<T>>;
Aliased Type§
struct OwnedGcRef<'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