pub struct Closing { /* private fields */ }Expand description
A closing substitution is used to map free variables into bound variables when converting a type being built in a context to a closed(ish) type that is above that context.
Like Opening, a given Closing substitution either affects
only existential variables or affects only universal variables, as
these are closed at different times.
Implementations§
Trait Implementations§
Source§impl<'a> Substitution<'a> for Closing
impl<'a> Substitution<'a> for Closing
Source§type Error = ClosingError
type Error = ClosingError
Some, but not all, substitutions are fallible (i.e. may reveal
latent misbehaviour in the type they are being applied to), so
any given
Substitution can provide its own
Substitution::Error type. Read moreSource§fn subst_bvar(&self, _: u32) -> Result<Option<Defined<'a>>, ClosingError>
fn subst_bvar(&self, _: u32) -> Result<Option<Defined<'a>>, ClosingError>
Any substitution should define whether a given bound variable
should be substituted, and if so with what.
Source§fn subst_evar(
&self,
o: u32,
i: u32,
) -> Result<Option<Defined<'a>>, ClosingError>
fn subst_evar( &self, o: u32, i: u32, ) -> Result<Option<Defined<'a>>, ClosingError>
Any substitution should define whether a given existential variable
should be substituted, and if so with what.
Source§fn subst_uvar(
&self,
o: u32,
i: u32,
) -> Result<Option<Defined<'a>>, ClosingError>
fn subst_uvar( &self, o: u32, i: u32, ) -> Result<Option<Defined<'a>>, ClosingError>
Any substitution should define whether a given universal variable
should be substituted, and if so with what.
fn record_fields( &self, rfs: &[RecordField<'a>], ) -> Result<Vec<RecordField<'a>>, Self::Error>
fn variant_cases( &self, vcs: &[VariantCase<'a>], ) -> Result<Vec<VariantCase<'a>>, Self::Error>
fn value_option( &self, vt: &Option<Value<'a>>, ) -> Result<Option<Value<'a>>, Self::Error>
fn value(&self, vt: &Value<'a>) -> Result<Value<'a>, Self::Error>
fn param(&self, pt: &Param<'a>) -> Result<Param<'a>, Self::Error>
fn params(&self, pts: &Vec<Param<'a>>) -> Result<Vec<Param<'a>>, Self::Error>
fn result(&self, rt: &Result<'a>) -> Result<Result<'a>, Self::Error>
fn func(&self, ft: &Func<'a>) -> Result<Func<'a>, Self::Error>
fn var(&self, tv: &Tyvar) -> Result<Option<Defined<'a>>, Self::Error>
fn handleable(&self, h: &Handleable) -> Result<Defined<'a>, Self::Error>
fn handleable_(&self, h: &Handleable) -> Result<Handleable, Self::Error>
fn defined(&self, dt: &Defined<'a>) -> Result<Defined<'a>, Self::Error>
fn type_bound(&self, tb: &TypeBound<'a>) -> Result<TypeBound<'a>, Self::Error>
fn bounded_tyvar( &self, btv: &BoundedTyvar<'a>, ) -> Result<BoundedTyvar<'a>, Self::Error>
fn extern_desc( &self, ed: &ExternDesc<'a>, ) -> Result<ExternDesc<'a>, Self::Error>
fn extern_decl( &self, ed: &ExternDecl<'a>, ) -> Result<ExternDecl<'a>, Self::Error>
fn instance(&self, it: &Instance<'a>) -> Result<Instance<'a>, Self::Error>
fn qualified_instance( &self, qit: &QualifiedInstance<'a>, ) -> Result<QualifiedInstance<'a>, Self::Error>
fn component(&self, ct: &Component<'a>) -> Result<Component<'a>, Self::Error>
Auto Trait Implementations§
impl Freeze for Closing
impl RefUnwindSafe for Closing
impl Send for Closing
impl Sync for Closing
impl Unpin for Closing
impl UnsafeUnpin for Closing
impl UnwindSafe for Closing
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
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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>
Converts
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>
Converts
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