#[non_exhaustive]pub enum Error<E> {
Syntax {
offset: usize,
expected: &'static str,
},
UnterminatedString {
offset: usize,
},
NotUtf8 {
offset: usize,
},
BinaryStream,
BadEscape {
offset: usize,
},
Lua(String),
Decompress(String),
Sink(E),
}Expand description
Why a scene could not be read.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Syntax
The input is not the grammar.
Fields
UnterminatedString
A string literal ran to end of input.
NotUtf8
A byte sequence that is not UTF-8.
BinaryStream
The input is a binarynsi stream, which this crate cannot read.
ɴsɪ has three stream formats and this reads one of them. The
binary encoding is undocumented, and autonsi – 3Delight’s
default for a name not ending .nsia – selects it, so a caller
can be handed one without having chosen it.
Detected rather than left to fail as “not UTF-8 at byte 0”, which is true and useless: it sends the reader looking for an encoding problem instead of a format one.
BadEscape
An escape sequence this format does not define.
Lua(String)
A Lua script failed to load or run.
Decompress(String)
The input announced a compressor and would not decompress.
Sink(E)
The sink refused a statement.
Parsing stops here, and the sink keeps everything applied before
it. A caller that wants all-or-nothing parses into a Recorder
first and commits afterwards.
Trait Implementations§
impl<E: Eq> Eq for Error<E>
Source§impl<E: Debug + Display> Error for Error<E>
impl<E: Debug + Display> Error for Error<E>
1.30.0 · Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
use the Display impl or to_string()
impl<E: PartialEq> StructuralPartialEq for Error<E>
Auto Trait Implementations§
impl<E> Freeze for Error<E>where
E: Freeze,
impl<E> RefUnwindSafe for Error<E>where
E: RefUnwindSafe,
impl<E> Send for Error<E>where
E: Send,
impl<E> Sync for Error<E>where
E: Sync,
impl<E> Unpin for Error<E>where
E: Unpin,
impl<E> UnsafeUnpin for Error<E>where
E: UnsafeUnpin,
impl<E> UnwindSafe for Error<E>where
E: UnwindSafe,
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<E> ExternalError for E
impl<E> ExternalError for E
fn into_lua_err(self) -> Error
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more