Struct alfred::Item [] [src]

pub struct Item<'a> {
    pub title: Cow<'a, str>,
    pub subtitle: Option<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>>,
    pub quicklook_url: Option<Cow<'a, str>>,
    pub modifiers: HashMap<Modifier, ModifierData<'a>>,
}

Representation of an <item>

Fields

Title for the item

Subtitle for the item

The subtitle may be overridden by modifiers.

Icon for the item

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.

The value that is passed to the next portion of the workflow when this item is selected

The arg may be overridden by modifiers.

What type of result this is

Whether or not the result is valid

When false, actioning the result will populate the search field with the autocomplete value instead.

The validity may be overridden by modifiers.

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.

What text the user gets when copying the result

This value is copied if the user presses ⌘C.

What text the user gets when displaying large type

This value is displayed if the user presses ⌘L.

A URL to use for Quick Look

Optional overrides of subtitle, arg, and valid by modifiers.

Methods

impl<'a> Item<'a>
[src]

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.

impl<'a> Item<'a>
[src]

Returns a new Item with the given title

Trait Implementations

impl<'a> ToJson for Item<'a>
[src]

Represent self as a serde_json::Value. Note that Value is not a JSON string. If you need a string, use serde_json::to_string instead. Read more

impl<'a> PartialEq for Item<'a>
[src]

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

impl<'a> Eq for Item<'a>
[src]

impl<'a> Clone for Item<'a>
[src]

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more