#[repr(C)]pub enum Error {
Show 40 variants
FailedToInitializeFileSystem = 1,
PermissionDenied = 2,
NotFound = 3,
AlreadyExists = 4,
DirectoryAlreadyExists = 5,
FileSystemFull = 6,
FileSystemError = 7,
InvalidPath = 8,
InvalidFile = 9,
InvalidDirectory = 10,
InvalidSymbolicLink = 11,
Unknown = 12,
InvalidIdentifier = 13,
FailedToGetTaskInformations = 14,
FailedToGetUsersInformations = 15,
TooManyMountedFileSystems = 16,
TooManyOpenFiles = 17,
InternalError = 18,
InvalidMode = 19,
UnsupportedOperation = 20,
RessourceBusy = 21,
AlreadyInitialized = 22,
NotInitialized = 23,
FailedToGetUsersManagerInstance = 24,
FailedToGetTaskManagerInstance = 25,
InvalidParameter = 26,
InvalidFlags = 27,
NotDirectory = 28,
IsDirectory = 29,
InputOutput = 30,
DirectoryNotEmpty = 31,
FileTooLarge = 32,
NoAttribute = 33,
NameTooLong = 34,
Corrupted = 35,
NoMemory = 36,
NoSpaceLeft = 37,
TimeError = 38,
InvalidInode = 39,
Other = 40,
}
Expand description
Comprehensive enumeration of all possible file system errors.
This enum covers errors that can occur at various levels of the file system stack, from low-level device operations to high-level file system operations. Each variant has a unique numeric discriminant for FFI compatibility.
Variants§
FailedToInitializeFileSystem = 1
Failed to initialize the file system.
PermissionDenied = 2
Permission denied for the requested operation.
NotFound = 3
File, directory, or resource not found.
AlreadyExists = 4
File or directory already exists.
DirectoryAlreadyExists = 5
Directory already exists (more specific than Already_exists).
FileSystemFull = 6
File system is full and cannot store more data.
FileSystemError = 7
Generic file system error.
InvalidPath = 8
The provided path is invalid or malformed.
InvalidFile = 9
The file is corrupted or invalid.
InvalidDirectory = 10
The directory is corrupted or invalid.
InvalidSymbolicLink = 11
The symbolic link is invalid or broken.
Unknown = 12
Unknown or unspecified error.
InvalidIdentifier = 13
File or task identifier is invalid.
FailedToGetTaskInformations = 14
Failed to retrieve task information from task manager.
FailedToGetUsersInformations = 15
Failed to retrieve user information from user manager.
TooManyMountedFileSystems = 16
Maximum number of mounted file systems exceeded.
TooManyOpenFiles = 17
Maximum number of open files exceeded.
InternalError = 18
Internal implementation error.
InvalidMode = 19
Invalid access mode specified.
UnsupportedOperation = 20
Operation is not supported by the device or file system.
RessourceBusy = 21
Resource is temporarily busy or unavailable.
AlreadyInitialized = 22
System or component is already initialized.
NotInitialized = 23
System or component is not initialized.
FailedToGetUsersManagerInstance = 24
Failed to get users manager instance.
FailedToGetTaskManagerInstance = 25
Failed to get task manager instance.
InvalidParameter = 26
Invalid parameter provided to function.
InvalidFlags = 27
Invalid flags specified for operation.
NotDirectory = 28
Expected a directory but found a file.
IsDirectory = 29
Expected a file but found a directory.
InputOutput = 30
Input/output error during operation.
DirectoryNotEmpty = 31
Directory is not empty and cannot be removed.
FileTooLarge = 32
File size exceeds maximum allowed size.
NoAttribute = 33
Requested attribute does not exist.
NameTooLong = 34
File or directory name is too long.
Corrupted = 35
Data corruption detected.
NoMemory = 36
Insufficient memory for operation.
NoSpaceLeft = 37
No space left on device.
TimeError = 38
Error in timestamp or time-related operation.
InvalidInode = 39
Invalid inode reference.
Other = 40
Other unclassified error.
Implementations§
Source§impl Error
impl Error
Sourcepub fn get_discriminant(&self) -> NonZeroU32
pub fn get_discriminant(&self) -> NonZeroU32
Get the numeric discriminant of the error as a non-zero u32.
This is useful for FFI operations where errors need to be represented as numeric codes.
§Returns
A NonZeroU32
containing the error’s discriminant value.
§Examples
use file_system::Error;
let error = Error::Permission_denied;
let code = error.get_discriminant();
assert_eq!(code.get(), 2); // Permission_denied has discriminant 2
Trait Implementations§
Source§impl Display for Error
Display implementation for user-friendly error messages.
impl Display for Error
Display implementation for user-friendly error messages.
Provides human-readable descriptions of all error variants.
Source§impl From<Error> for Error
Convert Task module errors to file system errors.
impl From<Error> for Error
Convert Task module errors to file system errors.
This allows transparent handling of task-related errors in file system operations.
Source§impl From<Error> for Error
Convert Users module errors to file system errors.
impl From<Error> for Error
Convert Users module errors to file system errors.
This allows transparent handling of user-related errors in file system operations.
Source§impl From<Error> for NonZeroU32
Convert file system errors to numeric discriminants.
impl From<Error> for NonZeroU32
Convert file system errors to numeric discriminants.
This conversion is useful for FFI where errors need to be represented as numbers.