Skip to main content

CoherentScope

Struct CoherentScope 

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

State-Machine-Tracker fuer Coherent-Set auf Publisher-Seite.

Lifecycle:

  1. begin_coherent_changes setzt active=true und merkt sich die naechste Sequence-Number als set_first_sn.
  2. Jede write() waehrend des aktiven Sets traegt diesen Marker.
  3. end_coherent_changes setzt active=false. Das naechste write ohne Marker oder mit neuem Marker signalisiert dem Reader das Set-Ende.

Implementations§

Source§

impl CoherentScope

Source

pub fn new() -> Arc<Self>

Neuer leerer Scope (in Arc, weil Caller den meist shared zwischen Publisher-Inner + write-Pfad halten muessen).

Source

pub fn is_active(&self) -> bool

True wenn der Scope aktiv ist.

Source

pub fn current_marker(&self) -> Option<CoherentSetMarker>

Liefert den aktuellen Marker, falls Scope aktiv ist.

Source

pub fn begin(&self, next_sn: CoherentSequenceNumber) -> Result<()>

Beginnt einen neuen Coherent-Set mit der gegebenen next_sn als Set-First-SN. Spec: §2.2.2.4.1.8 Publisher::begin_coherent_changes.

§Errors

PreconditionNotMet wenn ein Set bereits aktiv ist (Spec: nicht verschachtelbar aktuell).

Source

pub fn end(&self) -> Result<CoherentSetMarker>

Beendet den aktiven Coherent-Set. Spec: §2.2.2.4.1.9 Publisher::end_coherent_changes.

§Errors

PreconditionNotMet wenn kein Set aktiv ist.

Trait Implementations§

Source§

impl Debug for CoherentScope

Source§

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

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

impl Default for CoherentScope

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<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.