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: SessionUriThe URI now: the place and the claims are current.
live: boolTrue 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: u64The 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: boolTrue when the session registered as a worker (01M3NT4M159EHN5W8JRTQ417N4).
container: boolTrue 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: u64The 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: boolTrue 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
impl SessionInfo
Sourcepub fn fill_state(&mut self, riff: RiffState)
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
impl Clone for SessionInfo
Source§fn clone(&self) -> SessionInfo
fn clone(&self) -> SessionInfo
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for SessionInfo
impl Debug for SessionInfo
Source§impl<'de> Deserialize<'de> for SessionInfo
impl<'de> Deserialize<'de> for SessionInfo
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Source§impl JsonSchema for SessionInfo
impl JsonSchema for SessionInfo
Source§fn schema_id() -> Cow<'static, str>
fn schema_id() -> Cow<'static, str>
Source§fn json_schema(generator: &mut SchemaGenerator) -> Schema
fn json_schema(generator: &mut SchemaGenerator) -> Schema
Source§fn inline_schema() -> bool
fn inline_schema() -> bool
$ref keyword. Read moreSource§impl PartialEq for SessionInfo
impl PartialEq for SessionInfo
Source§impl Serialize for SessionInfo
impl Serialize for SessionInfo
impl Eq for SessionInfo
impl StructuralPartialEq for SessionInfo
Auto Trait Implementations§
impl Freeze for SessionInfo
impl RefUnwindSafe for SessionInfo
impl Send for SessionInfo
impl Sync for SessionInfo
impl Unpin for SessionInfo
impl UnsafeUnpin for SessionInfo
impl UnwindSafe for SessionInfo
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.