pub struct SafeDiagnostic {
pub code: DiagnosticCode,
pub message: Option<String>,
}Expand description
Bounded safe diagnostic attached to terminals, cancellations, and events.
Fields§
§code: DiagnosticCodeClassification code.
message: Option<String>Optional pre-redacted detail (never prompts, secrets, or raw bodies).
Implementations§
Source§impl SafeDiagnostic
impl SafeDiagnostic
Sourcepub fn try_new(
code: impl Into<String>,
message: Option<impl Into<String>>,
max_message_bytes: usize,
) -> Result<Self, SafeDiagnosticError>
pub fn try_new( code: impl Into<String>, message: Option<impl Into<String>>, max_message_bytes: usize, ) -> Result<Self, SafeDiagnosticError>
Construct with optional message truncated to limits.
Sourcepub fn try_new_default(
code: impl Into<String>,
message: Option<impl Into<String>>,
) -> Result<Self, SafeDiagnosticError>
pub fn try_new_default( code: impl Into<String>, message: Option<impl Into<String>>, ) -> Result<Self, SafeDiagnosticError>
Construct using default transaction diagnostic byte budget.
Trait Implementations§
Source§impl Clone for SafeDiagnostic
impl Clone for SafeDiagnostic
Source§fn clone(&self) -> SafeDiagnostic
fn clone(&self) -> SafeDiagnostic
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 SafeDiagnostic
impl Debug for SafeDiagnostic
Source§impl<'de> Deserialize<'de> for SafeDiagnostic
impl<'de> Deserialize<'de> for SafeDiagnostic
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
impl Eq for SafeDiagnostic
Source§impl PartialEq for SafeDiagnostic
impl PartialEq for SafeDiagnostic
Source§impl Serialize for SafeDiagnostic
impl Serialize for SafeDiagnostic
impl StructuralPartialEq for SafeDiagnostic
Auto Trait Implementations§
impl Freeze for SafeDiagnostic
impl RefUnwindSafe for SafeDiagnostic
impl Send for SafeDiagnostic
impl Sync for SafeDiagnostic
impl Unpin for SafeDiagnostic
impl UnsafeUnpin for SafeDiagnostic
impl UnwindSafe for SafeDiagnostic
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