Struct alfred::Item
[−]
[src]
pub struct Item<'a> { pub title: Cow<'a, str>, pub subtitle: HashMap<Option<Modifier>, Cow<'a, str>>, pub icon: Option<Icon<'a>>, pub uid: Option<Cow<'a, str>>, pub arg: Option<Cow<'a, str>>, pub type_: ItemType, pub valid: bool, pub autocomplete: Option<Cow<'a, str>>, pub text_copy: Option<Cow<'a, str>>, pub text_large_type: Option<Cow<'a, str>>, }
Representation of an <item>
Fields
title: Cow<'a, str>
Title for the item
subtitle: HashMap<Option<Modifier>, Cow<'a, str>>
Subtitle for the item
The subtitle may differ based on the active modifier.
icon: Option<Icon<'a>>
Icon for the item
uid: Option<Cow<'a, str>>
Identifier for the results
If given, must be unique among items, and is used for prioritizing feedback results based on usage. If blank, Alfred presents results in the order given and does not learn from them.
arg: Option<Cow<'a, str>>
The value that is passed to the next portion of the workflow when this item is selected
type_: ItemType
What type of result this is
valid: bool
Whether or not the result is valid
When false
, actioning the result will populate the search field with
the autocomplete
value instead.
autocomplete: Option<Cow<'a, str>>
Autocomplete data for the item
This value is populated into the search field if the tab key is
pressed. If valid = false
, this value is populated if the item is
actioned.
text_copy: Option<Cow<'a, str>>
What text the user gets when copying the result
This value is copied if the user presses ⌘C.
text_large_type: Option<Cow<'a, str>>
What text the user gets when displaying large type
This value is displayed if the user presses ⌘L.
Methods
impl<'a> Item<'a>
[src]
impl<'a> Item<'a>
[src]
fn write_xml(&self, w: &mut Write, indent: u32) -> Result<()>
Writes the XML fragment representing the Item
to the Write
XMLWriter
should be used instead if at all possible, in order to
write the XML header/footer and maintain proper error discipline.
Trait Implementations
impl<'a> Clone for Item<'a>
[src]
fn clone(&self) -> Item<'a>
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0
Performs copy-assignment from source
. Read more