pub enum SourceError {
Resolver(String),
Compiler {
code: CompilerErrorCode,
script_name: String,
message: String,
},
}Expand description
Errors returned while resolving or loading source files.
Variants§
Resolver(String)
The source resolver itself failed.
Compiler
The requested source file could not be loaded or violated a compiler rule.
Implementations§
Source§impl SourceError
impl SourceError
Sourcepub fn code(&self) -> Option<CompilerErrorCode>
pub fn code(&self) -> Option<CompilerErrorCode>
Returns the upstream compiler error code when this is a compiler failure.
Sourcepub fn file_not_found(script_name: impl Into<String>) -> Self
pub fn file_not_found(script_name: impl Into<String>) -> Self
Creates a file-not-found error.
Sourcepub fn include_recursive(script_name: impl Into<String>) -> Self
pub fn include_recursive(script_name: impl Into<String>) -> Self
Creates an include-recursive error.
Sourcepub fn include_too_many_levels(
script_name: impl Into<String>,
max_include_depth: usize,
) -> Self
pub fn include_too_many_levels( script_name: impl Into<String>, max_include_depth: usize, ) -> Self
Creates an include-too-many-levels error.
Trait Implementations§
Source§impl Clone for SourceError
impl Clone for SourceError
Source§fn clone(&self) -> SourceError
fn clone(&self) -> SourceError
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for SourceError
impl Debug for SourceError
Source§impl<'de> Deserialize<'de> for SourceError
impl<'de> Deserialize<'de> for SourceError
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl Display for SourceError
impl Display for SourceError
Source§impl Error for SourceError
impl Error for SourceError
1.30.0 · 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()
Source§impl From<SourceError> for CompilerSessionError
impl From<SourceError> for CompilerSessionError
Source§fn from(value: SourceError) -> Self
fn from(value: SourceError) -> Self
Converts to this type from the input type.
Source§impl From<SourceError> for LangSpecError
impl From<SourceError> for LangSpecError
Source§fn from(value: SourceError) -> Self
fn from(value: SourceError) -> Self
Converts to this type from the input type.
Source§impl From<SourceError> for PreprocessError
impl From<SourceError> for PreprocessError
Source§fn from(value: SourceError) -> Self
fn from(value: SourceError) -> Self
Converts to this type from the input type.
Source§impl PartialEq for SourceError
impl PartialEq for SourceError
Source§impl Serialize for SourceError
impl Serialize for SourceError
impl Eq for SourceError
impl StructuralPartialEq for SourceError
Auto Trait Implementations§
impl Freeze for SourceError
impl RefUnwindSafe for SourceError
impl Send for SourceError
impl Sync for SourceError
impl Unpin for SourceError
impl UnsafeUnpin for SourceError
impl UnwindSafe for SourceError
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.