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§
source§impl Clone for WallpaperExtension
impl Clone for WallpaperExtension
source§fn clone(&self) -> WallpaperExtension
fn clone(&self) -> WallpaperExtension
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresource§impl Debug for WallpaperExtension
impl Debug for WallpaperExtension
source§impl PartialEq<WallpaperExtension> for WallpaperExtension
impl PartialEq<WallpaperExtension> for WallpaperExtension
source§fn eq(&self, other: &WallpaperExtension) -> bool
fn eq(&self, other: &WallpaperExtension) -> bool
source§impl ToString for WallpaperExtension
impl ToString for WallpaperExtension
source§fn to_string(&self) -> String
fn to_string(&self) -> String
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();