pub struct RecordingSession {
pub id: u64,
pub started_at: Instant,
pub started_at_unix_secs: u64,
pub state: SessionState,
pub streams: SessionStreams,
}Expand description
One coordinated recording session — the orchestrator owned by
RecordingState (M-RECORD.1) for the lifetime of one
start → stop cycle.
Construction is staged so the Tauri-side start_recording
command can do the heavy lifting (spawn per-channel pipelines,
roll back on per-stream failure) without mutating session state
mid-failure:
RecordingSession::starting(streams)— allocates the session id, capturesInstant::now()asstarted_at, sets state toStarting. No pipelines spawned yet.- Caller spawns each enabled per-channel pipeline; on any
failure, calls
RecordingSession::abort()and returnsErr(...). - Once all enabled streams have reported their first frame,
RecordingSession::mark_running()flips state toRunning. - On
stop_recording,RecordingSession::begin_stop()flips toStopping; caller tears down per-channel pipelines. RecordingSession::finish_stop()flips back toIdle.
Fields§
§id: u64Unique-per-process session id. Stamped on every emitted
recording-status event so a delayed event from a prior
session can be filtered.
started_at: InstantShared monotonic clock — every per-frame PTS pushed into the
M-EXPORT encoder is computed as Instant::now() - started_at.
Captured ONCE here so all four streams share the same origin.
started_at_unix_secs: u64Wall-clock start time (Unix epoch seconds). Complements the
monotonic started_at; M-SAVE.1 carries it through to export
so the Screen-YYYY-MM-DD-HHMMSS.<ext> filename reflects when
the recording started, not when the user clicked Export.
state: SessionStateMaster lifecycle.
streams: SessionStreamsWhich channels are part of this session.
Implementations§
Source§impl RecordingSession
impl RecordingSession
Sourcepub fn starting(streams: SessionStreams) -> Self
pub fn starting(streams: SessionStreams) -> Self
Begin a new session — allocates an id, captures the start
time, sets state to Starting. Caller is responsible for
spawning the enabled per-channel pipelines.
Sourcepub fn mark_running(&mut self)
pub fn mark_running(&mut self)
Mark the session Running. Called by M-RECORD.1 once all
enabled streams have produced their first frame. Idempotent.
Sourcepub fn begin_stop(&mut self)
pub fn begin_stop(&mut self)
Begin tearing down — Starting | Running → Stopping.
Idempotent on Stopping; no-op on Idle.
Sourcepub fn finish_stop(&mut self)
pub fn finish_stop(&mut self)
Finish teardown — Stopping → Idle. Idempotent on Idle;
no-op on Starting | Running (the begin_stop step has to
happen first).
Trait Implementations§
Source§impl Clone for RecordingSession
impl Clone for RecordingSession
Source§fn clone(&self) -> RecordingSession
fn clone(&self) -> RecordingSession
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for RecordingSession
impl Debug for RecordingSession
Source§impl PartialEq for RecordingSession
impl PartialEq for RecordingSession
Source§fn eq(&self, other: &RecordingSession) -> bool
fn eq(&self, other: &RecordingSession) -> bool
self and other values to be equal, and is used by ==.impl Eq for RecordingSession
impl StructuralPartialEq for RecordingSession
Auto Trait Implementations§
impl Freeze for RecordingSession
impl RefUnwindSafe for RecordingSession
impl Send for RecordingSession
impl Sync for RecordingSession
impl Unpin for RecordingSession
impl UnsafeUnpin for RecordingSession
impl UnwindSafe for RecordingSession
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
§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.§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
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more