pub enum ScriptError {
Parse {
line: usize,
message: String,
},
UnknownKeyword {
line: usize,
keyword: String,
context: &'static str,
},
MissingOutput,
NoStructures,
UnclosedBlock(&'static str),
Io {
path: PathBuf,
message: String,
},
Pack(PackError),
}Expand description
Errors produced by the script module — from parsing, file loading, or
the downstream pack() call invoked by a script-driven run.
Variants§
Parse
Parse error with line number and diagnostic message.
UnknownKeyword
An unrecognised keyword appeared where a known one was expected. Unlike a generic parse error, this carries the offending token and the context block so error messages can suggest fixes.
MissingOutput
Script is missing a required output keyword.
NoStructures
Script contains zero structure blocks.
UnclosedBlock(&'static str)
A structure or atoms block was not closed with end ….
Io
Reading or writing a molecular frame failed.
Pack(PackError)
The packer itself returned an error.
Trait Implementations§
Source§impl Debug for ScriptError
impl Debug for ScriptError
Source§impl Display for ScriptError
impl Display for ScriptError
Source§impl Error for ScriptError
impl Error for ScriptError
Source§fn source(&self) -> Option<&(dyn Error + 'static)>
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
fn description(&self) -> &str
👎Deprecated since 1.42.0:
use the Display impl or to_string()
Auto Trait Implementations§
impl Freeze for ScriptError
impl RefUnwindSafe for ScriptError
impl Send for ScriptError
impl Sync for ScriptError
impl Unpin for ScriptError
impl UnsafeUnpin for ScriptError
impl UnwindSafe for ScriptError
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
Mutably borrows from an owned value. Read more