pub enum MicLifecycle {
Idle,
Starting,
Running,
Stopping,
}Expand description
Lifecycle state of the microphone capture worker.
Mirror of crate::preview::PreviewLifecycle. Starting /
Stopping exist so a re-entrant start_mic_capture can detect
“already booting, drop the new one” instead of double-spawning
gst children. Running is the steady state.
Variants§
Idle
No worker running.
Starting
start_mic_capture invoked but no audio chunk has arrived
yet (gst spawn + first-frame latency, ~100–300 ms on macOS
osxaudiosrc).
Running
Worker is producing audio chunks.
Stopping
stop_mic_capture invoked but the gst child is still being
torn down. Transient — drops into Idle once reaped.
Implementations§
Source§impl MicLifecycle
impl MicLifecycle
Sourcepub fn try_start(self) -> Self
pub fn try_start(self) -> Self
Attempt to advance to Starting. Re-entrant calls (already
Starting / Running / Stopping) are a no-op — the caller is
expected to first stop the existing session.
Sourcepub fn mark_running(self) -> Self
pub fn mark_running(self) -> Self
Mark the worker as running (first audio chunk received).
Idempotent — Running.mark_running() == Running.
Sourcepub fn try_stop(self) -> Self
pub fn try_stop(self) -> Self
Begin teardown — moves Running / Starting → Stopping. Stays
in Idle if no worker is up.
Sourcepub fn finish_stop(self) -> Self
pub fn finish_stop(self) -> Self
Complete teardown — moves Stopping → Idle.
Trait Implementations§
Source§impl Clone for MicLifecycle
impl Clone for MicLifecycle
Source§fn clone(&self) -> MicLifecycle
fn clone(&self) -> MicLifecycle
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 MicLifecycle
impl Debug for MicLifecycle
Source§impl Default for MicLifecycle
impl Default for MicLifecycle
Source§fn default() -> MicLifecycle
fn default() -> MicLifecycle
Source§impl<'de> Deserialize<'de> for MicLifecycle
impl<'de> Deserialize<'de> for MicLifecycle
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 PartialEq for MicLifecycle
impl PartialEq for MicLifecycle
Source§fn eq(&self, other: &MicLifecycle) -> bool
fn eq(&self, other: &MicLifecycle) -> bool
self and other values to be equal, and is used by ==.Source§impl Serialize for MicLifecycle
impl Serialize for MicLifecycle
impl Copy for MicLifecycle
impl Eq for MicLifecycle
impl StructuralPartialEq for MicLifecycle
Auto Trait Implementations§
impl Freeze for MicLifecycle
impl RefUnwindSafe for MicLifecycle
impl Send for MicLifecycle
impl Sync for MicLifecycle
impl Unpin for MicLifecycle
impl UnsafeUnpin for MicLifecycle
impl UnwindSafe for MicLifecycle
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<'de, D, R> CommandArg<'de, R> for Dwhere
D: Deserialize<'de>,
R: Runtime,
impl<'de, D, R> CommandArg<'de, R> for Dwhere
D: Deserialize<'de>,
R: Runtime,
§fn from_command(command: CommandItem<'de, R>) -> Result<D, InvokeError>
fn from_command(command: CommandItem<'de, R>) -> Result<D, InvokeError>
§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§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<R, P> ReadPrimitive<R> for P
impl<R, P> ReadPrimitive<R> for P
Source§fn read_from_little_endian(read: &mut R) -> Result<Self, Error>
fn read_from_little_endian(read: &mut R) -> Result<Self, Error>
ReadEndian::read_from_little_endian().