glib

Enum FileError

Source
#[non_exhaustive]
pub enum FileError {
Show 25 variants Exist, Isdir, Acces, Nametoolong, Noent, Notdir, Nxio, Nodev, Rofs, Txtbsy, Fault, Loop, Nospc, Nomem, Mfile, Nfile, Badf, Inval, Pipe, Again, Intr, Io, Perm, Nosys, Failed,
}
Expand description

Values corresponding to @errno codes returned from file operations on UNIX. Unlike @errno codes, GFileError values are available on all systems, even Windows. The exact meaning of each code depends on what sort of file operation you were performing; the UNIX documentation gives more details. The following error code descriptions come from the GNU C Library manual, and are under the copyright of that manual.

It’s not very portable to make detailed assumptions about exactly which errors will be returned from a given operation. Some errors don’t occur on some systems, etc., sometimes there are subtle differences in when a system will report a given error, etc.

Variants (Non-exhaustive)§

This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
§

Exist

Operation not permitted; only the owner of the file (or other resource) or processes with special privileges can perform the operation.

§

Isdir

File is a directory; you cannot open a directory for writing, or create or remove hard links to it.

§

Acces

Permission denied; the file permissions do not allow the attempted operation.

§

Nametoolong

Filename too long.

§

Noent

No such file or directory. This is a “file doesn’t exist” error for ordinary files that are referenced in contexts where they are expected to already exist.

§

Notdir

A file that isn’t a directory was specified when a directory is required.

§

Nxio

No such device or address. The system tried to use the device represented by a file you specified, and it couldn’t find the device. This can mean that the device file was installed incorrectly, or that the physical device is missing or not correctly attached to the computer.

§

Nodev

The underlying file system of the specified file does not support memory mapping.

§

Rofs

The directory containing the new link can’t be modified because it’s on a read-only file system.

§

Txtbsy

Text file busy.

§

Fault

You passed in a pointer to bad memory. (GLib won’t reliably return this, don’t pass in pointers to bad memory.)

§

Loop

Too many levels of symbolic links were encountered in looking up a file name. This often indicates a cycle of symbolic links.

§

Nospc

No space left on device; write operation on a file failed because the disk is full.

§

Nomem

No memory available. The system cannot allocate more virtual memory because its capacity is full.

§

Mfile

The current process has too many files open and can’t open any more. Duplicate descriptors do count toward this limit.

§

Nfile

There are too many distinct file openings in the entire system.

§

Badf

Bad file descriptor; for example, I/O on a descriptor that has been closed or reading from a descriptor open only for writing (or vice versa).

§

Inval

Invalid argument. This is used to indicate various kinds of problems with passing the wrong argument to a library function.

§

Pipe

Broken pipe; there is no process reading from the other end of a pipe. Every library function that returns this error code also generates a ‘SIGPIPE’ signal; this signal terminates the program if not handled or blocked. Thus, your program will never actually see this code unless it has handled or blocked ‘SIGPIPE’.

§

Again

Resource temporarily unavailable; the call might work if you try again later.

§

Intr

Interrupted function call; an asynchronous signal occurred and prevented completion of the call. When this happens, you should try the call again.

§

Io

Input/output error; usually used for physical read or write errors. i.e. the disk or other physical device hardware is returning errors.

§

Perm

Operation not permitted; only the owner of the file (or other resource) or processes with special privileges can perform the operation.

§

Nosys

Function not implemented; this indicates that the system is missing some functionality.

§

Failed

Does not correspond to a UNIX error code; this is the standard “failed for unspecified reason” error code present in all #GError error code enumerations. Returned if no specific code applies.

Trait Implementations§

Source§

impl Clone for FileError

Source§

fn clone(&self) -> FileError

Returns a copy of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for FileError

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl ErrorDomain for FileError

Source§

fn domain() -> Quark

Returns the quark identifying the error domain. Read more
Source§

fn code(self) -> i32

Gets the integer representation of the variant.
Source§

fn from(code: i32) -> Option<Self>

Tries to convert an integer code to an enum variant. Read more
Source§

impl Hash for FileError

Source§

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given Hasher. Read more
1.3.0 · Source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
Source§

impl Ord for FileError

Source§

fn cmp(&self, other: &FileError) -> Ordering

This method returns an Ordering between self and other. Read more
1.21.0 · Source§

fn max(self, other: Self) -> Self
where Self: Sized,

Compares and returns the maximum of two values. Read more
1.21.0 · Source§

fn min(self, other: Self) -> Self
where Self: Sized,

Compares and returns the minimum of two values. Read more
1.50.0 · Source§

fn clamp(self, min: Self, max: Self) -> Self
where Self: Sized,

Restrict a value to a certain interval. Read more
Source§

impl PartialEq for FileError

Source§

fn eq(&self, other: &FileError) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl PartialOrd for FileError

Source§

fn partial_cmp(&self, other: &FileError) -> Option<Ordering>

This method returns an ordering between self and other values if one exists. Read more
1.0.0 · Source§

fn lt(&self, other: &Rhs) -> bool

Tests less than (for self and other) and is used by the < operator. Read more
1.0.0 · Source§

fn le(&self, other: &Rhs) -> bool

Tests less than or equal to (for self and other) and is used by the <= operator. Read more
1.0.0 · Source§

fn gt(&self, other: &Rhs) -> bool

Tests greater than (for self and other) and is used by the > operator. Read more
1.0.0 · Source§

fn ge(&self, other: &Rhs) -> bool

Tests greater than or equal to (for self and other) and is used by the >= operator. Read more
Source§

impl Copy for FileError

Source§

impl Eq for FileError

Source§

impl StructuralPartialEq for FileError

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dst: *mut T)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.