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§
source§impl<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<[InternedStr]>
pub fn ptr_eq(&self, other: &GcPtr<T>) -> bool
pub unsafe fn unrooted(&self) -> Self
pub fn as_lifetime(&self) -> &()
pub unsafe fn cast<U>(ptr: Self) -> GcPtr<U>
Trait Implementations§
source§impl<T: ?Sized> CloneUnrooted for GcPtr<T>
impl<T: ?Sized> CloneUnrooted for GcPtr<T>
source§impl<T: ?Sized> CopyUnrooted for GcPtr<T>
impl<T: ?Sized> CopyUnrooted for GcPtr<T>
unsafe fn copy_unrooted(&self) -> Self
source§impl<'de, 'gc, T> DeserializeState<'de, DeSeed<'gc>> for GcPtr<T>
impl<'de, 'gc, T> DeserializeState<'de, DeSeed<'gc>> for GcPtr<T>
source§fn deserialize_state<D>(
seed: &mut DeSeed<'gc>,
deserializer: D
) -> Result<Self, D::Error>where
D: Deserializer<'de>,
fn deserialize_state<D>(
seed: &mut DeSeed<'gc>,
deserializer: D
) -> Result<Self, D::Error>where
D: Deserializer<'de>,
Deserializes
Self
using seed
and the deserializer
source§impl<'de, 'gc> DeserializeState<'de, DeSeed<'gc>> for GcPtr<ValueStr>
impl<'de, 'gc> DeserializeState<'de, DeSeed<'gc>> for GcPtr<ValueStr>
source§fn deserialize_state<D>(
seed: &mut DeSeed<'gc>,
deserializer: D
) -> Result<Self, D::Error>where
D: Deserializer<'de>,
fn deserialize_state<D>(
seed: &mut DeSeed<'gc>,
deserializer: D
) -> Result<Self, D::Error>where
D: Deserializer<'de>,
Deserializes
Self
using seed
and the deserializer
source§impl<'gc> From<&'gc GcPtr<ClosureData>> for Variants<'gc>
impl<'gc> From<&'gc GcPtr<ClosureData>> for Variants<'gc>
source§fn from(v: &'gc GcPtr<ClosureData>) -> Self
fn from(v: &'gc GcPtr<ClosureData>) -> Self
Converts to this type from the input type.
source§impl<T: ?Sized + Ord> Ord for GcPtr<T>
impl<T: ?Sized + Ord> Ord for GcPtr<T>
source§impl<T: ?Sized + PartialEq> PartialEq for GcPtr<T>
impl<T: ?Sized + PartialEq> PartialEq for GcPtr<T>
source§impl<T: ?Sized + PartialOrd> PartialOrd for GcPtr<T>
impl<T: ?Sized + PartialOrd> PartialOrd for GcPtr<T>
1.0.0 · source§fn 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 moresource§impl<T, Seed> SerializeState<Seed> for GcPtr<T>
impl<T, Seed> SerializeState<Seed> for GcPtr<T>
source§fn serialize_state<S>(
&self,
serializer: S,
seed: &Seed
) -> Result<S::Ok, S::Error>where
S: Serializer,
fn serialize_state<S>(
&self,
serializer: S,
seed: &Seed
) -> Result<S::Ok, S::Error>where
S: Serializer,
Serializes
self
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§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
§impl<T> CallHasher for T
impl<T> CallHasher for T
§impl<Q, K> Comparable<K> for Q
impl<Q, K> Comparable<K> for Q
§impl<Choices> CoproductSubsetter<CNil, HNil> for Choices
impl<Choices> CoproductSubsetter<CNil, HNil> for Choices
§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Convert
Box<dyn Trait>
(where Trait: Downcast
) to Box<dyn Any>
. Box<dyn Any>
can
then be further downcast
into Box<ConcreteType>
where ConcreteType
implements Trait
.§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Convert
Rc<Trait>
(where Trait: Downcast
) to Rc<Any>
. Rc<Any>
can then be
further downcast
into Rc<ConcreteType>
where ConcreteType
implements Trait
.§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
Convert
&Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &Any
’s vtable from &Trait
’s.§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
Convert
&mut Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &mut Any
’s vtable from &mut Trait
’s.source§impl<T> DowncastArc for T
impl<T> DowncastArc for T
§impl<T> DowncastSync for T
impl<T> DowncastSync for T
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Checks if this value is equivalent to the given key. Read more
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key
and return true
if they are equal.