pub enum FileError {
InvalidUri(String),
UnsupportedScheme(String),
NotFound(String),
PermissionDenied(String),
AlreadyExists(String),
NotDirectory(String),
IsDirectory(String),
Io(String),
Unsupported(String),
Other(String),
}Expand description
Error categories shared by filesystem providers and tree sources.
Payload strings are display-safe context chosen by the provider; this type intentionally does not retain a platform error source across serialization.
§Examples
use ailloli_ui_fs::FileError;
assert_eq!(FileError::NotFound("file:///missing".into()).to_string(), "file not found: file:///missing");Variants§
InvalidUri(String)
URI syntax or a URI operation’s precondition is invalid.
UnsupportedScheme(String)
The provider or local conversion does not support the URI scheme/authority.
NotFound(String)
The requested resource does not exist.
PermissionDenied(String)
Host permissions deny the requested operation.
AlreadyExists(String)
Creation/rename would collide with an existing resource.
NotDirectory(String)
An operation requiring a directory received another kind.
IsDirectory(String)
An operation requiring a non-directory received a directory.
Io(String)
I/O failure without a more specific portable category.
Unsupported(String)
The provider cannot perform the requested operation or entry kind.
Other(String)
Provider-specific failure not represented by another category.
Implementations§
Source§impl FileError
impl FileError
Sourcepub fn from_io(error: &Error, context: impl Into<String>) -> Self
pub fn from_io(error: &Error, context: impl Into<String>) -> Self
Maps a standard I/O error kind to the nearest portable category.
The supplied context becomes the complete payload for mapped categories.
Unmapped errors become Self::Io with "{context}: {error}".
std::io::ErrorKind::Unsupported maps to Self::Unsupported.
§Examples
use ailloli_ui_fs::FileError;
let io = std::io::Error::from(std::io::ErrorKind::NotFound);
assert_eq!(FileError::from_io(&io, "file:///missing"), FileError::NotFound("file:///missing".into()));