pub struct AddEnumMutation {
pub parent: SymbolId,
pub name: String,
pub variants: Vec<(String, PureFields)>,
pub is_pub: bool,
pub derives: Vec<String>,
}Expand description
Add a new enum to the file
Fields§
§parent: SymbolIdParent module SymbolId
name: String§variants: Vec<(String, PureFields)>§is_pub: bool§derives: Vec<String>Implementations§
Source§impl AddEnumMutation
impl AddEnumMutation
pub fn new(parent: SymbolId, name: impl Into<String>) -> Self
pub fn with_variant(self, name: impl Into<String>) -> Self
pub fn with_tuple_variant( self, name: impl Into<String>, types: Vec<String>, ) -> Self
pub fn with_struct_variant( self, name: impl Into<String>, fields: Vec<(String, String)>, ) -> Self
pub fn public(self) -> Self
pub fn with_derives(self, derives: Vec<String>) -> Self
Trait Implementations§
Source§impl Clone for AddEnumMutation
impl Clone for AddEnumMutation
Source§fn clone(&self) -> AddEnumMutation
fn clone(&self) -> AddEnumMutation
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 AddEnumMutation
impl Debug for AddEnumMutation
Source§impl Mutation for AddEnumMutation
impl Mutation for AddEnumMutation
Source§fn mutation_type(&self) -> &'static str
fn mutation_type(&self) -> &'static str
Get the mutation type name
Source§fn validate(&self, _file: &PureFile) -> ValidationResult
fn validate(&self, _file: &PureFile) -> ValidationResult
Validate the mutation before applying Read more
Source§fn can_proceed(&self, file: &PureFile, strategy: ValidationStrategy) -> bool
fn can_proceed(&self, file: &PureFile, strategy: ValidationStrategy) -> bool
Check if this mutation can proceed with the given strategy
Source§impl ToSerializable for AddEnumMutation
impl ToSerializable for AddEnumMutation
fn to_serializable(&self) -> SerializableMutation
Auto Trait Implementations§
impl Freeze for AddEnumMutation
impl RefUnwindSafe for AddEnumMutation
impl Send for AddEnumMutation
impl Sync for AddEnumMutation
impl Unpin for AddEnumMutation
impl UnsafeUnpin for AddEnumMutation
impl UnwindSafe for AddEnumMutation
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