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