Enum tdesktop_theme::WallpaperExtension[][src]

pub enum WallpaperExtension {
    Png,
    Jpg,
}

Represents possible wallpaper extensions. It is taken from the wallpaper's name.

Notes

This crate does not check the real type of the wallpaper, it is simply taken from the theme's wallpaper filename. If you want to be sure that the wallpaper is either a .jpg or a .png file, do it yourself.

Variants

If the wallpaper's extension is .png, this variant is chosen.

If the wallpaper's extension is .jpg, this variant is chosen.

Trait Implementations

impl Debug for WallpaperExtension
[src]

Formats the value using the given formatter. Read more

impl PartialEq for WallpaperExtension
[src]

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

impl Clone for WallpaperExtension
[src]

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

impl Copy for WallpaperExtension
[src]

impl ToString for WallpaperExtension
[src]

Returns a string corresponding to WallpaperExtension's value.

Possible return values

Enum variant String value
Png "png"
Jpg "jpg"

Examples

use tdesktop_theme::*;

let wallpaper = Wallpaper {
  wallpaper_type: WallpaperType::Tiled,
  extension: WallpaperExtension::Jpg,
  bytes: b"Pretend it's a wallpaper".to_vec(),
};

let name = format!(
  "examples/trash/wallpaper.{}",
  wallpaper.extension.to_string(),
);

// std::fs::write(name, wallpaper.bytes).unwrap();

Auto Trait Implementations