pub struct GcPtr<T: ?Sized> { /* private fields */ }
Expand description
A pointer to a garbage collected value.
It is only safe to access data through a GcPtr
if the value is rooted (stored in a place
where the garbage collector will find it during the mark phase).
Implementations
sourceimpl<T: ?Sized> GcPtr<T>
impl<T: ?Sized> GcPtr<T>
sourcepub unsafe fn as_mut(&mut self) -> &mut T
pub unsafe fn as_mut(&mut self) -> &mut T
Unsafe as it is up to the caller to ensure that this pointer is not referenced somewhere else
sourcepub unsafe fn from_raw(ptr: *const T) -> GcPtr<T>
pub unsafe fn from_raw(ptr: *const T) -> GcPtr<T>
Unsafe as ptr
must have been allocted by this garbage collector
pub fn generation(&self) -> Generation
pub fn poly_tag(&self) -> Option<InternedStr>
pub fn field_map(&self) -> &FnvMap<InternedStr, VmIndex>
pub fn field_names(&self) -> &Arc<Vec<InternedStr>>
pub fn ptr_eq(self, other: GcPtr<T>) -> bool
sourceimpl<'a, T: Traverseable + Send + Sync + 'a> GcPtr<T>
impl<'a, T: Traverseable + Send + Sync + 'a> GcPtr<T>
sourcepub fn as_traverseable(self) -> GcPtr<dyn Traverseable + Send + Sync + 'a>
pub fn as_traverseable(self) -> GcPtr<dyn Traverseable + Send + Sync + 'a>
Coerces self
to a Traverseable
trait object
sourceimpl GcPtr<str>
impl GcPtr<str>
sourcepub fn as_traverseable_string(self) -> GcPtr<dyn Traverseable + Send + Sync>
pub fn as_traverseable_string(self) -> GcPtr<dyn Traverseable + Send + Sync>
Coerces self
to a Traverseable
trait object
Trait Implementations
sourceimpl<T: ?Sized + Ord> Ord for GcPtr<T>
impl<T: ?Sized + Ord> Ord for GcPtr<T>
1.21.0 · sourcefn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
1.21.0 · sourcefn min(self, other: Self) -> Selfwhere
Self: Sized,
fn min(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the minimum of two values. Read more
1.50.0 · sourcefn clamp(self, min: Self, max: Self) -> Selfwhere
Self: Sized + PartialOrd<Self>,
fn clamp(self, min: Self, max: Self) -> Selfwhere
Self: Sized + PartialOrd<Self>,
Restrict a value to a certain interval. Read more
sourceimpl<T: ?Sized + PartialEq> PartialEq<GcPtr<T>> for GcPtr<T>
impl<T: ?Sized + PartialEq> PartialEq<GcPtr<T>> for GcPtr<T>
sourceimpl<T: ?Sized + PartialOrd> PartialOrd<GcPtr<T>> for GcPtr<T>
impl<T: ?Sized + PartialOrd> PartialOrd<GcPtr<T>> for GcPtr<T>
sourcefn partial_cmp(&self, other: &GcPtr<T>) -> Option<Ordering>
fn partial_cmp(&self, other: &GcPtr<T>) -> Option<Ordering>
1.0.0 · sourcefn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for
self
and other
) and is used by the <=
operator. Read moresourceimpl<T: ?Sized> Traverseable for GcPtr<T>where
T: Traverseable,
impl<T: ?Sized> Traverseable for GcPtr<T>where
T: Traverseable,
When traversing a GcPtr
we need to mark it
impl<T: ?Sized> Copy for GcPtr<T>
impl<T: ?Sized + Eq> Eq for GcPtr<T>
impl<T: ?Sized + Send + Sync> Send for GcPtr<T>
impl<T: ?Sized + Send + Sync> Sync for GcPtr<T>
Auto Trait Implementations
impl<T: ?Sized> RefUnwindSafe for GcPtr<T>where
T: RefUnwindSafe,
impl<T: ?Sized> Unpin for GcPtr<T>
impl<T: ?Sized> UnwindSafe for GcPtr<T>where
T: RefUnwindSafe,
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more