pub struct GlobalRegistry {
pub workspaces: Vec<String>,
}Expand description
Global registry of rustbrain workspaces on this machine.
Stored at $XDG_CONFIG_HOME/rustbrain/registry.json (Linux), or the platform
equivalent returned by the dirs crate.
Fields§
§workspaces: Vec<String>Absolute workspace paths (canonicalized when possible).
Implementations§
Source§impl GlobalRegistry
impl GlobalRegistry
Sourcepub fn config_path() -> Result<PathBuf>
pub fn config_path() -> Result<PathBuf>
Config path: $XDG_CONFIG_HOME/rustbrain/registry.json or platform equivalent.
Sourcepub fn prune_missing(&mut self)
pub fn prune_missing(&mut self)
Drop workspace paths that no longer have a brain database.
Sourcepub fn register<P: AsRef<Path>>(&mut self, workspace_path: P) -> Result<()>
pub fn register<P: AsRef<Path>>(&mut self, workspace_path: P) -> Result<()>
Register a workspace directory path.
Sourcepub fn search_all(&self, query: &str) -> Result<Vec<(String, Vec<Node>)>>
pub fn search_all(&self, query: &str) -> Result<Vec<(String, Vec<Node>)>>
Search FTS across all registered workspaces (unranked grouping).
Sourcepub fn search_all_ranked(
&self,
query: &str,
opts: &QueryOptions,
) -> Result<Vec<GlobalRankedHit>>
pub fn search_all_ranked( &self, query: &str, opts: &QueryOptions, ) -> Result<Vec<GlobalRankedHit>>
Cross-workspace ranked merge: highest score first, workspace tag preserved.
Trait Implementations§
Source§impl Clone for GlobalRegistry
impl Clone for GlobalRegistry
Source§fn clone(&self) -> GlobalRegistry
fn clone(&self) -> GlobalRegistry
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 GlobalRegistry
impl Debug for GlobalRegistry
Source§impl Default for GlobalRegistry
impl Default for GlobalRegistry
Source§fn default() -> GlobalRegistry
fn default() -> GlobalRegistry
Returns the “default value” for a type. Read more
Source§impl<'de> Deserialize<'de> for GlobalRegistry
impl<'de> Deserialize<'de> for GlobalRegistry
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for GlobalRegistry
impl RefUnwindSafe for GlobalRegistry
impl Send for GlobalRegistry
impl Sync for GlobalRegistry
impl Unpin for GlobalRegistry
impl UnsafeUnpin for GlobalRegistry
impl UnwindSafe for GlobalRegistry
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