Skip to main content

Module extract_function

Module extract_function 

Source

Structsยง

ContainerInfo ๐Ÿ”’
The thing whose expression we are extracting from. Can be a function, const, static, const arg, โ€ฆ
ControlFlow ๐Ÿ”’
Function ๐Ÿ”’
LocalUsages ๐Ÿ”’
Container of local variable usages
OutlivedLocal ๐Ÿ”’
Param ๐Ÿ”’

Enumsยง

Anchor ๐Ÿ”’
Where to put extracted function definition
FlowHandler ๐Ÿ”’
FlowKind ๐Ÿ”’
Control flow that is exported from extracted function
FunType ๐Ÿ”’
FunctionBody ๐Ÿ”’
Semantically same as ast::Expr, but preserves identity when using only part of the Block This is the future function body, the part that is being extracted.
GenericParent ๐Ÿ”’
ParamKind ๐Ÿ”’
RetType ๐Ÿ”’
TryKind ๐Ÿ”’

Functionsยง

expr_require_exclusive_access ๐Ÿ”’
checks if this expr requires &mut access, recurses on field access
extract_function ๐Ÿ”’
extraction_target ๐Ÿ”’
Try to guess what user wants to extract
find_non_trait_impl ๐Ÿ”’
fix_param_usages ๐Ÿ”’
change all usages to account for added &/&mut for some params
format_function ๐Ÿ”’
format_type ๐Ÿ”’
generic_parents ๐Ÿ”’
Search parentโ€™s ancestors for items with potentially applicable generic parameters
has_exclusive_usages ๐Ÿ”’
checks if relevant var is used with &mut access inside body
impl_type_name ๐Ÿ”’
is_defined_outside_of_body ๐Ÿ”’
checks if the relevant local was defined before(outside of) body
is_inherit_attr ๐Ÿ”’
is_trait_impl ๐Ÿ”’
last_impl_member ๐Ÿ”’
local_outlives_body ๐Ÿ”’
Returns usage details if local variable is used after(outside of) body
locals_defined_in_body ๐Ÿ”’
list local variables defined inside body
make_body ๐Ÿ”’
make_call ๐Ÿ”’
make_function_name ๐Ÿ”’
make_generic_param_list ๐Ÿ”’
make_generic_params_and_where_clause ๐Ÿ”’
make_rewritten_flow ๐Ÿ”’
make_ty ๐Ÿ”’
make_where_clause ๐Ÿ”’
map_tail_expr ๐Ÿ”’
node_to_insert_after ๐Ÿ”’
find where to put extracted function definition
param_is_required ๐Ÿ”’
path_element_of ๐Ÿ”’
find relevant ast::Expr for reference
path_expr_from_local ๐Ÿ”’
pred_is_required ๐Ÿ”’
reference_is_exclusive ๐Ÿ”’
checks if this reference requires &mut access inside node
resolved_type_param ๐Ÿ”’
rewrite_body_segment ๐Ÿ”’
update_external_control_flow ๐Ÿ”’
with_default_tail_expr ๐Ÿ”’
with_tail_expr ๐Ÿ”’