pub struct FnType<T: TypeMark> {
pub args: Arc<[FnArgType<T>]>,
pub vargs: Option<Type<T>>,
pub rtype: Type<T>,
pub constraints: Arc<RwLock<Vec<(TVar<T>, Type<T>)>>>,
}
Fields§
§args: Arc<[FnArgType<T>]>
§vargs: Option<Type<T>>
§rtype: Type<T>
§constraints: Arc<RwLock<Vec<(TVar<T>, Type<T>)>>>
Implementations§
Source§impl FnType<NoRefs>
impl FnType<NoRefs>
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<NoRefs>>) -> 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<NoRefs>)
pub fn alias_tvars(&self, known: &mut FxHashMap<ArcStr, TVar<NoRefs>>)
pub fn collect_tvars(&self, known: &mut FxHashMap<ArcStr, TVar<NoRefs>>)
pub fn contains(&self, t: &Self) -> bool
pub fn check_contains(&self, other: &Self) -> Result<()>
Sourcepub fn sigmatch(&self, other: &Self) -> bool
pub fn sigmatch(&self, other: &Self) -> bool
Return true if function signatures match. This is contains, but does not allow labeled argument subtyping.
pub fn check_sigmatch(&self, other: &Self) -> Result<()>
pub fn map_argpos( &self, other: &Self, ) -> FxHashMap<ArcStr, (Option<usize>, Option<usize>)>
Trait Implementations§
Source§impl<T: TypeMark> Ord for FnType<T>
impl<T: TypeMark> Ord for FnType<T>
Source§impl<T: TypeMark> PartialOrd for FnType<T>
impl<T: TypeMark> PartialOrd for FnType<T>
impl<T: TypeMark> Eq for FnType<T>
Auto Trait Implementations§
impl<T> Freeze for FnType<T>
impl<T> !RefUnwindSafe for FnType<T>
impl<T> Send for FnType<T>
impl<T> Sync for FnType<T>
impl<T> Unpin for FnType<T>where
T: Unpin,
impl<T> !UnwindSafe for FnType<T>
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 more