pub struct CameraPipelineHandle(pub Mutex<Option<CameraPipeline>>);Expand description
Tauri-managed handle for the active camera pipeline. Held in
tauri::State so the stop_preview command can drop the worker
(and consequently kill the gst child + join the thread).
Wrapping Option<CameraPipeline> in a Mutex rather than an
AtomicCell keeps the dep surface small; contention is bounded
by user-driven start/stop clicks, which can’t race meaningfully.
Tuple Fields§
§0: Mutex<Option<CameraPipeline>>Implementations§
Source§impl CameraPipelineHandle
impl CameraPipelineHandle
Sourcepub fn install(&self, pipeline: CameraPipeline)
pub fn install(&self, pipeline: CameraPipeline)
Install a freshly-spawned pipeline. If one was already running, it’s dropped first (which kills + joins it before the new one starts). Idempotent under concurrent calls — the mutex serialises the swap.
Trait Implementations§
Source§impl Default for CameraPipelineHandle
impl Default for CameraPipelineHandle
Source§fn default() -> CameraPipelineHandle
fn default() -> CameraPipelineHandle
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl !Freeze for CameraPipelineHandle
impl RefUnwindSafe for CameraPipelineHandle
impl Send for CameraPipelineHandle
impl Sync for CameraPipelineHandle
impl Unpin for CameraPipelineHandle
impl UnsafeUnpin for CameraPipelineHandle
impl UnwindSafe for CameraPipelineHandle
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
Mutably borrows from an owned value. Read more
§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>
Converts
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>
Converts
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>
Read this value from the supplied reader. Same as
ReadEndian::read_from_little_endian().