Skip to main content

OsError

Enum OsError 

Source
#[non_exhaustive]
pub enum OsError {
Show 55 variants Other, PermissionDenied, NotFound, NoSuchProcess, Interrupted, InputOutputError, TooBig, ExecFormatError, InvalidHandle, NoChild, WouldBlock, NoMemory, InvalidMemory, WrongDeviceKind, Busy, ObjectExists, CrossDevice, NoSuchDevice, NotADirectory, IsADirectory, InvalidArgument, GlobalHandleExhaustion, HandleExhaustion, Ioctl, TextFileBusy, NoSpaceLeft, InvalidSeek, ReadOnlyFilesystem, TooManyLinks, SymbolicLinkChain, BrokenPipe, DomainError, RangeError, Deadlock, ResourceExhaustion, UnsupportedSystemOp, ConnectionRefused, ConnectionReset, InvalidFilename, InProgress, QuotaExceeded, HostUnreachable, NetworkUnreachable, ConnectionAborted, NotConnected, AddrInUse, AddrNotAvailable, NetworkDown, InvalidData, TimedOut, StaleNetworkFileHandle, DirectoryNotEmpty, UnexpectedEof, WriteZero, AlreadyInProgress,
}
Expand description

Variant for encoding most os errors as a generic enum that can be matched upon in code - suitable for implementing FromRawOsError

OsError itself implements ErrorKind and FromRawOsError. However, it does not implement or IntoIoKind

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.
§

Other

Other errors not generated. Note that this is not produced by the impl for FromRawOsError

§

PermissionDenied

Permission Denied

§

NotFound

An Object was not found

§

NoSuchProcess

A Process was not found

§

Interrupted

System Call interrupted by signal/remote action

§

InputOutputError

Input/Output Error

§

TooBig

A name, a record, or list was too large for a system call

§

ExecFormatError

An process being spawned refers to an executable file that cannot be read

§

InvalidHandle

A Handle or File Descriptor is invalid/wrong type

§

NoChild

A Child process was not found

§

WouldBlock

An operation that was required not to block would have blocked

§

NoMemory

Memory is unavailable or cannot be allocated

§

InvalidMemory

A memory address passed to a system call was invalid/not mapped

§

WrongDeviceKind

A different kind of device was required

§

Busy

An Object being accessed was Busy

§

ObjectExists

An object that was required not to exist was located

§

CrossDevice

An operation crosses devices when it is required not to

§

NoSuchDevice

A device being identified does not exist

§

NotADirectory

An object being used as a directory was not a directory

§

IsADirectory

An object that is required not to be a directory was a directory

§

InvalidArgument

Invalid Argument/Operation

§

GlobalHandleExhaustion

A Global Handle Limit was exceeded

§

HandleExhaustion

A Local Handle Limit was exceeded

§

Ioctl

Invalid extended operation

§

TextFileBusy

An executable file is busy

§

NoSpaceLeft

No Space Left on Device

§

InvalidSeek

Seek on Non-Seekable Object

§

ReadOnlyFilesystem

Read-Only Filesystem

Too many links to the same object

§

SymbolicLinkChain

Symbolic Link Loop or excessive symbolic link chain

§

BrokenPipe

Broken Pipe

§

DomainError

Domain Error

§

RangeError

Range Error

§

Deadlock

Deadlock (Avoided)

§

ResourceExhaustion

A resource other than handle count, is exhausted

§

UnsupportedSystemOp

Unsupported System Call

§

ConnectionRefused

Connection Refused

§

ConnectionReset

Connection Reset

§

InvalidFilename

Invalid Filename

§

InProgress

Operation In-progress

§

QuotaExceeded

Quota Exceeded

§

HostUnreachable

Destination Host Unreachable

§

NetworkUnreachable

Destination Network Unreachable

§

ConnectionAborted

Connection Aborted

§

NotConnected

Socket not connected

§

AddrInUse

Bind address in use

§

AddrNotAvailable

Bind address not available

§

NetworkDown

Network down

§

InvalidData

Invalid Data

§

TimedOut

Operation timed out

§

StaleNetworkFileHandle

Stale File handle

§

DirectoryNotEmpty

Directory not empty

§

UnexpectedEof

Unexpected Eof

§

WriteZero

Write returned zero

§

AlreadyInProgress

Operation Already In progress

Trait Implementations§

Source§

impl Clone for OsError

Source§

fn clone(&self) -> OsError

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

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

Performs copy-assignment from source. Read more
Source§

impl Copy for OsError

Source§

impl Debug for OsError

Source§

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

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

impl Display for OsError

Source§

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

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

impl Eq for OsError

Source§

impl ErrorKind for OsError

Source§

const OTHER: Self = OsError::Other

A Constant for the ErrorKind that is an “Other” value
Source§

fn uncategorized() -> Self

Returns a value of the ErrorKind that represents an uncategorized Error. This should normally not be matachable outside of the crate that defines the ErrorKind
Source§

impl FromIoKind for OsError

Available on crate feature std only.
Source§

fn from_io_error_kind(kind: ErrorKind) -> Self

Produces a value of the ErrorKind that corresponds to kind Read more
Source§

impl FromRawOsError for OsError

Source§

fn from_raw_os_error(raw: RawOsError) -> Self

Returns an Error value that corresponds to the OS error code. Read more
Source§

impl Hash for OsError

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 PartialEq for OsError

Source§

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

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

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

Inequality operator !=. Read more
Source§

impl StructuralPartialEq for OsError

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, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. 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> ToString for T
where T: Display + ?Sized,

Source§

fn to_string(&self) -> String

Converts the given value to a String. 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.