TyMutator

Trait TyMutator 

Source
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§

Source

fn mutate(&mut self, ty: &Ty, pol: bool) -> Option<Ty>

Mutates the given type.

Source

fn mutate_rec(&mut self, ty: &Ty, pol: bool) -> Option<Ty>

Mutates the given type recursively.

Source

fn mutate_vec(&mut self, ty: &[Ty], pol: bool) -> Option<Interned<Vec<Ty>>>

Mutates the given vector of types.

Source

fn mutate_tuple(&mut self, ty: &[Ty], pol: bool) -> Option<Ty>

Mutates and normalizes a tuple type.

Source

fn push_spread_tuple_elements(types: &mut Vec<Ty>, ty: &Ty) -> bool

Pushes known tuple elements from an internal spread marker.

Source

fn mutate_option(&mut self, ty: Option<&Ty>, pol: bool) -> Option<Option<Ty>>

Mutates the given option of type.

Source

fn mutate_func(&mut self, ty: &Interned<SigTy>, pol: bool) -> Option<SigTy>

Mutates the given function signature.

Source

fn mutate_param( &mut self, param: &Interned<ParamTy>, pol: bool, ) -> Option<ParamTy>

Mutates the given parameter type.

Source

fn mutate_record( &mut self, record: &Interned<RecordTy>, pol: bool, ) -> Option<RecordTy>

Mutates the given record type.

Source

fn mutate_with_sig( &mut self, ty: &Interned<SigWithTy>, pol: bool, ) -> Option<SigWithTy>

Mutates the given function signature with type.

Source

fn mutate_unary_ty(&mut self, ty: &Interned<TypeUnary>, pol: bool) -> Option<Ty>

Mutates the given unary type.

Source

fn known_element_type(ty: &Ty) -> Option<Ty>

Gets the known element type of an iterable-like type.

Source

fn known_element_types<'a>(types: impl Iterator<Item = &'a Ty>) -> Option<Ty>

Gets known element types from multiple iterable-like types.

Source

fn known_tuple_element_type(elems: &[Ty]) -> Option<Ty>

Gets the known element type of a tuple.

Source

fn known_args_element_type(args: &SigTy) -> Option<Ty>

Gets the known positional element type of arguments.

Source

fn mutate_binary( &mut self, ty: &Interned<TypeBinary>, pol: bool, ) -> Option<TypeBinary>

Mutates the given binary type.

Source

fn mutate_if(&mut self, ty: &Interned<IfTy>, pol: bool) -> Option<IfTy>

Mutates the given if type.

Source

fn mutate_select( &mut self, ty: &Interned<SelectTy>, pol: bool, ) -> Option<SelectTy>

Mutates the given select 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.

Implementors§

Source§

impl<T> TyMutator for T
where T: FnMut(&Ty, bool) -> Option<Ty>,