pub struct Diagnostic { /* private fields */ }Expand description
Correctable diagnostic returned by an operation engine.
Implementations§
Source§impl Diagnostic
impl Diagnostic
Sourcepub fn new(
code: impl Into<String>,
severity: DiagnosticSeverity,
message: impl Into<String>,
) -> Result<Self, ResultError>
pub fn new( code: impl Into<String>, severity: DiagnosticSeverity, message: impl Into<String>, ) -> Result<Self, ResultError>
Creates a validated diagnostic.
Sourcepub fn with_field(self, field: impl Into<String>) -> Result<Self, ResultError>
pub fn with_field(self, field: impl Into<String>) -> Result<Self, ResultError>
Adds the request field associated with the diagnostic.
Sourcepub fn with_next_action(
self,
next_action: impl Into<String>,
) -> Result<Self, ResultError>
pub fn with_next_action( self, next_action: impl Into<String>, ) -> Result<Self, ResultError>
Adds a bounded corrective next action.
Sourcepub fn code_id(&self) -> &DiagnosticCode
pub fn code_id(&self) -> &DiagnosticCode
Returns the typed stable diagnostic code.
Sourcepub const fn severity(&self) -> DiagnosticSeverity
pub const fn severity(&self) -> DiagnosticSeverity
Returns diagnostic severity.
Trait Implementations§
Source§impl Clone for Diagnostic
impl Clone for Diagnostic
Source§fn clone(&self) -> Diagnostic
fn clone(&self) -> Diagnostic
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 Diagnostic
impl Debug for Diagnostic
Source§impl<'de> Deserialize<'de> for Diagnostic
impl<'de> Deserialize<'de> for Diagnostic
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl JsonSchema for Diagnostic
impl JsonSchema for Diagnostic
Source§fn schema_id() -> Cow<'static, str>
fn schema_id() -> Cow<'static, str>
Returns a string that uniquely identifies the schema produced by this type. Read more
Source§fn json_schema(generator: &mut SchemaGenerator) -> Schema
fn json_schema(generator: &mut SchemaGenerator) -> Schema
Generates a JSON Schema for this type. Read more
Source§fn inline_schema() -> bool
fn inline_schema() -> bool
Whether JSON Schemas generated for this type should be included directly in parent schemas,
rather than being re-used where possible using the
$ref keyword. Read moreSource§impl PartialEq for Diagnostic
impl PartialEq for Diagnostic
Source§fn eq(&self, other: &Diagnostic) -> bool
fn eq(&self, other: &Diagnostic) -> bool
Tests for
self and other values to be equal, and is used by ==.Source§impl Serialize for Diagnostic
impl Serialize for Diagnostic
impl Eq for Diagnostic
impl StructuralPartialEq for Diagnostic
Auto Trait Implementations§
impl Freeze for Diagnostic
impl RefUnwindSafe for Diagnostic
impl Send for Diagnostic
impl Sync for Diagnostic
impl Unpin for Diagnostic
impl UnsafeUnpin for Diagnostic
impl UnwindSafe for Diagnostic
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,
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.