pub struct FencingEpoch(/* private fields */);Expand description
Positive, monotonically increasing database fencing epoch for one run.
The maximum deliberately matches PostgreSQL BIGINT, and the wire form is
a canonical decimal string. The first successful claim uses epoch one;
every later claim uses exactly the checked successor, including claims made
after an orderly release.
Implementations§
Source§impl FencingEpoch
impl FencingEpoch
Sourcepub const fn new(value: u64) -> Result<Self, FencingEpochError>
pub const fn new(value: u64) -> Result<Self, FencingEpochError>
Constructs a positive PostgreSQL-compatible epoch.
§Errors
Returns FencingEpochError::Zero for zero and
FencingEpochError::AboveMaximum above PostgreSQL BIGINT.
Sourcepub const fn checked_next(self) -> Option<Self>
pub const fn checked_next(self) -> Option<Self>
Returns the exact successor or None at the PostgreSQL limit.
Trait Implementations§
Source§impl Clone for FencingEpoch
impl Clone for FencingEpoch
impl Copy for FencingEpoch
Source§impl Debug for FencingEpoch
impl Debug for FencingEpoch
Source§impl<'de> Deserialize<'de> for FencingEpoch
impl<'de> Deserialize<'de> for FencingEpoch
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 Display for FencingEpoch
impl Display for FencingEpoch
impl Eq for FencingEpoch
Source§impl FromStr for FencingEpoch
impl FromStr for FencingEpoch
Source§impl Hash for FencingEpoch
impl Hash for FencingEpoch
Source§impl JsonSchema for FencingEpoch
impl JsonSchema for FencingEpoch
Source§fn schema_id() -> Cow<'static, str>
fn schema_id() -> Cow<'static, str>
Returns a string that uniquely identifies the schema produced by this type. Read more
Source§fn json_schema(_: &mut SchemaGenerator) -> Schema
fn json_schema(_: &mut SchemaGenerator) -> Schema
Generates a JSON Schema for this type. Read more
Source§fn inline_schema() -> bool
fn inline_schema() -> bool
Whether JSON Schemas generated for this type should be included directly in parent schemas,
rather than being re-used where possible using the
$ref keyword. Read moreSource§impl Ord for FencingEpoch
impl Ord for FencingEpoch
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
1.21.0 (const: unstable) · Source§fn min(self, other: Self) -> Selfwhere
Self: Sized,
fn min(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the minimum of two values. Read more
Source§impl PartialEq for FencingEpoch
impl PartialEq for FencingEpoch
Source§impl PartialOrd for FencingEpoch
impl PartialOrd for FencingEpoch
Source§impl Serialize for FencingEpoch
impl Serialize for FencingEpoch
impl StructuralPartialEq for FencingEpoch
Auto Trait Implementations§
impl Forget for FencingEpoch
impl Freeze for FencingEpoch
impl Move for FencingEpoch
impl RefUnwindSafe for FencingEpoch
impl Send for FencingEpoch
impl Sync for FencingEpoch
impl Unpin for FencingEpoch
impl UnsafeUnpin for FencingEpoch
impl UnwindSafe for FencingEpoch
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