pub struct RecoveryDetails {
pub kind: &'static str,
pub error: String,
pub hint: String,
pub unsafe_condition: String,
pub would_change: String,
pub preserved: String,
pub recovery_commands: Option<Vec<String>>,
}Expand description
Structured recovery details that can cross the embeddable facade boundary.
Fields§
§kind: &'static str§error: String§hint: String§unsafe_condition: String§would_change: String§preserved: String§recovery_commands: Option<Vec<String>>Explicit, path-specific recovery commands. When present these override
the kind-keyed fallback the CLI envelope would otherwise reconstruct
(the first entry is the primary command). None = use the generic
per-kind recovery mapping.
Implementations§
Source§impl RecoveryDetails
impl RecoveryDetails
pub fn safety_refusal( kind: &'static str, error: impl Into<String>, hint: impl Into<String>, unsafe_condition: impl Into<String>, would_change: impl Into<String>, already_preserved: impl Into<String>, ) -> Self
Sourcepub fn with_recovery_commands(self, commands: Vec<String>) -> Self
pub fn with_recovery_commands(self, commands: Vec<String>) -> Self
Attach explicit, path-specific recovery commands (the first entry is the
primary command). Used where the callsite has context — e.g. a source
checkout path — that the kind-keyed CLI fallback cannot reconstruct.
pub fn invalid_usage( kind: &'static str, error: impl Into<String>, hint: impl Into<String>, ) -> Self
pub fn serialization_error(detail: impl Display) -> Self
pub fn repository_integrity_error(error: impl Into<String>) -> Self
pub fn repository_not_found(path: &Path) -> Self
pub fn state_not_found(state_id: impl Display) -> Self
Trait Implementations§
Source§impl Clone for RecoveryDetails
impl Clone for RecoveryDetails
Source§fn clone(&self) -> RecoveryDetails
fn clone(&self) -> RecoveryDetails
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 RecoveryDetails
impl Debug for RecoveryDetails
Source§impl Display for RecoveryDetails
impl Display for RecoveryDetails
Source§impl Error for RecoveryDetails
impl Error for RecoveryDetails
1.30.0 · Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
Returns the lower-level source of this error, if any. Read more
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
👎Deprecated since 1.42.0:
use the Display impl or to_string()
Source§impl PartialEq for RecoveryDetails
impl PartialEq for RecoveryDetails
impl StructuralPartialEq for RecoveryDetails
Auto Trait Implementations§
impl Freeze for RecoveryDetails
impl RefUnwindSafe for RecoveryDetails
impl Send for RecoveryDetails
impl Sync for RecoveryDetails
impl Unpin for RecoveryDetails
impl UnsafeUnpin for RecoveryDetails
impl UnwindSafe for RecoveryDetails
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