Enum pdbtbx::Context [−][src]
A struct to define the context of an error message
Variants
When no context can be given
When only a line (eg filename) can be shown
Fields of Show
line: String
The line to be shown to the user (eg filename)
When a full line is faulty and no special position can be annotated
Fields of FullLine
When a special position can be annotated on a line.
|
104 | ATOM O N MET A 1 27.251 24.447 2.594 1.00 11.79 N
| ^^^^
<- -><-->
The first space (annotated by <-
, ->
) is the offset, in this case 7. The
second space is the length, in this case 4.
Fields of Line
To show multiple lines where an error occurred.
Fields of Range
Implementations
impl Context
[src]
pub fn none() -> Context
[src]
Creates a new context when no context can be given
pub fn show(line: &str) -> Context
[src]
Creates a new context when only a line (eg filename) can be shown
pub fn full_line(linenumber: usize, line: &str) -> Context
[src]
Creates a new context when a full line is faulty and no special position can be annotated
pub fn line(
linenumber: usize,
line: &str,
offset: usize,
length: usize
) -> Context
[src]
linenumber: usize,
line: &str,
offset: usize,
length: usize
) -> Context
Creates a new context when a special position can be annotated on a line
pub fn position(pos: &Position<'_>) -> Context
[src]
Creates a new context to highlight a certain position
pub fn range(start: &Position<'_>, end: &Position<'_>) -> Context
[src]
Creates a new context from a start and end point within a single file
Trait Implementations
impl Clone for Context
[src]
impl Debug for Context
[src]
impl Display for Context
[src]
impl Eq for Context
[src]
impl PartialEq<Context> for Context
[src]
impl StructuralEq for Context
[src]
impl StructuralPartialEq for Context
[src]
Auto Trait Implementations
impl RefUnwindSafe for Context
impl Send for Context
impl Sync for Context
impl Unpin for Context
impl UnwindSafe for Context
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub fn clone_into(&self, target: &mut T)
[src]
impl<T> ToString for T where
T: Display + ?Sized,
[src]
T: Display + ?Sized,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,