AsepriteParseError

Enum AsepriteParseError 

Source
pub enum AsepriteParseError<I: Debug> {
Show 18 variants InvalidColorDepth(u16), InvalidUtf8(FromUtf8Error), InvalidLayerType(u16), InvalidBlendMode(u16), InvalidCompressedData(DecompressError), NotEnoughCompressedData, InvalidCel, InvalidCelType(u16), InvalidAnimationDirection(u8), GenericNom { input: I, nom: ErrorKind, }, InvalidLayerChunk(Box<AsepriteParseError<I>>), InvalidCelChunk(Box<AsepriteParseError<I>>), InvalidCelExtraChunk(Box<AsepriteParseError<I>>), InvalidTagsChunk(Box<AsepriteParseError<I>>), InvalidPaletteChunk(Box<AsepriteParseError<I>>), InvalidUserDataChunk(Box<AsepriteParseError<I>>), InvalidSliceChunk(Box<AsepriteParseError<I>>), InvalidColorProfileChunk(Box<AsepriteParseError<I>>),
}
Expand description

Errors that can occur during parsing

Encountering an error could mean one (or several) of these problems:

  • You passed in an incomplete file (For example when loading immediately after a file change, as this means that the file could be empty or only partially saved)
  • You passed in an invalid file (Not representing an .aseprite file)
  • You are passing a file that is either too old, or too new. Make sure that you are saving/using a compatible Aseprite file.

If you encounter this error even though you have checked for the above problems, please report this as a bug.

Variants§

§

InvalidColorDepth(u16)

Color depth was invalid

§

InvalidUtf8(FromUtf8Error)

An embedded string was not utf-8

§

InvalidLayerType(u16)

An invalid layer type was found

§

InvalidBlendMode(u16)

An invalid blend mode was found

§

InvalidCompressedData(DecompressError)

The pixel data could not be decompressed

§

NotEnoughCompressedData

There was not enough compressed data

§

InvalidCel

An invalid cel was found while decompressing

§

InvalidCelType(u16)

An invalid cel type was found

§

InvalidAnimationDirection(u8)

An invalid animation direction was found

§

GenericNom

A generic nom error was found

Fields

§input: I

The input causing the error

§nom: ErrorKind

The error kind reported by nom

§

InvalidLayerChunk(Box<AsepriteParseError<I>>)

Could not parse a layer chunk

§

InvalidCelChunk(Box<AsepriteParseError<I>>)

Could not parse a cel chunk

§

InvalidCelExtraChunk(Box<AsepriteParseError<I>>)

Could not parse a cel extra chunk

§

InvalidTagsChunk(Box<AsepriteParseError<I>>)

Could not parse a tags chunk

§

InvalidPaletteChunk(Box<AsepriteParseError<I>>)

Could not parse a palette chunk

§

InvalidUserDataChunk(Box<AsepriteParseError<I>>)

Could not parse a user data chunk

§

InvalidSliceChunk(Box<AsepriteParseError<I>>)

Could not parse a slice chunk

§

InvalidColorProfileChunk(Box<AsepriteParseError<I>>)

Could not parse a color profile chunk

Trait Implementations§

Source§

impl<I: Debug + Debug> Debug for AsepriteParseError<I>

Source§

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

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

impl<I: Debug> Display for AsepriteParseError<I>

Source§

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

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

impl<I: Debug> Error for AsepriteParseError<I>
where Self: Debug + Display,

1.30.0 · 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<'a> From<AsepriteParseError<&'a [u8]>> for AsepriteError

Source§

fn from(other: AsepriteParseError<&'a [u8]>) -> Self

Converts to this type from the input type.
Source§

impl<I: Debug> ParseError<I> for AsepriteParseError<I>

Source§

fn from_error_kind(input: I, kind: ErrorKind) -> Self

Creates an error from the input position and an ErrorKind
Source§

fn append(_input: I, _kind: ErrorKind, other: Self) -> Self

Combines an existing error with a new one created from the input position and an ErrorKind. This is useful when backtracking through a parse tree, accumulating error context on the way
Source§

fn from_char(input: I, _: char) -> Self

Creates an error from an input position and an expected character
Source§

fn or(self, other: Self) -> Self

Combines two existing errors. This function is used to compare errors generated in various branches of alt.

Auto Trait Implementations§

§

impl<I> Freeze for AsepriteParseError<I>
where I: Freeze,

§

impl<I> RefUnwindSafe for AsepriteParseError<I>
where I: RefUnwindSafe,

§

impl<I> Send for AsepriteParseError<I>
where I: Send,

§

impl<I> Sync for AsepriteParseError<I>
where I: Sync,

§

impl<I> Unpin for AsepriteParseError<I>
where I: Unpin,

§

impl<I> UnwindSafe for AsepriteParseError<I>
where I: UnwindSafe,

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> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
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> 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.
Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more