Struct pex::CustomError
source · pub struct CustomError<'i> {
pub message: &'i str,
pub start: usize,
pub end: usize,
}
Expand description
A custom error message
Fields§
§message: &'i str
The error message
start: usize
The start offset of the location where the error occurred
end: usize
The end offset of the location where the error occurred
Implementations§
source§impl<'i> CustomError<'i>
impl<'i> CustomError<'i>
sourcepub const fn range(&self) -> Range<usize>
pub const fn range(&self) -> Range<usize>
Create a new CustomError
Trait Implementations§
source§impl<'i> Clone for CustomError<'i>
impl<'i> Clone for CustomError<'i>
source§fn clone(&self) -> CustomError<'i>
fn clone(&self) -> CustomError<'i>
Returns a copy 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<'i> Debug for CustomError<'i>
impl<'i> Debug for CustomError<'i>
source§impl<'i> Display for CustomError<'i>
impl<'i> Display for CustomError<'i>
source§impl<'i> Error for CustomError<'i>
impl<'i> Error for CustomError<'i>
1.30.0 · source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
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<CustomError<'static>> for StopBecause
impl From<CustomError<'static>> for StopBecause
source§fn from(value: CustomError<'static>) -> Self
fn from(value: CustomError<'static>) -> Self
Converts to this type from the input type.
source§impl<'i> Hash for CustomError<'i>
impl<'i> Hash for CustomError<'i>
source§impl<'i> PartialEq<CustomError<'i>> for CustomError<'i>
impl<'i> PartialEq<CustomError<'i>> for CustomError<'i>
source§fn eq(&self, other: &CustomError<'i>) -> bool
fn eq(&self, other: &CustomError<'i>) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.impl<'i> Copy for CustomError<'i>
impl<'i> Eq for CustomError<'i>
impl<'i> StructuralEq for CustomError<'i>
impl<'i> StructuralPartialEq for CustomError<'i>
Auto Trait Implementations§
impl<'i> RefUnwindSafe for CustomError<'i>
impl<'i> Send for CustomError<'i>
impl<'i> Sync for CustomError<'i>
impl<'i> Unpin for CustomError<'i>
impl<'i> UnwindSafe for CustomError<'i>
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