pub struct GcObject {
pub id: GcObjectId,
pub size_bytes: u64,
pub ref_count: u32,
pub pinned: bool,
pub created_at: u64,
pub last_marked: Option<u64>,
pub links: Vec<GcObjectId>,
}Expand description
A node in the content-addressed DAG.
Fields§
§id: GcObjectIdUnique identifier (CID).
size_bytes: u64Size of this object in bytes.
ref_count: u32External reference count (from the application layer).
pinned: boolIf true, this object is never collected regardless of reachability.
created_at: u64Unix timestamp (seconds) when this object was created.
last_marked: Option<u64>Unix timestamp of the last GC mark pass that reached this object.
links: Vec<GcObjectId>CIDs of objects this object references (outgoing DAG edges).
Implementations§
Source§impl GcObject
impl GcObject
Sourcepub fn new(
id: GcObjectId,
size_bytes: u64,
created_at: u64,
links: Vec<GcObjectId>,
) -> Self
pub fn new( id: GcObjectId, size_bytes: u64, created_at: u64, links: Vec<GcObjectId>, ) -> Self
Convenience constructor.
Sourcepub fn with_ref_count(self, ref_count: u32) -> Self
pub fn with_ref_count(self, ref_count: u32) -> Self
Set the initial reference count and return self.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for GcObject
impl RefUnwindSafe for GcObject
impl Send for GcObject
impl Sync for GcObject
impl Unpin for GcObject
impl UnsafeUnpin for GcObject
impl UnwindSafe for GcObject
Blanket Implementations§
impl<T> Allocation for T
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<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more