#[repr(u16)]pub enum PatchPurpose {
Normal = 1,
RollbackDraft = 2,
}Expand description
Identity-bearing patch purpose.
Variants§
Normal = 1
Ordinary Patch. This is the default when tag 5 is absent and must not be encoded explicitly.
RollbackDraft = 2
Rollback draft Patch. This survives WAL-to-object persistence for classification.
Implementations§
Source§impl PatchPurpose
impl PatchPurpose
Sourcepub fn from_present_code(code: u16) -> Result<Self>
pub fn from_present_code(code: u16) -> Result<Self>
Parse a stable code from a present tag-5 purpose field.
Sourcepub fn decode_from_patch_payload(bytes: &[u8]) -> Result<Self>
pub fn decode_from_patch_payload(bytes: &[u8]) -> Result<Self>
Decode only the top-level PatchPayload purpose field, validating tag order and rejecting
an explicitly encoded Normal default. Absence means Normal.
Trait Implementations§
Source§impl Clone for PatchPurpose
impl Clone for PatchPurpose
Source§fn clone(&self) -> PatchPurpose
fn clone(&self) -> PatchPurpose
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 moreimpl Copy for PatchPurpose
Source§impl Debug for PatchPurpose
impl Debug for PatchPurpose
impl Eq for PatchPurpose
Source§impl Hash for PatchPurpose
impl Hash for PatchPurpose
Source§impl Ord for PatchPurpose
impl Ord for PatchPurpose
Source§fn cmp(&self, other: &PatchPurpose) -> Ordering
fn cmp(&self, other: &PatchPurpose) -> 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 PatchPurpose
impl PartialEq for PatchPurpose
Source§impl PartialOrd for PatchPurpose
impl PartialOrd for PatchPurpose
impl StructuralPartialEq for PatchPurpose
Auto Trait Implementations§
impl Freeze for PatchPurpose
impl RefUnwindSafe for PatchPurpose
impl Send for PatchPurpose
impl Sync for PatchPurpose
impl Unpin for PatchPurpose
impl UnsafeUnpin for PatchPurpose
impl UnwindSafe for PatchPurpose
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