Skip to main content

WorkerStore

Struct WorkerStore 

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

The versioned protected headers one worker holds. No serde, no Clone, and Debug prints counts only.

Implementations§

Source§

impl WorkerStore

Source

pub fn prepare( &mut self, cluster: &str, version: ProtectedHeaderVersion, payload: Option<Payload>, ) -> Result<(), StageError>

Stage payload as version of cluster; None stages a removal. Nothing is applied. A version at or below the applied one is refused, and staging the same version again keeps the first payload.

Source

pub fn commit( &mut self, cluster: &str, version: ProtectedHeaderVersion, ) -> Commit

Apply a staged version. Versions apply in order: one older than the applied version overwrites nothing, but it becomes the state an abort of the applied version restores when it is newer than the one kept.

Source

pub fn abort( &mut self, cluster: &str, version: ProtectedHeaderVersion, ) -> Resolution

Drop a staged version; when it is the applied one, restore the state that preceded it. Anything else is Ignored.

Source

pub fn release(&mut self, cluster: &str, version: ProtectedHeaderVersion)

The transaction that applied version succeeded everywhere: the state before it can no longer be wanted, and is dropped.

Source

pub fn effective(&self, cluster: &str) -> Option<&Payload>

The payload the cluster currently holds, if any.

Source

pub fn remove_cluster(&mut self, cluster: &str)

The cluster is gone: every held, kept and staged value goes with it.

Trait Implementations§

Source§

impl Debug for WorkerStore

Source§

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

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

impl Default for WorkerStore

Source§

fn default() -> Self

Returns the “default value” for a type. Read more

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<'a, T, E> AsTaggedExplicit<'a, E> for T
where T: 'a,

Source§

fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

Source§

impl<'a, T, E> AsTaggedImplicit<'a, E> for T
where T: 'a,

Source§

fn implicit( self, class: Class, constructed: bool, tag: u32, ) -> TaggedParser<'a, Implicit, Self, E>

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> Same for T

Source§

type Output = T

Should always be Self
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.