pub trait TagCounter: TagDrop + Sized {
// Required method
fn on_create(&self, inner: &HashAndFormat);
// Provided methods
fn as_weak(self: &Arc<Self>) -> Weak<dyn TagDrop> { ... }
fn temp_tag(self: &Arc<Self>, inner: HashAndFormat) -> TempTag { ... }
}
Expand description
A trait for things that can track liveness of blobs and collections.
This trait works together with TempTag to keep track of the liveness of a blob or collection.
It is important to include the format in the liveness tracking, since protecting a collection means protecting the blob and all its children, whereas protecting a raw blob only protects the blob itself.
Required Methods§
Sourcefn on_create(&self, inner: &HashAndFormat)
fn on_create(&self, inner: &HashAndFormat)
Called on creation of a temp tag
Provided Methods§
Sourcefn as_weak(self: &Arc<Self>) -> Weak<dyn TagDrop>
fn as_weak(self: &Arc<Self>) -> Weak<dyn TagDrop>
Get this as a weak reference for use in temp tags
Sourcefn temp_tag(self: &Arc<Self>, inner: HashAndFormat) -> TempTag
fn temp_tag(self: &Arc<Self>, inner: HashAndFormat) -> TempTag
Create a new temp tag for the given hash and format
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.
Implementations on Foreign Types§
Source§impl TagCounter for RwLock<TempCounterMap>
Available on crate feature fs-store
only.
impl TagCounter for RwLock<TempCounterMap>
Available on crate feature
fs-store
only.