pub struct AiExecutionContext { /* private fields */ }Expand description
Cooperative deadline, cancellation, and work-budget state for expensive
AI queries. Index loops call checkpoint and charge work with consume.
Implementations§
Source§impl AiExecutionContext
impl AiExecutionContext
pub fn new(deadline: Option<Instant>, work_budget: usize) -> Self
pub fn with_timeout(timeout: Duration, work_budget: usize) -> Self
pub fn with_limits( timeout: Duration, work_budget: usize, max_fused_candidates: usize, ) -> Self
pub fn with_control( control: ExecutionControl, work_budget: usize, max_fused_candidates: usize, ) -> Self
pub fn cancel(&self)
pub fn checkpoint(&self) -> Result<()>
pub fn consume(&self, work: usize) -> Result<()>
pub fn consumed_work(&self) -> usize
pub fn work_limit(&self) -> usize
pub fn remaining_duration(&self) -> Option<Duration>
pub fn execution_control(&self) -> &ExecutionControl
pub fn query_time_nanos(&self) -> i64
pub fn with_query_time_nanos(&self, query_time_nanos: i64) -> Self
pub fn max_fused_candidates(&self) -> usize
Trait Implementations§
Source§impl Clone for AiExecutionContext
impl Clone for AiExecutionContext
Source§fn clone(&self) -> AiExecutionContext
fn clone(&self) -> AiExecutionContext
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 !RefUnwindSafe for AiExecutionContext
impl !UnwindSafe for AiExecutionContext
impl Freeze for AiExecutionContext
impl Send for AiExecutionContext
impl Sync for AiExecutionContext
impl Unpin for AiExecutionContext
impl UnsafeUnpin for AiExecutionContext
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<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more