pub enum CascadeSpec {
AddDerive {
symbol_id: SymbolId,
derives: Vec<String>,
},
GenerateImpl {
target: SymbolPath,
trait_name: String,
call_new: bool,
},
ChangeVisibility {
symbol_id: SymbolId,
visibility: Visibility,
},
AddUse {
target_module: SymbolPath,
path: String,
},
AddMatchArm {
target: SymbolPath,
function_name: String,
enum_name: String,
pattern: String,
body: String,
},
RemoveMatchArm {
target: SymbolPath,
function_name: String,
enum_name: String,
pattern: String,
},
}Expand description
Cascade分析結果として生成される変更仕様
MutationSpecへの変換はryo-executorのFrom<CascadeSpec>で実装される。
Variants§
AddDerive
derive macroを追加
例: #[derive(Default)] を追加し、フィールド型にも伝播
Note: symbol_id is required. request_* fields are for diagnostics only.
Fields
GenerateImpl
manual impl blockを生成
derive不可能な場合(フィールド型がderive未対応)に使用
ChangeVisibility
visibilityを変更
cross-module accessエラーの修正に使用
AddUse
use文を追加
型参照の解決に使用
AddMatchArm
match式に新しいarmを追加
enum variantを追加した際の網羅性エラー修正に使用
Fields
§
target: SymbolPath対象モジュールへのSymbolPath
RemoveMatchArm
match式からarmを削除
enum variantを削除した際の不要arm除去に使用
Implementations§
Source§impl CascadeSpec
impl CascadeSpec
Sourcepub fn add_derive(symbol_id: SymbolId, derives: Vec<String>) -> Self
pub fn add_derive(symbol_id: SymbolId, derives: Vec<String>) -> Self
AddDeriveを作成
Sourcepub fn generate_impl(
target: SymbolPath,
trait_name: impl Into<String>,
call_new: bool,
) -> Self
pub fn generate_impl( target: SymbolPath, trait_name: impl Into<String>, call_new: bool, ) -> Self
GenerateImplを作成
Sourcepub fn change_visibility(symbol_id: SymbolId, visibility: Visibility) -> Self
pub fn change_visibility(symbol_id: SymbolId, visibility: Visibility) -> Self
ChangeVisibilityを作成
Sourcepub fn add_use(target_module: SymbolPath, path: impl Into<String>) -> Self
pub fn add_use(target_module: SymbolPath, path: impl Into<String>) -> Self
AddUseを作成
Sourcepub fn add_match_arm(
target: SymbolPath,
function_name: impl Into<String>,
enum_name: impl Into<String>,
pattern: impl Into<String>,
body: impl Into<String>,
) -> Self
pub fn add_match_arm( target: SymbolPath, function_name: impl Into<String>, enum_name: impl Into<String>, pattern: impl Into<String>, body: impl Into<String>, ) -> Self
AddMatchArmを作成
Sourcepub fn remove_match_arm(
target: SymbolPath,
function_name: impl Into<String>,
enum_name: impl Into<String>,
pattern: impl Into<String>,
) -> Self
pub fn remove_match_arm( target: SymbolPath, function_name: impl Into<String>, enum_name: impl Into<String>, pattern: impl Into<String>, ) -> Self
RemoveMatchArmを作成
Trait Implementations§
Source§impl Clone for CascadeSpec
impl Clone for CascadeSpec
Source§fn clone(&self) -> CascadeSpec
fn clone(&self) -> CascadeSpec
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for CascadeSpec
impl Debug for CascadeSpec
Source§impl PartialEq for CascadeSpec
impl PartialEq for CascadeSpec
Source§fn eq(&self, other: &CascadeSpec) -> bool
fn eq(&self, other: &CascadeSpec) -> bool
Tests for
self and other values to be equal, and is used by ==.impl Eq for CascadeSpec
impl StructuralPartialEq for CascadeSpec
Auto Trait Implementations§
impl Freeze for CascadeSpec
impl RefUnwindSafe for CascadeSpec
impl Send for CascadeSpec
impl Sync for CascadeSpec
impl Unpin for CascadeSpec
impl UnsafeUnpin for CascadeSpec
impl UnwindSafe for CascadeSpec
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
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 moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
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