#[repr(C)]pub struct QarSessionLifecycleInfo {
pub header: QarStructureHeader,
pub state: QarSessionLifecycleState,
pub cause: QarSessionChangeCause,
pub session_id: QarSessionId,
pub previous_session_id: QarSessionId,
pub has_previous_session: bool,
pub reason: *const c_char,
}Expand description
@brief One state of a session’s lifecycle.
Read with qar_session_get_lifecycle_state() (initialize it with qar_session_lifecycle_info_default()) or received by a qar_session_subscribe_lifecycle() callback.
Fields§
§header: QarStructureHeader< QAR_STRUCTURE_TYPE_SESSION_LIFECYCLE_INFO
state: QarSessionLifecycleState§cause: QarSessionChangeCauseWhy the latest move happened; QAR_SESSION_CHANGE_CAUSE_NONE on a state that is not part of a move.
session_id: QarSessionIdThe session the app is in now: during MIGRATING still the old one, the new one once the move completed. qar_session_get_id() answers the same.
previous_session_id: QarSessionIdThe session it moved from; valid only when has_previous_session.
has_previous_session: boolSet on the CONNECTED (or HUB_UNREACHABLE) state that ends a move. The state stays current until the next change, so the first state of a subscription made after a move, and qar_session_get_lifecycle_state(), still carry it with its cause: compare session_id with the id the app last saw to tell a new move from an old one.
reason: *const c_charUTF-8 text for logs and the operator, never a secret. Valid only during the callback; NULL from qar_session_get_lifecycle_state().