Skip to main content

ConnectionIncarnationAllocator

Struct ConnectionIncarnationAllocator 

Source
pub struct ConnectionIncarnationAllocator { /* private fields */ }
Expand description

Validated monotonic connection-incarnation allocator state.

This state is intentionally not Copy or Clone: each transition consumes its pre-state and returns the one resulting state which must be committed.

Implementations§

Source§

impl ConnectionIncarnationAllocator

Source

pub const fn try_restore( restored: ConnectionIncarnationAllocatorRestore, ) -> Result<Self, ConnectionIncarnationAllocatorRestoreError>

Restores the durable fixed header after validating the terminal bit.

§Errors

Returns ConnectionIncarnationAllocatorRestoreError unless ordinal u64::MAX and the exhaustion bit are either both present or both absent.

Source

pub const fn server_incarnation(&self) -> u64

Returns the current durable server incarnation.

Source

pub const fn last_examined_connection_ordinal(&self) -> Option<u64>

Returns the last allocated or collision-rejected connection ordinal.

Source

pub const fn connection_ordinal_exhausted(&self) -> bool

Returns whether this server incarnation can never mint another ordinal.

Source

pub const fn as_restore(&self) -> ConnectionIncarnationAllocatorRestore

Projects the exact fixed header which a binding must persist atomically.

Trait Implementations§

Source§

impl Debug for ConnectionIncarnationAllocator

Source§

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

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

impl Eq for ConnectionIncarnationAllocator

Source§

impl PartialEq for ConnectionIncarnationAllocator

Source§

fn eq(&self, other: &ConnectionIncarnationAllocator) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl StructuralPartialEq for ConnectionIncarnationAllocator

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> 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, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

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

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

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.