[][src]Struct tdesktop_theme::Wallpaper

pub struct Wallpaper {
    pub wallpaper_type: WallpaperType,
    pub extension: WallpaperExtension,
    pub bytes: Vec<u8>,
}

Represents a theme's wallpaper.

Fields

wallpaper_type: WallpaperType

Represents the type of the wallpaper, e.g. background.* or tiled.*.

extension: WallpaperExtension

Represents the extension of the wallpaper, e.g. *.png or *.jpg.

bytes: Vec<u8>

Holds the wallpaper's original bytes.

Implementations

impl Wallpaper[src]

pub fn get_filename(&self) -> String[src]

Generates the name of the wallpaper when the theme is zipped.

Possible return values

wallpaper.wallpaper_typewallpaper.extensionReturn value
TiledPng"tiled.png"
TiledJpg"tiled.jpg"
BackgroundPng"background.png"
BackgroundJpg"background.jpg"

Examples

use tdesktop_theme::*;

let wallpaper = Wallpaper {
  wallpaper_type: WallpaperType::Background,
  extension: WallpaperExtension::Jpg,
  bytes: Vec::new(),
};

assert_eq!(wallpaper.get_filename(), "background.jpg");

Trait Implementations

impl Clone for Wallpaper[src]

impl Debug for Wallpaper[src]

impl PartialEq<Wallpaper> for Wallpaper[src]

impl StructuralPartialEq for Wallpaper[src]

Auto Trait Implementations

Blanket Implementations

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

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

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

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.