pub enum Error {
Show 25 variants BadComponent(Error), BadCoordinate, BadDepth, BadFilename, BadFillCharacter, BadInventorySlot, BadItem, BadPaletteIndex, BadScreen, Blocked(BlockContent), ChecksumMismatch, DataTooLarge, FileNotFound, ImpossibleMove, InventoryFull, NegativeSeek, NoItem, NoInventory, NotEnoughEnergy, StorageReadOnly, TooManyDescriptors, TooManyOpenPorts, TooManyParts, Unsupported, Failed,
}
Expand description

The errors that a component call can return.

Variants

BadComponent(Error)

The call was addressed to a component that does not exist, is not accessible, or is of the wrong type.

The underlying syscall error is encapsulated.

BadCoordinate

An unsupported screen resolution, viewport size, or screen coordinate was requested.

BadDepth

An unsupported colour depth was requested.

BadFilename

The filename passed to a function is structurally invalid to be a filename.

BadFillCharacter

The character to use to fill the screen lies outside the basic multilingual plane and therefore cannot be used for filling.

BadInventorySlot

An index number is outside the range of slots for an inventory or tanks for a fluid-containing block.

In the case of item inventories, this is only returned if the block is in fact an inventory; NoInventory is returned for non-inventories. In the case of fluid containers, this is also returned if the block is not a fluid container at all (it is treated as a fluid container with zero tanks), but not if the block is in an unloaded chunk.

BadItem

An item is not usable for the requested purpose.

For example, an item that does not hold fluid cannot have its fluid level or capacity queried.

BadPaletteIndex

A set-colour request tried to set a colour by palette index, and the palette index was unacceptable. This could be because the palette index was outside the range of the palette for the current bit depth, or it could be because the current bit depth does not support a palette at all.

BadScreen

The address specified when binding a GPU does not exist, is inaccessible, or is not a screen; or, a GPU operation which requires a screen was executed when the GPU is unbound or the screen to which it was bound has been disconnected.

Blocked(BlockContent)

The robot cannot move because there is something in the way.

ChecksumMismatch

The checksum passed when trying to make an EEPROM read-only does not match the checksum of the contents of the EEPROM.

DataTooLarge

The data (e.g. to write to a file or EEPROM or send over a communication interface) is too large.

FileNotFound

The named file or directory does not exist.

ImpossibleMove

The robot tried to move to a position that is too far away from support (and does not have a suitable hover upgrade to allow such movement), tried to move into an unloaded chunk, or the destination is otherwise unsuitable for a reason other than there being something in the way.

InventoryFull

An attempt was made to move an item or fluid into an inventory slot or tank, but it could not be inserted because the slot or tank is full, or the existing contents are not compatible with the new addition.

NegativeSeek

A seek in a file would place the file pointer at a negative position.

NoItem

There is no item in an inventory slot when one is required.

NoInventory

There is no inventory in the specified location. This includes if the inventory is in an unloaded chunk.

This is also returned when attempting to access a fluid tank in an unloaded chunk, but not when attempting to access a fluid tank in a block that does not contain any tanks; in the latter case, BadInventorySlot is used instead.

NotEnoughEnergy

The computer does not have enough energy to perform the operation.

StorageReadOnly

The storage (e.g. EEPROM or filesystem) cannot be written to because it is read-only.

TooManyDescriptors

There are too many open descriptors.

TooManyOpenPorts

There are too many listening network ports.

TooManyParts

There are too many parts in a packet.

Unsupported

The operation is not supported for this component.

For example:

  • An attempt was made to set a filesystem’s label, but this particular filesystem does not support labels.
  • An attempt was made to access item stack information in an inventory, but detailed item information access is disabled in the configuration file.

Failed

The operation failed but no more detailed information is available at the type level. The individual method may document more specific reasons for this error to appear.

Implementations

Returns a string describing the error.

Trait Implementations

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Formats the value using the given formatter. Read more

Formats the value using the given formatter. Read more

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

🔬 This is a nightly-only experimental API. (backtrace)

Returns a stack backtrace, if available, of where this error occurred. Read more

👎 Deprecated since 1.42.0:

use the Display impl or to_string()

👎 Deprecated since 1.33.0:

replaced by Error::source, which can support downcasting

Converts to this type from the input type.

Converts to this type from the input type.

Feeds this value into the given Hasher. Read more

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

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

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

The resulting type after obtaining ownership.

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

🔬 This is a nightly-only experimental API. (toowned_clone_into)

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

Converts the given value to a String. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.