diff options
| author | 魏曹先生 <1992414357@qq.com> | 2026-06-18 02:47:32 +0800 |
|---|---|---|
| committer | 魏曹先生 <1992414357@qq.com> | 2026-06-18 02:47:32 +0800 |
| commit | 0b8e6e7d18abb94bd99553dc1d2b0ba5d4f265ea (patch) | |
| tree | 97a7c3430d56bfcb885cbfff0b011362671dd474 /rola-utils/space-system/src/space | |
| parent | ebd46942c3fcc7939e5567a797a55198148301ea (diff) | |
refactor: extract shared utilities and add space-system crate
Extract rola-vcs/internal_macros into shared utils crates
(shared_constants, shared_macros, space-system) and implement
the Bucket enum with async space management
Diffstat (limited to 'rola-utils/space-system/src/space')
| -rw-r--r-- | rola-utils/space-system/src/space/error.rs | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/rola-utils/space-system/src/space/error.rs b/rola-utils/space-system/src/space/error.rs new file mode 100644 index 0000000..33ee6e4 --- /dev/null +++ b/rola-utils/space-system/src/space/error.rs @@ -0,0 +1,23 @@ +#[derive(thiserror::Error, Debug)] +pub enum SpaceError { + #[error("Space not found")] + SpaceNotFound, + + #[error("Path format error: {0}")] + PathFormatError(#[from] just_fmt::fmt_path::PathFormatError), + + #[error("IO error: {0}")] + Io(#[from] std::io::Error), + + #[error("Other: {0}")] + Other(String), +} + +impl PartialEq for SpaceError { + fn eq(&self, other: &Self) -> bool { + match (self, other) { + (Self::Io(_), Self::Io(_)) => true, + _ => core::mem::discriminant(self) == core::mem::discriminant(other), + } + } +} |
