use thiserror::Error;
#[derive(Debug, Error)]
pub enum ProgressError {
#[error("进度已完成")]
AlreadyFinished,
#[error("进度值超出范围: {current} > {total}")]
OutOfRange {
current: u64,
total: u64,
},
#[error("订阅通道已关闭")]
ChannelClosed,
#[error("无效的总数: {0}(必须大于 0)")]
InvalidTotal(u64),
}
pub type ProgressResult<T> = Result<T, ProgressError>;