pub struct TempTag { /* private fields */ }
Expand description
An ephemeral, in-memory tag that protects content while the process is running.
If format is raw, this will protect just the blob If format is collection, this will protect the collection and all blobs in it
Implementations§
Source§impl TempTag
impl TempTag
Sourcepub fn new(inner: HashAndFormat, on_drop: Option<Weak<dyn TagDrop>>) -> Self
pub fn new(inner: HashAndFormat, on_drop: Option<Weak<dyn TagDrop>>) -> Self
Create a new temp tag for the given hash and format
This should only be used by store implementations.
The caller is responsible for increasing the refcount on creation and to make sure that temp tags that are created between a mark phase and a sweep phase are protected.
Sourcepub fn leaking_empty(format: BlobFormat) -> Self
pub fn leaking_empty(format: BlobFormat) -> Self
The empty temp tag. We don’t track the empty blob since we always have it.
Sourcepub fn inner(&self) -> &HashAndFormat
pub fn inner(&self) -> &HashAndFormat
The hash of the pinned item
Sourcepub fn format(&self) -> BlobFormat
pub fn format(&self) -> BlobFormat
The format of the pinned item
Sourcepub fn hash_and_format(&self) -> &HashAndFormat
pub fn hash_and_format(&self) -> &HashAndFormat
The hash and format of the pinned item
Trait Implementations§
Source§impl<'de> Deserialize<'de> for TempTag
impl<'de> Deserialize<'de> for TempTag
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
Source§impl From<&TempTag> for HashAndFormat
impl From<&TempTag> for HashAndFormat
Source§impl From<TempTag> for HashAndFormat
impl From<TempTag> for HashAndFormat
Auto Trait Implementations§
impl Freeze for TempTag
impl !RefUnwindSafe for TempTag
impl Send for TempTag
impl Sync for TempTag
impl Unpin for TempTag
impl !UnwindSafe for TempTag
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