pub struct JobHandle { /* private fields */ }Expand description
A live scan job handle (P7 task 9.2, PF-01). spawn_scan_json returns
immediately, so a UI thread never blocks on a walk: progress is polled,
cancellation is cooperative, and result_json is the only joining call.
Dropping the last handle detaches the worker; the database is only
written by the worker’s own publish step, so a detached run either
completes its publish or leaves none.
Implementations§
Source§impl JobHandle
impl JobHandle
Sourcepub fn progress_json(&self) -> String
pub fn progress_json(&self) -> String
A non-blocking snapshot: state, bytes observed so far, and whether the job finished. Safe to call from a UI render loop.
Sourcepub fn cancel(&self)
pub fn cancel(&self)
Asks the walk to stop at its next observation boundary. A job that already finished is unaffected; cancellation is cooperative, so the final state stays truthful about how far the walk got.
Sourcepub fn result_json(&self) -> String
pub fn result_json(&self) -> String
Joins the worker and returns the same envelope the synchronous call would have produced. Idempotent: later calls return the recorded result without re-running anything.
Trait Implementations§
Source§impl<UT> LowerError<UT> for JobHandle
impl<UT> LowerError<UT> for JobHandle
Source§fn lower_error(obj: Self) -> RustBuffer
fn lower_error(obj: Self) -> RustBuffer
Source§impl<UT> LowerReturn<UT> for JobHandle
impl<UT> LowerReturn<UT> for JobHandle
Source§type ReturnType = <Arc<JobHandle> as LowerReturn<UniFfiTag>>::ReturnType
type ReturnType = <Arc<JobHandle> as LowerReturn<UniFfiTag>>::ReturnType
Source§fn lower_return(obj: Self) -> Result<Self::ReturnType, RustCallError>
fn lower_return(obj: Self) -> Result<Self::ReturnType, RustCallError>
Source§fn handle_failed_lift(
error: LiftArgsError,
) -> Result<Self::ReturnType, RustCallError>
fn handle_failed_lift( error: LiftArgsError, ) -> Result<Self::ReturnType, RustCallError>
Auto Trait Implementations§
impl Freeze for JobHandle
impl RefUnwindSafe for JobHandle
impl Send for JobHandle
impl Sync for JobHandle
impl Unpin for JobHandle
impl UnsafeUnpin for JobHandle
impl UnwindSafe for JobHandle
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, UT> HandleAlloc<UT> for T
impl<T, UT> HandleAlloc<UT> for T
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