pub struct CompletionCache { /* private fields */ }Expand description
Lock-free completion cache
Uses ArcSwap for atomic snapshot replacement, allowing the render thread to read without blocking the saturator thread.
Implementations§
Source§impl CompletionCache
impl CompletionCache
Sourcepub fn store(&self, snapshot: CompletionSnapshot)
pub fn store(&self, snapshot: CompletionSnapshot)
Store a new snapshot (called by saturator)
This is lock-free and will immediately be visible to readers.
Sourcepub fn load(&self) -> Arc<CompletionSnapshot>
pub fn load(&self) -> Arc<CompletionSnapshot>
Load the current snapshot (called by render)
This is lock-free and will never block.
Sourcepub fn update_selection(&self, new_index: usize)
pub fn update_selection(&self, new_index: usize)
Update selected index without replacing the entire snapshot
Creates a new snapshot with updated selection.
Sourcepub fn select_next(&self)
pub fn select_next(&self)
Select next item (wraps around)
Sourcepub fn select_prev(&self)
pub fn select_prev(&self)
Select previous item (wraps around)
Trait Implementations§
Source§impl Debug for CompletionCache
impl Debug for CompletionCache
Auto Trait Implementations§
impl !Freeze for CompletionCache
impl RefUnwindSafe for CompletionCache
impl Send for CompletionCache
impl Sync for CompletionCache
impl Unpin for CompletionCache
impl UnwindSafe for CompletionCache
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> 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