pub struct ViewRefusal { /* private fields */ }Expand description
One or more diagnostics, gathered as a refusal.
A refusal renders every diagnostic through
crate::error::render_diagnostics, the one renderer tix link and
tix parent set already share, so a user who learned one refusal format does
not have to learn a second.
Implementations§
Source§impl ViewRefusal
impl ViewRefusal
Sourcepub fn from_diagnostics(diagnostics: Vec<ViewDiagnostic>) -> Self
pub fn from_diagnostics(diagnostics: Vec<ViewDiagnostic>) -> Self
Gather a non-empty diagnostic set.
§Panics
Panics on an empty set: a refusal with no diagnostic cannot explain itself, and the callers that build one always have at least one reason.
Sourcepub fn from_diagnostic(diagnostic: ViewDiagnostic) -> Self
pub fn from_diagnostic(diagnostic: ViewDiagnostic) -> Self
Refuse with one diagnostic.
Sourcepub fn diagnostics(&self) -> &[ViewDiagnostic]
pub fn diagnostics(&self) -> &[ViewDiagnostic]
Every diagnostic, in the order the operation produced them.
Sourcepub fn kind(&self) -> ViewDiagnosticKind
pub fn kind(&self) -> ViewDiagnosticKind
The first diagnostic’s kind — what a surface switches on for one line.
Trait Implementations§
Source§impl Clone for ViewRefusal
impl Clone for ViewRefusal
Source§impl Debug for ViewRefusal
impl Debug for ViewRefusal
Source§impl Display for ViewRefusal
impl Display for ViewRefusal
impl Eq for ViewRefusal
Source§impl Error for ViewRefusal
impl Error for ViewRefusal
1.30.0 · Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
Returns the lower-level source of this error, if any. Read more
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
👎Deprecated since 1.42.0:
use the Display impl or to_string()
Source§impl From<ViewDiagnostic> for ViewRefusal
impl From<ViewDiagnostic> for ViewRefusal
Source§fn from(diagnostic: ViewDiagnostic) -> Self
fn from(diagnostic: ViewDiagnostic) -> Self
Converts to this type from the input type.
Source§impl From<ViewRefusal> for ViewWriteError
impl From<ViewRefusal> for ViewWriteError
Source§fn from(refusal: ViewRefusal) -> Self
fn from(refusal: ViewRefusal) -> Self
Converts to this type from the input type.
Source§impl PartialEq for ViewRefusal
impl PartialEq for ViewRefusal
impl StructuralPartialEq for ViewRefusal
Auto Trait Implementations§
impl Freeze for ViewRefusal
impl RefUnwindSafe for ViewRefusal
impl Send for ViewRefusal
impl Sync for ViewRefusal
impl Unpin for ViewRefusal
impl UnsafeUnpin for ViewRefusal
impl UnwindSafe for ViewRefusal
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§impl<T> ToCompactString for Twhere
T: Display,
impl<T> ToCompactString for Twhere
T: Display,
Source§fn try_to_compact_string(&self) -> Result<CompactString, ToCompactStringError>
fn try_to_compact_string(&self) -> Result<CompactString, ToCompactStringError>
Fallible version of
ToCompactString::to_compact_string() Read moreSource§fn to_compact_string(&self) -> CompactString
fn to_compact_string(&self) -> CompactString
Converts the given value to a
CompactString. Read more