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>

source

pub fn new(value: &'gc T) -> Borrow<'gc, T::Value>where T: CloneUnrooted,

source

pub fn from_static(value: T) -> Selfwhere T: 'static,

source

pub fn map<U>(&self, f: impl FnOnce(&T) -> &U) -> Borrow<'gc, U::Value>where U: CloneUnrooted,

source

pub unsafe fn map_unrooted<U>(self, f: impl FnOnce(T) -> U) -> Borrow<'gc, U>

source

pub unsafe fn unrooted(self) -> T

source

pub fn as_lifetime(&self) -> &'gc ()

Trait Implementations§

source§

impl<T> CloneUnrooted for Borrow<'_, T>where T: CloneUnrooted,

§

type Value = <T as CloneUnrooted>::Value

source§

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,

§

type Value = <T as DataDef>::Value

The type of the value allocated.
source§

fn size(&self) -> usize

Returns how many bytes need to be allocted for this DataDef
source§

fn initialize(self, result: WriteOnly<'_, Self::Value>) -> &mut Self::Value

Consumes self to initialize the allocated value. Returns the initialized pointer.
source§

fn fields(&self) -> Option<&[InternedStr]>

source§

fn tag(&self) -> Option<&InternedStr>

source§

impl<'a, T: Debug> Debug for Borrow<'a, T>

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl<T> Deref for Borrow<'_, T>

§

type Target = T

The resulting type after dereferencing.
source§

fn deref(&self) -> &T

Dereferences the value.
source§

impl<T> DerefMut for Borrow<'_, T>

source§

fn deref_mut(&mut self) -> &mut T

Mutably dereferences the value.
source§

impl<'a, T: PartialEq> PartialEq<Borrow<'a, T>> for Borrow<'a, T>

source§

fn eq(&self, other: &Borrow<'a, T>) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl<'a, T: StackPrimitive + 'a> StackPrimitive for Borrow<'a, T>

source§

fn push_to(&self, stack: &mut Stack)

source§

fn extend_to<'b, I>(iter: I, stack: &mut Stack)where I: IntoIterator<Item = &'b Self>, Self: 'b,

source§

impl<'a, T: Trace> Trace for Borrow<'a, T>

source§

fn trace(&self, gc: &mut Gc)

source§

unsafe fn root(&mut self)

source§

unsafe fn unroot(&mut self)

source§

impl<'a, T: Eq> Eq for Borrow<'a, T>

source§

impl<'a, T> StructuralEq for Borrow<'a, T>

source§

impl<'a, T> StructuralPartialEq for Borrow<'a, T>