feat(service): Add isolate_with plugin query config

This query parameter will isolate search results when the specific regex query is matched.
This commit is contained in:
Michael Aaron Murphy 2021-10-20 21:39:01 +02:00
parent c330552c20
commit e7e6007e26
4 changed files with 26 additions and 0 deletions

View file

@ -79,6 +79,8 @@ pub struct PluginConnector {
/// this plugin to spawn as a background service
pub init: Box<dyn Fn() -> Sender<Request>>,
pub isolate_regex: Option<Regex>,
/// A compiled regular expression that a query must match
/// for the launcher service to justify spawning and sending
/// queries to this plugin
@ -93,11 +95,13 @@ impl PluginConnector {
pub fn new(
config: PluginConfig,
regex: Option<Regex>,
isolate_regex: Option<Regex>,
init: Box<dyn Fn() -> Sender<Request> + Send>,
) -> Self {
Self {
config,
init,
isolate_regex,
regex,
sender: None,
}