pub enum OperationFormat {
V1,
}Expand description
Version tag for the operation canonical form (#244).
The pre-image bytes hashed to derive an OpId are not stable
across schema evolutions: adding a field to OperationKind or
changing its serde representation rotates every existing OpId.
This enum tags the encoding used so a long-lived store can detect
mismatches and migrate explicitly via crate::migrate.
Today only Self::V1 is in production. Adding a future
variant requires:
- A new arm in
Operation::canonical_bytes_in. - An update to the canonical-form spec in [
crate::canonical]. - A
CHANGELOG.mdentry under### Internalcalling out theOpIdrotation. - A migration recipe via
crate::migrate::plan_migration— the mechanism is encoder-agnostic, but each new variant needs its owncanonical_bytes_inarm.
Variants§
V1
Implementations§
Source§impl OperationFormat
impl OperationFormat
Sourcepub const CURRENT: OperationFormat = OperationFormat::V1
pub const CURRENT: OperationFormat = OperationFormat::V1
The format every newly-emitted op uses today.
Sourcepub fn is_implicit(&self) -> bool
pub fn is_implicit(&self) -> bool
true for the implicit format (V1). Used by the
skip_serializing_if hook on OperationRecord::format_version
so existing V1 stores keep byte-identical on-disk JSON —
adding the version field doesn’t itself rotate any OpId.
Trait Implementations§
Source§impl Clone for OperationFormat
impl Clone for OperationFormat
Source§fn clone(&self) -> OperationFormat
fn clone(&self) -> OperationFormat
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 OperationFormat
impl Debug for OperationFormat
Source§impl Default for OperationFormat
impl Default for OperationFormat
Source§fn default() -> OperationFormat
fn default() -> OperationFormat
Returns the “default value” for a type. Read more
Source§impl<'de> Deserialize<'de> for OperationFormat
impl<'de> Deserialize<'de> for OperationFormat
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 Hash for OperationFormat
impl Hash for OperationFormat
Source§impl Ord for OperationFormat
impl Ord for OperationFormat
Source§fn cmp(&self, other: &OperationFormat) -> Ordering
fn cmp(&self, other: &OperationFormat) -> Ordering
1.21.0 (const: unstable) · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
Source§impl PartialEq for OperationFormat
impl PartialEq for OperationFormat
Source§fn eq(&self, other: &OperationFormat) -> bool
fn eq(&self, other: &OperationFormat) -> bool
Tests for
self and other values to be equal, and is used by ==.Source§impl PartialOrd for OperationFormat
impl PartialOrd for OperationFormat
Source§impl Serialize for OperationFormat
impl Serialize for OperationFormat
impl Copy for OperationFormat
impl Eq for OperationFormat
impl StructuralPartialEq for OperationFormat
Auto Trait Implementations§
impl Freeze for OperationFormat
impl RefUnwindSafe for OperationFormat
impl Send for OperationFormat
impl Sync for OperationFormat
impl Unpin for OperationFormat
impl UnsafeUnpin for OperationFormat
impl UnwindSafe for OperationFormat
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<Q, K> Comparable<K> for Q
impl<Q, K> Comparable<K> for Q
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
Compare self to
key and return true if they are equal.