pub enum SemanticAvailability {
Show 13 variants
Ready {
embedder_id: String,
},
NotInstalled,
NeedsConsent,
Downloading {
progress_pct: u8,
bytes_downloaded: u64,
total_bytes: u64,
},
Verifying,
IndexBuilding {
embedder_id: String,
progress_pct: Option<u8>,
items_indexed: u64,
total_items: u64,
},
HashFallback,
Disabled {
reason: String,
},
ModelMissing {
model_dir: PathBuf,
missing_files: Vec<String>,
},
IndexMissing {
index_path: PathBuf,
},
DatabaseUnavailable {
db_path: PathBuf,
error: String,
},
LoadFailed {
context: String,
},
UpdateAvailable {
embedder_id: String,
current_revision: String,
latest_revision: String,
},
}Expand description
Unified TUI state machine for semantic search availability.
This enum tracks the full lifecycle of semantic search from the user’s perspective:
- Model installation flow (NotInstalled → NeedsConsent → Downloading → Verifying → Ready)
- Index building flow (Ready → IndexBuilding → Ready)
- User preferences (HashFallback, Disabled)
- Error states (LoadFailed, ModelMissing, etc.)
Variants§
Ready
Model is ready for use.
NotInstalled
Model not installed - semantic not available. TUI should show option to download or use hash fallback.
NeedsConsent
User needs to consent before downloading model. TUI should show consent dialog.
Downloading
Model download in progress.
Fields
Verifying
Verifying downloaded model (SHA256 check).
IndexBuilding
Index is being built or rebuilt.
Fields
HashFallback
User opted for hash-based fallback (no ML model).
Disabled
Semantic search disabled by policy or user.
ModelMissing
Model files are missing.
IndexMissing
Vector index is missing.
Database is unavailable.
LoadFailed
Failed to load semantic context.
UpdateAvailable
Model update available - index rebuild needed.
Implementations§
Source§impl SemanticAvailability
impl SemanticAvailability
Sourcepub fn has_update(&self) -> bool
pub fn has_update(&self) -> bool
Check if a model update is available.
Sourcepub fn is_building(&self) -> bool
pub fn is_building(&self) -> bool
Check if the index is being rebuilt.
Sourcepub fn is_downloading(&self) -> bool
pub fn is_downloading(&self) -> bool
Check if a download is in progress.
Sourcepub fn needs_consent(&self) -> bool
pub fn needs_consent(&self) -> bool
Check if user consent is needed.
Sourcepub fn is_hash_fallback(&self) -> bool
pub fn is_hash_fallback(&self) -> bool
Check if hash fallback is active.
Sourcepub fn is_disabled(&self) -> bool
pub fn is_disabled(&self) -> bool
Check if semantic search is disabled.
Sourcepub fn is_not_installed(&self) -> bool
pub fn is_not_installed(&self) -> bool
Check if the model is not installed.
Sourcepub fn can_search(&self) -> bool
pub fn can_search(&self) -> bool
Check if semantic can be used (ready or hash fallback).
Sourcepub fn download_progress(&self) -> Option<(u8, u64, u64)>
pub fn download_progress(&self) -> Option<(u8, u64, u64)>
Get download progress if downloading.
Sourcepub fn index_progress(&self) -> Option<(Option<u8>, u64, u64)>
pub fn index_progress(&self) -> Option<(Option<u8>, u64, u64)>
Get index building progress if building.
Sourcepub fn status_label(&self) -> &'static str
pub fn status_label(&self) -> &'static str
Get a short status label for display in status bar.
Trait Implementations§
Source§impl Clone for SemanticAvailability
impl Clone for SemanticAvailability
Source§fn clone(&self) -> SemanticAvailability
fn clone(&self) -> SemanticAvailability
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreAuto Trait Implementations§
impl Freeze for SemanticAvailability
impl RefUnwindSafe for SemanticAvailability
impl Send for SemanticAvailability
impl Sync for SemanticAvailability
impl Unpin for SemanticAvailability
impl UnsafeUnpin for SemanticAvailability
impl UnwindSafe for SemanticAvailability
Blanket Implementations§
Source§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
Source§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>, which can then be
downcast into Box<dyn ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>, which can then be further
downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.Source§impl<T> DowncastSend for T
impl<T> DowncastSend for T
Source§impl<T> DowncastSync for T
impl<T> DowncastSync for T
Source§impl<T> DowncastSync for T
impl<T> DowncastSync for T
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> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, _span: NoopSpan) -> Self
fn instrument(self, _span: NoopSpan) -> Self
Source§fn in_current_span(self) -> Self
fn in_current_span(self) -> 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>
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>
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