libappstream::prelude

Trait ReviewExt

source
pub trait ReviewExt:
    IsA<Review>
    + Sealed
    + 'static {
Show 37 methods // Provided methods fn add_flags(&self, flags: ReviewFlags) { ... } fn add_metadata(&self, key: &str, value: &str) { ... } fn equal(&self, review2: &impl IsA<Review>) -> bool { ... } fn date(&self) -> Option<DateTime> { ... } fn description(&self) -> Option<GString> { ... } fn flags(&self) -> ReviewFlags { ... } fn id(&self) -> Option<GString> { ... } fn locale(&self) -> Option<GString> { ... } fn metadata_item(&self, key: &str) -> Option<GString> { ... } fn priority(&self) -> i32 { ... } fn rating(&self) -> i32 { ... } fn reviewer_id(&self) -> Option<GString> { ... } fn reviewer_name(&self) -> Option<GString> { ... } fn summary(&self) -> Option<GString> { ... } fn version(&self) -> Option<GString> { ... } fn set_date(&self, date: &DateTime) { ... } fn set_description(&self, description: &str) { ... } fn set_flags(&self, flags: ReviewFlags) { ... } fn set_id(&self, id: &str) { ... } fn set_locale(&self, locale: &str) { ... } fn set_priority(&self, priority: i32) { ... } fn set_rating(&self, rating: i32) { ... } fn set_reviewer_id(&self, reviewer_id: &str) { ... } fn set_reviewer_name(&self, reviewer_name: &str) { ... } fn set_summary(&self, summary: &str) { ... } fn set_version(&self, version: &str) { ... } fn connect_date_notify<F: Fn(&Self) + 'static>( &self, f: F, ) -> SignalHandlerId { ... } fn connect_description_notify<F: Fn(&Self) + 'static>( &self, f: F, ) -> SignalHandlerId { ... } fn connect_flags_notify<F: Fn(&Self) + 'static>( &self, f: F, ) -> SignalHandlerId { ... } fn connect_id_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId { ... } fn connect_locale_notify<F: Fn(&Self) + 'static>( &self, f: F, ) -> SignalHandlerId { ... } fn connect_priority_notify<F: Fn(&Self) + 'static>( &self, f: F, ) -> SignalHandlerId { ... } fn connect_rating_notify<F: Fn(&Self) + 'static>( &self, f: F, ) -> SignalHandlerId { ... } fn connect_reviewer_id_notify<F: Fn(&Self) + 'static>( &self, f: F, ) -> SignalHandlerId { ... } fn connect_reviewer_name_notify<F: Fn(&Self) + 'static>( &self, f: F, ) -> SignalHandlerId { ... } fn connect_summary_notify<F: Fn(&Self) + 'static>( &self, f: F, ) -> SignalHandlerId { ... } fn connect_version_notify<F: Fn(&Self) + 'static>( &self, f: F, ) -> SignalHandlerId { ... }
}
Expand description

Trait containing all Review methods.

§Implementors

Review

Provided Methods§

source

fn add_flags(&self, flags: ReviewFlags)

Adds flags to an existing review without replacing the other flags.

§flags

a ReviewFlags, e.g. ReviewFlags::SELF

source

fn add_metadata(&self, key: &str, value: &str)

Adds metadata to the review object. It is left for the the plugin to use this method as required, but a typical use would be to store some secure authentication token.

§key

a string

§value

a string

source

fn equal(&self, review2: &impl IsA<Review>) -> bool

source

fn date(&self) -> Option<DateTime>

Gets the date the review was originally submitted.

§Returns

the glib::DateTime, or None for unset

source

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

Gets the multi-line review text that forms the body of the review.

§Returns

the string, or None

source

fn flags(&self) -> ReviewFlags

Gets any flags set on the review, for example if the user has already voted on the review or if the user wrote the review themselves.

§Returns

a ReviewFlags, e.g. ReviewFlags::SELF

source

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

Gets the review id.

§Returns

the review identifier, e.g. “deadbeef”

source

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

Gets the locale for the review.

§Returns

the string, or None

source

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

Gets some metadata from a review object. It is left for the the plugin to use this method as required, but a typical use would be to retrieve some secure authentication token.

§key

a string

§Returns

A string value, or None for not found

source

fn priority(&self) -> i32

This allows the UI to sort reviews into the correct order. Higher numbers indicate a more important or relevant review.

§Returns

the review priority, or 0 for unset.

source

fn rating(&self) -> i32

Gets the star rating of the review, where 100 is 5 stars.

§Returns

integer as a percentage, or 0 for unset

source

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

Gets the name of the reviewer.

§Returns

the reviewer ID, e.g. “deadbeef”, or None

source

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

Gets the name of the reviewer.

§Returns

the reviewer name, e.g. “David Smith”, or None

source

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

Gets the review summary.

§Returns

the one-line summary, e.g. “Awesome application”

source

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

Gets the version string for the application being reviewed..

§Returns

the version string, e.g. “0.1.2”, or None for unset

source

fn set_date(&self, date: &DateTime)

Sets the date the review was originally submitted.

§date

a glib::DateTime, or None

source

fn set_description(&self, description: &str)

Sets the multi-line review text that forms the body of the review.

§description

multi-line description

source

fn set_flags(&self, flags: ReviewFlags)

Gets any flags set on the review, for example if the user has already voted on the review or if the user wrote the review themselves.

§flags

a ReviewFlags, e.g. ReviewFlags::SELF

source

fn set_id(&self, id: &str)

Sets the review identifier that is unique to each review.

§id

review identifier, e.g. “deadbeef”

source

fn set_locale(&self, locale: &str)

Sets the locale for the review.

§locale

a BCP47 locale, e.g. “en-GB”

source

fn set_priority(&self, priority: i32)

Sets the priority for the review, where positive numbers indicate a better review for the specific user.

§priority

a priority value

source

fn set_rating(&self, rating: i32)

Sets the star rating of the review, where 100 is 5 stars..

§rating

a integer as a percentage, or 0 for unset

source

fn set_reviewer_id(&self, reviewer_id: &str)

Sets the name of the reviewer, which can be left unset.

§reviewer_id

the reviewer ID, e.g. “deadbeef”

source

fn set_reviewer_name(&self, reviewer_name: &str)

Sets the name of the reviewer, which can be left unset.

§reviewer_name

the reviewer name, e.g. “David Smith”

source

fn set_summary(&self, summary: &str)

Sets the one-line summary that may be displayed in bold.

§summary

a one-line summary, e.g. “Awesome application”

source

fn set_version(&self, version: &str)

Sets the version string for the application being reviewed.

§version

a version string, e.g. “0.1.2”

source

fn connect_date_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_flags_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_locale_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId

source

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

source

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

source

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

source

fn connect_reviewer_name_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_version_notify<F: Fn(&Self) + 'static>( &self, f: F, ) -> SignalHandlerId

Object Safety§

This trait is not object safe.

Implementors§

source§

impl<O: IsA<Review>> ReviewExt for O