[][src]Enum tdesktop_theme::WallpaperExtension

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

Png

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

Jpg

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

Trait Implementations

impl Clone for WallpaperExtension[src]

impl Copy for WallpaperExtension[src]

impl Debug for WallpaperExtension[src]

impl PartialEq<WallpaperExtension> for WallpaperExtension[src]

impl StructuralPartialEq for WallpaperExtension[src]

impl ToString for WallpaperExtension[src]

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

Returns a string corresponding to WallpaperExtension's value.

Possible return values

Enum variantString 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

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.