pub enum File {
FileId(u16),
Synthetic(u16),
}Expand description
The source site containing syntax.
FileId is the ordinary source-file identity. Keeping the identity behind
an enum lets the syntax model add distinct embedded or macro hygiene sites
without changing every span and token field.
Variants§
FileId(u16)
An ordinary source file registered under a compact process-local id.
Synthetic(u16)
Syntax constructed without a corresponding on-disk source file.
Implementations§
Source§impl File
impl File
Sourcepub fn fresh() -> Self
pub fn fresh() -> Self
Allocates a compact process-local file label.
The counter may recycle after all u16 values have been used. Source
snapshot identity is carried by the shared Source allocation, so a
recycled display label cannot make unrelated spans equal or joinable.
Trait Implementations§
impl Copy for File
impl Eq for File
impl StructuralPartialEq for File
Auto Trait Implementations§
impl Freeze for File
impl RefUnwindSafe for File
impl Send for File
impl Sync for File
impl Unpin for File
impl UnsafeUnpin for File
impl UnwindSafe for File
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