Skip to main content

GroupAccessScope

Struct GroupAccessScope 

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

Subscriber-side group access (Spec §2.2.2.5.2.8/9).

When Presentation.access_scope = GROUP and coherent_access is active, the subscriber MUST guarantee the atomic view across all DataReaders in the subscriber between begin_access and end_access.

Group-access scope with snapshot atomicity: each begin_access increments the snapshot_generation counter; all DataReaders in the subscriber that are read between begin and end see the SAME generation and therefore, per spec, an atomic cut across all topics.

Implementations§

Source§

impl GroupAccessScope

Source

pub fn new() -> Arc<Self>

New empty scope.

Source

pub fn is_active(&self) -> bool

True if at least one begin_access is currently open.

Source

pub fn current_snapshot(&self) -> u64

Current snapshot generation (see struct docs). 0 means “no snapshot ever opened”.

Source

pub fn begin(&self)

Subscriber::begin_access (Spec §2.2.2.5.2.8). Idempotently nestable — each call raises the counter, each end_access lowers it. On the 0→1 transition the snapshot generation is also incremented (atomic cut begin).

Source

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

Subscriber::end_access (Spec §2.2.2.5.2.9).

§Errors

PreconditionNotMet if no begin_access is open (counter would underflow).

Trait Implementations§

Source§

impl Debug for GroupAccessScope

Source§

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

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

impl Default for GroupAccessScope

Source§

fn default() -> GroupAccessScope

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.