-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add get_image function to IconState (#20)
- Loading branch information
Showing
4 changed files
with
120 additions
and
56 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,26 +1,28 @@ | ||
use std::io; | ||
use thiserror::Error; | ||
|
||
#[derive(Error, Debug)] | ||
pub enum DmiError { | ||
#[error("IO error")] | ||
Io(#[from] io::Error), | ||
#[error("Image-processing error")] | ||
Image(#[from] image::error::ImageError), | ||
#[error("FromUtf8 error")] | ||
FromUtf8(#[from] std::string::FromUtf8Error), | ||
#[error("ParseInt error")] | ||
ParseInt(#[from] std::num::ParseIntError), | ||
#[error("ParseFloat error")] | ||
ParseFloat(#[from] std::num::ParseFloatError), | ||
#[error("Invalid chunk type (byte outside the range `A-Za-z`): {chunk_type:?}")] | ||
InvalidChunkType { chunk_type: [u8; 4] }, | ||
#[error("CRC mismatch (stated {stated:?}, calculated {calculated:?})")] | ||
CrcMismatch { stated: u32, calculated: u32 }, | ||
#[error("Dmi error: {0}")] | ||
Generic(String), | ||
#[error("Encoding error: {0}")] | ||
Encoding(String), | ||
#[error("Conversion error: {0}")] | ||
Conversion(String), | ||
} | ||
use std::io; | ||
use thiserror::Error; | ||
|
||
#[derive(Error, Debug)] | ||
pub enum DmiError { | ||
#[error("IO error")] | ||
Io(#[from] io::Error), | ||
#[error("Image-processing error")] | ||
Image(#[from] image::error::ImageError), | ||
#[error("FromUtf8 error")] | ||
FromUtf8(#[from] std::string::FromUtf8Error), | ||
#[error("ParseInt error")] | ||
ParseInt(#[from] std::num::ParseIntError), | ||
#[error("ParseFloat error")] | ||
ParseFloat(#[from] std::num::ParseFloatError), | ||
#[error("Invalid chunk type (byte outside the range `A-Za-z`): {chunk_type:?}")] | ||
InvalidChunkType { chunk_type: [u8; 4] }, | ||
#[error("CRC mismatch (stated {stated:?}, calculated {calculated:?})")] | ||
CrcMismatch { stated: u32, calculated: u32 }, | ||
#[error("Dmi error: {0}")] | ||
Generic(String), | ||
#[error("Dmi IconState error: {0}")] | ||
IconState(String), | ||
#[error("Encoding error: {0}")] | ||
Encoding(String), | ||
#[error("Conversion error: {0}")] | ||
Conversion(String), | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters