pub struct SourceId(/* private fields */);
Expand description
A SourceId represents the index/identifier associated with a unique source file in a SourceManager implementation.
Implementations§
Source§impl SourceId
impl SourceId
pub const UNKNOWN: Self
Sourcepub fn new(id: u32) -> Self
pub fn new(id: u32) -> Self
Create a new SourceId from a u32
value, but assert if the value is reserved
Sourcepub const fn new_unchecked(id: u32) -> Self
pub const fn new_unchecked(id: u32) -> Self
Create a new SourceId from a raw u32
value
pub const fn to_usize(self) -> usize
pub const fn to_u32(self) -> u32
pub const fn is_unknown(&self) -> bool
Trait Implementations§
Source§impl<'de> Deserialize<'de> for SourceId
impl<'de> Deserialize<'de> for SourceId
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl Ord for SourceId
impl Ord for SourceId
Source§impl PartialOrd for SourceId
impl PartialOrd for SourceId
impl Copy for SourceId
impl Eq for SourceId
impl StructuralPartialEq for SourceId
Auto Trait Implementations§
impl Freeze for SourceId
impl RefUnwindSafe for SourceId
impl Send for SourceId
impl Sync for SourceId
impl Unpin for SourceId
impl UnwindSafe for SourceId
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