pub struct BlobEntry {
pub hash: ContentHash,
pub modified_unix_ms: i64,
}Expand description
One stored blob and when it was last written.
The timestamp is Unix milliseconds rather than a SystemTime because this
type crosses the daemon’s HTTP and gRPC surfaces, where milliseconds are the
wire form; keeping one type avoids a near-identical DTO in the client and the
server. Use from_system_time and
age rather than reading the field arithmetically.
Fields§
§hash: ContentHash§modified_unix_ms: i64Implementations§
Source§impl BlobEntry
impl BlobEntry
pub fn from_system_time(hash: ContentHash, modified: SystemTime) -> Self
Sourcepub fn age(&self, now: SystemTime) -> Option<Duration>
pub fn age(&self, now: SystemTime) -> Option<Duration>
How old this blob is at now, or None when it is dated in the future.
Callers treat None as “too young to sweep”: a blob dated ahead of the
GC host’s clock must not be deleted on the strength of a clock
disagreement.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for BlobEntry
impl<'de> Deserialize<'de> for BlobEntry
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
impl Eq for BlobEntry
impl StructuralPartialEq for BlobEntry
Auto Trait Implementations§
impl Freeze for BlobEntry
impl RefUnwindSafe for BlobEntry
impl Send for BlobEntry
impl Sync for BlobEntry
impl Unpin for BlobEntry
impl UnsafeUnpin for BlobEntry
impl UnwindSafe for BlobEntry
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