pub struct SourceNamespace(/* private fields */);Expand description
A caller-coordinated source identity namespace.
Implementations§
Source§impl SourceNamespace
impl SourceNamespace
Sourcepub const UNKNOWN: Self
pub const UNKNOWN: Self
Represents an unknown/undefined source namespace.
This namespace can never represent a valid source file - it is only used to represent the fact that a source reference is invalid/unknown.
Sourcepub const fn new(namespace: NonZeroU32) -> Self
pub const fn new(namespace: NonZeroU32) -> Self
Construct a new SourceNamespace with the given unique identifier
Sourcepub fn new_unchecked(namespace: u32) -> Self
pub fn new_unchecked(namespace: u32) -> Self
Construct a new SourceNamespace with the given unique identifier
If the input value is 0, this will produce SourceNamespace::UNKNOWN which will result
in associated source identifiers to be treated as invalid/unresolvable
Sourcepub const fn is_unknown(self) -> bool
pub const fn is_unknown(self) -> bool
Returns true if this represents an invalid/unknown source namespace
Trait Implementations§
Source§impl Clone for SourceNamespace
impl Clone for SourceNamespace
impl Copy for SourceNamespace
Source§impl Debug for SourceNamespace
impl Debug for SourceNamespace
Source§impl Default for SourceNamespace
impl Default for SourceNamespace
Source§impl Display for SourceNamespace
impl Display for SourceNamespace
impl Eq for SourceNamespace
Source§impl Hash for SourceNamespace
impl Hash for SourceNamespace
Source§impl Ord for SourceNamespace
impl Ord for SourceNamespace
1.21.0 (const: unstable) · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
1.21.0 (const: unstable) · Source§fn min(self, other: Self) -> Selfwhere
Self: Sized,
fn min(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the minimum of two values. Read more
Source§impl PartialEq for SourceNamespace
impl PartialEq for SourceNamespace
Source§impl PartialOrd for SourceNamespace
impl PartialOrd for SourceNamespace
impl StructuralPartialEq for SourceNamespace
Auto Trait Implementations§
impl Forget for SourceNamespace
impl Freeze for SourceNamespace
impl Move for SourceNamespace
impl RefUnwindSafe for SourceNamespace
impl Send for SourceNamespace
impl Sync for SourceNamespace
impl Unpin for SourceNamespace
impl UnsafeUnpin for SourceNamespace
impl UnwindSafe for SourceNamespace
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