libappstream::prelude

Trait ComponentExt

source
pub trait ComponentExt:
    IsA<Component>
    + Sealed
    + 'static {
Show 134 methods // Provided methods fn add_addon(&self, addon: &impl IsA<Component>) { ... } fn add_agreement(&self, agreement: &impl IsA<Agreement>) { ... } fn add_bundle(&self, bundle: &impl IsA<Bundle>) { ... } fn add_category(&self, category: &str) { ... } fn add_content_rating(&self, content_rating: &impl IsA<ContentRating>) { ... } fn add_extends(&self, cpt_id: &str) { ... } fn add_icon(&self, icon: &impl IsA<Icon>) { ... } fn add_keyword(&self, keyword: &str, locale: Option<&str>) { ... } fn add_language(&self, locale: Option<&str>, percentage: i32) { ... } fn add_launchable(&self, launchable: &impl IsA<Launchable>) { ... } fn add_provided(&self, prov: &impl IsA<Provided>) { ... } fn add_provided_item(&self, kind: ProvidedKind, item: &str) { ... } fn add_relation(&self, relation: &impl IsA<Relation>) { ... } fn add_release(&self, release: &impl IsA<Release>) { ... } fn add_replaces(&self, cid: &str) { ... } fn add_review(&self, review: &impl IsA<Review>) { ... } fn add_screenshot(&self, sshot: &impl IsA<Screenshot>) { ... } fn add_suggested(&self, suggested: &impl IsA<Suggested>) { ... } fn add_tag(&self, ns: &str, tag: &str) -> bool { ... } fn add_translation(&self, tr: &impl IsA<Translation>) { ... } fn add_url(&self, url_kind: UrlKind, url: &str) { ... } fn clear_keywords(&self, locale: Option<&str>) { ... } fn clear_languages(&self) { ... } fn clear_tags(&self) { ... } fn addons(&self) -> Vec<Component> { ... } fn agreement_by_kind(&self, kind: AgreementKind) -> Option<Agreement> { ... } fn agreements(&self) -> Vec<Agreement> { ... } fn branch(&self) -> Option<GString> { ... } fn branding(&self) -> Option<Branding> { ... } fn bundle(&self, bundle_kind: BundleKind) -> Option<Bundle> { ... } fn bundles(&self) -> Vec<Bundle> { ... } fn categories(&self) -> Vec<GString> { ... } fn compulsory_for_desktops(&self) -> Vec<GString> { ... } fn content_rating(&self, kind: &str) -> Option<ContentRating> { ... } fn content_ratings(&self) -> Vec<ContentRating> { ... } fn context(&self) -> Option<Context> { ... } fn custom_value(&self, key: &str) -> Option<GString> { ... } fn data_id(&self) -> Option<GString> { ... } fn date_eol(&self) -> Option<GString> { ... } fn description(&self) -> Option<GString> { ... } fn extends(&self) -> Vec<GString> { ... } fn icon_by_size(&self, width: u32, height: u32) -> Option<Icon> { ... } fn icon_stock(&self) -> Option<Icon> { ... } fn icons(&self) -> Vec<Icon> { ... } fn id(&self) -> Option<GString> { ... } fn keywords(&self) -> Vec<GString> { ... } fn kind(&self) -> ComponentKind { ... } fn language(&self, locale: Option<&str>) -> i32 { ... } fn languages(&self) -> Vec<GString> { ... } fn launchable(&self, kind: LaunchableKind) -> Option<Launchable> { ... } fn launchables(&self) -> Vec<Launchable> { ... } fn merge_kind(&self) -> MergeKind { ... } fn metadata_license(&self) -> Option<GString> { ... } fn name(&self) -> Option<GString> { ... } fn name_variant_suffix(&self) -> Option<GString> { ... } fn origin(&self) -> Option<GString> { ... } fn pkgname(&self) -> Option<GString> { ... } fn pkgnames(&self) -> Vec<GString> { ... } fn priority(&self) -> i32 { ... } fn project_group(&self) -> Option<GString> { ... } fn project_license(&self) -> Option<GString> { ... } fn provided(&self) -> Vec<Provided> { ... } fn provided_for_kind(&self, kind: ProvidedKind) -> Option<Provided> { ... } fn recommends(&self) -> Vec<Relation> { ... } fn releases_plain(&self) -> Option<ReleaseList> { ... } fn replaces(&self) -> Vec<GString> { ... } fn requires(&self) -> Vec<Relation> { ... } fn reviews(&self) -> Vec<Review> { ... } fn scope(&self) -> ComponentScope { ... } fn screenshots_all(&self) -> Vec<Screenshot> { ... } fn search_tokens(&self) -> Vec<GString> { ... } fn sort_score(&self) -> u32 { ... } fn source_pkgname(&self) -> Option<GString> { ... } fn suggested(&self) -> Vec<Suggested> { ... } fn summary(&self) -> Option<GString> { ... } fn supports(&self) -> Vec<Relation> { ... } fn timestamp_eol(&self) -> u64 { ... } fn translations(&self) -> Vec<Translation> { ... } fn url(&self, url_kind: UrlKind) -> Option<GString> { ... } fn has_bundle(&self) -> bool { ... } fn has_category(&self, category: &str) -> bool { ... } fn has_tag(&self, ns: &str, tag: &str) -> bool { ... } fn insert_custom_value(&self, key: &str, value: &str) -> bool { ... } fn is_compulsory_for_desktop(&self, desktop: &str) -> bool { ... } fn is_floss(&self) -> bool { ... } fn is_ignored(&self) -> bool { ... } fn is_member_of_category(&self, category: &impl IsA<Category>) -> bool { ... } fn is_valid(&self) -> bool { ... } fn load_from_bytes( &self, context: &impl IsA<Context>, format: FormatKind, bytes: &Bytes, ) -> Result<(), Error> { ... } fn load_releases( &self, allow_net: bool, ) -> Result<Option<ReleaseList>, Error> { ... } fn remove_tag(&self, ns: &str, tag: &str) -> bool { ... } fn search_matches(&self, term: &str) -> u32 { ... } fn set_branch(&self, branch: &str) { ... } fn set_branding(&self, branding: &impl IsA<Branding>) { ... } fn set_compulsory_for_desktop(&self, desktop: &str) { ... } fn set_context(&self, context: &impl IsA<Context>) { ... } fn set_context_locale(&self, locale: &str) { ... } fn set_data_id(&self, value: &str) { ... } fn set_date_eol(&self, date: &str) { ... } fn set_description(&self, value: &str, locale: Option<&str>) { ... } fn set_id(&self, value: &str) { ... } fn set_keywords( &self, new_keywords: &[&str], locale: Option<&str>, deep_copy: bool, ) { ... } fn set_kind(&self, value: ComponentKind) { ... } fn set_merge_kind(&self, kind: MergeKind) { ... } fn set_metadata_license(&self, value: &str) { ... } fn set_name(&self, value: &str, locale: Option<&str>) { ... } fn set_name_variant_suffix(&self, value: &str, locale: Option<&str>) { ... } fn set_origin(&self, origin: &str) { ... } fn set_pkgname(&self, pkgname: &str) { ... } fn set_pkgnames(&self, packages: &[&str]) { ... } fn set_priority(&self, priority: i32) { ... } fn set_project_group(&self, value: &str) { ... } fn set_project_license(&self, value: &str) { ... } fn set_releases(&self, releases: &impl IsA<ReleaseList>) { ... } fn set_scope(&self, scope: ComponentScope) { ... } fn set_sort_score(&self, score: u32) { ... } fn set_source_pkgname(&self, spkgname: &str) { ... } fn set_summary(&self, value: &str, locale: Option<&str>) { ... } fn sort_screenshots( &self, environment: Option<&str>, style: Option<&str>, prioritize_style: bool, ) { ... } fn to_str(&self) -> GString { ... } fn to_xml_data(&self, context: &impl IsA<Context>) -> Result<GString, Error> { ... } fn connect_categories_notify<F: Fn(&Self) + 'static>( &self, f: F, ) -> SignalHandlerId { ... } fn connect_description_notify<F: Fn(&Self) + 'static>( &self, f: F, ) -> SignalHandlerId { ... } fn connect_icons_notify<F: Fn(&Self) + 'static>( &self, f: F, ) -> SignalHandlerId { ... } fn connect_id_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId { ... } fn connect_keywords_notify<F: Fn(&Self) + 'static>( &self, f: F, ) -> SignalHandlerId { ... } fn connect_kind_notify<F: Fn(&Self) + 'static>( &self, f: F, ) -> SignalHandlerId { ... } fn connect_name_notify<F: Fn(&Self) + 'static>( &self, f: F, ) -> SignalHandlerId { ... } fn connect_pkgnames_notify<F: Fn(&Self) + 'static>( &self, f: F, ) -> SignalHandlerId { ... } fn connect_project_group_notify<F: Fn(&Self) + 'static>( &self, f: F, ) -> SignalHandlerId { ... } fn connect_project_license_notify<F: Fn(&Self) + 'static>( &self, f: F, ) -> SignalHandlerId { ... } fn connect_screenshots_notify<F: Fn(&Self) + 'static>( &self, f: F, ) -> SignalHandlerId { ... } fn connect_summary_notify<F: Fn(&Self) + 'static>( &self, f: F, ) -> SignalHandlerId { ... } fn connect_urls_notify<F: Fn(&Self) + 'static>( &self, f: F, ) -> SignalHandlerId { ... }
}
Expand description

Trait containing all Component methods.

§Implementors

Component

Provided Methods§

source

fn add_addon(&self, addon: &impl IsA<Component>)

Add a reference to the addon that is enhancing this component.

§addon

The Component that extends self

source

fn add_agreement(&self, agreement: &impl IsA<Agreement>)

Adds an agreement to the software component.

§agreement

an Agreement instance.

source

fn add_bundle(&self, bundle: &impl IsA<Bundle>)

Adds a bundle to the component.

§bundle

The Bundle to add.

source

fn add_category(&self, category: &str)

Add a category.

§category

the categories name to add.

source

fn add_content_rating(&self, content_rating: &impl IsA<ContentRating>)

Adds a content rating to this component.

§content_rating

a ContentRating instance.

source

fn add_extends(&self, cpt_id: &str)

Add a reference to the extended component

§cpt_id

The id of a component which is extended by this component

source

fn add_icon(&self, icon: &impl IsA<Icon>)

Add an icon to this component.

§icon

the valid Icon instance to add.

source

fn add_keyword(&self, keyword: &str, locale: Option<&str>)

Add a new keyword to the keywords list for the given locale. This function does not check for duplicate keywords.

§keyword

The new keyword to add.

§locale

BCP47 locale of the values, or None to use current locale.

source

fn add_language(&self, locale: Option<&str>, percentage: i32)

Adds a language to the component.

§locale

the BCP47 locale, or None. e.g. “en-GB”

§percentage

the percentage completion of the translation, 0 for locales with unknown amount of translation

source

fn add_launchable(&self, launchable: &impl IsA<Launchable>)

Adds a Launchable containing launchables entries for this component.

§launchable

a Launchable instance.

source

fn add_provided(&self, prov: &impl IsA<Provided>)

Add a set of provided items to this component.

§prov

a Provided instance.

source

fn add_provided_item(&self, kind: ProvidedKind, item: &str)

Adds a provided item to the component with the given kind, creating a new Provided for this kind internally if necessary.

§kind

the kind of the provided item (e.g. ProvidedKind::Mediatype)

§item

the item to add.

source

fn add_relation(&self, relation: &impl IsA<Relation>)

Adds a Relation to set a recommends or requires relation of component self on the item mentioned in the Relation.

§relation

a Relation instance.

source

fn add_release(&self, release: &impl IsA<Release>)

Add an Release to this component.

§release

The Release to add

source

fn add_replaces(&self, cid: &str)

Add the component ID of a component that gets replaced by the current component.

§cid

an AppStream component ID

source

fn add_review(&self, review: &impl IsA<Review>)

Adds a user review to a software component.

§review

a Review instance.

source

fn add_screenshot(&self, sshot: &impl IsA<Screenshot>)

Add an Screenshot to this component.

§sshot

The Screenshot to add

source

fn add_suggested(&self, suggested: &impl IsA<Suggested>)

Add an Suggested to this component.

§suggested

The Suggested

source

fn add_tag(&self, ns: &str, tag: &str) -> bool

Add a tag to this component.

§ns

The namespace the tag belongs to

§tag

The tag name

§Returns

true if the tag was added.

source

fn add_translation(&self, tr: &impl IsA<Translation>)

Assign an Translation object describing the translation system used by this component.

§tr

an Translation instance.

source

fn add_url(&self, url_kind: UrlKind, url: &str)

Adds some URL data to the component.

§url_kind

the URL kind, e.g. UrlKind::Homepage

§url

the full URL.

source

fn clear_keywords(&self, locale: Option<&str>)

Remove all keywords for the given locale.

§locale

BCP47 locale of the values, or None to use current locale.

source

fn clear_languages(&self)

Remove all registered language translation information.

source

fn clear_tags(&self)

Remove all tags associated with this component.

source

fn addons(&self) -> Vec<Component>

Returns a list of Component objects which are addons extending this component in functionality.

This is the reverse of extends()

§Returns

An array of Component.

source

fn agreement_by_kind(&self, kind: AgreementKind) -> Option<Agreement>

Gets an agreement the component has specified for the particular kind.

§kind

an agreement kind, e.g. AgreementKind::Eula

§Returns

a Agreement or None for not found

source

fn agreements(&self) -> Vec<Agreement>

Get a list of all agreements registered with this software component.

§Returns

An array of Agreement.

source

fn branch(&self) -> Option<GString>

Gets the branch for the application.

§Returns

string, or None if unset

source

fn branding(&self) -> Option<Branding>

Get the branding associated with this component, or None in case this component has no special branding.

§Returns

An Branding.

source

fn bundle(&self, bundle_kind: BundleKind) -> Option<Bundle>

Gets a bundle identifier string.

§bundle_kind

the bundle kind, e.g. BundleKind::Limba.

§Returns

An Bundle, or None if not set.

source

fn bundles(&self) -> Vec<Bundle>

Get a list of all software bundles associated with this component.

§Returns

A list of Bundle.

source

fn categories(&self) -> Vec<GString>

§Returns

String array of categories

source

fn compulsory_for_desktops(&self) -> Vec<GString>

§Returns

A list of desktops where this component is compulsory

source

fn content_rating(&self, kind: &str) -> Option<ContentRating>

Gets a content ratings of a specific type that are defined for this component.

§kind

a ratings kind, e.g. “oars-1.0”

§Returns

a ContentRating or None if not found

source

fn content_ratings(&self) -> Vec<ContentRating>

Gets all content ratings defined for this software.

§Returns

an array

source

fn context(&self) -> Option<Context>

Get the Context associated with this component. This function may return None if no context is set (which will be the case if the component was not loaded from a file or cache but constructed in memory).

§Returns

the associated Context or None

source

fn custom_value(&self, key: &str) -> Option<GString>

Retrieve value for a custom data entry with the given key.

§key

Field name.

source

fn data_id(&self) -> Option<GString>

Get a unique identifier for this metadata set. This unique ID is only valid for the current session, as opposed to the AppStream ID which uniquely identifies a software component.

The format of the unique id usually is: %{scope}/%{origin}/%{distribution_system}/%{appstream_id}

For example: system/os/package/org.example.FooBar

§Returns

the unique session-specific identifier.

source

fn date_eol(&self) -> Option<GString>

Gets the end-of-life date for the entire component.

§Returns

The EOL date as string in ISO8601 format.

source

fn description(&self) -> Option<GString>

Get the localized long description of this component.

§Returns

the description.

source

fn extends(&self) -> Vec<GString>

Returns a string list of IDs of components which are extended by this addon.

See extends() for the reverse.

§Returns

A GPtrArray or None if not set.

source

fn icon_by_size(&self, width: u32, height: u32) -> Option<Icon>

Gets an icon matching the size constraints. The icons are not filtered by type, and the first icon which matches the size is returned. If you want more control over which icons you use for displaying, use the icons() function to get a list of all icons.

Note that this function is not HiDPI aware! It will never return an icon with a scaling factor > 1.

§width

The icon width in pixels.

§height

the icon height in pixels.

§Returns

An icon matching the given width/height, or None if not found.

source

fn icon_stock(&self) -> Option<Icon>

Gets a stock icon for this component if one is associated with it. Will return None otherwise.

§Returns

An stock icon, or None if none found.

source

fn icons(&self) -> Vec<Icon>

§Returns

A GPtrArray of all icons for this component.

source

fn id(&self) -> Option<GString>

Get the unique AppStream identifier for this component. This ID is unique for the described component, but does not uniquely identify the metadata set.

For a unique ID for this metadata set in the current session, use data_id()

§Returns

the unique AppStream identifier.

source

fn keywords(&self) -> Vec<GString>

§Returns

String array of keywords

source

fn kind(&self) -> ComponentKind

Returns the ComponentKind of this component.

§Returns

the kind of this.

source

fn language(&self, locale: Option<&str>) -> i32

Gets the translation coverage in percent for a specific locale

§locale

the BCP47 locale, or None. e.g. “en-GB”

§Returns

a percentage value, -1 if locale was not found

source

fn languages(&self) -> Vec<GString>

Get a list of all languages.

§Returns

list of locales

source

fn launchable(&self, kind: LaunchableKind) -> Option<Launchable>

Gets a Launchable of a specific type that contains launchable entries for this component.

§kind

a launch kind, e.g. LaunchableKind::DesktopId

§Returns

a Launchable or None if not found

source

fn launchables(&self) -> Vec<Launchable>

§Returns

an array

source

fn merge_kind(&self) -> MergeKind

Get the merge method which should apply to duplicate components with this ID.

§Returns

the MergeKind of this component.

source

fn metadata_license(&self) -> Option<GString>

The license the metadata iself is subjected to.

§Returns

the license.

source

fn name(&self) -> Option<GString>

A human-readable name for this component.

§Returns

the name.

source

fn name_variant_suffix(&self) -> Option<GString>

Get variant suffix for the component name (only to be displayed if two components have the same name).

§Returns

the variant suffix

source

fn origin(&self) -> Option<GString>

source

fn pkgname(&self) -> Option<GString>

Get the first package name of the list of packages that need to be installed for this component to be present on the system. Since most components consist of only one package, this is safe to use for about 90% of all cases.

However, to support a component fully, please use pkgnames() for getting all packages that need to be installed, and use this method only to e.g. get the main package to perform a quick “is it installed?” check.

§Returns

String array of package names

source

fn pkgnames(&self) -> Vec<GString>

Get a list of package names which this component consists of. This usually is just one package name.

§Returns

String array of package names

source

fn priority(&self) -> i32

Returns the priority of this component. This method is used internally.

source

fn project_group(&self) -> Option<GString>

Get the component’s project group.

§Returns

the project group.

source

fn project_license(&self) -> Option<GString>

Get the license of the project this component belongs to.

§Returns

the license.

source

fn provided(&self) -> Vec<Provided>

Get a list of Provided objects associated with this component.

§Returns

A list of Provided objects.

source

fn provided_for_kind(&self, kind: ProvidedKind) -> Option<Provided>

Get an Provided object for the given interface type, containing information about the public interfaces (mimetypes, firmware, DBus services, …) this component provides.

§kind

kind of the provided item, e.g. ProvidedKind::Mediatype

§Returns

Provided containing the items this component provides, or None.

source

fn recommends(&self) -> Vec<Relation>

Get an array of items that are recommended by this component.

§Returns

an array

source

fn releases_plain(&self) -> Option<ReleaseList>

Get release information for this component, without downloading or loading any data from external sources.

§Returns

Release information as ReleaseList

source

fn replaces(&self) -> Vec<GString>

Get a list of component IDs of components that this software replaces entirely.

§Returns

an array of component-IDs

source

fn requires(&self) -> Vec<Relation>

Get an array of items that are required by this component.

§Returns

an array

source

fn reviews(&self) -> Vec<Review>

Gets any reviews associated with the component.

§Returns

an array

source

fn scope(&self) -> ComponentScope

§Returns

the ComponentScope of this component.

source

fn screenshots_all(&self) -> Vec<Screenshot>

Get a list of all associated screenshots, for all environments.

§Returns

an array of Screenshot instances

source

fn search_tokens(&self) -> Vec<GString>

Returns all search tokens for this component.

§Returns

The string search tokens

source

fn sort_score(&self) -> u32

Returns the sorting priority of this component.

This will only return a valid value if this component was the result of or involved in a search operation which returned sorted results. In most cases you will not need to access this value explicitly, as all results of search operations in AppStream are already sorted from best match to worst.

The returned value is an arbitrary integer value, valid only for the search terms involved in the search operation that yielded this component as a result.

source

fn source_pkgname(&self) -> Option<GString>

§Returns

the source package name.

source

fn suggested(&self) -> Vec<Suggested>

Get a list of associated suggestions.

§Returns

an array of Suggested instances

source

fn summary(&self) -> Option<GString>

Get a short description of this component.

§Returns

the summary.

source

fn supports(&self) -> Vec<Relation>

Get an array of items that are supported by this component, e.g. to indicate support for a specific piece of hardware.

§Returns

an array

source

fn timestamp_eol(&self) -> u64

Gets the UNIX timestamp for the date when this component is out of support (end-of-life) and will receive no more updates, not even security fixes.

§Returns

UNIX timestamp, or 0 for unset or invalid.

source

fn translations(&self) -> Vec<Translation>

Get a GPtrArray of Translation objects describing the translation systems and translation-ids (e.g. Gettext domains) used by this software component.

Only set for metainfo files.

§Returns

An array of Translation objects.

source

fn url(&self, url_kind: UrlKind) -> Option<GString>

Gets a URL.

§url_kind

the URL kind, e.g. UrlKind::Homepage.

§Returns

string, or None if unset

source

fn has_bundle(&self) -> bool

§Returns

true if this component has a bundle associated.

source

fn has_category(&self, category: &str) -> bool

Check if component is in the specified category.

§category

the specified category to check

§Returns

true if the component is in the specified category.

source

fn has_tag(&self, ns: &str, tag: &str) -> bool

Test if the component is tagged with the selected tag.

§ns

The namespace the tag belongs to

§tag

The tag name

§Returns

true if tag exists.

source

fn insert_custom_value(&self, key: &str, value: &str) -> bool

Add a key and value pair to the custom data table.

§key

Key name.

§value

A string value.

§Returns

true if the key did not exist yet.

source

fn is_compulsory_for_desktop(&self, desktop: &str) -> bool

Check if this component is compulsory for the given desktop.

§desktop

the desktop-id to test for

§Returns

true if compulsory, false otherwise.

source

fn is_floss(&self) -> bool

Returns true if this component is free and open source software. To determine this status, this function will check if it comes from a vetted free-software-only source or whether its licenses are only free software licenses.

§Returns

true if this component is free software.

source

fn is_ignored(&self) -> bool

§Returns

Whether this component’s metadata should be ignored.

source

fn is_member_of_category(&self, category: &impl IsA<Category>) -> bool

Test if the component self is a member of category category.

§category

The category to test.

source

fn is_valid(&self) -> bool

Check if the essential properties of this Component are populated with useful data.

§Returns

TRUE if the component data was validated successfully.

source

fn load_from_bytes( &self, context: &impl IsA<Context>, format: FormatKind, bytes: &Bytes, ) -> Result<(), Error>

Load metadata for this component from an XML string. You normally do not want to use this method directly and instead use the more convenient API of Metadata to create and update components.

If this function returns true, a valid component is returned unless the selected format was FormatKind::DesktopEntry, in which case a component ID will have to be set explicitly by the caller in order to make the component valid.

§context

an Context instance.

§format

the format of the data to load, e.g. FormatKind::Xml

§bytes

the data to load.

§Returns

true on success.

source

fn load_releases(&self, allow_net: bool) -> Result<Option<ReleaseList>, Error>

Get release information for this component, download it if necessary.

§Returns

Release information as ReleaseList, or None if loading failed.

source

fn remove_tag(&self, ns: &str, tag: &str) -> bool

Remove a tag from this component

§ns

The namespace the tag belongs to

§tag

The tag name

§Returns

true if the tag was removed.

source

fn search_matches(&self, term: &str) -> u32

Searches component data for a specific keyword.

§term

the search term.

§Returns

a match scrore, where 0 is no match and 100 is the best match.

source

fn set_branch(&self, branch: &str)

Set the branch that the component instance was sourced from.

§branch

the branch, e.g. “master” or “3-16”.

source

fn set_branding(&self, branding: &impl IsA<Branding>)

Set branding for this component.

§branding

an Branding instance.

source

fn set_compulsory_for_desktop(&self, desktop: &str)

Mark this component to be compulsory for the specified desktop environment.

§desktop

The name of the desktop.

source

fn set_context(&self, context: &impl IsA<Context>)

Sets the document context this component is associated with.

§context

the Context.

source

fn set_context_locale(&self, locale: &str)

Set the active locale on the context assoaiacted with this component, creating a new context for the component if none exists yet.

Please not that this will flip the locale of all other components and entities that use the same context as well! This function is just a convenience method, and does not replace proper Context management.

§locale

the new locale.

source

fn set_data_id(&self, value: &str)

Set the session-specific unique metadata identifier for this component. If two components have a different data_id but the same ID, they will be treated as independent sets of metadata describing the same component type.

§value

the unique session-specific identifier.

source

fn set_date_eol(&self, date: &str)

Sets an end-of-life date for this component.

§date

the EOL date in ISO8601 format.

source

fn set_description(&self, value: &str, locale: Option<&str>)

Set long description for this component.

§value

The long description

§locale

The BCP47 locale for this value, or None to use the current active one.

source

fn set_id(&self, value: &str)

Set the AppStream identifier for this component.

§value

the unique identifier.

source

fn set_keywords( &self, new_keywords: &[&str], locale: Option<&str>, deep_copy: bool, )

Set keywords for this component, replacing all existing ones for the selected locale.

§new_keywords

Array of keywords

§locale

BCP47 locale of the values, or None to use current locale.

§deep_copy

Set to true if the keywords array should be copied, false to set by reference.

source

fn set_kind(&self, value: ComponentKind)

Sets the ComponentKind of this component.

§value

the ComponentKind.

source

fn set_merge_kind(&self, kind: MergeKind)

Sets the MergeKind for this component.

§kind

the MergeKind.

source

fn set_metadata_license(&self, value: &str)

Set the license this metadata is licensed under.

§value

the metadata license.

source

fn set_name(&self, value: &str, locale: Option<&str>)

Set a human-readable name for this component.

§value

The name

§locale

The BCP47 locale for this value, or None to use the current active one.

source

fn set_name_variant_suffix(&self, value: &str, locale: Option<&str>)

Set a variant suffix for the component name (only to be displayed if components have the same name).

§value

the developer or developer team name

§locale

the BCP47 locale, or None. e.g. “en-GB”

source

fn set_origin(&self, origin: &str)

§origin

the origin.

source

fn set_pkgname(&self, pkgname: &str)

Set the package name that provides this component.

§pkgname

the package name

source

fn set_pkgnames(&self, packages: &[&str])

Set a list of package names this component consists of. (This should usually be just one package name)

source

fn set_priority(&self, priority: i32)

Sets the priority of this component. This method is used internally.

§priority

the given priority

source

fn set_project_group(&self, value: &str)

Set the component’s project group.

§value

the project group.

source

fn set_project_license(&self, value: &str)

Set the project license.

§value

the project license.

source

fn set_releases(&self, releases: &impl IsA<ReleaseList>)

Set a new set of releases for this component.

§releases

the ReleaseList to use.

source

fn set_scope(&self, scope: ComponentScope)

Sets the ComponentScope of this component.

§scope

the ComponentKind.

source

fn set_sort_score(&self, score: u32)

Sets the sorting score of this component.

§score

the given sorting score

source

fn set_source_pkgname(&self, spkgname: &str)

§spkgname

the source package name.

source

fn set_summary(&self, value: &str, locale: Option<&str>)

Set a short description for this component.

§value

The summary

§locale

The BCP47 locale for this value, or None to use the current active one.

source

fn sort_screenshots( &self, environment: Option<&str>, style: Option<&str>, prioritize_style: bool, )

Reorder the screenshots to prioritize a certain environment or style, instead of using the default screenshot order.

If both “environment” and “style” are None, the previous default order is restored.

§environment

a GUI environment string, e.g. “plasma” or “gnome”

§style

and environment style string, e.g. “light” or “dark”

§prioritize_style

if true, order screenshots of the given style earlier than ones of the given environment.

source

fn to_str(&self) -> GString

Returns a string identifying this component. (useful for debugging)

§Returns

A descriptive string

source

fn to_xml_data(&self, context: &impl IsA<Context>) -> Result<GString, Error>

Serialize this component into an XML string. You normally do not want to use this method directly and instead use the more convenient API of Metadata to serialize components.

§context

an Context instance.

§Returns

true on success.

source

fn connect_categories_notify<F: Fn(&Self) + 'static>( &self, f: F, ) -> SignalHandlerId

source

fn connect_description_notify<F: Fn(&Self) + 'static>( &self, f: F, ) -> SignalHandlerId

source

fn connect_icons_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId

source

fn connect_id_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId

source

fn connect_keywords_notify<F: Fn(&Self) + 'static>( &self, f: F, ) -> SignalHandlerId

source

fn connect_kind_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId

source

fn connect_name_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId

source

fn connect_pkgnames_notify<F: Fn(&Self) + 'static>( &self, f: F, ) -> SignalHandlerId

source

fn connect_project_group_notify<F: Fn(&Self) + 'static>( &self, f: F, ) -> SignalHandlerId

source

fn connect_project_license_notify<F: Fn(&Self) + 'static>( &self, f: F, ) -> SignalHandlerId

source

fn connect_screenshots_notify<F: Fn(&Self) + 'static>( &self, f: F, ) -> SignalHandlerId

source

fn connect_summary_notify<F: Fn(&Self) + 'static>( &self, f: F, ) -> SignalHandlerId

source

fn connect_urls_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId

Object Safety§

This trait is not object safe.

Implementors§