Enum Error

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

Source§

impl Error

Source

pub fn as_str(&self) -> &'static str

Returns a string describing the error.

Trait Implementations§

Source§

impl Clone for Error

Source§

fn clone(&self) -> Error

Returns a duplicate 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 Error

Source§

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

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

impl Display for Error

Source§

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

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

impl Error for Error

Source§

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

Returns 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<Error> for Error

Source§

fn from(source: Error) -> Self

Converts to this type from the input type.
Source§

impl From<MethodCallError<'_>> for Error

Source§

fn from(source: MethodCallError<'_>) -> Self

Converts to this type from the input type.
Source§

impl Hash for Error

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 Error

Source§

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

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

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

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl Eq for Error

Source§

impl StructuralPartialEq for Error

Auto Trait Implementations§

§

impl Freeze for Error

§

impl RefUnwindSafe for Error

§

impl Send for Error

§

impl Sync for Error

§

impl Unpin for Error

§

impl UnwindSafe for Error

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.