mirror of
https://gitlab.com/asus-linux/asusctl.git
synced 2026-02-06 00:15:04 +01:00
Animatrix: simulators, add features
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
use std::convert::TryFrom;
|
||||
use std::str::FromStr;
|
||||
use std::thread::sleep;
|
||||
use std::time::{Duration, Instant};
|
||||
|
||||
@@ -53,6 +54,19 @@ pub enum AnimeType {
|
||||
Unknown,
|
||||
}
|
||||
|
||||
impl FromStr for AnimeType {
|
||||
type Err = AnimeError;
|
||||
|
||||
fn from_str(s: &str) -> std::result::Result<Self, Self::Err> {
|
||||
Ok(match s {
|
||||
"ga401" | "GA401" => Self::GA401,
|
||||
"ga402" | "GA402" => Self::GA402,
|
||||
"gu604" | "GU604" => Self::GU604,
|
||||
_ => Self::Unknown,
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
impl AnimeType {
|
||||
/// The width of diagonal images
|
||||
pub fn width(&self) -> usize {
|
||||
|
||||
Reference in New Issue
Block a user