#[repr(transparent)]pub(crate) struct ObjCell(Cell<Gc<ObjectType<'static>>>);
Expand description
This type represents and immutable view into an Object. The reason we have
an additional type is because there could be other references to this same
cell that can change the underlying data, so this is wrapper around
std::cell::Cell
type. It is not valid to mutate the data under a reference
unless it is inside an Unsafe
Cell. However because this struct could also
be used in an immutable data structure (function constants), we need to
ensure that this cell cannot be mutated by default. This type is not safe to
be copy or clone.
Tuple Fields§
§0: Cell<Gc<ObjectType<'static>>>
Implementations§
Trait Implementations§
impl Eq for ObjCell
impl StructuralPartialEq for ObjCell
Auto Trait Implementations§
impl !Freeze for ObjCell
impl !RefUnwindSafe for ObjCell
impl Send for ObjCell
impl !Sync for ObjCell
impl Unpin for ObjCell
impl !UnwindSafe for ObjCell
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<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.