pub struct RedactionsBlob {
pub format_version: u8,
pub redactions: Vec<Redaction>,
}Expand description
On-disk blob containing all redactions for a single blob hash. One file
per redacted blob, encoded with rmp-serde — matches the
ReviewSignaturesBlob pattern.
Fields§
§format_version: u8§redactions: Vec<Redaction>Implementations§
Source§impl RedactionsBlob
impl RedactionsBlob
pub const FORMAT_VERSION: u8 = 1
pub fn new(redactions: Vec<Redaction>) -> Self
pub fn empty() -> Self
pub fn encode(&self) -> Result<Vec<u8>, RedactionError>
pub fn decode(bytes: &[u8]) -> Result<Self, RedactionError>
pub fn push(&mut self, redaction: Redaction)
Sourcepub fn has_active(&self) -> bool
pub fn has_active(&self) -> bool
true iff any redaction in this blob is non-superseded — i.e. the
reader should see the stub. Today every redaction is active; a
future “unredact” verb would skip the superseded ones.
Sourcepub fn latest(&self) -> Option<&Redaction>
pub fn latest(&self) -> Option<&Redaction>
The most recent redaction, by redacted_at. Used as the canonical
stub source when multiple redactions exist for the same blob (e.g.
because of --all-states plus a later refinement).
Sourcepub fn mark_all_purged(&mut self, at: DateTime<Utc>) -> usize
pub fn mark_all_purged(&mut self, at: DateTime<Utc>) -> usize
Mark every redaction in this blob as purged. Returns the count that actually transitioned (others were already purged).
Trait Implementations§
Source§impl Clone for RedactionsBlob
impl Clone for RedactionsBlob
Source§fn clone(&self) -> RedactionsBlob
fn clone(&self) -> RedactionsBlob
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for RedactionsBlob
impl Debug for RedactionsBlob
Source§impl<'de> Deserialize<'de> for RedactionsBlob
impl<'de> Deserialize<'de> for RedactionsBlob
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 RedactionsBlob
Source§impl PartialEq for RedactionsBlob
impl PartialEq for RedactionsBlob
Source§fn eq(&self, other: &RedactionsBlob) -> bool
fn eq(&self, other: &RedactionsBlob) -> bool
Tests for
self and other values to be equal, and is used by ==.Source§impl Serialize for RedactionsBlob
impl Serialize for RedactionsBlob
impl StructuralPartialEq for RedactionsBlob
Auto Trait Implementations§
impl Freeze for RedactionsBlob
impl RefUnwindSafe for RedactionsBlob
impl Send for RedactionsBlob
impl Sync for RedactionsBlob
impl Unpin for RedactionsBlob
impl UnsafeUnpin for RedactionsBlob
impl UnwindSafe for RedactionsBlob
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