#[non_exhaustive]pub struct CroppedRegion {
pub text: String,
pub source_name: String,
pub start_line: usize,
pub end_line: usize,
pub location: Location,
}Expand description
Cropped YAML source window stored inside Error::WithSnippet.
The window is described in terms of the original (absolute) 1-based line numbers. This allows selecting the best-matching region for a particular error location.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.text: StringCropped source text used for snippet rendering.
source_name: StringSource name/path displayed in snippet headers.
start_line: usizeThe 1-based line number in the original input where text starts.
end_line: usizeThe 1-based line number in the original input where text ends (inclusive).
location: LocationThe location to point to in this region.
Implementations§
Trait Implementations§
Source§impl Clone for CroppedRegion
impl Clone for CroppedRegion
Source§fn clone(&self) -> CroppedRegion
fn clone(&self) -> CroppedRegion
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · 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 CroppedRegion
impl Debug for CroppedRegion
impl Eq for CroppedRegion
Source§impl PartialEq for CroppedRegion
impl PartialEq for CroppedRegion
impl StructuralPartialEq for CroppedRegion
Auto Trait Implementations§
impl Freeze for CroppedRegion
impl RefUnwindSafe for CroppedRegion
impl Send for CroppedRegion
impl Sync for CroppedRegion
impl Unpin for CroppedRegion
impl UnsafeUnpin for CroppedRegion
impl UnwindSafe for CroppedRegion
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