pub struct EngineHandle { /* private fields */ }Expand description
Cloneable async handle used by Tokio IPC servers (Unix socket, D-Bus) to query the actor thread.
Implementations§
Source§impl EngineHandle
impl EngineHandle
Sourcepub fn spawn() -> Self
pub fn spawn() -> Self
Spawns the dedicated OS actor thread initialized from $XDG_CONFIG_HOME/fount/config.json
(or ~/.config/fount/config.json, falling back to defaults if not present).
Sourcepub fn spawn_with_catalog(catalog: IndexCatalog) -> Self
pub fn spawn_with_catalog(catalog: IndexCatalog) -> Self
Spawns the dedicated OS actor thread taking ownership of the provided IndexCatalog.
Nucleo runs its own internal Rayon thread pool; keeping IndexCatalog and nucleo.tick()
isolated on this dedicated OS thread guarantees Tokio worker threads are never blocked.
Sourcepub async fn search(
&self,
query: impl Into<String>,
limit: usize,
) -> Result<Vec<SearchResult>, EngineError>
pub async fn search( &self, query: impl Into<String>, limit: usize, ) -> Result<Vec<SearchResult>, EngineError>
Submits a fuzzy search query to the engine actor and awaits the ranked results.
Sourcepub async fn launch(
&self,
id: impl Into<String>,
execute_process: bool,
) -> Result<(), EngineError>
pub async fn launch( &self, id: impl Into<String>, execute_process: bool, ) -> Result<(), EngineError>
Records a launch for id (updating frecency) and optionally spawns the process.
Sourcepub async fn reload(&self) -> Result<usize, EngineError>
pub async fn reload(&self) -> Result<usize, EngineError>
Triggers an index reload and returns the updated entry count.
Sourcepub async fn shutdown(&self) -> Result<(), EngineError>
pub async fn shutdown(&self) -> Result<(), EngineError>
Flushes state to disk and stops the actor thread cleanly.
Sourcepub async fn dispatch(&self, msg: ClientMessage) -> DaemonMessage
pub async fn dispatch(&self, msg: ClientMessage) -> DaemonMessage
Stateless dispatcher for wire protocol messages received from the IPC server.
Trait Implementations§
Source§impl Clone for EngineHandle
impl Clone for EngineHandle
Auto Trait Implementations§
impl Forget for EngineHandle
impl Freeze for EngineHandlewhere
*const ArcInner<Chan<EngineCommand, Semaphore>> is !null: Freeze,
PhantomData<ArcInner<Chan<EngineCommand, Semaphore>>>: Freeze,
impl Move for EngineHandle
impl RefUnwindSafe for EngineHandle
impl Send for EngineHandle
impl Sync for EngineHandle
impl Unpin for EngineHandle
impl UnsafeUnpin for EngineHandlewhere
*const ArcInner<Chan<EngineCommand, Semaphore>> is !null: UnsafeUnpin,
PhantomData<ArcInner<Chan<EngineCommand, Semaphore>>>: UnsafeUnpin,
impl UnwindSafe for EngineHandle
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
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> ⓘ
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