pub struct RotationLog { /* private fields */ }Expand description
The append-only rotation log in a manifest store.
Implementations§
Source§impl RotationLog
impl RotationLog
Sourcepub fn read(&self) -> Result<Vec<RotationRecord>, RotationError>
pub fn read(&self) -> Result<Vec<RotationRecord>, RotationError>
Every record. A missing file is an empty log; an unreadable or unparseable one is an error (fail closed).
Sourcepub fn history(
&self,
current: &[u8; 32],
) -> Result<UserKeyHistory, RotationError>
pub fn history( &self, current: &[u8; 32], ) -> Result<UserKeyHistory, RotationError>
The history for current: single when the log is empty.
Sourcepub fn replace(&self, records: &[RotationRecord]) -> Result<(), RotationError>
pub fn replace(&self, records: &[RotationRecord]) -> Result<(), RotationError>
Replace the whole log with records (the chain’s copy, for rebuilding a
deleted or truncated file). The records must form one history.
Sourcepub fn append(&self, record: &RotationRecord) -> Result<(), RotationError>
pub fn append(&self, record: &RotationRecord) -> Result<(), RotationError>
Append record (the whole file is rewritten atomically, 0600). The
record must extend the existing log.
Trait Implementations§
Source§impl Clone for RotationLog
impl Clone for RotationLog
Auto Trait Implementations§
impl Freeze for RotationLog
impl RefUnwindSafe for RotationLog
impl Send for RotationLog
impl Sync for RotationLog
impl Unpin for RotationLog
impl UnsafeUnpin for RotationLog
impl UnwindSafe for RotationLog
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
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