pub struct Job { /* private fields */ }Expand description
A background job whose items run between browser frames.
Implementations§
Source§impl Job
impl Job
Sourcepub fn set(
&mut self,
count: u64,
f: impl Fn(usize, &JobCtl) + Send + Sync + 'static,
) -> bool
pub fn set( &mut self, count: u64, f: impl Fn(usize, &JobCtl) + Send + Sync + 'static, ) -> bool
Replace a completed job’s work; item counts must fit wasm32 address space.
Sourcepub fn wait(&self) -> Result<(), Cancelled>
pub fn wait(&self) -> Result<(), Cancelled>
Finish remaining work synchronously when a caller explicitly waits.
Sourcepub fn items_done(&self) -> u64
pub fn items_done(&self) -> u64
Completed item count.
Trait Implementations§
Auto Trait Implementations§
impl !RefUnwindSafe for Job
impl !UnwindSafe for Job
impl Forget for Job
impl Freeze for Job
impl Send for Job
impl Sync for Job
impl Unpin for Job
impl UnsafeUnpin for Job
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