pub struct FileId(/* private fields */);
Expand description
Identifier for a file,
Globally interned and thus cheap to copy, compare, and hash.
Implementations§
Source§impl FileId
impl FileId
pub fn new(path: impl Into<VirtualPath>) -> Self
Sourcepub fn fake(path: impl Into<VirtualPath>) -> Self
pub fn fake(path: impl Into<VirtualPath>) -> Self
Create a fake file id for a virtual path.
Always returns a new file id, no matter if the file is already in the interner.
pub fn path(&self) -> &'static VirtualPath
pub fn try_path(&self) -> Option<&'static VirtualPath>
Trait Implementations§
Source§impl Ord for FileId
impl Ord for FileId
Source§impl PartialOrd for FileId
impl PartialOrd for FileId
impl Copy for FileId
impl Eq for FileId
impl StructuralPartialEq for FileId
Auto Trait Implementations§
impl Freeze for FileId
impl RefUnwindSafe for FileId
impl Send for FileId
impl Sync for FileId
impl Unpin for FileId
impl UnwindSafe for FileId
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