pub struct DocLink {
pub range: SourceRange,
pub target: String,
}Expand description
A symbol reference written in a doc comment — Rust’s [`Widget::grow`].
C++ has no such syntax, and a documentation comment is where a reader most often wants one: the sentence that
says “see Widget::grow” is asking for a jump, and every other place a name is written already has one. The
spelling is Rust’s because it is unambiguous in prose: an array index (a[0]) is not backticked, and a code
span (`Widget`) has no bracket around it.
range is the target spelling, between the backticks, in the file’s own coordinates. The brackets and
backticks are the syntax around it and are not part of the answer: a consumer that highlights the range draws
the name, and one that resolves it asks about the name.
Fields§
§range: SourceRange§target: StringThe spelling between the backticks, as written — Widget::grow, std::vector, operator==.
Trait Implementations§
impl Eq for DocLink
impl StructuralPartialEq for DocLink
Auto Trait Implementations§
impl Forget for DocLink
impl Freeze for DocLink
impl Move for DocLink
impl RefUnwindSafe for DocLink
impl Send for DocLink
impl Sync for DocLink
impl Unpin for DocLink
impl UnsafeUnpin for DocLink
impl UnwindSafe for DocLink
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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
key and return true if they are equal.Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
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> ⓘ
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> ⓘ
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