pub struct QueryHandle { /* private fields */ }Expand description
A handle to an in-flight query. Returned alongside the row
stream so callers can cancel a query without dropping the
stream (the stream itself short-circuits to
MeshError::QueryCancelled on the next row boundary).
Cheap to clone; the cancel flag is shared.
Implementations§
Source§impl QueryHandle
impl QueryHandle
Sourcepub fn new(id: QueryId) -> Self
pub fn new(id: QueryId) -> Self
Construct a fresh handle with the given id. The cancel
flag starts cleared. Used by both LocalMeshQueryExecutor
and the federated executor in super::federated.
Sourcepub fn cancel(&self)
pub fn cancel(&self)
Signal cancellation. The row stream will surface
MeshError::QueryCancelled at its next yield point.
Idempotent.
Sourcepub fn is_cancelled(&self) -> bool
pub fn is_cancelled(&self) -> bool
Whether Self::cancel has been called.
Trait Implementations§
Source§impl Clone for QueryHandle
impl Clone for QueryHandle
Source§fn clone(&self) -> QueryHandle
fn clone(&self) -> QueryHandle
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 moreAuto Trait Implementations§
impl Freeze for QueryHandle
impl RefUnwindSafe for QueryHandle
impl Send for QueryHandle
impl Sync for QueryHandle
impl Unpin for QueryHandle
impl UnsafeUnpin for QueryHandle
impl UnwindSafe for QueryHandle
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