pub struct CancelToken<'a> { /* private fields */ }Expand description
v4.5 cooperative cancellation token. A long-running SELECT /
UPDATE / DELETE checks is_cancelled at row-loop checkpoints
and bails with EngineError::Cancelled. The host
(spg-server) creates an AtomicBool per query, spawns a
watchdog thread that sets it after SPG_QUERY_TIMEOUT_MS,
and passes it via execute_with_cancel / execute_readonly_with_cancel.
CancelToken::none() is a no-op — used by the legacy execute
and execute_readonly entry points so existing callers don’t
change.
Implementations§
Source§impl<'a> CancelToken<'a>
impl<'a> CancelToken<'a>
pub const fn none() -> Self
pub const fn from_flag(f: &'a AtomicBool) -> Self
pub fn is_cancelled(self) -> bool
Sourcepub fn check(self) -> Result<(), EngineError>
pub fn check(self) -> Result<(), EngineError>
Returns Err(Cancelled) if the token has been tripped.
Used at row-loop checkpoints to bail cooperatively without
scattering raw is_cancelled checks across the executor.
Trait Implementations§
Source§impl<'a> Clone for CancelToken<'a>
impl<'a> Clone for CancelToken<'a>
Source§fn clone(&self) -> CancelToken<'a>
fn clone(&self) -> CancelToken<'a>
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 moreimpl<'a> Copy for CancelToken<'a>
Auto Trait Implementations§
impl<'a> Freeze for CancelToken<'a>
impl<'a> RefUnwindSafe for CancelToken<'a>
impl<'a> Send for CancelToken<'a>
impl<'a> Sync for CancelToken<'a>
impl<'a> Unpin for CancelToken<'a>
impl<'a> UnsafeUnpin for CancelToken<'a>
impl<'a> UnwindSafe for CancelToken<'a>
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