Enum stam::StamError

source ·
pub enum StamError {
Show 25 variants HandleError(&'static str), IdNotFoundError(String, &'static str), NoIdError(&'static str), Unbound(&'static str), AlreadyBound(&'static str), AlreadyExists(usize, &'static str), DuplicateIdError(String, &'static str), BuildError(Box<StamError>, &'static str), StoreError(Box<StamError>, &'static str), IOError(Error, String, &'static str), JsonError(Error<Error>, String, &'static str), CsvError(String, &'static str), RegexError(Error, &'static str), SerializationError(String), WrongSelectorType(&'static str), WrongSelectorTarget(&'static str), CursorOutOfBounds(Cursor, &'static str), InvalidOffset(Cursor, Cursor, &'static str), InvalidCursor(String, &'static str), NoTarget(&'static str), NoText(&'static str), InUse(&'static str), IncompleteError(String, &'static str), ValueError(String, &'static str), OtherError(&'static str),
}
Expand description

This enum groups the different kind of errors that this STAM library can produce

Variants§

§

HandleError(&'static str)

This error is raised when the specified internal ID does not exist. The first parameter is the requested internal ID

§

IdNotFoundError(String, &'static str)

This error is raised when the specified public ID does not exist The first parameter is the requested public ID

§

NoIdError(&'static str)

This error is raised when an item has no public ID but one is expected

§

Unbound(&'static str)

This error is raised when an item has no internal ID but one is expected. This happens when an item is instantiated but not yet added to a store. We such an item unbound.

§

AlreadyBound(&'static str)

This error is raised when an item is already bound and you are trying it again

§

AlreadyExists(usize, &'static str)

This error is raised when an item is already exists and you are adding it again

§

DuplicateIdError(String, &'static str)

This error is raised when you attempt to set a public ID that is already in use (within a particular scope) The first parameter is the requested public ID

§

BuildError(Box<StamError>, &'static str)

This error indicates there was an error during the building of an item from its recipe. It wraps the deeper error that occured.

§

StoreError(Box<StamError>, &'static str)

This error indicates there was an error during the storage of an item It wraps the deeper error that occured.

§

IOError(Error, String, &'static str)

This error indicates there was an Input/Output error. It wraps the deeper error that occured.

§

JsonError(Error<Error>, String, &'static str)

This error indicates there was an error during JSON parsing. It wraps the deeper error that occurred.

§

CsvError(String, &'static str)

This error indicates there was an error during CSV parsing. It wraps the deeper error that occurred.

§

RegexError(Error, &'static str)

This error is raised when there is an error in regular expressions

§

SerializationError(String)

§

WrongSelectorType(&'static str)

This error is raised when you ask a selector to do something it is not capable of because it is the wrong type of selector

§

WrongSelectorTarget(&'static str)

This error is raised when you apply a selector on a target it is not intended for

§

CursorOutOfBounds(Cursor, &'static str)

This error indicates the cursor is out of bounds when applied to the text.

§

InvalidOffset(Cursor, Cursor, &'static str)

This error indicates the offset is invalid, the end precedes the beginning. It wraps the begin and end cursors, respectively

§

InvalidCursor(String, &'static str)

This error indicates the cursor is invalid

§

NoTarget(&'static str)

Annotation has no target

§

NoText(&'static str)

Annotation has no text

§

InUse(&'static str)

Called when removal of an item is requested but it is still being referenced.

§

IncompleteError(String, &'static str)

This error is raised when the information supplied during build is incomplete

§

ValueError(String, &'static str)

Unexpected value error

§

OtherError(&'static str)

Category for other errors, try to use this sparingly

Trait Implementations§

source§

impl Debug for StamError

source§

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

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

impl Display for StamError

source§

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

Formats the error message for printing

source§

impl Error for StamError

source§

fn custom<T>(msg: T) -> Selfwhere T: Display,

Used when a Serialize implementation encounters any error while serializing a type. Read more
source§

impl Error for StamError

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, demand: &mut Demand<'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<&StamError> for String

source§

fn from(error: &StamError) -> String

Returns the error message as a String

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere 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 Twhere 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<E> Provider for Ewhere E: Error + ?Sized,

source§

fn provide<'a>(&'a self, demand: &mut Demand<'a>)

🔬This is a nightly-only experimental API. (provide_any)
Data providers should implement this method to provide all values they are able to provide by using demand. Read more
source§

impl<T> ToString for Twhere 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 Twhere 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 Twhere 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.
§

impl<V, T> VZip<V> for Twhere V: MultiLane<T>,

§

fn vzip(self) -> V