pub struct SerializableDiagnostic {
pub severity: Severity,
pub code: Option<String>,
pub message: String,
pub primary: Option<Location>,
pub hint: Option<String>,
pub source_chain: Vec<String>,
}Expand description
Serializable diagnostic for cross-language boundaries
This type is used when diagnostics need to be serialized and sent across
FFI boundaries (e.g., Python, WASM). Unlike Diagnostic, it does not
contain the non-serializable source field, but instead includes a
flattened source_chain for display purposes.
Fields§
§severity: SeverityError severity level
code: Option<String>Optional error code (e.g., “E001”, “typst::syntax”)
message: StringHuman-readable error message
primary: Option<Location>Primary source location
hint: Option<String>Optional hint for fixing the error
source_chain: Vec<String>Source chain as list of strings (for display purposes)
Trait Implementations§
Source§impl Clone for SerializableDiagnostic
impl Clone for SerializableDiagnostic
Source§fn clone(&self) -> SerializableDiagnostic
fn clone(&self) -> SerializableDiagnostic
Returns a duplicate of the value. Read more
1.0.0 · 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 SerializableDiagnostic
impl Debug for SerializableDiagnostic
Source§impl<'de> Deserialize<'de> for SerializableDiagnostic
impl<'de> Deserialize<'de> for SerializableDiagnostic
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 From<&Diagnostic> for SerializableDiagnostic
impl From<&Diagnostic> for SerializableDiagnostic
Source§fn from(diag: &Diagnostic) -> Self
fn from(diag: &Diagnostic) -> Self
Converts to this type from the input type.
Source§impl From<Diagnostic> for SerializableDiagnostic
impl From<Diagnostic> for SerializableDiagnostic
Source§fn from(diag: Diagnostic) -> Self
fn from(diag: Diagnostic) -> Self
Converts to this type from the input type.
Auto Trait Implementations§
impl Freeze for SerializableDiagnostic
impl RefUnwindSafe for SerializableDiagnostic
impl Send for SerializableDiagnostic
impl Sync for SerializableDiagnostic
impl Unpin for SerializableDiagnostic
impl UnwindSafe for SerializableDiagnostic
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