pub type Constraints = Constraints<Interner>;
Aliased Type§
struct Constraints { /* private fields */ }
Implementations
§impl<I> Constraints<I>where
I: Interner,
impl<I> Constraints<I>where
I: Interner,
pub fn from_fallible<E>(
interner: I,
elements: impl IntoIterator<Item = Result<impl CastTo<InEnvironment<Constraint<I>>>, E>>,
) -> Result<Constraints<I>, E>
pub fn from_fallible<E>( interner: I, elements: impl IntoIterator<Item = Result<impl CastTo<InEnvironment<Constraint<I>>>, E>>, ) -> Result<Constraints<I>, E>
Tries to create a sequence using an iterator of element-like things.
pub fn from_iter(
interner: I,
elements: impl IntoIterator<Item = impl CastTo<InEnvironment<Constraint<I>>>>,
) -> Constraints<I>
pub fn from_iter( interner: I, elements: impl IntoIterator<Item = impl CastTo<InEnvironment<Constraint<I>>>>, ) -> Constraints<I>
Create a sequence from elements
pub fn from1(
interner: I,
element: impl CastTo<InEnvironment<Constraint<I>>>,
) -> Constraints<I>
pub fn from1( interner: I, element: impl CastTo<InEnvironment<Constraint<I>>>, ) -> Constraints<I>
Create a sequence from a single element.
§impl<I> Constraints<I>where
I: Interner,
impl<I> Constraints<I>where
I: Interner,
pub fn interned(&self) -> &<I as Interner>::InternedConstraints
pub fn interned(&self) -> &<I as Interner>::InternedConstraints
Get the interned elements.
pub fn as_slice(&self, interner: I) -> &[InEnvironment<Constraint<I>>]
pub fn as_slice(&self, interner: I) -> &[InEnvironment<Constraint<I>>]
Returns a slice containing the elements.
pub fn at(&self, interner: I, index: usize) -> &InEnvironment<Constraint<I>>
pub fn at(&self, interner: I, index: usize) -> &InEnvironment<Constraint<I>>
Index into the sequence.
pub fn empty(interner: I) -> Constraints<I>
pub fn empty(interner: I) -> Constraints<I>
Create an empty sequence.
Trait Implementations
§impl<I> HasInterner for Constraints<I>where
I: Interner,
impl<I> HasInterner for Constraints<I>where
I: Interner,
§impl<I> Ord for Constraints<I>
impl<I> Ord for Constraints<I>
§impl<I> PartialOrd for Constraints<I>where
I: PartialOrd + Interner,
<I as Interner>::InternedConstraints: PartialOrd,
impl<I> PartialOrd for Constraints<I>where
I: PartialOrd + Interner,
<I as Interner>::InternedConstraints: PartialOrd,
§impl<I> TypeFoldable<I> for Constraints<I>where
I: Interner,
impl<I> TypeFoldable<I> for Constraints<I>where
I: Interner,
§fn try_fold_with<E>(
self,
folder: &mut dyn FallibleTypeFolder<I, Error = E>,
outer_binder: DebruijnIndex,
) -> Result<Constraints<I>, E>
fn try_fold_with<E>( self, folder: &mut dyn FallibleTypeFolder<I, Error = E>, outer_binder: DebruijnIndex, ) -> Result<Constraints<I>, E>
Apply the given folder
folder
to self
; binders
is the
number of binders that are in scope when beginning the
folder. Typically binders
starts as 0, but is adjusted when
we encounter Binders<T>
in the IR or other similar
constructs.§fn fold_with(
self,
folder: &mut dyn TypeFolder<I, Error = Infallible>,
outer_binder: DebruijnIndex,
) -> Self
fn fold_with( self, folder: &mut dyn TypeFolder<I, Error = Infallible>, outer_binder: DebruijnIndex, ) -> Self
A convenient alternative to
try_fold_with
for use with infallible
folders. Do not override this method, to ensure coherence with
try_fold_with
.§impl<I> TypeVisitable<I> for Constraints<I>where
I: Interner,
impl<I> TypeVisitable<I> for Constraints<I>where
I: Interner,
§fn visit_with<B>(
&self,
visitor: &mut dyn TypeVisitor<I, BreakTy = B>,
outer_binder: DebruijnIndex,
) -> ControlFlow<B>
fn visit_with<B>( &self, visitor: &mut dyn TypeVisitor<I, BreakTy = B>, outer_binder: DebruijnIndex, ) -> ControlFlow<B>
Apply the given visitor
visitor
to self
; binders
is the
number of binders that are in scope when beginning the
visitor. Typically binders
starts as 0, but is adjusted when
we encounter Binders<T>
in the IR or other similar
constructs.