Struct rustc_utils::source_map::filename::FilenameIndex
source · pub struct FilenameIndex { /* private fields */ }
Implementations§
source§impl FilenameIndex
impl FilenameIndex
sourcepub const MAX_AS_U32: u32 = 4_294_967_040u32
pub const MAX_AS_U32: u32 = 4_294_967_040u32
Maximum value the index can take, as a u32
.
sourcepub const fn from_usize(value: usize) -> Self
pub const fn from_usize(value: usize) -> Self
sourcepub const unsafe fn from_u32_unchecked(value: u32) -> Self
pub const unsafe fn from_u32_unchecked(value: u32) -> Self
Creates a new index from a given u32
.
Safety
The provided value must be less than or equal to the maximum value for the newtype. Providing a value outside this range is undefined due to layout restrictions.
Prefer using from_u32
.
source§impl FilenameIndex
impl FilenameIndex
pub fn find_source_file(self, source_map: &SourceMap) -> Result<Lrc<SourceFile>>
Trait Implementations§
source§impl Add<usize> for FilenameIndex
impl Add<usize> for FilenameIndex
source§impl Clone for FilenameIndex
impl Clone for FilenameIndex
source§fn clone(&self) -> FilenameIndex
fn clone(&self) -> FilenameIndex
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresource§impl Debug for FilenameIndex
impl Debug for FilenameIndex
source§impl From<FilenameIndex> for u32
impl From<FilenameIndex> for u32
source§fn from(v: FilenameIndex) -> u32
fn from(v: FilenameIndex) -> u32
Converts to this type from the input type.
source§impl From<FilenameIndex> for usize
impl From<FilenameIndex> for usize
source§fn from(v: FilenameIndex) -> usize
fn from(v: FilenameIndex) -> usize
Converts to this type from the input type.
source§impl From<u32> for FilenameIndex
impl From<u32> for FilenameIndex
source§impl From<usize> for FilenameIndex
impl From<usize> for FilenameIndex
source§impl Hash for FilenameIndex
impl Hash for FilenameIndex
source§impl Idx for FilenameIndex
impl Idx for FilenameIndex
source§impl PartialEq for FilenameIndex
impl PartialEq for FilenameIndex
source§fn eq(&self, other: &FilenameIndex) -> bool
fn eq(&self, other: &FilenameIndex) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.source§impl Serialize for FilenameIndex
impl Serialize for FilenameIndex
impl Copy for FilenameIndex
impl Eq for FilenameIndex
impl StructuralEq for FilenameIndex
impl StructuralPartialEq for FilenameIndex
Auto Trait Implementations§
impl RefUnwindSafe for FilenameIndex
impl Send for FilenameIndex
impl Sync for FilenameIndex
impl Unpin for FilenameIndex
impl UnwindSafe for FilenameIndex
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