pub struct Workspace {
pub paths: Paths,
pub config: Config,
}Expand description
Shared state for every subcommand: where things live and what is indexed.
Fields§
§paths: Paths§config: ConfigImplementations§
Source§impl Workspace
impl Workspace
pub fn new() -> Self
Sourcepub fn search_roots(&self, flags: &[String]) -> Vec<PathBuf>
pub fn search_roots(&self, flags: &[String]) -> Vec<PathBuf>
Search scope: --root flags, then the config file, then everything in
the index. Searching must not silently depend on the current directory.
Sourcepub fn roots(&self, flags: &[String]) -> Vec<PathBuf>
pub fn roots(&self, flags: &[String]) -> Vec<PathBuf>
CLI --root flags win, then the config file, then the current directory.
pub fn open_index(&self) -> Result<Connection>
Sourcepub fn embedder(&self) -> Option<SharedEmbedder>
pub fn embedder(&self) -> Option<SharedEmbedder>
Load the embedder only when it is already on disk: searching must never trigger a surprise download. If both embedding models are present the multilingual one wins, since it also covers English.
pub fn pipeline(&self) -> Result<SearchPipeline>
pub fn embedding_model_installed(&self) -> bool
pub fn reranker_installed(&self) -> bool
Trait Implementations§
Auto Trait Implementations§
impl Forget for Workspace
impl Freeze for Workspace
impl Move for Workspace
impl RefUnwindSafe for Workspace
impl Send for Workspace
impl Sync for Workspace
impl Unpin for Workspace
impl UnsafeUnpin for Workspace
impl UnwindSafe for Workspace
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
impl<T> ErasedDestructor for Twhere
T: 'static,
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