pub struct Ambiguity<T> {
pub input: String,
pub matches: Vec<T>,
}Expand description
The candidates a shorthand matched when more than one qualified.
Carries the offending input and every matching candidate in the order they
were encountered, so the caller can render an actionable “did you mean one of
…?” diagnostic. Held by value so it outlives the borrowed candidate iterator.
Fields§
§input: StringThe shorthand that matched more than one candidate.
matches: Vec<T>Every candidate whose key equalled input, in encounter order.
Trait Implementations§
impl<T: Eq> Eq for Ambiguity<T>
Source§impl<T: Debug + Display> Error for Ambiguity<T>
impl<T: Debug + Display> Error for Ambiguity<T>
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()
impl<T: PartialEq> StructuralPartialEq for Ambiguity<T>
Auto Trait Implementations§
impl<T> Freeze for Ambiguity<T>
impl<T> RefUnwindSafe for Ambiguity<T>where
T: RefUnwindSafe,
impl<T> Send for Ambiguity<T>where
T: Send,
impl<T> Sync for Ambiguity<T>where
T: Sync,
impl<T> Unpin for Ambiguity<T>where
T: Unpin,
impl<T> UnsafeUnpin for Ambiguity<T>
impl<T> UnwindSafe for Ambiguity<T>where
T: UnwindSafe,
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