pub struct HostFailure { /* private fields */ }Expand description
A host-stack failure observed inside lean-rs.
Constructed only by the crate; fields are private so the bounded-message invariant survives downstream pattern-matching.
Implementations§
Source§impl HostFailure
impl HostFailure
Sourcepub fn stage(&self) -> HostStage
pub fn stage(&self) -> HostStage
The host-stack stage that observed the failure.
This is the internal classification; reach for
Self::code when displaying a stable identifier or routing on
the caller-facing failure family. The HostStage tag may grow
new variants alongside new internal paths.
Sourcepub fn code(&self) -> LeanDiagnosticCode
pub fn code(&self) -> LeanDiagnosticCode
The stable diagnostic code matching this failure.
Recorded at the construction site rather than projected from
Self::stage, so the code identity does not drift if the
internal stage tag is later refined. Use this for stable
logging, metrics, or downstream error routing.
Sourcepub fn message(&self) -> &str
pub fn message(&self) -> &str
Developer-facing diagnostic, truncated to at most
LEAN_ERROR_MESSAGE_LIMIT bytes on a UTF-8 char boundary.
Trait Implementations§
Source§impl Clone for HostFailure
impl Clone for HostFailure
Source§fn clone(&self) -> HostFailure
fn clone(&self) -> HostFailure
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more