libappstream::prelude

Trait ImageExt

source
pub trait ImageExt:
    IsA<Image>
    + Sealed
    + 'static {
    // Provided methods
    fn height(&self) -> u32 { ... }
    fn kind(&self) -> ImageKind { ... }
    fn locale(&self) -> Option<GString> { ... }
    fn scale(&self) -> u32 { ... }
    fn url(&self) -> Option<GString> { ... }
    fn width(&self) -> u32 { ... }
    fn set_height(&self, height: u32) { ... }
    fn set_kind(&self, kind: ImageKind) { ... }
    fn set_locale(&self, locale: &str) { ... }
    fn set_scale(&self, scale: u32) { ... }
    fn set_url(&self, url: &str) { ... }
    fn set_width(&self, width: u32) { ... }
}
Expand description

Trait containing all Image methods.

§Implementors

Image

Provided Methods§

source

fn height(&self) -> u32

Gets the image height.

§Returns

height in pixels

source

fn kind(&self) -> ImageKind

Gets the image kind.

§Returns

the ImageKind

source

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

Get locale for this image.

§Returns

Locale string

source

fn scale(&self) -> u32

Gets the image integer scale factor.

§Returns

the scale factor.

source

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

Gets the full qualified URL for the image, usually pointing at some mirror.

§Returns

URL

source

fn width(&self) -> u32

Gets the image width.

§Returns

width in pixels

source

fn set_height(&self, height: u32)

Sets the image height.

§height

the height in pixels.

source

fn set_kind(&self, kind: ImageKind)

Sets the image kind.

§kind

the ImageKind, e.g. ImageKind::Thumbnail.

source

fn set_locale(&self, locale: &str)

Sets the locale for this image.

§locale

the BCP47 locale string.

source

fn set_scale(&self, scale: u32)

Sets the image scale factor.

§scale

the integer scale factor, e.g. 2

source

fn set_url(&self, url: &str)

Sets the fully-qualified mirror URL to use for the image.

§url

the URL.

source

fn set_width(&self, width: u32)

Sets the image width.

§width

the width in pixels.

Object Safety§

This trait is not object safe.

Implementors§

source§

impl<O: IsA<Image>> ImageExt for O