Skip to main content

InstanceState

Struct InstanceState 

Source
pub struct InstanceState {
Show 13 fields pub handle: InstanceHandle, pub kind: InstanceStateKind, pub disposed_generation_count: i32, pub no_writers_generation_count: i32, pub writer_count: u32, pub last_sample_timestamp: Option<Time>, pub last_delivered_ts: Option<Time>, pub disposed_at: Option<Time>, pub no_writers_at: Option<Time>, pub current_owner: Option<([u8; 16], i32)>, pub key_holder: Vec<u8>, pub reader_view_new: bool, pub samples_in_cache: u32,
}
Expand description

Per-instance bookkeeping.

Fields§

§handle: InstanceHandle

Local handle (stable across the tracker lifecycle).

§kind: InstanceStateKind

Current lifecycle state.

§disposed_generation_count: i32

NOT_ALIVE_DISPOSED → ALIVE transitions since the first sample.

§no_writers_generation_count: i32

NOT_ALIVE_NO_WRITERS → ALIVE transitions since the first sample.

§writer_count: u32

Number of writers that currently consider this instance registered. Reader side: each incoming sample increments the counter (if it is a new writer); each unregister marker decrements it. Writer side: 0 or 1 (a single writer’s view).

§last_sample_timestamp: Option<Time>

Wall-clock time of the last processed sample (or None).

§last_delivered_ts: Option<Time>

Reader side: source_timestamp of this instance’s last sample delivered to the user API. Spec §2.2.3.12 TIME_BASED_FILTER: a new sample is filtered out when t - last_delivered_ts < minimum_separation.

§disposed_at: Option<Time>

Reader side: wall-clock time at which the instance transitioned into NOT_ALIVE_DISPOSED. Spec §2.2.3.22 autopurge_disposed_samples_delay: samples are purged after the delay elapses.

§no_writers_at: Option<Time>

Reader side: wall-clock time at which the instance transitioned into NOT_ALIVE_NO_WRITERS. Spec §2.2.3.22 autopurge_no_writer_samples_delay.

§current_owner: Option<([u8; 16], i32)>

Reader side OWNERSHIP=EXCLUSIVE (Spec §2.2.3.10): current owner writer as (GuidLike, Strength). On a tie, the lexicographically higher GuidLike wins. On liveliness loss: reset explicitly via clear_owner.

§key_holder: Vec<u8>

Stored key holder (bytes), so get_key_value can replay the key without re-decoding. This is the PLAIN_CDR2-BE stream, i.e. exactly the input to compute_key_hash.

§reader_view_new: bool

View state on the reader side. Unused on the writer side.

§samples_in_cache: u32

Number of reader samples so far in this instance (a sample_rank helper value for the next read).

Trait Implementations§

Source§

impl Clone for InstanceState

Source§

fn clone(&self) -> InstanceState

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for InstanceState

Source§

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

Formats the value using the given formatter. 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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. 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> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
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.