pub struct ItemBuilder<'a> { /* private fields */ }Expand description
Helper for building Item values.
Implementations§
Source§impl<'a> ItemBuilder<'a>
impl<'a> ItemBuilder<'a>
Source§impl<'a> ItemBuilder<'a>
impl<'a> ItemBuilder<'a>
Sourcepub fn title<S: Into<Cow<'a, str>>>(self, title: S) -> ItemBuilder<'a>
pub fn title<S: Into<Cow<'a, str>>>(self, title: S) -> ItemBuilder<'a>
Sets the title to the given value.
Sourcepub fn subtitle<S: Into<Cow<'a, str>>>(self, subtitle: S) -> ItemBuilder<'a>
pub fn subtitle<S: Into<Cow<'a, str>>>(self, subtitle: S) -> ItemBuilder<'a>
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.
Sourcepub fn subtitle_mod<S: Into<Cow<'a, str>>>(
self,
modifier: Modifier,
subtitle: S,
) -> ItemBuilder<'a>
pub fn subtitle_mod<S: Into<Cow<'a, str>>>( self, modifier: Modifier, subtitle: S, ) -> ItemBuilder<'a>
Sets the subtitle to the given value with the given modifier.
This sets the subtitle to use when the given modifier is pressed.
Sourcepub fn icon_path<S: Into<Cow<'a, str>>>(self, path: S) -> ItemBuilder<'a>
pub fn icon_path<S: Into<Cow<'a, str>>>(self, path: S) -> ItemBuilder<'a>
Sets the icon to an image file on disk.
The path is interpreted relative to the workflow directory.
Sourcepub fn icon_file<S: Into<Cow<'a, str>>>(self, path: S) -> ItemBuilder<'a>
pub fn icon_file<S: Into<Cow<'a, str>>>(self, path: S) -> ItemBuilder<'a>
Sets the icon to the icon for a given file on disk.
The path is interpreted relative to the workflow directory.
Sourcepub fn icon_filetype<S: Into<Cow<'a, str>>>(
self,
filetype: S,
) -> ItemBuilder<'a>
pub fn icon_filetype<S: Into<Cow<'a, str>>>( self, filetype: S, ) -> ItemBuilder<'a>
Sets the icon to the icon for a given file type.
The type is a UTI, such as “public.jpeg”.
Sourcepub fn icon_path_mod<S: Into<Cow<'a, str>>>(
self,
modifier: Modifier,
path: S,
) -> ItemBuilder<'a>
pub fn icon_path_mod<S: Into<Cow<'a, str>>>( self, modifier: Modifier, path: S, ) -> ItemBuilder<'a>
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.
Sourcepub fn icon_file_mod<S: Into<Cow<'a, str>>>(
self,
modifier: Modifier,
path: S,
) -> ItemBuilder<'a>
pub fn icon_file_mod<S: Into<Cow<'a, str>>>( self, modifier: Modifier, path: S, ) -> ItemBuilder<'a>
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.
Sourcepub fn icon_filetype_mod<S: Into<Cow<'a, str>>>(
self,
modifier: Modifier,
filetype: S,
) -> ItemBuilder<'a>
pub fn icon_filetype_mod<S: Into<Cow<'a, str>>>( self, modifier: Modifier, filetype: S, ) -> ItemBuilder<'a>
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.
Sourcepub fn uid<S: Into<Cow<'a, str>>>(self, uid: S) -> ItemBuilder<'a>
pub fn uid<S: Into<Cow<'a, str>>>(self, uid: S) -> ItemBuilder<'a>
Sets the uid to the given value.
Sourcepub fn arg<S: Into<Cow<'a, str>>>(self, arg: S) -> ItemBuilder<'a>
pub fn arg<S: Into<Cow<'a, str>>>(self, arg: S) -> ItemBuilder<'a>
Sets the arg to the given value.
Sourcepub fn arg_mod<S: Into<Cow<'a, str>>>(
self,
modifier: Modifier,
arg: S,
) -> ItemBuilder<'a>
pub fn arg_mod<S: Into<Cow<'a, str>>>( self, modifier: Modifier, arg: S, ) -> ItemBuilder<'a>
Sets the arg to the given value with the given modifier.
This sets the arg to use when the given modifier is pressed.
Sourcepub fn type_(self, type_: ItemType) -> ItemBuilder<'a>
pub fn type_(self, type_: ItemType) -> ItemBuilder<'a>
Sets the type to the given value.
Sourcepub fn valid(self, valid: bool) -> ItemBuilder<'a>
pub fn valid(self, valid: bool) -> ItemBuilder<'a>
Sets valid to the given value.
Sourcepub fn valid_mod(self, modifier: Modifier, valid: bool) -> ItemBuilder<'a>
pub fn valid_mod(self, modifier: Modifier, valid: bool) -> ItemBuilder<'a>
Sets valid to the given value with the given modifier.
This sets the validity to use when the given modifier is pressed.
Sourcepub 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>
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>
Sets the subtitle, arg, validity, and icon to use with the given modifier.
Sourcepub fn autocomplete<S: Into<Cow<'a, str>>>(
self,
autocomplete: S,
) -> ItemBuilder<'a>
pub fn autocomplete<S: Into<Cow<'a, str>>>( self, autocomplete: S, ) -> ItemBuilder<'a>
Sets autocomplete to the given value.
Sourcepub fn text_copy<S: Into<Cow<'a, str>>>(self, text: S) -> ItemBuilder<'a>
pub fn text_copy<S: Into<Cow<'a, str>>>(self, text: S) -> ItemBuilder<'a>
Sets text_copy to the given value.
Sourcepub fn text_large_type<S: Into<Cow<'a, str>>>(self, text: S) -> ItemBuilder<'a>
pub fn text_large_type<S: Into<Cow<'a, str>>>(self, text: S) -> ItemBuilder<'a>
Sets text_large_type to the given value.
Sourcepub fn quicklook_url<S: Into<Cow<'a, str>>>(self, url: S) -> ItemBuilder<'a>
pub fn quicklook_url<S: Into<Cow<'a, str>>>(self, url: S) -> ItemBuilder<'a>
Sets quicklook_url to the given value.
Sourcepub fn variable<K, V>(self, key: K, value: V) -> ItemBuilder<'a>
pub fn variable<K, V>(self, key: K, value: V) -> ItemBuilder<'a>
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.
Sourcepub fn variables<I, K, V>(self, variables: I) -> ItemBuilder<'a>
pub fn variables<I, K, V>(self, variables: I) -> ItemBuilder<'a>
Sets the item’s variables to variables.
Item variables are only used with JSON output and only affect Alfred 3.4.1 or later.
Sourcepub fn variable_mod<K, V>(
self,
modifier: Modifier,
key: K,
value: V,
) -> ItemBuilder<'a>
pub fn variable_mod<K, V>( self, modifier: Modifier, key: K, value: V, ) -> ItemBuilder<'a>
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.
Sourcepub fn variables_mod<I, K, V>(
self,
modifier: Modifier,
variables: I,
) -> ItemBuilder<'a>
pub fn variables_mod<I, K, V>( self, modifier: Modifier, variables: I, ) -> ItemBuilder<'a>
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.
Source§impl<'a> ItemBuilder<'a>
impl<'a> ItemBuilder<'a>
Sourcepub fn set_title<S: Into<Cow<'a, str>>>(&mut self, title: S)
pub fn set_title<S: Into<Cow<'a, str>>>(&mut self, title: S)
Sets the title to the given value.
Sourcepub fn set_subtitle<S: Into<Cow<'a, str>>>(&mut self, subtitle: S)
pub fn set_subtitle<S: Into<Cow<'a, str>>>(&mut self, subtitle: S)
Sets the default subtitle to the given value.
Sourcepub fn unset_subtitle(&mut self)
pub fn unset_subtitle(&mut self)
Unsets the default subtitle.
Sourcepub fn set_subtitle_mod<S: Into<Cow<'a, str>>>(
&mut self,
modifier: Modifier,
subtitle: S,
)
pub fn set_subtitle_mod<S: Into<Cow<'a, str>>>( &mut self, modifier: Modifier, subtitle: S, )
Sets the subtitle to the given value for the given modifier.
Sourcepub fn unset_subtitle_mod(&mut self, modifier: Modifier)
pub fn unset_subtitle_mod(&mut self, modifier: Modifier)
Unsets the subtitle for the given modifier.
This unsets the subtitle that’s used when the given modifier is pressed.
Sourcepub fn clear_subtitle(&mut self)
pub fn clear_subtitle(&mut self)
Clears the subtitle for all modifiers.
This unsets both the default subtitle and the per-modifier subtitles.
Sourcepub fn set_icon_path<S: Into<Cow<'a, str>>>(&mut self, path: S)
pub fn set_icon_path<S: Into<Cow<'a, str>>>(&mut self, path: S)
Sets the icon to an image file on disk.
The path is interpreted relative to the workflow directory.
Sourcepub fn set_icon_file<S: Into<Cow<'a, str>>>(&mut self, path: S)
pub fn set_icon_file<S: Into<Cow<'a, str>>>(&mut self, path: S)
Sets the icon to the icon for a given file on disk.
The path is interpreted relative to the workflow directory.
Sourcepub fn set_icon_filetype<S: Into<Cow<'a, str>>>(&mut self, filetype: S)
pub fn set_icon_filetype<S: Into<Cow<'a, str>>>(&mut self, filetype: S)
Sets the icon to the icon for a given file type.
The type is a UTI, such as “public.jpeg”.
Sourcepub fn unset_icon(&mut self)
pub fn unset_icon(&mut self)
Unsets the icon.
Sourcepub fn set_icon_path_mod<S: Into<Cow<'a, str>>>(
&mut self,
modifier: Modifier,
path: S,
)
pub fn set_icon_path_mod<S: Into<Cow<'a, str>>>( &mut self, modifier: Modifier, path: S, )
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.
Sourcepub fn set_icon_file_mod<S: Into<Cow<'a, str>>>(
&mut self,
modifier: Modifier,
path: S,
)
pub fn set_icon_file_mod<S: Into<Cow<'a, str>>>( &mut self, modifier: Modifier, path: S, )
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.
Sourcepub fn set_icon_filetype_mod<S: Into<Cow<'a, str>>>(
&mut self,
modifier: Modifier,
filetype: S,
)
pub fn set_icon_filetype_mod<S: Into<Cow<'a, str>>>( &mut self, modifier: Modifier, filetype: S, )
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.
Sourcepub fn unset_icon_mod(&mut self, modifier: Modifier)
pub fn unset_icon_mod(&mut self, modifier: Modifier)
Unsets icon for the given modifier.
This unsets the result icon that’s used when the given modifier is pressed.
Sourcepub fn clear_icon(&mut self)
pub fn clear_icon(&mut self)
Clears the icon for all modifiers.
This unsets both the default icon and the per-modifier icons.
Sourcepub fn set_arg_mod<S: Into<Cow<'a, str>>>(&mut self, modifier: Modifier, arg: S)
pub fn set_arg_mod<S: Into<Cow<'a, str>>>(&mut self, modifier: Modifier, arg: S)
Sets the arg to the given value for the given modifier.
Sourcepub fn unset_arg_mod(&mut self, modifier: Modifier)
pub fn unset_arg_mod(&mut self, modifier: Modifier)
Unsets the arg for the given modifier.
This unsets the arg that’s used when the given modifier is pressed.
Sourcepub fn clear_arg(&mut self)
pub fn clear_arg(&mut self)
Clears the arg for all modifiers.
This unsets both the default arg and the per-modifier args.
Sourcepub fn set_valid_mod(&mut self, modifier: Modifier, valid: bool)
pub fn set_valid_mod(&mut self, modifier: Modifier, valid: bool)
Sets valid to the given value for the given modifier.
Sourcepub fn unset_valid_mod(&mut self, modifier: Modifier)
pub fn unset_valid_mod(&mut self, modifier: Modifier)
Unsets valid for the given modifier.
This unsets the validity that’s used when the given modifier is pressed.
Sourcepub fn clear_valid(&mut self)
pub fn clear_valid(&mut self)
Unsets valid for all modifiers.
This resets valid back to the default and clears all per-modifier validity.
Sourcepub fn set_autocomplete<S: Into<Cow<'a, str>>>(&mut self, autocomplete: S)
pub fn set_autocomplete<S: Into<Cow<'a, str>>>(&mut self, autocomplete: S)
Sets autocomplete to the given value.
Sourcepub fn unset_autocomplete(&mut self)
pub fn unset_autocomplete(&mut self)
Unsets autocomplete.
Sourcepub 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>>,
)
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>>, )
Sets subtitle, arg, validity, and icon for the given modifier.
Sourcepub fn unset_modifier(&mut self, modifier: Modifier)
pub fn unset_modifier(&mut self, modifier: Modifier)
Unsets subtitle, arg, and validity for the given modifier.
Sourcepub fn set_text_copy<S: Into<Cow<'a, str>>>(&mut self, text: S)
pub fn set_text_copy<S: Into<Cow<'a, str>>>(&mut self, text: S)
Sets text_copy to the given value.
Sourcepub fn unset_text_copy(&mut self)
pub fn unset_text_copy(&mut self)
Unsets text_copy.
Sourcepub fn set_text_large_type<S: Into<Cow<'a, str>>>(&mut self, text: S)
pub fn set_text_large_type<S: Into<Cow<'a, str>>>(&mut self, text: S)
Sets text_large_type to the given value.
Sourcepub fn unset_text_large_type(&mut self)
pub fn unset_text_large_type(&mut self)
Unsets text_large_type.
Sourcepub fn set_quicklook_url<S: Into<Cow<'a, str>>>(&mut self, url: S)
pub fn set_quicklook_url<S: Into<Cow<'a, str>>>(&mut self, url: S)
Sets quicklook_url to the given value.
Sourcepub fn unset_quicklook_url(&mut self)
pub fn unset_quicklook_url(&mut self)
Unsets quicklook_url.
Sourcepub fn set_variable<K, V>(&mut self, key: K, value: V)
pub fn set_variable<K, V>(&mut self, key: K, value: V)
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.
Sourcepub fn unset_variable<K>(&mut self, key: &K)
pub fn unset_variable<K>(&mut self, key: &K)
Removes a key from the item variables.
Item variables are only used with JSON output and only affect Alfred 3.4.1 or later.
Sourcepub fn set_variables<I, K, V>(&mut self, variables: I)
pub fn set_variables<I, K, V>(&mut self, variables: I)
Sets the item’s variables to variables.
Item variables are only used with JSON output and only affect Alfred 3.4.1 or later.
Sourcepub fn unset_variables(&mut self)
pub fn unset_variables(&mut self)
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.
Sourcepub fn set_variable_mod<K, V>(&mut self, modifier: Modifier, key: K, value: V)
pub fn set_variable_mod<K, V>(&mut self, modifier: Modifier, key: K, value: V)
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.
Sourcepub fn unset_variable_mod<K>(&mut self, modifier: Modifier, key: &K)
pub fn unset_variable_mod<K>(&mut self, modifier: Modifier, key: &K)
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.
Sourcepub fn set_variables_mod<I, K, V>(&mut self, modifier: Modifier, variables: I)
pub fn set_variables_mod<I, K, V>(&mut self, modifier: Modifier, variables: I)
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.
Sourcepub fn unset_variables_mod(&mut self, modifier: Modifier)
pub fn unset_variables_mod(&mut self, modifier: Modifier)
Removes all variables for the given modifier.
Item variables are only used with JSON output and only affect Alfred 3.4.1 or later.
Sourcepub fn clear_variables(&mut self)
pub fn clear_variables(&mut self)
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§
Source§impl<'a> Clone for ItemBuilder<'a>
impl<'a> Clone for ItemBuilder<'a>
Source§fn clone(&self) -> ItemBuilder<'a>
fn clone(&self) -> ItemBuilder<'a>
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more