pub struct DiagnosticCode(/* private fields */);Expand description
A stable string identifier for a diagnostic.
Implementations§
Source§impl DiagnosticCode
impl DiagnosticCode
Sourcepub fn new(value: impl AsRef<str>) -> Result<Self, DiagnosticCodeError>
pub fn new(value: impl AsRef<str>) -> Result<Self, DiagnosticCodeError>
Creates a diagnostic code from a non-empty string after trimming surrounding whitespace.
§Errors
Returns DiagnosticCodeError::Empty when the trimmed value is empty.
Sourcepub fn into_string(self) -> String
pub fn into_string(self) -> String
Consumes the code and returns the owned string.
Trait Implementations§
Source§impl AsRef<str> for DiagnosticCode
impl AsRef<str> for DiagnosticCode
Source§impl Clone for DiagnosticCode
impl Clone for DiagnosticCode
Source§fn clone(&self) -> DiagnosticCode
fn clone(&self) -> DiagnosticCode
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 DiagnosticCode
impl Debug for DiagnosticCode
Source§impl Display for DiagnosticCode
impl Display for DiagnosticCode
Source§impl FromStr for DiagnosticCode
impl FromStr for DiagnosticCode
Source§impl Hash for DiagnosticCode
impl Hash for DiagnosticCode
Source§impl Ord for DiagnosticCode
impl Ord for DiagnosticCode
Source§fn cmp(&self, other: &DiagnosticCode) -> Ordering
fn cmp(&self, other: &DiagnosticCode) -> 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 DiagnosticCode
impl PartialEq for DiagnosticCode
Source§fn eq(&self, other: &DiagnosticCode) -> bool
fn eq(&self, other: &DiagnosticCode) -> bool
Tests for
self and other values to be equal, and is used by ==.Source§impl PartialOrd for DiagnosticCode
impl PartialOrd for DiagnosticCode
impl Eq for DiagnosticCode
impl StructuralPartialEq for DiagnosticCode
Auto Trait Implementations§
impl Freeze for DiagnosticCode
impl RefUnwindSafe for DiagnosticCode
impl Send for DiagnosticCode
impl Sync for DiagnosticCode
impl Unpin for DiagnosticCode
impl UnsafeUnpin for DiagnosticCode
impl UnwindSafe for DiagnosticCode
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