mirror of
https://github.com/YGGverse/ggemini.git
synced 2026-04-01 01:25:32 +00:00
20 lines
506 B
Rust
20 lines
506 B
Rust
use std::fmt::{Display, Formatter, Result};
|
|
|
|
#[derive(Debug)]
|
|
pub enum Error {
|
|
BytesTotal(usize, usize),
|
|
InputStream(glib::Error),
|
|
}
|
|
|
|
impl Display for Error {
|
|
fn fmt(&self, f: &mut Formatter) -> Result {
|
|
match self {
|
|
Self::BytesTotal(total, limit) => {
|
|
write!(f, "Bytes total limit reached: {total} / {limit}")
|
|
}
|
|
Self::InputStream(reason) => {
|
|
write!(f, "Input stream error: {reason}")
|
|
}
|
|
}
|
|
}
|
|
}
|