Skip to main content

SessionInfo

Struct SessionInfo 

Source
pub struct SessionInfo {
Show 16 fields pub uri: SessionUri, pub live: bool, pub idle_secs: u64, pub status: Option<StatusInfo>, pub worker: bool, pub container: bool, pub binary: Option<RiffBinary>, pub claims_secs: u64, pub must_clear: bool, pub fresh_secs: Option<u64>, pub state: Option<SessionState>, pub work: Option<Activity>, pub waits: Option<Waits>, pub blocked: Option<BlockedInfo>, pub step: Option<StepInfo>, pub machine: Option<MachineInfo>,
}

Fields§

§uri: SessionUri

The URI now: the place and the claims are current.

§live: bool

True while the session has an open watch stream. A lead and a session in a container are live while they are not gone, also with no watch (01M48VDGQ5KETKPM4G6TKTC2MB, 01M510MG0CKDXAKF6YJ768K7E8).

§idle_secs: u64

The seconds since the last call of the session. 0 while it is live.

§status: Option<StatusInfo>

The last status that the session set, if it set one.

§worker: bool

True when the session registered as a worker (01M3NT4M159EHN5W8JRTQ417N4).

§container: bool

True when the riff daemon keeps the session alive: it runs in a container. It is live while it is not gone (01M510MG0CKDXAKF6YJ768K7E8).

§binary: Option<RiffBinary>

The riff that the session runs, from its last keep-alive that named one. None when no keep-alive named one, as from an older riff (01M514C11BPE93PJT4221PYVHS).

§claims_secs: u64

The seconds since the claims of the session last changed: a claim, a release, a new start, or the start of riff-server. A worker with no claim is idle for this time (01M3Q551WCMPQRCNJ8FXQEBFY4).

§must_clear: bool

True when the session is a worker that must clear its context before its next claim (01M3X9XAK1KPZZVM1AJR2H8DSS).

§fresh_secs: Option<u64>

The seconds since the last fresh start of the session: a new agent process or a clear of its context. None when the log has no such start (01M3X9XC99KY4RQY36A7CYWY11).

§state: Option<SessionState>

The state of the session, that the server derives (01M3QB6CJ1XCQG5B1BVR8AF3B4). An older server sends none: see SessionInfo::fill_state.

§work: Option<Activity>

The newest fact of the hooks of the session, with its age now (01M41FZNTPXQNCZ1S99HE42PYQ).

§waits: Option<Waits>

What each claim of the session waits for, when each one waits (01M41FZP9A50CH4A2VX344DW49).

§blocked: Option<BlockedInfo>

The block of the session, while it holds (01M41FZPGEK4TNPSM2051W4VMS).

§step: Option<StepInfo>

The long step of the session, until it is done (01M48VDGTD40P8RBZMS0XB5M9N).

§machine: Option<MachineInfo>

The last numbers of the machine of the session, with their age, when it sent some (01M515KSWVGCBS76AWZV74TJQ3).

Implementations§

Source§

impl SessionInfo

Source

pub fn fill_state(&mut self, riff: RiffState)

Sets the state from the other facts of the session when the server sent none, as an older server does. riff is the state of the riff. A state from the server stays.

use riff_core::wire::{RiffState, SessionInfo, SessionState};

// A who reply of an older server: no state.
let json = r#"{"uri":"riff://mike@thelio/o/r?session=w1&claim=issue-12","live":true}"#;
let mut s: SessionInfo = serde_json::from_str(json).unwrap();
assert_eq!(s.state, None);
s.fill_state(RiffState::Running);
assert_eq!(s.state, Some(SessionState::Busy));
s.fill_state(RiffState::Paused);
assert_eq!(s.state, Some(SessionState::Busy), "a state stays");

Trait Implementations§

Source§

impl Clone for SessionInfo

Source§

fn clone(&self) -> SessionInfo

Returns a duplicate of the value. Read more
1.0.0 · Source§

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

Performs copy-assignment from source. Read more
Source§

impl Debug for SessionInfo

Source§

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

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

impl<'de> Deserialize<'de> for SessionInfo

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl JsonSchema for SessionInfo

Source§

fn schema_name() -> Cow<'static, str>

The name of the generated JSON Schema. Read more
Source§

fn schema_id() -> Cow<'static, str>

Returns a string that uniquely identifies the schema produced by this type. Read more
Source§

fn json_schema(generator: &mut SchemaGenerator) -> Schema

Generates a JSON Schema for this type. Read more
Source§

fn inline_schema() -> bool

Whether JSON Schemas generated for this type should be included directly in parent schemas, rather than being re-used where possible using the $ref keyword. Read more
Source§

impl PartialEq for SessionInfo

Source§

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

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

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

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl Serialize for SessionInfo

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
Source§

impl Eq for SessionInfo

Source§

impl StructuralPartialEq for SessionInfo

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> DynClone for T
where T: Clone,

Source§

fn __clone_box(&self, _: Private) -> *mut ()

§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
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> 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.
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,