pub struct LocalJobScheduler { /* private fields */ }Implementations§
Source§impl LocalJobScheduler
impl LocalJobScheduler
pub fn new() -> Self
pub fn global() -> Arc<Self> ⓘ
Sourcepub fn spawn_global_worker_with_runtime(runtime: Handle)
pub fn spawn_global_worker_with_runtime(runtime: Handle)
Spawn the background worker that processes queued jobs. The worker must run on a Tokio runtime;
pass a Handle when calling from outside a runtime context (e.g. from a Tauri setup callback,
which runs synchronously and is NOT inside tokio::spawn’s implicit runtime). When called from
within a runtime context, None falls back to tokio::spawn.
Sourcepub fn spawn_global_worker(runtime: Option<Handle>)
pub fn spawn_global_worker(runtime: Option<Handle>)
Spawn the background worker. Uses tokio::spawn — only call this from within a Tokio runtime
context. For callers outside a runtime (e.g. Tauri’s setup hook), use
[spawn_global_worker_with_runtime] with an explicit handle.
pub fn enqueue(&self, kind: LocalJobKind) -> Result<LocalJob, String>
Sourcepub fn update_job_meta(&self, updated: &LocalJob) -> Result<(), String>
pub fn update_job_meta(&self, updated: &LocalJob) -> Result<(), String>
Patch provenance fields on an existing job (e.g. after fleet accept).
Sourcepub fn enqueue_for_device(
&self,
kind: LocalJobKind,
target_device_id: Option<String>,
) -> Result<LocalJob, String>
pub fn enqueue_for_device( &self, kind: LocalJobKind, target_device_id: Option<String>, ) -> Result<LocalJob, String>
Enqueue work for a specific apparatus. None / local device_id runs here.
Remote registered devices are delivered via the fleet job path (HTTP + outbox).
pub fn snapshot(&self) -> Result<JobQueueSnapshot, String>
pub fn get(&self, id: &str) -> Result<Option<LocalJob>, String>
pub fn cancel(&self, id: &str) -> Result<bool, String>
Sourcepub fn retry(&self, id: &str) -> Result<LocalJob, String>
pub fn retry(&self, id: &str) -> Result<LocalJob, String>
Re-enqueue a completed, failed, or cancelled job with the same bounded inputs.
Sourcepub fn clear_finished(&self) -> Result<usize, String>
pub fn clear_finished(&self) -> Result<usize, String>
Remove finished history while preserving queued and running work.
Trait Implementations§
Source§impl Clone for LocalJobScheduler
impl Clone for LocalJobScheduler
Source§fn clone(&self) -> LocalJobScheduler
fn clone(&self) -> LocalJobScheduler
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreAuto Trait Implementations§
impl Freeze for LocalJobScheduler
impl RefUnwindSafe for LocalJobScheduler
impl Send for LocalJobScheduler
impl Sync for LocalJobScheduler
impl Unpin for LocalJobScheduler
impl UnsafeUnpin for LocalJobScheduler
impl UnwindSafe for LocalJobScheduler
Blanket Implementations§
§impl<S, A> Aggregate<Result<S, Error>> for Awhere
A: Aggregate<S>,
impl<S, A> Aggregate<Result<S, Error>> for Awhere
A: Aggregate<S>,
§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
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<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