pub struct AddVariantMutation {
pub enum_id: SymbolId,
pub variant_name: String,
pub fields: PureFields,
}Expand description
Add a variant to an existing enum
Fields§
§enum_id: SymbolId§variant_name: String§fields: PureFieldsImplementations§
Source§impl AddVariantMutation
impl AddVariantMutation
pub fn new( enum_id: SymbolId, variant_name: impl Into<String>, fields: PureFields, ) -> Self
pub fn unit(enum_id: SymbolId, variant_name: impl Into<String>) -> Self
pub fn tuple( enum_id: SymbolId, variant_name: impl Into<String>, types: Vec<String>, ) -> Self
pub fn struct_variant( enum_id: SymbolId, variant_name: impl Into<String>, fields: Vec<(String, String)>, ) -> Self
Trait Implementations§
Source§impl Clone for AddVariantMutation
impl Clone for AddVariantMutation
Source§fn clone(&self) -> AddVariantMutation
fn clone(&self) -> AddVariantMutation
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 AddVariantMutation
impl Debug for AddVariantMutation
Source§impl Mutation for AddVariantMutation
impl Mutation for AddVariantMutation
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 AddVariantMutation
impl ToSerializable for AddVariantMutation
fn to_serializable(&self) -> SerializableMutation
Auto Trait Implementations§
impl Freeze for AddVariantMutation
impl RefUnwindSafe for AddVariantMutation
impl Send for AddVariantMutation
impl Sync for AddVariantMutation
impl Unpin for AddVariantMutation
impl UnsafeUnpin for AddVariantMutation
impl UnwindSafe for AddVariantMutation
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