pub struct Suggestion {
pub path: String,
pub kind: String,
}Expand description
One ranked --suggest alternative.
The ranker used to hand back Vec<String> already formatted as
"option::Option::unwrap (method)", and the only place those strings ever
landed was inside error.message. An agent that wanted the alternatives had
to split on "; suggestions: ", split again on ", " and then regex the
trailing "(kind)" off each entry — parsing prose the CLI had just built out
of data it already held. Keeping the pair typed lets
crate::render::error_envelope publish error.suggestions while the two
renderers keep composing the same sentence for humans, from one source.
Fields§
§path: StringItem path to retype, without the crate prefix (option::Option::unwrap).
kind: StringCLI kind the caller would pass alongside path (method, variant, …).
This is the kind the caller would retype, not the rustdoc anchor family:
labelling an associated type (method) would send them straight back into
the same not-found.
Implementations§
Trait Implementations§
Source§impl Clone for Suggestion
impl Clone for Suggestion
Source§impl Debug for Suggestion
impl Debug for Suggestion
impl Eq for Suggestion
Source§impl PartialEq for Suggestion
impl PartialEq for Suggestion
Source§impl Serialize for Suggestion
impl Serialize for Suggestion
impl StructuralPartialEq for Suggestion
Auto Trait Implementations§
impl Freeze for Suggestion
impl RefUnwindSafe for Suggestion
impl Send for Suggestion
impl Sync for Suggestion
impl Unpin for Suggestion
impl UnsafeUnpin for Suggestion
impl UnwindSafe for Suggestion
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.