pub enum QueryControl {
Deadline(Deadline),
Cancel(CancelToken),
}Expand description
The mandatory cooperative stop mechanism carried by one store query.
Variants§
Deadline(Deadline)
Stop when the monotonic deadline expires.
Cancel(CancelToken)
Stop when any clone of the token is cancelled.
Implementations§
Source§impl QueryControl
impl QueryControl
Sourcepub fn checkpoint(&self) -> Result<(), QueryError>
pub fn checkpoint(&self) -> Result<(), QueryError>
Checks the same absolute deadline or cancellation token before admission and between caller-owned stages such as tokenization and embedding.
This never extends a deadline. An admitted store query also checks its snapshot lease so store-close cancellation retains precedence.
§Errors
Returns QueryError::Timeout or QueryError::Cancelled, always
with partial: false, when the caller’s control has stopped the query.
Trait Implementations§
Source§impl Clone for QueryControl
impl Clone for QueryControl
Auto Trait Implementations§
impl !RefUnwindSafe for QueryControl
impl !UnwindSafe for QueryControl
impl Freeze for QueryControl
impl Send for QueryControl
impl Sync for QueryControl
impl Unpin for QueryControl
impl UnsafeUnpin for QueryControl
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