pub enum RenderError {
EngineCreation {
diags: Vec<Diagnostic>,
},
InvalidPayload {
diags: Vec<Diagnostic>,
},
CompilationFailed {
diags: Vec<Diagnostic>,
},
FormatNotSupported {
diags: Vec<Diagnostic>,
},
UnsupportedBackend {
diags: Vec<Diagnostic>,
},
ValidationFailed {
diags: Vec<Diagnostic>,
},
QuillConfig {
diags: Vec<Diagnostic>,
},
QuillMismatch {
diags: Vec<Diagnostic>,
},
}Expand description
Main error type for rendering operations.
Every variant carries a non-empty diags: Vec<Diagnostic>. Variants whose
failure is inherently a single diagnostic still carry a one-element vector
— the uniform shape lets every consumer, and every language binding,
handle all rendering errors through a single code path. See
RenderError::diagnostics and RenderError::into_diagnostics. The
variant itself records the kind of failure (which bindings map to typed
exceptions); the payload is always just the diagnostics.
Variants§
EngineCreation
Failed to create rendering engine.
Fields
diags: Vec<Diagnostic>Diagnostics describing the failure. Always non-empty.
InvalidPayload
Invalid YAML in a card-yaml block.
Fields
diags: Vec<Diagnostic>Diagnostics describing the failure. Always non-empty.
CompilationFailed
Backend compilation failed with one or more errors.
Fields
diags: Vec<Diagnostic>All compilation diagnostics. Always non-empty.
FormatNotSupported
Requested output format not supported by backend.
Fields
diags: Vec<Diagnostic>Diagnostics describing the failure. Always non-empty.
UnsupportedBackend
Backend not registered with engine.
Fields
diags: Vec<Diagnostic>Diagnostics describing the failure. Always non-empty.
ValidationFailed
Validation failed for parsed document — may carry multiple diagnostics
when several problems are detected during a single validation pass
(e.g. multiple missing required fields). Each diagnostic should set
path to anchor the error at a specific location in the document model.
Fields
diags: Vec<Diagnostic>All validation diagnostics. Always non-empty.
QuillConfig
Quill configuration error — may carry multiple diagnostics when several problems are detected during parsing (e.g. several unknown keys at once).
Fields
diags: Vec<Diagnostic>All configuration diagnostics. Always non-empty.
QuillMismatch
The document was rendered with a quill that does not satisfy its $quill
reference — a different name (quill::name_mismatch) or a version
outside the selector (quill::version_mismatch). Distinct from
ValidationFailed: the document is
well-formed; it was paired with the wrong quill.
Fields
diags: Vec<Diagnostic>The mismatch diagnostic. Always non-empty.
Implementations§
Source§impl RenderError
impl RenderError
Sourcepub fn diagnostics(&self) -> &[Diagnostic]
pub fn diagnostics(&self) -> &[Diagnostic]
Returns all diagnostics for this error. Always non-empty.
Sourcepub fn into_diagnostics(self) -> Vec<Diagnostic>
pub fn into_diagnostics(self) -> Vec<Diagnostic>
Consume the error and return its diagnostics.
Trait Implementations§
Source§impl Debug for RenderError
impl Debug for RenderError
Source§impl Display for RenderError
impl Display for RenderError
Source§impl Error for RenderError
impl Error for RenderError
1.30.0 · Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
use the Display impl or to_string()