pub struct Problem {
pub worktree_locations: Option<Box<WorktreeLocations>>,
pub code: ProblemCode,
pub message: String,
pub remedy: String,
pub project_remedy: Option<Box<ProjectRemedy>>,
pub repositories: Vec<PathBuf>,
pub detail: Option<Box<ProblemDetail>>,
}Expand description
Classified failure with diagnostic text and optional recovery guidance.
Fields§
§worktree_locations: Option<Box<WorktreeLocations>>Paths associated with a worktree relationship problem.
code: ProblemCodeStable machine-readable diagnostic classification.
message: StringHuman-readable explanation for the caller.
remedy: StringSuggested action for resolving the problem.
project_remedy: Option<Box<ProjectRemedy>>Structured project selection or naming guidance.
repositories: Vec<PathBuf>Repositories affected by this diagnostic, for presentation by native path.
detail: Option<Box<ProblemDetail>>Additional presentation facts available for this failure.
Implementations§
Source§impl Problem
impl Problem
Sourcepub fn new(code: ProblemCode, message: impl Into<String>) -> Self
pub fn new(code: ProblemCode, message: impl Into<String>) -> Self
Create a classified diagnostic with the supplied message.
Sourcepub fn remedy(self, remedy: impl Into<String>) -> Self
pub fn remedy(self, remedy: impl Into<String>) -> Self
Attach a suggested next step for the caller.
Sourcepub fn in_repository(self, path: &Path) -> Self
pub fn in_repository(self, path: &Path) -> Self
Identify the repository associated with a diagnostic.
Trait Implementations§
Source§impl Error for Problem
impl Error for Problem
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()
Auto Trait Implementations§
impl Forget for Problem
impl Freeze for Problem
impl Move for Problem
impl RefUnwindSafe for Problem
impl Send for Problem
impl Sync for Problem
impl Unpin for Problem
impl UnsafeUnpin for Problem
impl UnwindSafe for Problem
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