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