Skip to main content

CommitHeader

Struct CommitHeader 

Source
#[repr(C)]
pub struct CommitHeader {
Show 15 fields pub checksum: u128, pub checksum_body: u128, pub cluster: u128, pub size: u32, pub view: u32, pub release: u32, pub command: Command, pub replica: u8, pub reserved_frame: [u8; 66], pub commit_checksum: u128, pub timestamp_monotonic: u64, pub commit: u64, pub checkpoint_op: u64, pub group: u64, pub reserved: [u8; 80],
}
Expand description

Primary -> replicas: commit up to this op. Header-only (no body).

Fields§

§checksum: u128§checksum_body: u128§cluster: u128§size: u32§view: u32§release: u32§command: Command§replica: u8§reserved_frame: [u8; 66]§commit_checksum: u128§timestamp_monotonic: u64§commit: u64§checkpoint_op: u64§group: u64§reserved: [u8; 80]

Trait Implementations§

Source§

impl CheckedBitPattern for CommitHeader

Source§

type Bits = CommitHeaderBits

Self must have the same layout as the specified Bits except for the possible invalid bit patterns being checked during is_valid_bit_pattern.
Source§

fn is_valid_bit_pattern(bits: &CommitHeaderBits) -> bool

If this function returns true, then it must be valid to reinterpret bits as &Self.
Source§

impl Clone for CommitHeader

Source§

fn clone(&self) -> CommitHeader

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl ConsensusHeader for CommitHeader

Source§

const FRAME_SEALED: bool = true

Whether this header’s checksum field seals the frame. Read more
Source§

const COMMAND: Command = Command::Commit

Source§

fn checksum(&self) -> u128

The checksum field, whatever this header spends it on.
Source§

fn set_checksum(&mut self, checksum: u128)

Overwrite the checksum field.
Source§

fn operation(&self) -> Operation

Source§

fn command(&self) -> Command

Source§

fn size(&self) -> u32

Source§

fn validate(&self) -> Result<(), ConsensusError>

Errors Read more
Source§

const IDENTITY_CHECKSUMMED: bool = false

Whether checksum carries the prepare identity, which covers the operation byte: an unknown operation on such a frame can be authenticated from the raw bytes even though the typed view refuses to cast. False wherever checksum seals the frame or crosses the client boundary.
Source§

const OPERATION_OFFSET: Option<usize> = None

Byte offset of this header’s operation field, None when it carries none. Read more
Source§

fn accepts(command: Command) -> bool

Whether a frame carrying command may be typed as this header. Defaults to an exact match; a header that serves several commands with one layout (e.g. RepairDone / RangeEvicted) widens it.
Source§

fn frame_checksum(&self) -> u128

Checksum over every byte of the header past checksum itself. Read more
Source§

fn seal(&mut self)

Stamp Self::frame_checksum. Call last when building a frame: it covers every other field, checksum_body included, so later writes are uncovered.
Source§

fn verify_frame(&self) -> Result<(), ConsensusError>

Reject a frame whose header does not match its own checksum. Read more
Source§

impl Copy for CommitHeader

Source§

impl Debug for CommitHeader

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl NoUninit for CommitHeader

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.