pub struct OperationControl { /* private fields */ }Expand description
Cancellation and progress controls shared by one operation pipeline.
Implementations§
Source§impl OperationControl
impl OperationControl
Sourcepub fn new(cancellation: CancellationToken) -> Self
pub fn new(cancellation: CancellationToken) -> Self
Creates controls around the supplied cancellation token.
Sourcepub fn with_observer(self, observer: Arc<dyn ProgressObserver>) -> Self
pub fn with_observer(self, observer: Arc<dyn ProgressObserver>) -> Self
Installs a synchronous progress observer.
Sourcepub fn cancellation(&self) -> &CancellationToken
pub fn cancellation(&self) -> &CancellationToken
Returns the shared cancellation token.
Sourcepub fn checkpoint(
&self,
phase: ProgressPhase,
completed: u64,
total: Option<u64>,
) -> Result<()>
pub fn checkpoint( &self, phase: ProgressPhase, completed: u64, total: Option<u64>, ) -> Result<()>
Checks cancellation, then emits a bounded progress event.
Trait Implementations§
Source§impl Clone for OperationControl
impl Clone for OperationControl
Source§fn clone(&self) -> OperationControl
fn clone(&self) -> OperationControl
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Default for OperationControl
impl Default for OperationControl
Source§fn default() -> OperationControl
fn default() -> OperationControl
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl !RefUnwindSafe for OperationControl
impl !UnwindSafe for OperationControl
impl Freeze for OperationControl
impl Send for OperationControl
impl Sync for OperationControl
impl Unpin for OperationControl
impl UnsafeUnpin for OperationControl
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<U, T> ToOwnedObj<U> for Twhere
U: FromObjRef<T>,
impl<U, T> ToOwnedObj<U> for Twhere
U: FromObjRef<T>,
Source§fn to_owned_obj(&self, data: FontData<'_>) -> U
fn to_owned_obj(&self, data: FontData<'_>) -> U
Convert this type into
T, using the provided data to resolve any offsets.