pub struct WalGeneration {
pub checkpoint_seq: u32,
pub salt: Option<WalSalt>,
}Expand description
R858-B19 — the identity of one WAL generation: the checkpoint sequence
and the header salt that actually distinguishes it. This is what
tail_frames compares across calls, what the watermark sidecar persists,
and what a generation manifest stamps.
salt: None means unknown generation, and unknown is a value here, not
a missing one: it arises from a sidecar or manifest written before this
field existed, or from a WAL with no frames to read a salt out of. An
unknown generation is never provably equal to anything — see
WalGeneration::is_provably_same_as — so it forces a restart on the write
side and a refusal on the restore side rather than a guess.
Fields§
§checkpoint_seq: u32§salt: Option<WalSalt>Implementations§
Source§impl WalGeneration
impl WalGeneration
Sourcepub fn is_provably_same_as(&self, other: &WalGeneration) -> bool
pub fn is_provably_same_as(&self, other: &WalGeneration) -> bool
True only when both sides carry a known salt and every component agrees — i.e. only when these are provably the same WAL.
The asymmetry is the whole point. “Not provably the same” is treated as “different”, which costs a redundant re-upload (or a loud restore refusal) in the worst case. The opposite default — “no evidence of a change, so assume it is the same WAL” — is what spliced two WAL generations into one chain and restored a plausible wrong image.
Trait Implementations§
Source§impl Clone for WalGeneration
impl Clone for WalGeneration
Source§fn clone(&self) -> WalGeneration
fn clone(&self) -> WalGeneration
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreimpl Copy for WalGeneration
Source§impl Debug for WalGeneration
impl Debug for WalGeneration
Source§impl Default for WalGeneration
impl Default for WalGeneration
Source§fn default() -> WalGeneration
fn default() -> WalGeneration
impl Eq for WalGeneration
Source§impl PartialEq for WalGeneration
impl PartialEq for WalGeneration
impl StructuralPartialEq for WalGeneration
Auto Trait Implementations§
impl Freeze for WalGeneration
impl RefUnwindSafe for WalGeneration
impl Send for WalGeneration
impl Sync for WalGeneration
impl Unpin for WalGeneration
impl UnsafeUnpin for WalGeneration
impl UnwindSafe for WalGeneration
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>, which can then be
downcast into Box<dyn ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>, which can then be further
downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.Source§impl<T> DowncastSend for T
impl<T> DowncastSend for T
Source§impl<T> DowncastSync for T
impl<T> DowncastSync for T
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.Source§impl<K, Q> Equivalent<Q> for K
impl<K, Q> Equivalent<Q> for K
Source§fn equivalent(&self, key: &Q) -> bool
fn equivalent(&self, key: &Q) -> bool
key and return true if they are equal.impl<T> ErasedDestructor for Twhere
T: 'static,
impl<T> Fruit for T
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> ⓘ
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> ⓘ
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