pub struct SchemaVersion(/* private fields */);Expand description
Schema-format version stamped on a persisted record (e.g. a
crate::apply::Checkpoint or a crate::index::Plan).
Strict-equality compatibility: a persisted record with a SchemaVersion
that does not equal the build’s CURRENT_SCHEMA_VERSION is refused rather
than silently re-interpreted. Use SchemaVersion::compatible_with to
perform the comparison.
Implementations§
Source§impl SchemaVersion
impl SchemaVersion
Sourcepub const fn new(v: u32) -> Self
pub const fn new(v: u32) -> Self
Construct a SchemaVersion from a raw u32.
Sourcepub const fn compatible_with(self, other: Self) -> bool
pub const fn compatible_with(self, other: Self) -> bool
Returns true if self is compatible with other.
Compatibility is strict equality: persisted records carrying a different version cannot be silently consumed against the current schema, because the layout may have shifted in either direction.
Sourcepub const fn wrapping_add(self, rhs: u32) -> Self
pub const fn wrapping_add(self, rhs: u32) -> Self
Return a SchemaVersion whose inner u32 is
self.get().wrapping_add(rhs). Intended for tests that need to
fabricate a “version off by one” value.
Sourcepub const fn wrapping_sub(self, rhs: u32) -> Self
pub const fn wrapping_sub(self, rhs: u32) -> Self
Return a SchemaVersion whose inner u32 is
self.get().wrapping_sub(rhs). Intended for tests that need to
fabricate a “version off by one” value.
Trait Implementations§
Source§impl Clone for SchemaVersion
impl Clone for SchemaVersion
Source§fn clone(&self) -> SchemaVersion
fn clone(&self) -> SchemaVersion
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for SchemaVersion
impl Debug for SchemaVersion
Source§impl<'de> Deserialize<'de> for SchemaVersion
impl<'de> Deserialize<'de> for SchemaVersion
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>,
Source§impl Display for SchemaVersion
impl Display for SchemaVersion
Source§impl From<SchemaVersion> for u32
impl From<SchemaVersion> for u32
Source§fn from(v: SchemaVersion) -> Self
fn from(v: SchemaVersion) -> Self
Source§impl From<u32> for SchemaVersion
impl From<u32> for SchemaVersion
Source§impl Hash for SchemaVersion
impl Hash for SchemaVersion
Source§impl Ord for SchemaVersion
impl Ord for SchemaVersion
Source§fn cmp(&self, other: &SchemaVersion) -> Ordering
fn cmp(&self, other: &SchemaVersion) -> Ordering
1.21.0 (const: unstable) · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Source§impl PartialEq for SchemaVersion
impl PartialEq for SchemaVersion
Source§fn eq(&self, other: &SchemaVersion) -> bool
fn eq(&self, other: &SchemaVersion) -> bool
self and other values to be equal, and is used by ==.Source§impl PartialOrd for SchemaVersion
impl PartialOrd for SchemaVersion
Source§impl Serialize for SchemaVersion
impl Serialize for SchemaVersion
impl Copy for SchemaVersion
impl Eq for SchemaVersion
impl StructuralPartialEq for SchemaVersion
Auto Trait Implementations§
impl Freeze for SchemaVersion
impl RefUnwindSafe for SchemaVersion
impl Send for SchemaVersion
impl Sync for SchemaVersion
impl Unpin for SchemaVersion
impl UnsafeUnpin for SchemaVersion
impl UnwindSafe for SchemaVersion
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> CustomError for T
impl<T> CustomError 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