pub enum PointerObj {
Released,
UpVal(UpValue),
Struct(Rc<(RefCell<StructObj>, RCount)>, GosMetadata),
Array(Rc<(ArrayObj, RCount)>, GosMetadata),
Slice(Rc<(SliceObj, RCount)>, GosMetadata),
Map(Rc<(MapObj, RCount)>, GosMetadata),
SliceMember(Rc<(SliceObj, RCount)>, OpIndex),
StructField(Rc<(RefCell<StructObj>, RCount)>, OpIndex),
PkgMember(PackageKey, OpIndex),
}
Expand description
Logically there are 4 types of pointers, they point to:
- local
- slice member
- struct field
- package member and for pointers to locals, the default way of handling it is to use “UpValue” (PointerObj::UpVal). Struct/Map/Slice are optimizations for this type, when the pointee has a “real” pointer
Variants§
Released
UpVal(UpValue)
Struct(Rc<(RefCell<StructObj>, RCount)>, GosMetadata)
Array(Rc<(ArrayObj, RCount)>, GosMetadata)
Slice(Rc<(SliceObj, RCount)>, GosMetadata)
Map(Rc<(MapObj, RCount)>, GosMetadata)
SliceMember(Rc<(SliceObj, RCount)>, OpIndex)
StructField(Rc<(RefCell<StructObj>, RCount)>, OpIndex)
PkgMember(PackageKey, OpIndex)
Implementations§
Source§impl PointerObj
impl PointerObj
pub fn new_local(val: GosValue) -> PointerObj
pub fn set_local_ref_type(&self, val: GosValue)
pub fn deep_clone(&self, gcos: &GcoVec) -> PointerObj
Sourcepub fn ref_sub_one(&self)
pub fn ref_sub_one(&self)
for gc
Sourcepub fn mark_dirty(&self, queue: &mut RCQueue)
pub fn mark_dirty(&self, queue: &mut RCQueue)
for gc
Trait Implementations§
Source§impl Clone for PointerObj
impl Clone for PointerObj
Source§fn clone(&self) -> PointerObj
fn clone(&self) -> PointerObj
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl Debug for PointerObj
impl Debug for PointerObj
Source§impl Display for PointerObj
impl Display for PointerObj
Source§impl Hash for PointerObj
impl Hash for PointerObj
Source§impl PartialEq for PointerObj
impl PartialEq for PointerObj
impl Eq for PointerObj
Auto Trait Implementations§
impl Freeze for PointerObj
impl !RefUnwindSafe for PointerObj
impl !Send for PointerObj
impl !Sync for PointerObj
impl Unpin for PointerObj
impl !UnwindSafe for PointerObj
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