improv(plugins): Convert web plugin to Rust plugin, with config support

This commit is contained in:
Michael Aaron Murphy 2021-08-15 14:32:50 +02:00
parent 251dcd5b2c
commit 48f09be4c9
15 changed files with 324 additions and 164 deletions

View file

@ -7,7 +7,7 @@ use flume::{unbounded, Receiver, Sender};
use futures_lite::{future, StreamExt};
use regex::Regex;
use slab::Slab;
use std::io::Write;
use std::io::{self, Write};
pub type PluginKey = usize;
@ -23,6 +23,12 @@ pub struct PluginHelp {
pub description: String,
pub help: Option<String>,
}
pub async fn main() {
let stdout = io::stdout();
Service::new(stdout.lock()).exec().await
}
pub struct Service<O> {
active_search: Vec<(PluginKey, PluginSearchResult)>,
awaiting_results: usize,