Skip to main content

Intent

Enum Intent 

Source
pub enum Intent {
Show 60 variants RenameIdent { symbol_id: Option<String>, symbol_path: Option<String>, target_ident: Option<String>, to: String, kind: IdentKind, }, ChangeVisibility { symbol_id: Option<String>, symbol_path: Option<String>, target_item: Option<String>, to: Visibility, }, MoveItem { symbol_id: Option<String>, symbol_path: Option<String>, target_item: Option<String>, to_module: String, }, ExtractTrait { symbol_id: Option<String>, symbol_path: Option<String>, target_type: Option<String>, trait_name: String, methods: Vec<String>, }, InlineTrait { trait_symbol_id: Option<String>, trait_symbol_path: Option<String>, target_trait: Option<String>, struct_symbol_id: Option<String>, struct_symbol_path: Option<String>, target_struct: Option<String>, remove_trait: bool, }, EnumToTrait { symbol_id: Option<String>, symbol_path: Option<String>, target_enum: Option<String>, new_trait_name: Option<String>, remove_enum: bool, strategy: EnumToTraitStrategy, match_handling: MatchHandling, }, RemoveMod { parent_mod: Vec<String>, mod_name: String, }, CreateMod { parent_mod: Vec<String>, mod_name: String, content: String, is_pub: bool, }, AddField { symbol_id: Option<String>, symbol_path: Option<String>, target_struct: Option<String>, field_name: String, field_type: String, is_pub: bool, }, RemoveField { symbol_id: Option<String>, symbol_path: Option<String>, target_struct: Option<String>, field_name: String, }, AddDerive { symbol_id: Option<String>, symbol_path: Option<String>, target_type: Option<String>, derives: Vec<String>, }, RemoveDerive { symbol_id: Option<String>, symbol_path: Option<String>, target_type: Option<String>, derives: Vec<String>, }, AddEnum { symbol_path: String, name: String, variants: Vec<String>, is_pub: bool, derives: Vec<String>, }, AddVariant { symbol_id: Option<String>, symbol_path: Option<String>, target_enum: Option<String>, variant_name: String, variant_type: String, }, RemoveVariant { symbol_id: Option<String>, symbol_path: Option<String>, target_enum: Option<String>, variant_name: String, }, AddMatchArm { symbol_id: Option<String>, symbol_path: Option<String>, target_fn: Option<String>, enum_name: String, pattern: String, body: String, }, RemoveMatchArm { symbol_id: Option<String>, symbol_path: Option<String>, target_fn: Option<String>, enum_name: String, pattern: String, }, ReplaceMatchArm { symbol_id: Option<String>, symbol_path: Option<String>, target_fn: Option<String>, enum_name: String, old_pattern: String, new_pattern: String, new_body: String, }, AddStructLiteralField { symbol_id: Option<String>, symbol_path: Option<String>, target_struct: Option<String>, field_name: String, value: String, }, RemoveStructLiteralField { symbol_id: Option<String>, symbol_path: Option<String>, target_struct: Option<String>, field_name: String, }, RemoveStruct { symbol_id: Option<String>, symbol_path: Option<String>, target_struct: Option<String>, }, RemoveEnum { symbol_id: Option<String>, symbol_path: Option<String>, target_enum: Option<String>, }, DuplicateFunction { symbol_id: Option<String>, symbol_path: Option<String>, target_fn: Option<String>, to: String, }, DuplicateStruct { symbol_id: Option<String>, symbol_path: Option<String>, target_struct: Option<String>, to: String, include_impls: bool, }, DuplicateEnum { symbol_id: Option<String>, symbol_path: Option<String>, target_enum: Option<String>, to: String, include_impls: bool, }, DuplicateModTree { symbol_id: Option<String>, symbol_path: Option<String>, target_mod: Option<String>, to: String, }, AddConst { symbol_path: String, name: String, ty: String, value: String, is_pub: bool, }, AddTypeAlias { symbol_path: String, name: String, ty: String, is_pub: bool, }, AddSpec { symbol_id: Option<String>, symbol_path: Option<String>, target_type: Option<String>, module_id: Option<String>, module_path: Option<String>, target_mod: Option<String>, group: String, alias_name: Option<String>, relations: Vec<SpecRelation>, }, AddMethod { symbol_id: Option<String>, symbol_path: Option<String>, target_type: Option<String>, method_name: String, params: Vec<(String, String)>, return_type: Option<String>, body: String, is_pub: bool, self_param: Option<SelfParam>, }, RemoveMethod { symbol_id: Option<String>, symbol_path: Option<String>, target_type: Option<String>, method_name: String, }, RemoveConst { symbol_id: Option<String>, symbol_path: Option<String>, target_const: Option<String>, }, RemoveTypeAlias { symbol_id: Option<String>, symbol_path: Option<String>, target_type_alias: Option<String>, }, RemoveUse { symbol_id: Option<String>, symbol_path: Option<String>, target_use: Option<String>, }, RemoveTrait { symbol_id: Option<String>, symbol_path: Option<String>, target_trait: Option<String>, }, RemoveImpl { symbol_id: Option<String>, symbol_path: Option<String>, target_type: Option<String>, trait_name: Option<String>, }, AddItem { symbol_id: Option<String>, symbol_path: Option<String>, target_mod: Option<String>, content: String, item_kind: ItemKind, }, RemoveItem { symbol_id: Option<String>, symbol_path: Option<String>, target_item: Option<String>, item_kind: ItemKind, }, AddCode { symbol_id: Option<String>, symbol_path: Option<String>, target_mod: Option<String>, code: String, }, OrganizeImports { target_mod: Option<String>, deduplicate: bool, merge_groups: bool, }, MergeImplBlocks { target_mod: Option<String>, target_type: Option<String>, inherent_only: bool, }, LoopToIterator { target_mod: Option<String>, target_var: Option<String>, }, UnwrapToQuestion { target_mod: Option<String>, target_fn: Option<String>, include_expect: bool, }, IntroduceVariable { target_mod: Option<String>, target_fn: Option<String>, expr: String, var_name: String, }, GenerateBuilder { symbol_id: Option<String>, symbol_path: Option<String>, target_struct: Option<String>, target_mod: Option<String>, fields: Vec<(String, String)>, add_builder_method: bool, }, ReplaceExpr { target_mod: Option<String>, target_fn: Option<String>, old_expr: String, new_expr: String, replace_all: bool, symbol_path: Option<String>, }, RemoveStatement { target_mod: Option<String>, target_fn: Option<String>, pattern: String, remove_all: bool, symbol_path: Option<String>, }, InsertStatement { target_mod: Option<String>, target_fn: String, stmt: String, position: StmtInsertPosition, reference_pattern: Option<String>, symbol_path: Option<String>, }, ReplaceStatement { target_mod: Option<String>, target_fn: Option<String>, old_stmt: String, new_stmt: String, symbol_path: Option<String>, }, AssignOp { target_mod: Option<String>, target_fn: Option<String>, }, BoolSimplify { target_mod: Option<String>, }, CloneOnCopy { target_mod: Option<String>, }, CollapsibleIf { target_mod: Option<String>, }, ComparisonToMethod { target_mod: Option<String>, }, RedundantClosure { target_mod: Option<String>, }, ManualMap { target_mod: Option<String>, }, MatchToIfLet { target_mod: Option<String>, }, FilterNext { target_mod: Option<String>, target_fn: Option<String>, }, MapUnwrapOr { target_mod: Option<String>, target_fn: Option<String>, }, Custom { description: String, examples: Vec<TransformExample>, },
}
Expand description

変換意図

§Future Intents (Not Yet Implemented)

The following Intents are planned for future implementation:

  • Decorator → AddFunction + Rename (wrap function with logging/timing/retry)
  • ExtractFunction → AddFunction + ReplaceExpr (extract statements into new function)
  • InlineFunction → ReplaceExpr + RemoveFunction (inline function calls)

These will be implemented as compositions of existing MutationSpecs.

Variants§

§

RenameIdent

単一識別子のリネーム

Fields

§symbol_id: Option<String>

SymbolId(O(1)確定、“7v2“形式)

§symbol_path: Option<String>

シンボルパス(“tokio::net::TcpStream“形式)

§target_ident: Option<String>

リネーム元の識別子名(診断用、フォールバック検索)

§

ChangeVisibility

可視性変更

Fields

§symbol_id: Option<String>

SymbolId(O(1)確定、“7v2“形式)

§symbol_path: Option<String>

シンボルパス(“crate::module::Type“形式)

§target_item: Option<String>

ターゲット名(診断用、フォールバック検索)

§to: Visibility

変更後のvisibility

§

MoveItem

アイテムを別モジュールに移動

Fields

§symbol_id: Option<String>

SymbolId(O(1)確定、“7v2“形式)

§symbol_path: Option<String>

シンボルパス(“tokio::net::TcpStream“形式)

§target_item: Option<String>

移動対象の名前(診断用、フォールバック検索)

§to_module: String
§

ExtractTrait

implからトレイトを抽出

Fields

§symbol_id: Option<String>

SymbolId(O(1)確定、“7v2“形式)

§symbol_path: Option<String>

シンボルパス(“tokio::net::TcpStream“形式)

§target_type: Option<String>

impl対象の型名(診断用、フォールバック検索)

§trait_name: String
§methods: Vec<String>

抽出するメソッド(空 = 全メソッド)

§

InlineTrait

トレイトをインライン化(implに戻す)

Fields

§trait_symbol_id: Option<String>

Trait SymbolId

§trait_symbol_path: Option<String>

Trait シンボルパス

§target_trait: Option<String>

Trait名(診断用、フォールバック検索)

§struct_symbol_id: Option<String>

Struct SymbolId

§struct_symbol_path: Option<String>

Struct シンボルパス

§target_struct: Option<String>

Struct名(診断用、フォールバック検索)

§remove_trait: bool

トレイト定義を削除するか

§

EnumToTrait

EnumをTraitに変換(Replace Conditional with Polymorphism)

Enum variants become struct implementations of the generated trait. Use strategy to control type annotation replacement.

Fields

§symbol_id: Option<String>

SymbolId(O(1)確定、“7v2“形式)

§symbol_path: Option<String>

シンボルパス(“tokio::net::TcpStream“形式)

§target_enum: Option<String>

変換対象のEnum名(診断用、フォールバック検索)

§new_trait_name: Option<String>

生成するTrait名(省略時はEnum名を使用)

§remove_enum: bool

元のEnumを削除するか

§strategy: EnumToTraitStrategy

変換戦略: Dynamic (Box), Static (impl), MarkerOnly

§match_handling: MatchHandling

match式の処理方法

§

RemoveMod

モジュール宣言を削除

Fields

§parent_mod: Vec<String>

親モジュールパス (空 = crate root)

§mod_name: String

削除するモジュール名

§

CreateMod

モジュールファイルを作成

Fields

§parent_mod: Vec<String>

親モジュールパス (空 = crate root)

§mod_name: String

作成するモジュール名

§content: String

初期コンテンツ

§is_pub: bool

public かどうか

§

AddField

フィールドを追加

Fields

§symbol_id: Option<String>

SymbolId(O(1)確定、“7v2“形式)

§symbol_path: Option<String>

シンボルパス(“tokio::net::TcpStream“形式)

§target_struct: Option<String>

対象の構造体名(診断用、フォールバック検索)

§field_name: String
§field_type: String
§is_pub: bool
§

RemoveField

フィールドを削除

Fields

§symbol_id: Option<String>

SymbolId(O(1)確定、“7v2“形式)

§symbol_path: Option<String>

シンボルパス(“tokio::net::TcpStream“形式)

§target_struct: Option<String>

対象の構造体名(診断用、フォールバック検索)

§field_name: String
§

AddDerive

Deriveマクロを追加

Fields

§symbol_id: Option<String>

SymbolId(O(1)確定、“7v2“形式)

§symbol_path: Option<String>

シンボルパス(“tokio::net::TcpStream“形式)

§target_type: Option<String>

対象の型名(診断用、フォールバック検索)

§derives: Vec<String>
§

RemoveDerive

Deriveマクロを削除

Fields

§symbol_id: Option<String>

SymbolId(O(1)確定、“7v2“形式)

§symbol_path: Option<String>

シンボルパス(“tokio::net::TcpStream“形式)

§target_type: Option<String>

対象の型名(診断用、フォールバック検索)

§derives: Vec<String>
§

AddEnum

Enumを追加

Fields

§symbol_path: String

追加先モジュールパス(必須: “my_crate”, “my_crate::domain“等)

§name: String
§variants: Vec<String>
§is_pub: bool
§derives: Vec<String>
§

AddVariant

Enumにバリアントを追加

Fields

§symbol_id: Option<String>

SymbolId(O(1)確定、“7v2“形式)

§symbol_path: Option<String>

シンボルパス(“tokio::net::TcpStream“形式)

§target_enum: Option<String>

対象のEnum名(診断用、フォールバック検索)

§variant_name: String
§variant_type: String

“unit”, “tuple:Type1,Type2”, “struct:field1:Type1,field2:Type2”

§

RemoveVariant

Enumからバリアントを削除

Fields

§symbol_id: Option<String>

SymbolId(O(1)確定、“7v2“形式)

§symbol_path: Option<String>

シンボルパス(“tokio::net::TcpStream“形式)

§target_enum: Option<String>

対象のEnum名(診断用、フォールバック検索)

§variant_name: String
§

AddMatchArm

Match式にarmを追加(Cascade用)

AddVariantと組み合わせて使用。CascadeAnalyzerで生成された AddMatchArmをIntentとして渡すことで、網羅性エラーを自動修正。

Fields

§symbol_id: Option<String>

SymbolId(O(1)確定、“7v2“形式)

§symbol_path: Option<String>

関数のシンボルパス (e.g., “crate::handlers::process”)

§target_fn: Option<String>

関数名(symbol_pathから自動抽出可能、明示指定も可)

§enum_name: String

対象のenum型名

§pattern: String

追加するパターン (e.g., “Status::Cancelled”)

§body: String

Armのbody (e.g., “todo!()”)

§

RemoveMatchArm

Match式からarmを削除(Cascade用)

RemoveVariantと組み合わせて使用。バリアント削除後の 不要なmatch armを削除する。

Fields

§symbol_id: Option<String>

SymbolId(O(1)確定、“7v2“形式)

§symbol_path: Option<String>

関数のシンボルパス (e.g., “crate::handlers::process”)

§target_fn: Option<String>

関数名(symbol_pathから自動抽出可能、明示指定も可)

§enum_name: String

対象のenum型名

§pattern: String

削除するパターン (e.g., “Status::Completed”)

§

ReplaceMatchArm

Match armを置換(パターン + body をセットで変更)

ReplaceExprはbody(式)のみを置換するが、このIntentはパターンも 同時に置換できる。例えば { start: _, end: _ }{ start, end } に変更しつつ、bodyも新しい実装に置き換える場合に使用する。

Fields

§symbol_id: Option<String>

SymbolId(O(1)確定、“7v2“形式)

§symbol_path: Option<String>

関数のシンボルパス (e.g., “crate::handlers::process”)

§target_fn: Option<String>

関数名(symbol_pathから自動抽出可能、明示指定も可)

§enum_name: String

対象のenum型名

§old_pattern: String

置換対象のパターン (e.g., “PathSegment::Slice { start: _, end: _ }”)

§new_pattern: String

新しいパターン (e.g., “PathSegment::Slice { start, end }”)

§new_body: String

新しいbody (e.g., “{ let s = start.unwrap_or(0); … }”)

§

AddStructLiteralField

構造体リテラルにフィールドを追加(Cascade用)

AddFieldと組み合わせて使用。フィールド追加後の構造体リテラルを 自動的に更新する。

Fields

§symbol_id: Option<String>

SymbolId(O(1)確定、“7v2“形式)

§symbol_path: Option<String>

シンボルパス(“tokio::net::TcpStream“形式)

§target_struct: Option<String>

対象の構造体名(診断用、フォールバック検索)

§field_name: String

追加するフィールド名

§value: String

フィールドの値 (e.g., “None”, “Default::default()”)

§

RemoveStructLiteralField

構造体リテラルからフィールドを削除(Cascade用)

RemoveFieldと組み合わせて使用。フィールド削除後の構造体リテラルを 自動的に更新する。

Fields

§symbol_id: Option<String>

SymbolId(O(1)確定、“7v2“形式)

§symbol_path: Option<String>

シンボルパス(“tokio::net::TcpStream“形式)

§target_struct: Option<String>

対象の構造体名(診断用、フォールバック検索)

§field_name: String

削除するフィールド名

§

RemoveStruct

構造体を削除

Fields

§symbol_id: Option<String>

SymbolId(O(1)確定、“7v2“形式)

§symbol_path: Option<String>

シンボルパス(“tokio::net::TcpStream“形式)

§target_struct: Option<String>

対象の構造体名(診断用、フォールバック検索)

§

RemoveEnum

Enumを削除

Fields

§symbol_id: Option<String>

SymbolId(O(1)確定、“7v2“形式)

§symbol_path: Option<String>

シンボルパス(“tokio::net::TcpStream“形式)

§target_enum: Option<String>

対象のEnum名(診断用、フォールバック検索)

§

DuplicateFunction

関数を複製

Fields

§symbol_id: Option<String>

SymbolId(O(1)確定、“7v2“形式)

§symbol_path: Option<String>

シンボルパス(“tokio::net::TcpStream“形式)

§target_fn: Option<String>

複製元の関数名(診断用、フォールバック検索)

§to: String

新しい関数名

§

DuplicateStruct

構造体を複製(関連impl含む)

Fields

§symbol_id: Option<String>

SymbolId(O(1)確定、“7v2“形式)

§symbol_path: Option<String>

シンボルパス(“tokio::net::TcpStream“形式)

§target_struct: Option<String>

複製元の構造体名(診断用、フォールバック検索)

§to: String

新しい構造体名

§include_impls: bool

impl blockも複製するか

§

DuplicateEnum

Enumを複製(関連impl含む)

Fields

§symbol_id: Option<String>

SymbolId(O(1)確定、“7v2“形式)

§symbol_path: Option<String>

シンボルパス(“tokio::net::TcpStream“形式)

§target_enum: Option<String>

複製元のEnum名(診断用、フォールバック検索)

§to: String

新しいEnum名

§include_impls: bool

impl blockも複製するか

§

DuplicateModTree

インラインモジュールを複製

Fields

§symbol_id: Option<String>

SymbolId(O(1)確定、“7v2“形式)

§symbol_path: Option<String>

シンボルパス(“tokio::net::TcpStream“形式)

§target_mod: Option<String>

複製元のモジュール名(診断用、フォールバック検索)

§to: String

新しいモジュール名

§

AddConst

定数を追加

Fields

§symbol_path: String

追加先モジュールパス(必須: “my_crate”, “my_crate::domain“等)

§name: String
§value: String
§is_pub: bool
§

AddTypeAlias

型エイリアスを追加

Fields

§symbol_path: String

追加先モジュールパス(必須: “my_crate”, “my_crate::domain“等)

§name: String
§is_pub: bool
§

AddSpec

Spec TypeAliasを追加 (ドメイン仕様マーカー)

Fields

§symbol_id: Option<String>

SymbolId(O(1)確定、“7v2“形式)

§symbol_path: Option<String>

シンボルパス(“tokio::net::TcpStream“形式)

§target_type: Option<String>

対象の型名(診断用、フォールバック検索)

§module_id: Option<String>

モジュールのSymbolId

§module_path: Option<String>

モジュールのシンボルパス (e.g., “crate::domain”)

§target_mod: Option<String>

モジュール名(診断用、フォールバック検索)

§group: String

グループ名 (e.g., “DomainGroup”, “ConfigGroup”)

§alias_name: Option<String>

エイリアス名 (省略時: “{target_type}Spec”)

§relations: Vec<SpecRelation>

依存関係 (最大3つ)

§

AddMethod

implにメソッドを追加

Fields

§symbol_id: Option<String>

SymbolId(O(1)確定、“7v2“形式)

§symbol_path: Option<String>

シンボルパス(“tokio::net::TcpStream“形式)

§target_type: Option<String>

対象の型名(診断用、フォールバック検索)

§method_name: String

メソッド名

§params: Vec<(String, String)>

パラメータ (name, type) のペア

§return_type: Option<String>

戻り値の型 (None = unit)

§body: String

メソッド本体

§is_pub: bool

public かどうか

§self_param: Option<SelfParam>

selfパラメータ

§

RemoveMethod

implからメソッドを削除

Fields

§symbol_id: Option<String>

SymbolId(O(1)確定、“7v2“形式)

§symbol_path: Option<String>

シンボルパス(“tokio::net::TcpStream“形式)

§target_type: Option<String>

対象の型名(診断用、フォールバック検索)

§method_name: String
§

RemoveConst

定数を削除

Fields

§symbol_id: Option<String>

SymbolId(O(1)確定、“7v2“形式)

§symbol_path: Option<String>

シンボルパス(“tokio::net::TcpStream“形式)

§target_const: Option<String>

対象の定数名(診断用、フォールバック検索)

§

RemoveTypeAlias

型エイリアスを削除

Fields

§symbol_id: Option<String>

SymbolId(O(1)確定、“7v2“形式)

§symbol_path: Option<String>

シンボルパス(“tokio::net::TcpStream“形式)

§target_type_alias: Option<String>

対象の型エイリアス名(診断用、フォールバック検索)

§

RemoveUse

use文を削除

Fields

§symbol_id: Option<String>

SymbolId(O(1)確定、“7v2“形式)

§symbol_path: Option<String>

シンボルパス(“tokio::net::TcpStream“形式)

§target_use: Option<String>

対象のuseパス(診断用、フォールバック検索)

§

RemoveTrait

Traitを削除

Fields

§symbol_id: Option<String>

SymbolId(O(1)確定、“7v2“形式)

§symbol_path: Option<String>

シンボルパス(“tokio::net::TcpStream“形式)

§target_trait: Option<String>

対象のTrait名(診断用、フォールバック検索)

§

RemoveImpl

impl blockを削除

Fields

§symbol_id: Option<String>

SymbolId(O(1)確定、“7v2“形式)

§symbol_path: Option<String>

シンボルパス(“tokio::net::TcpStream“形式)

§target_type: Option<String>

対象の型名(診断用、フォールバック検索)

§trait_name: Option<String>
§

AddItem

アイテム追加

Fields

§symbol_id: Option<String>

SymbolId(O(1)確定、“7v2“形式)

§symbol_path: Option<String>

シンボルパス(“crate::module“形式)

§target_mod: Option<String>

モジュール名(診断用、フォールバック検索)

§content: String
§item_kind: ItemKind
§

RemoveItem

アイテム削除

Fields

§symbol_id: Option<String>

SymbolId(O(1)確定、“7v2“形式)

§symbol_path: Option<String>

シンボルパス(“tokio::net::TcpStream“形式)

§target_item: Option<String>

削除対象の名前(診断用、フォールバック検索)

§item_kind: ItemKind
§

AddCode

コードを親パスに追加(存在しなければモジュール自動作成)

AddItemの簡易版。item_kindはsynパースで自動判定し、 親パスが存在しない場合は再帰的にモジュールを作成する。

§自動モジュール作成
  • SymbolRegistryあり: 既存モジュールをスキップし、存在しないモジュールのみ作成
  • SymbolRegistryなし: 全親セグメントに対してCreateModを生成(CreateModは冪等)

例: parent: "crate::infrastructure::memory" の場合

  1. CreateMod { parent: “crate”, mod_name: “infrastructure” }
  2. CreateMod { parent: “crate::infrastructure”, mod_name: “memory” }
  3. AddItem { target: “crate::infrastructure::memory”, … }
§parent と parent_ref

どちらか一方を指定。両方指定時は parent_ref を優先。

§Example (シンプル形式 - parent)

{
  "type": "AddCode",
  "parent": "crate::usecase",
  "code": "pub struct CreateOrderInput { pub user_id: UserId }"
}

§Example (明示的形式 - parent_ref)

{
  "type": "AddCode",
  "parent_ref": { "type": "FilePath", "path": "src/usecase.rs" },
  "code": "pub struct CreateOrderInput { ... }"
}

Fields

§symbol_id: Option<String>

SymbolId直接指定(“7v2“形式、O(1)解決)

§symbol_path: Option<String>

SymbolPathまたはファイルパス “::“を含めばSymbolPath、それ以外はファイルパスとして解釈

§target_mod: Option<String>

モジュール名(診断/フォールバック用)

§code: String

追加するRustコード(複数Item可、synでパース)

§

OrganizeImports

use文の整理・ソート

Fields

§target_mod: Option<String>

対象モジュール(None = 全モジュール)“lib::foo::bar” 形式

§deduplicate: bool

重複を削除

§merge_groups: bool

同一プレフィックスをグループ化

§

MergeImplBlocks

同一型のimplブロックをマージ

Fields

§target_mod: Option<String>

対象モジュール(None = 全モジュール)

§target_type: Option<String>

対象の型名 (None = 全て)

§inherent_only: bool

inherent implのみ (trait implを除外)

§

LoopToIterator

forループをイテレータチェーンに変換

Fields

§target_mod: Option<String>

対象モジュール(None = 全モジュール)

§target_var: Option<String>

特定の変数名のループのみ対象

§

UnwrapToQuestion

.unwrap()/.expect() を ? 演算子に変換

Fields

§target_mod: Option<String>

対象モジュール(None = 全モジュール)

§target_fn: Option<String>

特定の関数のみ対象

§include_expect: bool

.expect()も変換対象にする

§

IntroduceVariable

重複式を変数に抽出

Fields

§target_mod: Option<String>

対象モジュール(None = 全モジュール)

§target_fn: Option<String>

対象の関数名(None = 全関数)

§expr: String

抽出対象の式(Rustコード文字列, e.g. “a + b * c”)

§var_name: String

抽出する変数名

§

GenerateBuilder

Builder patternを生成

指定した struct に対して Builder pattern を生成する。 以下のコードが生成される:

  • {StructName}Builder struct (Option-wrapped fields)
  • impl {StructName}Builder with new(), setter methods, build()
  • (オプション) impl {StructName} with builder() method

§Example

{
  "type": "GenerateBuilder",
  "struct_name": "Config",
  "fields": [
    ["host", "String"],
    ["port", "u16"],
    ["timeout", "Option<u32>"]
  ]
}

Fields

§symbol_id: Option<String>

SymbolId(O(1)確定、“7v2“形式)

§symbol_path: Option<String>

シンボルパス(“tokio::net::TcpStream“形式)

§target_struct: Option<String>

対象の struct 名(診断用、フォールバック検索)

§target_mod: Option<String>

Builder追加先のモジュールパス(例: “crate::config”) symbol_id指定時は省略可(registryから解決)

§fields: Vec<(String, String)>

フィールド定義 [(name, type), …]

§add_builder_method: bool

元の struct に builder() メソッドを追加するか(デフォルト: true)

§

ReplaceExpr

式を別の式に置換

対象指定方法(どちらか一方を使用):

  • old_expr: パターンマッチで対象を検索
  • symbol_path: 直接位置指定(例: “crate::fn::$body::0::1”)

Fields

§target_mod: Option<String>

対象モジュール(None = 全モジュール)

§target_fn: Option<String>

対象の関数名(None=全関数)

§old_expr: String

置換元の式(Rustコード文字列)- パターンマッチ方式

§new_expr: String

置換先の式(Rustコード文字列)

§replace_all: bool

全ての出現箇所を置換するか(デフォルト: true)

§symbol_path: Option<String>

直接位置指定(例: “my_crate::my_fn::$body::0::1::2”) 指定時は old_expr を無視し、この位置の式を直接置換

§

RemoveStatement

文を削除

対象指定方法(どちらか一方を使用):

  • pattern: パターンマッチで対象を検索
  • symbol_path: 直接位置指定(例: “crate::fn::$body::2”)

Fields

§target_mod: Option<String>

対象モジュール(None = 全モジュール)

§target_fn: Option<String>

対象の関数名(None=全関数)

§pattern: String

削除対象の文パターン(Rustコード文字列, e.g. “println!(..)”)- パターンマッチ方式

§remove_all: bool

全ての出現箇所を削除するか(デフォルト: true)

§symbol_path: Option<String>

直接位置指定(例: “my_crate::my_fn::$body::2”) 指定時は pattern を無視し、この位置の文を直接削除

§

InsertStatement

文を挿入

対象指定方法:

  • target_fn + position: 従来方式
  • symbol_path: 直接位置指定($body::N の後に挿入)

Fields

§target_mod: Option<String>

対象モジュール(None = 全モジュール)

§target_fn: String

対象の関数名

§stmt: String

挿入する文(Rustコード文字列)

§position: StmtInsertPosition

挿入位置

§reference_pattern: Option<String>

参照パターン(BeforePattern/AfterPattern用)

§symbol_path: Option<String>

直接位置指定(例: “my_crate::my_fn::$body::2”) 指定時は position を無視し、この位置の後に挿入

§

ReplaceStatement

文を別の文に置換

対象指定方法(どちらか一方を使用):

  • old_stmt: パターンマッチで対象を検索
  • symbol_path: 直接位置指定(例: “crate::fn::$body::1”)

Fields

§target_mod: Option<String>

対象モジュール(None = 全モジュール)

§target_fn: Option<String>

対象の関数名(None=全関数)

§old_stmt: String

置換元の文パターン(Rustコード文字列)- パターンマッチ方式

§new_stmt: String

置換先の文(Rustコード文字列)

§symbol_path: Option<String>

直接位置指定(例: “my_crate::my_fn::$body::1”) 指定時は old_stmt を無視し、この位置の文を直接置換

§

AssignOp

代入演算子の簡略化: x = x + 1x += 1

Fields

§target_mod: Option<String>

対象モジュール(None = 全モジュール)

§target_fn: Option<String>

特定の関数のみ対象

§

BoolSimplify

bool式の簡略化: x == truex, x == false!x

Fields

§target_mod: Option<String>

対象モジュール(None = 全モジュール)

§

CloneOnCopy

Copy型での冗長な.clone()削除

Fields

§target_mod: Option<String>

対象モジュール(None = 全モジュール)

§

CollapsibleIf

ネストしたifを&&で統合: if a { if b { ... } }if a && b { ... }

Fields

§target_mod: Option<String>

対象モジュール(None = 全モジュール)

§

ComparisonToMethod

比較をメソッド呼び出しに変換: s == ""s.is_empty()

Fields

§target_mod: Option<String>

対象モジュール(None = 全モジュール)

§

RedundantClosure

冗長なクロージャを削除: |x| f(x)f

Fields

§target_mod: Option<String>

対象モジュール(None = 全モジュール)

§

ManualMap

matchをmap()に変換: match opt { Some(x) => Some(f(x)), None => None }opt.map(f)

Fields

§target_mod: Option<String>

対象モジュール(None = 全モジュール)

§

MatchToIfLet

matchをif letに変換

Fields

§target_mod: Option<String>

対象モジュール(None = 全モジュール)

§

FilterNext

.filter().next() を .find() に変換

Fields

§target_mod: Option<String>

対象モジュール(None = 全モジュール)

§target_fn: Option<String>

特定の関数のみ対象

§

MapUnwrapOr

.map().unwrap_or() を .map_or() に変換

Fields

§target_mod: Option<String>

対象モジュール(None = 全モジュール)

§target_fn: Option<String>

特定の関数のみ対象

§

Custom

LLMが理解したが定義済みIntentにマッチしない場合

Fields

§description: String
§examples: Vec<TransformExample>

LLMが推測した変換例(Before → After)

Trait Implementations§

Source§

impl Clone for Intent

Source§

fn clone(&self) -> Intent

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for Intent

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<'de> Deserialize<'de> for Intent

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl From<CascadeSpec> for Intent

Source§

fn from(spec: CascadeSpec) -> Self

Converts to this type from the input type.
Source§

impl Serialize for Intent

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> DynClone for T
where T: Clone,

Source§

fn __clone_box(&self, _: Private) -> *mut ()

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> FutureExt for T

Source§

fn with_context(self, otel_cx: Context) -> WithContext<Self>

Attaches the provided Context to this type, returning a WithContext wrapper. Read more
Source§

fn with_current_context(self) -> WithContext<Self>

Attaches the current Context to this type, returning a WithContext wrapper. Read more
Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts self into a Left variant of Either<Self, Self> if into_left is true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts self into a Left variant of Either<Self, Self> if into_left(&self) returns true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

impl<T> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,