pub struct SuggestStrategy {
pub granularity: EvalGranularity,
pub min_interval: Duration,
pub max_pending_changes: usize,
pub enabled_triggers: HashSet<TriggerKind>,
}Expand description
Strategy for controlling suggestion re-evaluation timing
Fields§
§granularity: EvalGranularityRe-evaluation granularity
min_interval: DurationMinimum interval between evaluations
max_pending_changes: usizeMaximum pending changes before forcing evaluation
enabled_triggers: HashSet<TriggerKind>Enabled trigger kinds
Implementations§
Source§impl SuggestStrategy
impl SuggestStrategy
Sourcepub fn interactive() -> Self
pub fn interactive() -> Self
Interactive preset: evaluate after every goal
Sourcepub fn should_evaluate(
&self,
trigger: &SuggestTrigger,
pending: &PendingChanges,
) -> bool
pub fn should_evaluate( &self, trigger: &SuggestTrigger, pending: &PendingChanges, ) -> bool
Check if a trigger should cause re-evaluation
Sourcepub fn with_granularity(self, granularity: EvalGranularity) -> Self
pub fn with_granularity(self, granularity: EvalGranularity) -> Self
Set granularity
Sourcepub fn with_min_interval(self, interval: Duration) -> Self
pub fn with_min_interval(self, interval: Duration) -> Self
Set minimum interval
Sourcepub fn enable_trigger(self, kind: TriggerKind) -> Self
pub fn enable_trigger(self, kind: TriggerKind) -> Self
Enable a trigger kind
Sourcepub fn disable_trigger(self, kind: TriggerKind) -> Self
pub fn disable_trigger(self, kind: TriggerKind) -> Self
Disable a trigger kind
Trait Implementations§
Source§impl Clone for SuggestStrategy
impl Clone for SuggestStrategy
Source§fn clone(&self) -> SuggestStrategy
fn clone(&self) -> SuggestStrategy
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 Debug for SuggestStrategy
impl Debug for SuggestStrategy
Auto Trait Implementations§
impl Freeze for SuggestStrategy
impl RefUnwindSafe for SuggestStrategy
impl Send for SuggestStrategy
impl Sync for SuggestStrategy
impl Unpin for SuggestStrategy
impl UnsafeUnpin for SuggestStrategy
impl UnwindSafe for SuggestStrategy
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> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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