pub enum WallpaperExtension {
    Png,
    Jpg,
}
Expand description

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§

Returns a copy of the value. Read more
Performs copy-assignment from source. Read more
Formats the value using the given formatter. Read more
This method tests for self and other values to be equal, and is used by ==. Read more
This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason. Read more

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§

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The resulting type after obtaining ownership.
Creates owned data from borrowed data, usually by cloning. Read more
Uses borrowed data to replace owned data, usually by cloning. Read more
The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.