Enum stam::StamError

source ·
pub enum StamError {
Show 29 variants HandleError(&'static str), IdNotFoundError(String, &'static str), NotFoundError(Type, &'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), QuerySyntaxError(String, &'static str), SerializationError(String), DeserializationError(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), UndefinedVariable(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

§

NotFoundError(Type, &'static str)

A more generic NotFound error

§

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

§

QuerySyntaxError(String, &'static str)

A syntax error in query syntax

§

SerializationError(String)

§

DeserializationError(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

§

UndefinedVariable(String, &'static str)

Undefined variable in query

§

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

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, 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 Error for StamError

source§

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

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

impl Error for StamError

source§

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

Raised when there is general error when deserializing a type. Read more
source§

fn invalid_type(unexp: Unexpected<'_>, exp: &dyn Expected) -> Self

Raised when a Deserialize receives a type different from what it was expecting. Read more
source§

fn invalid_value(unexp: Unexpected<'_>, exp: &dyn Expected) -> Self

Raised when a Deserialize receives a value of the right type but that is wrong for some other reason. Read more
source§

fn invalid_length(len: usize, exp: &dyn Expected) -> Self

Raised when deserializing a sequence or map and the input data contains too many or too few elements. Read more
source§

fn unknown_variant(variant: &str, expected: &'static [&'static str]) -> Self

Raised when a Deserialize enum type received a variant with an unrecognized name.
source§

fn unknown_field(field: &str, expected: &'static [&'static str]) -> Self

Raised when a Deserialize struct type received a field with an unrecognized name.
source§

fn missing_field(field: &'static str) -> Self

Raised when a Deserialize struct type expected to receive a required field with a particular name but that field was not present in the input.
source§

fn duplicate_field(field: &'static str) -> Self

Raised when a Deserialize struct type received more than one of the same field.
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 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> 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.

§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T> ToString for T
where 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 T
where 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 T
where 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 T
where V: MultiLane<T>,

§

fn vzip(self) -> V