pub struct BackgroundJobs { /* private fields */ }Expand description
One session’s background jobs. Dropping the store (with the session’s tools) cancels every job still running.
Implementations§
Source§impl BackgroundJobs
impl BackgroundJobs
Sourcepub fn new(limit: usize, finished: Option<UnboundedSender<()>>) -> Self
pub fn new(limit: usize, finished: Option<UnboundedSender<()>>) -> Self
At most limit jobs run at once. finished is woken as jobs finish.
Sourcepub fn with_approvals(self, gate: Arc<dyn ApprovalGate>) -> Self
pub fn with_approvals(self, gate: Arc<dyn ApprovalGate>) -> Self
Decide running jobs’ nested approval requests with gate, which must
never grant more than the session’s foreground would.
pub fn limit(&self) -> usize
Sourcepub fn take_unreported(&self) -> Vec<JobReport>
pub fn take_unreported(&self) -> Vec<JobReport>
Finished jobs the model has not seen yet, marked seen, for a report turn. At most a few per call; the rest stay for the next.
Trait Implementations§
Source§impl Debug for BackgroundJobs
impl Debug for BackgroundJobs
Source§impl Drop for BackgroundJobs
impl Drop for BackgroundJobs
Auto Trait Implementations§
impl !Freeze for BackgroundJobs
impl !RefUnwindSafe for BackgroundJobs
impl !UnwindSafe for BackgroundJobs
impl Send for BackgroundJobs
impl Sync for BackgroundJobs
impl Unpin for BackgroundJobs
impl UnsafeUnpin for BackgroundJobs
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