Struct syscalls::Errno

source ·
pub struct Errno(/* private fields */);

Implementations§

source§

impl Errno

source

pub const EPERM: Errno = _

Operation not permitted

source

pub const ENOENT: Errno = _

No such file or directory

source

pub const ESRCH: Errno = _

No such process

source

pub const EINTR: Errno = _

Interrupted system call

source

pub const EIO: Errno = _

I/O error

source

pub const ENXIO: Errno = _

No such device or address

source

pub const E2BIG: Errno = _

Argument list too long

source

pub const ENOEXEC: Errno = _

Exec format error

source

pub const EBADF: Errno = _

Bad file number

source

pub const ECHILD: Errno = _

No child processes

source

pub const EAGAIN: Errno = _

Try again

source

pub const ENOMEM: Errno = _

Out of memory

source

pub const EACCES: Errno = _

Permission denied

source

pub const EFAULT: Errno = _

Bad address

source

pub const ENOTBLK: Errno = _

Block device required

source

pub const EBUSY: Errno = _

Device or resource busy

source

pub const EEXIST: Errno = _

File exists

source

pub const EXDEV: Errno = _

Cross-device link

source

pub const ENODEV: Errno = _

No such device

source

pub const ENOTDIR: Errno = _

Not a directory

source

pub const EISDIR: Errno = _

Is a directory

source

pub const EINVAL: Errno = _

Invalid argument

source

pub const ENFILE: Errno = _

File table overflow

source

pub const EMFILE: Errno = _

Too many open files

source

pub const ENOTTY: Errno = _

Not a typewriter

source

pub const ETXTBSY: Errno = _

Text file busy

source

pub const EFBIG: Errno = _

File too large

source

pub const ENOSPC: Errno = _

No space left on device

source

pub const ESPIPE: Errno = _

Illegal seek

source

pub const EROFS: Errno = _

Read-only file system

Too many links

source

pub const EPIPE: Errno = _

Broken pipe

source

pub const EDOM: Errno = _

Math argument out of domain of func

source

pub const ERANGE: Errno = _

Math result not representable

source

pub const EDEADLK: Errno = _

Resource deadlock would occur

source

pub const ENAMETOOLONG: Errno = _

File name too long

source

pub const ENOLCK: Errno = _

No record locks available

source

pub const ENOSYS: Errno = _

Invalid system call number

source

pub const ENOTEMPTY: Errno = _

Directory not empty

source

pub const ELOOP: Errno = _

Too many symbolic links encountered

source

pub const ENOMSG: Errno = _

No message of desired type

source

pub const EIDRM: Errno = _

Identifier removed

source

pub const ECHRNG: Errno = _

Channel number out of range

source

pub const EL2NSYNC: Errno = _

Level 2 not synchronized

source

pub const EL3HLT: Errno = _

Level 3 halted

source

pub const EL3RST: Errno = _

Level 3 reset

source

pub const ELNRNG: Errno = _

Link number out of range

source

pub const EUNATCH: Errno = _

Protocol driver not attached

source

pub const ENOCSI: Errno = _

No CSI structure available

source

pub const EL2HLT: Errno = _

Level 2 halted

source

pub const EBADE: Errno = _

Invalid exchange

source

pub const EBADR: Errno = _

Invalid request descriptor

source

pub const EXFULL: Errno = _

Exchange full

source

pub const ENOANO: Errno = _

No anode

source

pub const EBADRQC: Errno = _

Invalid request code

source

pub const EBADSLT: Errno = _

Invalid slot

source

pub const EBFONT: Errno = _

Bad font file format

source

pub const ENOSTR: Errno = _

Device not a stream

source

pub const ENODATA: Errno = _

No data available

source

pub const ETIME: Errno = _

Timer expired

source

pub const ENOSR: Errno = _

Out of streams resources

source

pub const ENONET: Errno = _

Machine is not on the network

source

pub const ENOPKG: Errno = _

Package not installed

source

pub const EREMOTE: Errno = _

Object is remote

Link has been severed

source

pub const EADV: Errno = _

Advertise error

source

pub const ESRMNT: Errno = _

Srmount error

source

pub const ECOMM: Errno = _

Communication error on send

source

pub const EPROTO: Errno = _

Protocol error

source

pub const EMULTIHOP: Errno = _

Multihop attempted

source

pub const EDOTDOT: Errno = _

RFS specific error

source

pub const EBADMSG: Errno = _

Not a data message

source

pub const EOVERFLOW: Errno = _

Value too large for defined data type

source

pub const ENOTUNIQ: Errno = _

Name not unique on network

source

pub const EBADFD: Errno = _

File descriptor in bad state

source

pub const EREMCHG: Errno = _

Remote address changed

source

pub const ELIBACC: Errno = _

Can not access a needed shared library

source

pub const ELIBBAD: Errno = _

Accessing a corrupted shared library

source

pub const ELIBSCN: Errno = _

.lib section in a.out corrupted

source

pub const ELIBMAX: Errno = _

Attempting to link in too many shared libraries

source

pub const ELIBEXEC: Errno = _

Cannot exec a shared library directly

source

pub const EILSEQ: Errno = _

Illegal byte sequence

source

pub const ERESTART: Errno = _

Interrupted system call should be restarted

source

pub const ESTRPIPE: Errno = _

Streams pipe error

source

pub const EUSERS: Errno = _

Too many users

source

pub const ENOTSOCK: Errno = _

Socket operation on non-socket

source

pub const EDESTADDRREQ: Errno = _

Destination address required

source

pub const EMSGSIZE: Errno = _

Message too long

source

pub const EPROTOTYPE: Errno = _

Protocol wrong type for socket

source

pub const ENOPROTOOPT: Errno = _

Protocol not available

source

pub const EPROTONOSUPPORT: Errno = _

Protocol not supported

source

pub const ESOCKTNOSUPPORT: Errno = _

Socket type not supported

source

pub const EOPNOTSUPP: Errno = _

Operation not supported on transport endpoint

source

pub const EPFNOSUPPORT: Errno = _

Protocol family not supported

source

pub const EAFNOSUPPORT: Errno = _

Address family not supported by protocol

source

pub const EADDRINUSE: Errno = _

Address already in use

source

pub const EADDRNOTAVAIL: Errno = _

Cannot assign requested address

source

pub const ENETDOWN: Errno = _

Network is down

source

pub const ENETUNREACH: Errno = _

Network is unreachable

source

pub const ENETRESET: Errno = _

Network dropped connection because of reset

source

pub const ECONNABORTED: Errno = _

Software caused connection abort

source

pub const ECONNRESET: Errno = _

Connection reset by peer

source

pub const ENOBUFS: Errno = _

No buffer space available

source

pub const EISCONN: Errno = _

Transport endpoint is already connected

source

pub const ENOTCONN: Errno = _

Transport endpoint is not connected

source

pub const ESHUTDOWN: Errno = _

Cannot send after transport endpoint shutdown

source

pub const ETOOMANYREFS: Errno = _

Too many references: cannot splice

source

pub const ETIMEDOUT: Errno = _

Connection timed out

source

pub const ECONNREFUSED: Errno = _

Connection refused

source

pub const EHOSTDOWN: Errno = _

Host is down

source

pub const EHOSTUNREACH: Errno = _

No route to host

source

pub const EALREADY: Errno = _

Operation already in progress

source

pub const EINPROGRESS: Errno = _

Operation now in progress

source

pub const ESTALE: Errno = _

Stale file handle

source

pub const EUCLEAN: Errno = _

Structure needs cleaning

source

pub const ENOTNAM: Errno = _

Not a XENIX named type file

source

pub const ENAVAIL: Errno = _

No XENIX semaphores available

source

pub const EISNAM: Errno = _

Is a named type file

source

pub const EREMOTEIO: Errno = _

Remote I/O error

source

pub const EDQUOT: Errno = _

Quota exceeded

source

pub const ENOMEDIUM: Errno = _

No medium found

source

pub const EMEDIUMTYPE: Errno = _

Wrong medium type

source

pub const ECANCELED: Errno = _

Operation Canceled

source

pub const ENOKEY: Errno = _

Required key not available

source

pub const EKEYEXPIRED: Errno = _

Key has expired

source

pub const EKEYREVOKED: Errno = _

Key has been revoked

source

pub const EKEYREJECTED: Errno = _

Key was rejected by service

source

pub const EOWNERDEAD: Errno = _

Owner died

source

pub const ENOTRECOVERABLE: Errno = _

State not recoverable

source

pub const ERFKILL: Errno = _

Operation not possible due to RF-kill

source

pub const EHWPOISON: Errno = _

Memory page has hardware error

source

pub const ERESTARTSYS: Errno = _

Restart syscall

source

pub const ERESTARTNOINTR: Errno = _

Restart if no interrupt

source

pub const ERESTARTNOHAND: Errno = _

restart if no handler..

source

pub const ENOIOCTLCMD: Errno = _

No ioctl command

source

pub const ERESTART_RESTARTBLOCK: Errno = _

restart by calling sys_restart_syscall

source

pub const EPROBE_DEFER: Errno = _

Driver requests probe retry

source

pub const EOPENSTALE: Errno = _

open found a stale dentry

source

pub const ENOPARAM: Errno = _

Parameter not supported

source

pub const EBADHANDLE: Errno = _

Illegal NFS file handle

source

pub const ENOTSYNC: Errno = _

Update synchronization mismatch

source

pub const EBADCOOKIE: Errno = _

Cookie is stale

source

pub const ENOTSUPP: Errno = _

Operation is not supported

source

pub const ETOOSMALL: Errno = _

Buffer or request is too small

source

pub const ESERVERFAULT: Errno = _

An untranslatable error occurred

source

pub const EBADTYPE: Errno = _

Type not supported by server

source

pub const EJUKEBOX: Errno = _

Request initiated, but will not complete before timeout

source

pub const EIOCBQUEUED: Errno = _

iocb queued, will get completion event

source

pub const ERECALLCONFLICT: Errno = _

conflict with recalled state

source

pub const ENOGRACE: Errno = _

NFS file lock reclaim refused

source

pub fn name_and_description(&self) -> Option<(&'static str, &'static str)>

Returns a pair containing the name of the error and a string describing the error.

source§

impl Errno

source

pub const EWOULDBLOCK: Self = Self::EAGAIN

Operation would block. This is the same as Errno::EAGAIN.

source

pub const EDEADLOCK: Self = Self::EDEADLK

Same as Errno::EDEADLK.

source

pub fn new(num: i32) -> Self

Creates a new Errno.

source

pub fn into_raw(self) -> i32

Converts the Errno into a raw i32.

source

pub fn is_valid(&self) -> bool

Returns true if the error code is valid (i.e., less than 4096).

source

pub fn from_ret(value: usize) -> Result<usize, Errno>

Converts a raw syscall return value to a result.

source

pub fn last() -> Self

Returns the last error that occurred.

source

pub fn result<T>(value: T) -> Result<T, Errno>
where T: ErrnoSentinel + PartialEq<T>,

Converts a value into an Errno.

source

pub fn name(&self) -> Option<&'static str>

Returns the name of the error. If the internal error code is unknown or invalid, None is returned.

source

pub fn description(&self) -> Option<&'static str>

Returns the error description. If the internal error code is unknown or invalid, None is returned.

source

pub fn from_io_error(err: Error) -> Option<Self>

Converts an std::io::Error into an Errno if possible. Since an error code is just one of the few possible error types that std::io::Error can represent, this will return None if the conversion is not possible.

A From<std::io::Error> implementation is not provided because this conversion can fail. However, the reverse is possible, so that is provided as a From implementation.

Trait Implementations§

source§

impl Clone for Errno

source§

fn clone(&self) -> Errno

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 Errno

source§

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

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

impl<'de> Deserialize<'de> for Errno

source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
source§

impl Display for Errno

source§

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

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

impl Error for Errno

1.30.0 · source§

fn source(&self) -> Option<&(dyn Error + 'static)>

The lower-level source of this error, if any. Read more
1.0.0 · source§

fn description(&self) -> &str

👎Deprecated since 1.42.0: use the Display impl or to_string()
1.0.0 · source§

fn cause(&self) -> Option<&dyn Error>

👎Deprecated since 1.33.0: replaced by Error::source, which can support downcasting
source§

fn provide<'a>(&'a self, request: &mut Request<'a>)

🔬This is a nightly-only experimental API. (error_generic_member_access)
Provides type based access to context intended for error reports. Read more
source§

impl From<Errno> for Error

source§

fn from(err: Errno) -> Self

Converts to this type from the input type.
source§

impl Hash for Errno

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 Errno

source§

fn cmp(&self, other: &Errno) -> 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 + PartialOrd,

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

impl PartialEq for Errno

source§

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

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

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

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl PartialOrd for Errno

source§

fn partial_cmp(&self, other: &Errno) -> 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

This method 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

This method 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

This method 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

This method tests greater than or equal to (for self and other) and is used by the >= operator. Read more
source§

impl Serialize for Errno

source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
source§

impl Copy for Errno

source§

impl Eq for Errno

source§

impl StructuralPartialEq for Errno

Auto Trait Implementations§

§

impl Freeze for Errno

§

impl RefUnwindSafe for Errno

§

impl Send for Errno

§

impl Sync for Errno

§

impl Unpin for Errno

§

impl UnwindSafe for Errno

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> 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,

§

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§

default 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>,

§

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>,

§

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

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,