#[non_exhaustive]pub enum SourceMapError {
Show 13 variants
GlobalVariableCount {
expected: usize,
found: usize,
},
PlayerVariableCount {
expected: usize,
found: usize,
},
SubroutineCount {
expected: usize,
found: usize,
},
RuleCount {
expected: usize,
found: usize,
},
ConditionCount {
rule: usize,
expected: usize,
found: usize,
},
ActionCount {
rule: usize,
expected: usize,
found: usize,
},
InvalidPosition,
DuplicateEntry,
EmptyEntry,
UnknownFile(usize),
InvalidSpan(Span),
UnsupportedFormat(String),
Malformed(String),
}Expand description
A failure while decoding or applying a SourceMap.
A failed SourceMap::apply leaves the program unchanged.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
GlobalVariableCount
PlayerVariableCount
SubroutineCount
RuleCount
ConditionCount
ActionCount
InvalidPosition
An entry addresses a node outside the program shape.
DuplicateEntry
Two entries map the same node.
EmptyEntry
A declaration entry carries neither a span nor a name span.
UnknownFile(usize)
A span references a file outside the file table.
InvalidSpan(Span)
A span is not a valid 1-based interval.
UnsupportedFormat(String)
The artifact declares a format other than workshop-rs/mapped-text-v1.
Malformed(String)
The artifact is not well-formed JSON of the expected structure.
Trait Implementations§
Source§impl Clone for SourceMapError
impl Clone for SourceMapError
Source§impl Debug for SourceMapError
impl Debug for SourceMapError
Source§impl Display for SourceMapError
impl Display for SourceMapError
impl Eq for SourceMapError
Source§impl Error for SourceMapError
impl Error for SourceMapError
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 PartialEq for SourceMapError
impl PartialEq for SourceMapError
impl StructuralPartialEq for SourceMapError
Auto Trait Implementations§
impl Freeze for SourceMapError
impl RefUnwindSafe for SourceMapError
impl Send for SourceMapError
impl Sync for SourceMapError
impl Unpin for SourceMapError
impl UnsafeUnpin for SourceMapError
impl UnwindSafe for SourceMapError
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