pub struct DynIdx { /* private fields */ }
Expand description
A simple idx in the code that can be used to track back to the original source location
Used in two places:
- In the
CallBody
to track the location of hotreloadable literals - In the
Body
to track the ID of each template
We need an ID system, unfortunately, to properly disambiguate between different templates since rustc assigns them all the same line!() and column!() information. Before, we hashed spans but that has collision issues and is eventually relied on specifics of proc macros that aren’t available in testing (like snapshot testing). So, we just need an ID for each of these items, hence this struct.
This is “transparent” to partialeq and eq, so it will always return true when compared to another DynIdx.
Implementations§
Trait Implementations§
impl Eq for DynIdx
Auto Trait Implementations§
impl !Freeze for DynIdx
impl !RefUnwindSafe for DynIdx
impl Send for DynIdx
impl !Sync for DynIdx
impl Unpin for DynIdx
impl UnwindSafe for DynIdx
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