pub trait TyMutator {
Show 18 methods
// Provided methods
fn mutate(&mut self, ty: &Ty, pol: bool) -> Option<Ty> { ... }
fn mutate_rec(&mut self, ty: &Ty, pol: bool) -> Option<Ty> { ... }
fn mutate_vec(&mut self, ty: &[Ty], pol: bool) -> Option<Interned<Vec<Ty>>> { ... }
fn mutate_tuple(&mut self, ty: &[Ty], pol: bool) -> Option<Ty> { ... }
fn push_spread_tuple_elements(types: &mut Vec<Ty>, ty: &Ty) -> bool { ... }
fn mutate_option(
&mut self,
ty: Option<&Ty>,
pol: bool,
) -> Option<Option<Ty>> { ... }
fn mutate_func(&mut self, ty: &Interned<SigTy>, pol: bool) -> Option<SigTy> { ... }
fn mutate_param(
&mut self,
param: &Interned<ParamTy>,
pol: bool,
) -> Option<ParamTy> { ... }
fn mutate_record(
&mut self,
record: &Interned<RecordTy>,
pol: bool,
) -> Option<RecordTy> { ... }
fn mutate_with_sig(
&mut self,
ty: &Interned<SigWithTy>,
pol: bool,
) -> Option<SigWithTy> { ... }
fn mutate_unary_ty(
&mut self,
ty: &Interned<TypeUnary>,
pol: bool,
) -> Option<Ty> { ... }
fn known_element_type(ty: &Ty) -> Option<Ty> { ... }
fn known_element_types<'a>(
types: impl Iterator<Item = &'a Ty>,
) -> Option<Ty> { ... }
fn known_tuple_element_type(elems: &[Ty]) -> Option<Ty> { ... }
fn known_args_element_type(args: &SigTy) -> Option<Ty> { ... }
fn mutate_binary(
&mut self,
ty: &Interned<TypeBinary>,
pol: bool,
) -> Option<TypeBinary> { ... }
fn mutate_if(&mut self, ty: &Interned<IfTy>, pol: bool) -> Option<IfTy> { ... }
fn mutate_select(
&mut self,
ty: &Interned<SelectTy>,
pol: bool,
) -> Option<SelectTy> { ... }
}Expand description
A trait to mutate a type.
Provided Methods§
Sourcefn mutate_vec(&mut self, ty: &[Ty], pol: bool) -> Option<Interned<Vec<Ty>>>
fn mutate_vec(&mut self, ty: &[Ty], pol: bool) -> Option<Interned<Vec<Ty>>>
Mutates the given vector of types.
Sourcefn mutate_tuple(&mut self, ty: &[Ty], pol: bool) -> Option<Ty>
fn mutate_tuple(&mut self, ty: &[Ty], pol: bool) -> Option<Ty>
Mutates and normalizes a tuple type.
Sourcefn push_spread_tuple_elements(types: &mut Vec<Ty>, ty: &Ty) -> bool
fn push_spread_tuple_elements(types: &mut Vec<Ty>, ty: &Ty) -> bool
Pushes known tuple elements from an internal spread marker.
Sourcefn mutate_option(&mut self, ty: Option<&Ty>, pol: bool) -> Option<Option<Ty>>
fn mutate_option(&mut self, ty: Option<&Ty>, pol: bool) -> Option<Option<Ty>>
Mutates the given option of type.
Sourcefn mutate_func(&mut self, ty: &Interned<SigTy>, pol: bool) -> Option<SigTy>
fn mutate_func(&mut self, ty: &Interned<SigTy>, pol: bool) -> Option<SigTy>
Mutates the given function signature.
Sourcefn mutate_param(
&mut self,
param: &Interned<ParamTy>,
pol: bool,
) -> Option<ParamTy>
fn mutate_param( &mut self, param: &Interned<ParamTy>, pol: bool, ) -> Option<ParamTy>
Mutates the given parameter type.
Sourcefn mutate_record(
&mut self,
record: &Interned<RecordTy>,
pol: bool,
) -> Option<RecordTy>
fn mutate_record( &mut self, record: &Interned<RecordTy>, pol: bool, ) -> Option<RecordTy>
Mutates the given record type.
Sourcefn mutate_with_sig(
&mut self,
ty: &Interned<SigWithTy>,
pol: bool,
) -> Option<SigWithTy>
fn mutate_with_sig( &mut self, ty: &Interned<SigWithTy>, pol: bool, ) -> Option<SigWithTy>
Mutates the given function signature with type.
Sourcefn mutate_unary_ty(&mut self, ty: &Interned<TypeUnary>, pol: bool) -> Option<Ty>
fn mutate_unary_ty(&mut self, ty: &Interned<TypeUnary>, pol: bool) -> Option<Ty>
Mutates the given unary type.
Sourcefn known_element_type(ty: &Ty) -> Option<Ty>
fn known_element_type(ty: &Ty) -> Option<Ty>
Gets the known element type of an iterable-like type.
Sourcefn known_element_types<'a>(types: impl Iterator<Item = &'a Ty>) -> Option<Ty>
fn known_element_types<'a>(types: impl Iterator<Item = &'a Ty>) -> Option<Ty>
Gets known element types from multiple iterable-like types.
Sourcefn known_tuple_element_type(elems: &[Ty]) -> Option<Ty>
fn known_tuple_element_type(elems: &[Ty]) -> Option<Ty>
Gets the known element type of a tuple.
Sourcefn known_args_element_type(args: &SigTy) -> Option<Ty>
fn known_args_element_type(args: &SigTy) -> Option<Ty>
Gets the known positional element type of arguments.
Sourcefn mutate_binary(
&mut self,
ty: &Interned<TypeBinary>,
pol: bool,
) -> Option<TypeBinary>
fn mutate_binary( &mut self, ty: &Interned<TypeBinary>, pol: bool, ) -> Option<TypeBinary>
Mutates the given binary type.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.