pub struct Component<'a> {
pub uvars: Vec<BoundedTyvar<'a>>,
pub imports: Vec<ExternDecl<'a>>,
pub instance: QualifiedInstance<'a>,
}
Expand description
componenttype_e in the specification
Fields§
§uvars: Vec<BoundedTyvar<'a>>
Universal variables over which this component is parameterized
(which may be referred to by imports
). These are stored in
“outside-in” order that matches how they would be written on
paper: de Bruijn index Bound(0) in the imports is the last
element in the list, and later elements can depend on earlier
ones.
imports: Vec<ExternDecl<'a>>
§instance: QualifiedInstance<'a>
Since we already have QualifiedInstance
, we use that to
keep track of both the evars and the actual instance, unlike
in the spec; this is quite natural, since during inference the
evars are generated by the exports. However, they conceptually
belong here as much as there: instantiating a component should
add them to the context as non-imported uvars and produce an
Instance
, rather than a QualifiedInstance
directly.
Trait Implementations§
Auto Trait Implementations§
impl<'a> Freeze for Component<'a>
impl<'a> RefUnwindSafe for Component<'a>
impl<'a> Send for Component<'a>
impl<'a> Sync for Component<'a>
impl<'a> Unpin for Component<'a>
impl<'a> UnwindSafe for Component<'a>
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<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more