Enum chalk_solve::solve::Solution [−][src]
pub enum Solution<I: Interner> { Unique(Canonical<ConstrainedSubst<I>>), Ambig(Guidance<I>), }
Expand description
A (possible) solution for a proposed goal.
Variants
Unique(Canonical<ConstrainedSubst<I>>)
The goal indeed holds, and there is a unique value for all existential variables. In this case, we also record a set of lifetime constraints which must also hold for the goal to be valid.
Ambig(Guidance<I>)
The goal may be provable in multiple ways, but regardless we may have some guidance for type inference. In this case, we don’t return any lifetime constraints, since we have not “committed” to any particular solution yet.
Implementations
impl<I: Interner> Solution<I>
[src]
impl<I: Interner> Solution<I>
[src]pub fn combine(self, other: Solution<I>, interner: &I) -> Solution<I>
[src]
pub fn combine(self, other: Solution<I>, interner: &I) -> Solution<I>
[src]There are multiple candidate solutions, which may or may not agree on the values for existential variables; attempt to combine them. This operation does not depend on the order of its arguments.
pub fn into_guidance(self) -> Guidance<I>
[src]
pub fn into_guidance(self) -> Guidance<I>
[src]View this solution purely in terms of type inference guidance
pub fn constrained_subst(
&self,
interner: &I
) -> Option<Canonical<ConstrainedSubst<I>>>
[src]
pub fn constrained_subst(
&self,
interner: &I
) -> Option<Canonical<ConstrainedSubst<I>>>
[src]Extract a constrained substitution from this solution, even if ambiguous.
pub fn definite_subst(
&self,
interner: &I
) -> Option<Canonical<ConstrainedSubst<I>>>
[src]
pub fn definite_subst(
&self,
interner: &I
) -> Option<Canonical<ConstrainedSubst<I>>>
[src]Determine whether this solution contains type information that must hold, and returns the subst in that case.
pub fn is_unique(&self) -> bool
[src]
pub fn is_ambig(&self) -> bool
[src]
pub fn display<'a>(&'a self, interner: &'a I) -> SolutionDisplay<'a, I>
[src]
Trait Implementations
impl<I: Interner> HasInterner for Solution<I>
[src]
impl<I: Interner> HasInterner for Solution<I>
[src]type Interner = I
type Interner = I
The interner associated with the type.
impl<I: Eq + Interner> Eq for Solution<I>
[src]
impl<I: Interner> StructuralEq for Solution<I>
[src]
impl<I: Interner> StructuralPartialEq for Solution<I>
[src]
Auto Trait Implementations
impl<I> RefUnwindSafe for Solution<I> where
<I as Interner>::InternedCanonicalVarKinds: RefUnwindSafe,
<I as Interner>::InternedConstraints: RefUnwindSafe,
<I as Interner>::InternedSubstitution: RefUnwindSafe,
<I as Interner>::InternedCanonicalVarKinds: RefUnwindSafe,
<I as Interner>::InternedConstraints: RefUnwindSafe,
<I as Interner>::InternedSubstitution: RefUnwindSafe,
impl<I> Send for Solution<I> where
<I as Interner>::InternedCanonicalVarKinds: Send,
<I as Interner>::InternedConstraints: Send,
<I as Interner>::InternedSubstitution: Send,
<I as Interner>::InternedCanonicalVarKinds: Send,
<I as Interner>::InternedConstraints: Send,
<I as Interner>::InternedSubstitution: Send,
impl<I> Sync for Solution<I> where
<I as Interner>::InternedCanonicalVarKinds: Sync,
<I as Interner>::InternedConstraints: Sync,
<I as Interner>::InternedSubstitution: Sync,
<I as Interner>::InternedCanonicalVarKinds: Sync,
<I as Interner>::InternedConstraints: Sync,
<I as Interner>::InternedSubstitution: Sync,
impl<I> Unpin for Solution<I> where
<I as Interner>::InternedCanonicalVarKinds: Unpin,
<I as Interner>::InternedConstraints: Unpin,
<I as Interner>::InternedSubstitution: Unpin,
<I as Interner>::InternedCanonicalVarKinds: Unpin,
<I as Interner>::InternedConstraints: Unpin,
<I as Interner>::InternedSubstitution: Unpin,
impl<I> UnwindSafe for Solution<I> where
<I as Interner>::InternedCanonicalVarKinds: UnwindSafe,
<I as Interner>::InternedConstraints: UnwindSafe,
<I as Interner>::InternedSubstitution: UnwindSafe,
<I as Interner>::InternedCanonicalVarKinds: UnwindSafe,
<I as Interner>::InternedConstraints: UnwindSafe,
<I as Interner>::InternedSubstitution: UnwindSafe,
Blanket Implementations
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]pub fn borrow_mut(&mut self) -> &mut T
[src]
pub fn borrow_mut(&mut self) -> &mut T
[src]Mutably borrows from an owned value. Read more
impl<T> Cast for T
[src]
impl<T> Cast for T
[src]fn cast<U>(self, interner: &<U as HasInterner>::Interner) -> U where
Self: CastTo<U>,
U: HasInterner,
[src]
fn cast<U>(self, interner: &<U as HasInterner>::Interner) -> U where
Self: CastTo<U>,
U: HasInterner,
[src]Cast a value to type U
using CastTo
.
impl<Q, K> Equivalent<K> for Q where
K: Borrow<Q> + ?Sized,
Q: Eq + ?Sized,
[src]
impl<Q, K> Equivalent<K> for Q where
K: Borrow<Q> + ?Sized,
Q: Eq + ?Sized,
[src]pub fn equivalent(&self, key: &K) -> bool
[src]
pub fn equivalent(&self, key: &K) -> bool
[src]Compare self to key
and return true
if they are equal.
impl<T> Instrument for T
[src]
impl<T> Instrument for T
[src]fn instrument(self, span: Span) -> Instrumented<Self>
[src]
fn instrument(self, span: Span) -> Instrumented<Self>
[src]Instruments this type with the provided Span
, returning an
Instrumented
wrapper. Read more
fn in_current_span(self) -> Instrumented<Self>
[src]
fn in_current_span(self) -> Instrumented<Self>
[src]impl<T> ToOwned for T where
T: Clone,
[src]
impl<T> ToOwned for T where
T: Clone,
[src]type Owned = T
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub fn to_owned(&self) -> T
[src]Creates owned data from borrowed data, usually by cloning. Read more
pub fn clone_into(&self, target: &mut T)
[src]
pub fn clone_into(&self, target: &mut T)
[src]🔬 This is a nightly-only experimental API. (toowned_clone_into
)
recently added
Uses borrowed data to replace owned data, usually by cloning. Read more