pub struct DiagnosticSourceId(/* private fields */);Expand description
A stable identifier for a source, file, buffer, document, or virtual source.
Implementations§
Source§impl DiagnosticSourceId
impl DiagnosticSourceId
Sourcepub fn new(
value: impl AsRef<str>,
) -> Result<DiagnosticSourceId, DiagnosticSourceIdError>
pub fn new( value: impl AsRef<str>, ) -> Result<DiagnosticSourceId, DiagnosticSourceIdError>
Creates a source identifier from non-empty text after trimming surrounding whitespace.
§Errors
Returns DiagnosticSourceIdError::Empty when the trimmed value is empty.
Sourcepub fn into_string(self) -> String
pub fn into_string(self) -> String
Consumes the source identifier and returns the owned string.
Trait Implementations§
Source§impl AsRef<str> for DiagnosticSourceId
impl AsRef<str> for DiagnosticSourceId
Source§impl Clone for DiagnosticSourceId
impl Clone for DiagnosticSourceId
Source§fn clone(&self) -> DiagnosticSourceId
fn clone(&self) -> DiagnosticSourceId
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · 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 DiagnosticSourceId
impl Debug for DiagnosticSourceId
Source§impl Display for DiagnosticSourceId
impl Display for DiagnosticSourceId
Source§impl FromStr for DiagnosticSourceId
impl FromStr for DiagnosticSourceId
Source§type Err = DiagnosticSourceIdError
type Err = DiagnosticSourceIdError
The associated error which can be returned from parsing.
Source§fn from_str(
value: &str,
) -> Result<DiagnosticSourceId, <DiagnosticSourceId as FromStr>::Err>
fn from_str( value: &str, ) -> Result<DiagnosticSourceId, <DiagnosticSourceId as FromStr>::Err>
Parses a string
s to return a value of this type. Read moreSource§impl Hash for DiagnosticSourceId
impl Hash for DiagnosticSourceId
Source§impl Ord for DiagnosticSourceId
impl Ord for DiagnosticSourceId
Source§fn cmp(&self, other: &DiagnosticSourceId) -> Ordering
fn cmp(&self, other: &DiagnosticSourceId) -> Ordering
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
Source§impl PartialEq for DiagnosticSourceId
impl PartialEq for DiagnosticSourceId
Source§fn eq(&self, other: &DiagnosticSourceId) -> bool
fn eq(&self, other: &DiagnosticSourceId) -> bool
Tests for
self and other values to be equal, and is used by ==.Source§impl PartialOrd for DiagnosticSourceId
impl PartialOrd for DiagnosticSourceId
impl Eq for DiagnosticSourceId
impl StructuralPartialEq for DiagnosticSourceId
Auto Trait Implementations§
impl Freeze for DiagnosticSourceId
impl RefUnwindSafe for DiagnosticSourceId
impl Send for DiagnosticSourceId
impl Sync for DiagnosticSourceId
impl Unpin for DiagnosticSourceId
impl UnsafeUnpin for DiagnosticSourceId
impl UnwindSafe for DiagnosticSourceId
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