pub struct Output { /* private fields */ }Expand description
The Alfred script filter workflow output.
A script filter is required to return zero or more Items. Each Item
describes a result row displayed in Alfred. The three obvious elements are
the ones you see in an Alfred result row - Item::new, Item::subtitle
and Item::icon.
Implementations§
Source§impl Output
impl Output
Sourcepub fn rerun(&mut self, duration: Duration) -> &mut Self
pub fn rerun(&mut self, duration: Duration) -> &mut Self
Set the rerun value.
Scripts can be set to re-run automatically after an interval with a value of 0.1 to 5.0 seconds. The script will only be re-run if the script filter is still active and the user hasn’t changed the state of the filter by typing and triggering a re-run.
Sourcepub fn skip_knowledge(&mut self, skip_knowledge: bool) -> &mut Self
pub fn skip_knowledge(&mut self, skip_knowledge: bool) -> &mut Self
Set the skip knowledge value.
This allows you to set uid and preserve the item order while allowing
Alfred to retain knowledge of your items, like your current selection
during a re-run.
Sourcepub fn variables<K, V>(
self,
variables: impl IntoIterator<Item = (K, V)>,
) -> Self
pub fn variables<K, V>( self, variables: impl IntoIterator<Item = (K, V)>, ) -> Self
Set the variables which are passed out of the script filter object.
These remain accessible throughout the current session as environment variables. In addition, they are passed back in when the script reruns within the same session. This can be used for managing state between runs as the user types input or when the script is set to re-run after an interval.
These can be overridden on a per-item or per-modifier basis. See
Item::variables and Modifier::variables.
Sourcepub fn items<I>(&mut self, iter: I) -> &mut Selfwhere
I: IntoIterator<Item = Item>,
pub fn items<I>(&mut self, iter: I) -> &mut Selfwhere
I: IntoIterator<Item = Item>,
Extend the list of items to output.