pub struct SubrType {
pub kind: SubrKind,
pub non_default_params: Vec<ParamTy>,
pub var_params: Option<Box<ParamTy>>,
pub default_params: Vec<ParamTy>,
pub return_t: Box<Type>,
}
Expand description
e.g. (x: Int, ?base: Int) -> Int => SubrTy{ kind: Func, non_default_params: [x: Int], default_params: [base: Int] return_t: Int }
Fields
kind: SubrKind
non_default_params: Vec<ParamTy>
var_params: Option<Box<ParamTy>>
default_params: Vec<ParamTy>
return_t: Box<Type>
Implementations
sourceimpl SubrType
impl SubrType
pub fn new(
kind: SubrKind,
non_default_params: Vec<ParamTy>,
var_params: Option<ParamTy>,
default_params: Vec<ParamTy>,
return_t: Type
) -> Self
pub fn contains_tvar(&self, name: &str) -> bool
pub fn has_qvar(&self) -> bool
pub fn typarams(&self) -> Vec<TyParam>
pub fn self_t(&self) -> Option<&Type>
Trait Implementations
sourceimpl LimitedDisplay for SubrType
impl LimitedDisplay for SubrType
fn limited_fmt(&self, f: &mut Formatter<'_>, limit: usize) -> Result
sourceimpl PartialEq<SubrType> for SubrType
impl PartialEq<SubrType> for SubrType
impl Eq for SubrType
impl StructuralEq for SubrType
impl StructuralPartialEq for SubrType
Auto Trait Implementations
impl !RefUnwindSafe for SubrType
impl !Send for SubrType
impl !Sync for SubrType
impl Unpin for SubrType
impl !UnwindSafe for SubrType
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more