pub struct GcHeader {
pub kind: u8,
pub size: u32,
/* private fields */
}Expand description
8-byte header prepended to every GC-managed object.
Fields§
§kind: u8HeapKind discriminant for type identification during tracing.
size: u32Object size in bytes (excluding this header).
Implementations§
Source§impl GcHeader
impl GcHeader
Sourcepub fn new(kind: u8, size: u32) -> Self
pub fn new(kind: u8, size: u32) -> Self
Create a new header for a young-generation white object.
Sourcepub fn generation(&self) -> Generation
pub fn generation(&self) -> Generation
Get the generation.
Sourcepub fn set_generation(&mut self, generation: Generation)
pub fn set_generation(&mut self, generation: Generation)
Set the generation.
Sourcepub fn is_forwarded(&self) -> bool
pub fn is_forwarded(&self) -> bool
Check if this object has been forwarded (relocated).
Sourcepub fn set_forwarded(&mut self, forwarded: bool)
pub fn set_forwarded(&mut self, forwarded: bool)
Mark this object as forwarded.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for GcHeader
impl RefUnwindSafe for GcHeader
impl Send for GcHeader
impl Sync for GcHeader
impl Unpin for GcHeader
impl UnsafeUnpin for GcHeader
impl UnwindSafe for GcHeader
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