Enum brane_ast::errors::LocationError
source · pub enum LocationError {
IllegalLocation {
range: TextRange,
},
OnNoLocation {
range: TextRange,
reasons: Vec<TextRange>,
},
NoLocation {
range: TextRange,
reasons: Vec<TextRange>,
},
}
Expand description
Defines errors that occur during location resolving.
Variants§
IllegalLocation
A location was not a literal string.
OnNoLocation
An On-structure combination already limited the locations too much.
NoLocation
The usage of On-structures and/or annotations caused a function to never-ever be able to run.
Implementations§
source§impl LocationError
impl LocationError
sourcepub fn prettyprint(&self, file: impl AsRef<str>, source: impl AsRef<str>)
pub fn prettyprint(&self, file: impl AsRef<str>, source: impl AsRef<str>)
Prints the warning in a pretty way to stderr.
§Arguments
file
: The ‘path’ of the file (or some other identifier) where the source text originates from.source
: The source text to read the debug range from.
sourcepub fn prettywrite(
&self,
writer: impl Write,
file: impl AsRef<str>,
source: impl AsRef<str>,
) -> Result<(), Error>
pub fn prettywrite( &self, writer: impl Write, file: impl AsRef<str>, source: impl AsRef<str>, ) -> Result<(), Error>
Prints the warning in a pretty way to the given Write
r.
§Arguments:
writer
: TheWrite
-enabled object to write to.file
: The ‘path’ of the file (or some other identifier) where the source text originates from.source
: The source text to read the debug range from.
§Errors
This function may error if we failed to write to the given writer.
Trait Implementations§
source§impl Debug for LocationError
impl Debug for LocationError
source§impl Display for LocationError
impl Display for LocationError
source§impl Error for LocationError
impl Error for LocationError
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<LocationError> for AstError
impl From<LocationError> for AstError
source§fn from(err: LocationError) -> Self
fn from(err: LocationError) -> Self
Converts to this type from the input type.
Auto Trait Implementations§
impl Freeze for LocationError
impl RefUnwindSafe for LocationError
impl Send for LocationError
impl Sync for LocationError
impl Unpin for LocationError
impl UnwindSafe for LocationError
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> Instrument for T
impl<T> Instrument for T
source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
source§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
Wrap the input message
T
in a tonic::Request