Module std::errno

The errno std::fs, std::net and std::env answer in their Errs, named and formatted. They answer the kernel's word, a bare Int, so a match takes Err(2); wrapping it, Errno::new(e), gives its Display: strerror's text as glibc words it (No such file or directory), and Unknown error <n> for a number outside the table.

Source: std/errno.weir; committed interface: std/errno.iface. Index

struct Errno

pub struct Errno: copy {
    /* private fields */
}

An errno, the kernel's error number, with glibc's strerror text as its Display.

Implementations:

impl Errno

method new

pub fn new(code: Int) -> Errno

Wraps the number code; any Int is accepted, unknown ones included.

Committed interface (std/errno.iface): the signature alone.

method code

pub fn code(&self) -> Int

The number.

Committed interface (std/errno.iface): the signature alone.

method description

pub fn description(&self) -> Option<Str>

strerror's text, None for a number outside the table.

Committed interface (std/errno.iface): the signature alone.