pub struct DefSite {
pub path: &'static str,
pub key: &'static str,
}Expand description
Describes the source code where something is defined.
This does not include a concrete line number because, due to the way Rust
macros expand, a #[func] item in a #[scope] impl receives the line of
the full impl, which is not so useful. Rather, a per-file unique key is used
to find the element. Identifiers of a semantical parent may also be used in
this key. This has the added benefit that we can reliably find the
definition site in the presence of edits (for hot reload).
Fields§
§path: &'static strThe path to the file as returned by the file!() macro.
Note that the path separator may vary across platforms.
key: &'static strAn identifying key associated with the definition. Can be used to find the definition in the file.
Trait Implementations§
impl Copy for DefSite
impl Eq for DefSite
impl StructuralPartialEq for DefSite
Auto Trait Implementations§
impl Freeze for DefSite
impl RefUnwindSafe for DefSite
impl Send for DefSite
impl Sync for DefSite
impl Unpin for DefSite
impl UnsafeUnpin for DefSite
impl UnwindSafe for DefSite
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