pub struct Tag {
pub rel_fname: String,
pub fname: String,
pub line: i32,
pub name: String,
pub kind: TagKind,
}Expand description
A tag extracted from source code (SPEC §2.1).
Field order is significant for derived PartialOrd/Ord:
tags sort by (rel_fname, fname, line, name, kind).
Fields§
§rel_fname: StringPath relative to repository root (SPEC §2.2)
fname: StringAbsolute path to file
line: i321-indexed line number, or -1 for fallback refs (SPEC §3.4)
name: StringThe identifier text
kind: TagKindDefinition or reference
Implementations§
Source§impl Tag
impl Tag
Sourcepub fn new(
rel_fname: impl Into<String>,
fname: impl Into<String>,
line: i32,
name: impl Into<String>,
kind: TagKind,
) -> Self
pub fn new( rel_fname: impl Into<String>, fname: impl Into<String>, line: i32, name: impl Into<String>, kind: TagKind, ) -> Self
Create a new tag.
Sourcepub fn def(
rel_fname: impl Into<String>,
fname: impl Into<String>,
line: i32,
name: impl Into<String>,
) -> Self
pub fn def( rel_fname: impl Into<String>, fname: impl Into<String>, line: i32, name: impl Into<String>, ) -> Self
Create a definition tag.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Tag
impl<'de> Deserialize<'de> for Tag
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 Tag
Source§impl Ord for Tag
impl Ord for Tag
1.21.0 (const: unstable) · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
Source§impl PartialOrd for Tag
impl PartialOrd for Tag
impl StructuralPartialEq for Tag
Auto Trait Implementations§
impl Freeze for Tag
impl RefUnwindSafe for Tag
impl Send for Tag
impl Sync for Tag
impl Unpin for Tag
impl UnsafeUnpin for Tag
impl UnwindSafe for Tag
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<Q, K> Comparable<K> for Q
impl<Q, K> Comparable<K> for Q
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.