pub struct TaskState { /* private fields */ }Expand description
An owned duckdb_task_state that drives a database’s task execution.
Holds the database Arc so the underlying database outlives the state.
Implementations§
Source§impl TaskState
impl TaskState
Sourcepub fn execute(&self)
pub fn execute(&self)
Executes pending tasks on the calling thread until finish
is signalled. Intended to be run on a dedicated worker thread (and may be run
on several threads sharing this state).
Sourcepub fn execute_n(&self, max_tasks: u64) -> u64
pub fn execute_n(&self, max_tasks: u64) -> u64
Executes up to max_tasks pending tasks on the calling thread, returning how
many actually ran. Stops early if finish is signalled
or there are no more tasks.
Sourcepub fn is_finished(&self) -> bool
pub fn is_finished(&self) -> bool
Whether finish has been signalled on this state.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for TaskState
impl RefUnwindSafe for TaskState
impl Unpin for TaskState
impl UnsafeUnpin for TaskState
impl UnwindSafe for TaskState
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