pub struct Plugin {
pub manifest: Manifest,
pub directory: PathBuf,
pub id: String,
}Expand description
A discovered plugin: its manifest plus the directory it lives in.
Fields§
§manifest: ManifestThe parsed manifest.toml.
directory: PathBufWhere the plugin lives. Commands are resolved relative to it.
id: StringDirectory name, used as the stable plugin identifier.
Implementations§
Source§impl Plugin
impl Plugin
Sourcepub fn match_query_as<'a>(
&self,
keyword: Option<&str>,
query: &'a str,
) -> Option<&'a str>
pub fn match_query_as<'a>( &self, keyword: Option<&str>, query: &'a str, ) -> Option<&'a str>
Whether this plugin should run for query, and the text it should see.
A keyworded plugin receives the query with its keyword stripped, matching
Alfred: typing gh jump hands the plugin jump. The host passes the
effective keyword, so a user override replaces the manifest’s here.
Sourcepub fn match_query<'a>(&self, query: &'a str) -> Option<&'a str>
pub fn match_query<'a>(&self, query: &'a str) -> Option<&'a str>
Self::match_query_as with the manifest’s own keyword.
Sourcepub fn activate(&self, arg: &str, variables: &[(String, String)])
pub fn activate(&self, arg: &str, variables: &[(String, String)])
Run the plugin’s activation command for arg.
variables — the item’s merged variables, Alfred-style — are
exported into the command’s environment, which is how a plugin carries
state from query to activation without encoding it all into arg.
Spawned detached: the launcher dismisses immediately and does not wait for the action to finish.