Skip to main content

jump_core/
lib.rs

1// Copyright 2026 entro314-labs
2// SPDX-License-Identifier: MPL-2.0
3
4//! Search engine, ranking, and plugin host for the jump launcher.
5//!
6//! This crate holds everything a launcher frontend needs that is not drawing:
7//! talking to the pop-launcher service, ranking results by usage, and running
8//! user plugins. It has no UI dependencies, which is what lets the COSMIC
9//! (libcosmic) and future GNOME (GTK4) frontends share one engine rather than
10//! drifting into two half-implementations.
11//!
12//! ```no_run
13//! # async fn example() -> Result<(), Box<dyn std::error::Error>> {
14//! use jump_core::{Launcher, Frecency, PluginHost};
15//!
16//! let (launcher, mut events, _guard) = Launcher::spawn()?;
17//! let plugins = PluginHost::discover();
18//! let frecency = Frecency::load();
19//!
20//! launcher.search("fire");
21//! while let Some(event) = events.recv().await {
22//!     if let jump_core::Event::Update { items, .. } = event {
23//!         // One scale for every provider, then usage as a tiebreak.
24//!         let ranked = jump_core::rank::merge(items, "fire", &frecency);
25//!         let _ = ranked;
26//!     }
27//! }
28//! # Ok(())
29//! # }
30//! ```
31
32// This crate is published, so its public surface is the contract a second
33// frontend builds against. Undocumented public items are a defect here in a
34// way they are not in the application binary.
35#![warn(missing_docs)]
36#![warn(clippy::missing_errors_doc, clippy::missing_panics_doc)]
37
38pub mod calc;
39pub mod content;
40pub mod emoji;
41pub mod files;
42pub mod frecency;
43pub mod launcher;
44pub mod model;
45pub mod plugin;
46pub mod process;
47pub mod rank;
48pub mod web;
49
50pub use content::Content;
51pub use files::Files;
52pub use frecency::Frecency;
53pub use launcher::{Error, Event, Launcher, LauncherGuard};
54pub use model::{Icon, Item, ItemKey, Mod, Results, Source};
55pub use plugin::{Manifest, Plugin, PluginHost, QueryResults};
56
57// Re-exported so frontends can speak the protocol's vocabulary (activation
58// indices, GPU preference for desktop entries) without depending on
59// pop-launcher directly.
60pub use pop_launcher::{ContextOption, GpuPreference, Indice};