pub struct FnType {
pub args: Arc<[FnArgType]>,
pub vargs: Option<Type>,
pub rtype: Type,
pub constraints: Arc<RwLock<Vec<(TVar, Type)>>>,
}
Fields§
§args: Arc<[FnArgType]>
§vargs: Option<Type>
§rtype: Type
§constraints: Arc<RwLock<Vec<(TVar, Type)>>>
Implementations§
Source§impl FnType
impl FnType
pub fn scope_refs(&self, scope: &ModPath) -> FnType
pub fn unbind_tvars(&self)
pub fn constrain_known(&self)
pub fn reset_tvars(&self) -> Self
pub fn replace_tvars(&self, known: &FxHashMap<ArcStr, Type>) -> Self
Sourcepub fn replace_auto_constrained(&self) -> Self
pub fn replace_auto_constrained(&self) -> Self
replace automatically constrained type variables with their constraint type. This is only useful for making nicer display types in IDEs and shells.
pub fn has_unbound(&self) -> bool
pub fn bind_as(&self, t: &Type)
pub fn alias_tvars(&self, known: &mut FxHashMap<ArcStr, TVar>)
pub fn collect_tvars(&self, known: &mut FxHashMap<ArcStr, TVar>)
pub fn contains<C: Ctx, E: UserEvent>( &self, env: &Env<C, E>, t: &Self, ) -> Result<bool>
pub fn check_contains<C: Ctx, E: UserEvent>( &self, env: &Env<C, E>, other: &Self, ) -> Result<()>
Sourcepub fn sigmatch<C: Ctx, E: UserEvent>(
&self,
env: &Env<C, E>,
other: &Self,
) -> Result<bool>
pub fn sigmatch<C: Ctx, E: UserEvent>( &self, env: &Env<C, E>, other: &Self, ) -> Result<bool>
Return true if function signatures match. This is contains, but does not allow labeled argument subtyping.
pub fn check_sigmatch<C: Ctx, E: UserEvent>( &self, env: &Env<C, E>, other: &Self, ) -> Result<()>
pub fn map_argpos( &self, other: &Self, ) -> FxHashMap<ArcStr, (Option<usize>, Option<usize>)>
Trait Implementations§
Source§impl Ord for FnType
impl Ord for FnType
Source§impl PartialOrd for FnType
impl PartialOrd for FnType
impl Eq for FnType
Auto Trait Implementations§
impl Freeze for FnType
impl !RefUnwindSafe for FnType
impl Send for FnType
impl Sync for FnType
impl Unpin for FnType
impl !UnwindSafe for FnType
Blanket Implementations§
Source§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
Source§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Comparable<K> for Q
impl<Q, K> Comparable<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key
and return true
if they are equal.Source§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<T> ToCompactString for Twhere
T: Display,
impl<T> ToCompactString for Twhere
T: Display,
Source§fn try_to_compact_string(&self) -> Result<CompactString, ToCompactStringError>
fn try_to_compact_string(&self) -> Result<CompactString, ToCompactStringError>
Fallible version of
ToCompactString::to_compact_string()
Read moreSource§fn to_compact_string(&self) -> CompactString
fn to_compact_string(&self) -> CompactString
Converts the given value to a
CompactString
. Read moreSource§impl<T> ToCompactString for Twhere
T: Display,
impl<T> ToCompactString for Twhere
T: Display,
Source§fn try_to_compact_string(&self) -> Result<CompactString, ToCompactStringError>
fn try_to_compact_string(&self) -> Result<CompactString, ToCompactStringError>
Fallible version of
ToCompactString::to_compact_string()
Read moreSource§fn to_compact_string(&self) -> CompactString
fn to_compact_string(&self) -> CompactString
Converts the given value to a
CompactString
. Read more