pub struct Match {Show 14 fields
pub content: Option<ContentId>,
pub id: MatchId,
pub path: RelPath,
pub language: LanguageId,
pub span: Span,
pub start: Position,
pub end: Position,
pub kind: String,
pub text: String,
pub line: String,
pub captures: BTreeMap<String, CaptureValue>,
pub symbol: Option<Symbol>,
pub role: Role,
pub address: Option<Address>,
}Fields§
§content: Option<ContentId>Complete source version; absent only in older serialized matches.
id: MatchId§path: RelPath§language: LanguageId§span: Span§start: Position§end: Position§kind: String§text: String§line: StringThe source line on which the match starts, for display in context.
captures: BTreeMap<String, CaptureValue>§symbol: Option<Symbol>§role: Role§address: Option<Address>For a declaration in an addressable file: its module address, the
value outline gives it. Filled by the engine, which has the project.
Implementations§
Source§impl Match
impl Match
pub fn anchor(&self) -> Option<SourceAnchor>
pub fn capture(&self, name: &str) -> Option<&CaptureValue>
Sourcepub fn line_count(&self) -> u32
pub fn line_count(&self) -> u32
Number of lines the match spans.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Match
impl<'de> Deserialize<'de> for Match
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
impl Eq for Match
impl StructuralPartialEq for Match
Auto Trait Implementations§
impl Freeze for Match
impl RefUnwindSafe for Match
impl Send for Match
impl Sync for Match
impl Unpin for Match
impl UnsafeUnpin for Match
impl UnwindSafe for Match
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,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
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