IMPORTANT: To view this page as Markdown, append `.md` to the URL (e.g. /docs/manual/basics.md). For the complete Mojo documentation index, see llms.txt.
Skip to main content
Version: Nightly
For the complete Mojo documentation index, see llms.txt. Markdown versions of all pages are available by appending .md to any URL (e.g. /docs/manual/basics.md).

IOErrorKind

struct IOErrorKind

Classifies an IOError independently of the platform.

The enum is open: later releases can add kinds, so a match over it is exhaustive only with a case _ arm.

Implemented traits​

AnyType, Copyable, Deinitable, EnumLike, Equatable, Hashable, ImplicitlyCopyable, Movable, Writable, __Enum

comptime members​

address_in_use​

comptime address_in_use = IOErrorKind.__enum_init[Int(9), NoneType]()

The local address is already in use.

address_not_available​

comptime address_not_available = IOErrorKind.__enum_init[Int(10), NoneType]()

The requested address isn't local or doesn't exist.

already_exists​

comptime already_exists = IOErrorKind.__enum_init[Int(2), NoneType]()

An entity, such as a file, already exists.

broken_pipe​

comptime broken_pipe = IOErrorKind.__enum_init[Int(14), NoneType]()

The other end of a pipe or connection has closed.

connection_aborted​

comptime connection_aborted = IOErrorKind.__enum_init[Int(7), NoneType]()

The local host aborted the connection.

connection_refused​

comptime connection_refused = IOErrorKind.__enum_init[Int(5), NoneType]()

The remote host refused the connection.

connection_reset​

comptime connection_reset = IOErrorKind.__enum_init[Int(6), NoneType]()

The remote host reset the connection.

host_unreachable​

comptime host_unreachable = IOErrorKind.__enum_init[Int(11), NoneType]()

The remote host couldn't be reached.

interrupted​

comptime interrupted = IOErrorKind.__enum_init[Int(17), NoneType]()

The operation was interrupted, typically by a signal.

invalid_input​

comptime invalid_input = IOErrorKind.__enum_init[Int(3), NoneType]()

An argument was invalid.

network_down​

comptime network_down = IOErrorKind.__enum_init[Int(13), NoneType]()

The network is down.

network_unreachable​

comptime network_unreachable = IOErrorKind.__enum_init[Int(12), NoneType]()

The network containing the remote host couldn't be reached.

not_connected​

comptime not_connected = IOErrorKind.__enum_init[Int(8), NoneType]()

The operation needs a connected socket, and the socket isn't connected.

not_found​

comptime not_found = IOErrorKind.__enum_init[Int(0), NoneType]()

An entity, such as a file, wasn't found.

permission_denied​

comptime permission_denied = IOErrorKind.__enum_init[Int(1), NoneType]()

The operation lacked the necessary privileges.

timed_out​

comptime timed_out = IOErrorKind.__enum_init[Int(16), NoneType]()

The operation timed out.

uncategorized​

comptime uncategorized = IOErrorKind.__enum_init[Int(18), NoneType]()

An operating system error that no other kind covers.

would_block​

comptime would_block = IOErrorKind.__enum_init[Int(15), NoneType]()

The operation would block, and blocking wasn't requested.

write_zero​

comptime write_zero = IOErrorKind.__enum_init[Int(4), NoneType]()

A write that had to make progress wrote zero bytes.

Methods​

__eq__​

def __eq__(self, other: Self) -> Bool

Returns whether two kinds are the same.

Args:

  • ​other (Self): The kind to compare against.

Returns:

Bool: True if both are the same kind.

__hash__​

def __hash__(self, mut hasher: T)

Hashes the kind using the given hasher.

Args:

  • ​hasher (T): The hasher instance.