pub struct PatternLocation {
pub file: PathBuf,
pub start_row: usize,
pub start_col: usize,
}Expand description
The file path and source position of a single pattern instance.
§Examples
use std::path::PathBuf;
use sdivi_patterns::catalog::PatternLocation;
let loc = PatternLocation { file: PathBuf::from("src/lib.rs"), start_row: 10, start_col: 4 };
assert_eq!(loc.start_row, 10);Fields§
§file: PathBufSource file path relative to the repository root.
start_row: usizeZero-indexed source row (line) of the pattern instance.
start_col: usizeZero-indexed source column of the pattern instance.
Trait Implementations§
Source§impl Clone for PatternLocation
impl Clone for PatternLocation
Source§fn clone(&self) -> PatternLocation
fn clone(&self) -> PatternLocation
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 PatternLocation
impl Debug for PatternLocation
Source§impl<'de> Deserialize<'de> for PatternLocation
impl<'de> Deserialize<'de> for PatternLocation
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl PartialEq for PatternLocation
impl PartialEq for PatternLocation
Source§fn eq(&self, other: &PatternLocation) -> bool
fn eq(&self, other: &PatternLocation) -> bool
Tests for
self and other values to be equal, and is used by ==.Source§impl Serialize for PatternLocation
impl Serialize for PatternLocation
impl StructuralPartialEq for PatternLocation
Auto Trait Implementations§
impl Freeze for PatternLocation
impl RefUnwindSafe for PatternLocation
impl Send for PatternLocation
impl Sync for PatternLocation
impl Unpin for PatternLocation
impl UnsafeUnpin for PatternLocation
impl UnwindSafe for PatternLocation
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more