[][src]Struct alfred::ItemBuilder

pub struct ItemBuilder<'a> { /* fields omitted */ }

Helper for building Item values.

Methods

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

pub fn new<S: Into<Cow<'a, str>>>(title: S) -> ItemBuilder<'a>[src]

Returns a new ItemBuilder with the given title.

pub fn into_item(self) -> Item<'a>[src]

Returns the built Item.

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

pub fn title<S: Into<Cow<'a, str>>>(self, title: S) -> ItemBuilder<'a>[src]

Sets the title to the given value.

pub fn subtitle<S: Into<Cow<'a, str>>>(self, subtitle: S) -> ItemBuilder<'a>[src]

Sets the default subtitle to the given value.

This sets the default subtitle, used when no modifier is pressed, or when no subtitle is provided for the pressed modifier.

pub fn subtitle_mod<S: Into<Cow<'a, str>>>(
    self,
    modifier: Modifier,
    subtitle: S
) -> ItemBuilder<'a>
[src]

Sets the subtitle to the given value with the given modifier.

This sets the subtitle to use when the given modifier is pressed.

pub fn icon_path<S: Into<Cow<'a, str>>>(self, path: S) -> ItemBuilder<'a>[src]

Sets the icon to an image file on disk.

The path is interpreted relative to the workflow directory.

pub fn icon_file<S: Into<Cow<'a, str>>>(self, path: S) -> ItemBuilder<'a>[src]

Sets the icon to the icon for a given file on disk.

The path is interpreted relative to the workflow directory.

pub fn icon_filetype<S: Into<Cow<'a, str>>>(
    self,
    filetype: S
) -> ItemBuilder<'a>
[src]

Sets the icon to the icon for a given file type.

The type is a UTI, such as "public.jpeg".

pub fn icon_path_mod<S: Into<Cow<'a, str>>>(
    self,
    modifier: Modifier,
    path: S
) -> ItemBuilder<'a>
[src]

Sets the icon to an image file on disk for the given modifier.

The path is interpreted relative to the workflow directory.

This property is only used with JSON output. The legacy XML output does not include per-modifier icons.

This property is only used with Alfred 3.4.1 or later.

pub fn icon_file_mod<S: Into<Cow<'a, str>>>(
    self,
    modifier: Modifier,
    path: S
) -> ItemBuilder<'a>
[src]

Sets the icon to the icon for a given file on disk for the given modifier.

The path is interpreted relative to the workflow directory.

This property is only used with JSON output. The legacy XML output does not include per-modifier icons.

This property is only used with Alfred 3.4.1 or later.

pub fn icon_filetype_mod<S: Into<Cow<'a, str>>>(
    self,
    modifier: Modifier,
    filetype: S
) -> ItemBuilder<'a>
[src]

Sets the icon to the icon for a given file type for the given modifier.

The type is a UTI, such as "public.jpeg".

This property is only used with JSON output. The legacy XML output does not include per-modifier icons.

This property is only used with Alfred 3.4.1 or later.

pub fn uid<S: Into<Cow<'a, str>>>(self, uid: S) -> ItemBuilder<'a>[src]

Sets the uid to the given value.

pub fn arg<S: Into<Cow<'a, str>>>(self, arg: S) -> ItemBuilder<'a>[src]

Sets the arg to the given value.

pub fn arg_mod<S: Into<Cow<'a, str>>>(
    self,
    modifier: Modifier,
    arg: S
) -> ItemBuilder<'a>
[src]

Sets the arg to the given value with the given modifier.

This sets the arg to use when the given modifier is pressed.

pub fn type_(self, type_: ItemType) -> ItemBuilder<'a>[src]

Sets the type to the given value.

pub fn valid(self, valid: bool) -> ItemBuilder<'a>[src]

Sets valid to the given value.

pub fn valid_mod(self, modifier: Modifier, valid: bool) -> ItemBuilder<'a>[src]

Sets valid to the given value with the given modifier.

This sets the validity to use when the given modifier is pressed.

pub fn modifier<S: Into<Cow<'a, str>>, S2: Into<Cow<'a, str>>>(
    self,
    modifier: Modifier,
    subtitle: Option<S>,
    arg: Option<S2>,
    valid: bool,
    icon: Option<Icon<'a>>
) -> ItemBuilder<'a>
[src]

Sets the subtitle, arg, validity, and icon to use with the given modifier.

pub fn autocomplete<S: Into<Cow<'a, str>>>(
    self,
    autocomplete: S
) -> ItemBuilder<'a>
[src]

Sets autocomplete to the given value.

pub fn text_copy<S: Into<Cow<'a, str>>>(self, text: S) -> ItemBuilder<'a>[src]

Sets text_copy to the given value.

pub fn text_large_type<S: Into<Cow<'a, str>>>(self, text: S) -> ItemBuilder<'a>[src]

Sets text_large_type to the given value.

pub fn quicklook_url<S: Into<Cow<'a, str>>>(self, url: S) -> ItemBuilder<'a>[src]

Sets quicklook_url to the given value.

pub fn variable<K, V>(self, key: K, value: V) -> ItemBuilder<'a> where
    K: Into<Cow<'a, str>>,
    V: Into<Cow<'a, str>>, 
[src]

Inserts a key/value pair into the item variables.

Item variables are only used with JSON output and only affect Alfred 3.4.1 or later.

pub fn variables<I, K, V>(self, variables: I) -> ItemBuilder<'a> where
    I: IntoIterator<Item = (K, V)>,
    K: Into<Cow<'a, str>>,
    V: Into<Cow<'a, str>>, 
[src]

Sets the item's variables to variables.

Item variables are only used with JSON output and only affect Alfred 3.4.1 or later.

pub fn variable_mod<K, V>(
    self,
    modifier: Modifier,
    key: K,
    value: V
) -> ItemBuilder<'a> where
    K: Into<Cow<'a, str>>,
    V: Into<Cow<'a, str>>, 
[src]

Inserts a key/value pair into the variables for the given modifier.

Item variables are only used with JSON output and only affect Alfred 3.4.1 or later.

pub fn variables_mod<I, K, V>(
    self,
    modifier: Modifier,
    variables: I
) -> ItemBuilder<'a> where
    I: IntoIterator<Item = (K, V)>,
    K: Into<Cow<'a, str>>,
    V: Into<Cow<'a, str>>, 
[src]

Sets the variables to variables for the given modifier.

Item variables are only used with JSON output and only affect Alfred 3.4.1 or later.

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

pub fn set_title<S: Into<Cow<'a, str>>>(&mut self, title: S)[src]

Sets the title to the given value.

pub fn set_subtitle<S: Into<Cow<'a, str>>>(&mut self, subtitle: S)[src]

Sets the default subtitle to the given value.

pub fn unset_subtitle(&mut self)[src]

Unsets the default subtitle.

pub fn set_subtitle_mod<S: Into<Cow<'a, str>>>(
    &mut self,
    modifier: Modifier,
    subtitle: S
)
[src]

Sets the subtitle to the given value for the given modifier.

pub fn unset_subtitle_mod(&mut self, modifier: Modifier)[src]

Unsets the subtitle for the given modifier.

This unsets the subtitle that's used when the given modifier is pressed.

pub fn clear_subtitle(&mut self)[src]

Clears the subtitle for all modifiers.

This unsets both the default subtitle and the per-modifier subtitles.

pub fn set_icon_path<S: Into<Cow<'a, str>>>(&mut self, path: S)[src]

Sets the icon to an image file on disk.

The path is interpreted relative to the workflow directory.

pub fn set_icon_file<S: Into<Cow<'a, str>>>(&mut self, path: S)[src]

Sets the icon to the icon for a given file on disk.

The path is interpreted relative to the workflow directory.

pub fn set_icon_filetype<S: Into<Cow<'a, str>>>(&mut self, filetype: S)[src]

Sets the icon to the icon for a given file type.

The type is a UTI, such as "public.jpeg".

pub fn unset_icon(&mut self)[src]

Unsets the icon.

pub fn set_icon_path_mod<S: Into<Cow<'a, str>>>(
    &mut self,
    modifier: Modifier,
    path: S
)
[src]

Sets icon to an image file on disk for the given modifier.

The path is interpreted relative to the workflow directory.

This property is only used with JSON output. The legacy XML output does not include per-modifier icons.

This property is only used with Alfred 3.4.1 or later.

pub fn set_icon_file_mod<S: Into<Cow<'a, str>>>(
    &mut self,
    modifier: Modifier,
    path: S
)
[src]

Sets icon to the icon for a given file on disk for the given modifier.

The path is interpreted relative to the workflow directory.

This property is only used with JSON output. The legacy XML output does not include per-modifier icons.

This property is only used with Alfred 3.4.1 or later.

pub fn set_icon_filetype_mod<S: Into<Cow<'a, str>>>(
    &mut self,
    modifier: Modifier,
    filetype: S
)
[src]

Sets icon to the icon for a given file type for the given modifier.

The type is a UTI, such as "public.jpeg".

This property is only used with JSON output. The legacy XML output does not include per-modifier icons.

This property is only used with Alfred 3.4.1 or later.

pub fn unset_icon_mod(&mut self, modifier: Modifier)[src]

Unsets icon for the given modifier.

This unsets the result icon that's used when the given modifier is pressed.

pub fn clear_icon(&mut self)[src]

Clears the icon for all modifiers.

This unsets both the default icon and the per-modifier icons.

pub fn set_uid<S: Into<Cow<'a, str>>>(&mut self, uid: S)[src]

Sets the uid to the given value.

pub fn unset_uid(&mut self)[src]

Unsets the uid.

pub fn set_arg<S: Into<Cow<'a, str>>>(&mut self, arg: S)[src]

Sets the arg to the given value.

pub fn unset_arg(&mut self)[src]

Unsets the arg.

pub fn set_arg_mod<S: Into<Cow<'a, str>>>(&mut self, modifier: Modifier, arg: S)[src]

Sets the arg to the given value for the given modifier.

pub fn unset_arg_mod(&mut self, modifier: Modifier)[src]

Unsets the arg for the given modifier.

This unsets the arg that's used when the given modifier is pressed.

pub fn clear_arg(&mut self)[src]

Clears the arg for all modifiers.

This unsets both the default arg and the per-modifier args.

pub fn set_type(&mut self, type_: ItemType)[src]

Sets the type to the given value.

pub fn set_valid(&mut self, valid: bool)[src]

Sets valid to the given value.

pub fn set_valid_mod(&mut self, modifier: Modifier, valid: bool)[src]

Sets valid to the given value for the given modifier.

pub fn unset_valid_mod(&mut self, modifier: Modifier)[src]

Unsets valid for the given modifier.

This unsets the validity that's used when the given modifier is pressed.

pub fn clear_valid(&mut self)[src]

Unsets valid for all modifiers.

This resets valid back to the default and clears all per-modifier validity.

pub fn set_autocomplete<S: Into<Cow<'a, str>>>(&mut self, autocomplete: S)[src]

Sets autocomplete to the given value.

pub fn unset_autocomplete(&mut self)[src]

Unsets autocomplete.

pub fn set_modifier<S: Into<Cow<'a, str>>, S2: Into<Cow<'a, str>>>(
    &mut self,
    modifier: Modifier,
    subtitle: Option<S>,
    arg: Option<S2>,
    valid: bool,
    icon: Option<Icon<'a>>
)
[src]

Sets subtitle, arg, validity, and icon for the given modifier.

pub fn unset_modifier(&mut self, modifier: Modifier)[src]

Unsets subtitle, arg, and validity for the given modifier.

pub fn set_text_copy<S: Into<Cow<'a, str>>>(&mut self, text: S)[src]

Sets text_copy to the given value.

pub fn unset_text_copy(&mut self)[src]

Unsets text_copy.

pub fn set_text_large_type<S: Into<Cow<'a, str>>>(&mut self, text: S)[src]

Sets text_large_type to the given value.

pub fn unset_text_large_type(&mut self)[src]

Unsets text_large_type.

pub fn set_quicklook_url<S: Into<Cow<'a, str>>>(&mut self, url: S)[src]

Sets quicklook_url to the given value.

pub fn unset_quicklook_url(&mut self)[src]

Unsets quicklook_url.

pub fn set_variable<K, V>(&mut self, key: K, value: V) where
    K: Into<Cow<'a, str>>,
    V: Into<Cow<'a, str>>, 
[src]

Inserts a key/value pair into the item variables.

Item variables are only used with JSON output and only affect Alfred 3.4.1 or later.

pub fn unset_variable<K: ?Sized>(&mut self, key: &K) where
    Cow<'a, str>: Borrow<K>,
    K: Hash + Eq
[src]

Removes a key from the item variables.

Item variables are only used with JSON output and only affect Alfred 3.4.1 or later.

pub fn set_variables<I, K, V>(&mut self, variables: I) where
    I: IntoIterator<Item = (K, V)>,
    K: Into<Cow<'a, str>>,
    V: Into<Cow<'a, str>>, 
[src]

Sets the item's variables to variables.

Item variables are only used with JSON output and only affect Alfred 3.4.1 or later.

pub fn unset_variables(&mut self)[src]

Removes all item variables.

This does not affect per-modifier variables.

Item variables are only used with JSON output and only affect Alfred 3.4.1 or later.

pub fn set_variable_mod<K, V>(&mut self, modifier: Modifier, key: K, value: V) where
    K: Into<Cow<'a, str>>,
    V: Into<Cow<'a, str>>, 
[src]

Inserts a key/value pair into the variables for the given modifier.

Item variables are only used with JSON output and only affect Alfred 3.4.1 or later.

pub fn unset_variable_mod<K: ?Sized>(&mut self, modifier: Modifier, key: &K) where
    Cow<'a, str>: Borrow<K>,
    K: Hash + Eq
[src]

Removes a key from the variables for the given modifier.

Item variables are only used with JSON output and only affect Alfred 3.4.1 or later.

pub fn set_variables_mod<I, K, V>(&mut self, modifier: Modifier, variables: I) where
    I: IntoIterator<Item = (K, V)>,
    K: Into<Cow<'a, str>>,
    V: Into<Cow<'a, str>>, 
[src]

Sets the variables to variables for the given modifier.

Item variables are only used with JSON output and only affect Alfred 3.4.1 or later.

pub fn unset_variables_mod(&mut self, modifier: Modifier)[src]

Removes all variables for the given modifier.

Item variables are only used with JSON output and only affect Alfred 3.4.1 or later.

pub fn clear_variables(&mut self)[src]

Removes all item variables and all per-modifier variables.

Item variables are only used with JSON output and only affect Alfred 3.4.1 or later.

Trait Implementations

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

fn clone_from(&mut self, source: &Self)1.0.0[src]

Performs copy-assignment from source. Read more

impl<'a> Debug for ItemBuilder<'a>[src]

Auto Trait Implementations

impl<'a> Send for ItemBuilder<'a>

impl<'a> Unpin for ItemBuilder<'a>

impl<'a> Sync for ItemBuilder<'a>

impl<'a> UnwindSafe for ItemBuilder<'a>

impl<'a> RefUnwindSafe for ItemBuilder<'a>

Blanket Implementations

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]