pub enum MutationTargetSymbol {
ById(SymbolId),
ByPath(Box<SymbolPath>),
ByKindAndName(ItemKind, String),
ByAffectedId {
parent_id: SymbolId,
kind: ItemKind,
name: Option<String>,
},
}Expand description
Target symbol specification for MutationSpec.
Supports flexible target resolution:
- Eager: Already resolved to SymbolId
- Lazy: Resolved during Wave execution (DetectConflict phase)
- Derived: Resolved from parent mutations (e.g., newly added struct)
§Design
Replaces the scattered request_* fields with a unified approach.
Enables batch processing of Add & Update operations within a Wave.
§Examples
ById(symbol_id) // Direct reference (already resolved)
ByPath("crate::config::Settings") // Lazy resolution by path
ByKindAndName(Struct, "User") // Lazy resolution by kind + name
ByAffectedId(parent_id, Field, "id") // Derived from parent (e.g., field in newly added struct)Variants§
ById(SymbolId)
Direct reference by SymbolId (already resolved)
ByPath(Box<SymbolPath>)
Lazy resolution by SymbolPath (parsed path)
ByKindAndName(ItemKind, String)
Lazy resolution by kind and name
ByAffectedId
Derived from affected parent symbol Example: Field in a struct that was just added in the same Wave
Implementations§
Source§impl MutationTargetSymbol
impl MutationTargetSymbol
Sourcepub fn by_path(path: SymbolPath) -> Self
pub fn by_path(path: SymbolPath) -> Self
Create a lazy SymbolPath reference
Sourcepub fn by_kind_and_name(kind: ItemKind, name: impl Into<String>) -> Self
pub fn by_kind_and_name(kind: ItemKind, name: impl Into<String>) -> Self
Create a lazy kind+name reference
Sourcepub fn by_affected_id(
parent_id: SymbolId,
kind: ItemKind,
name: Option<String>,
) -> Self
pub fn by_affected_id( parent_id: SymbolId, kind: ItemKind, name: Option<String>, ) -> Self
Create a derived reference from parent
Sourcepub fn is_resolved(&self) -> bool
pub fn is_resolved(&self) -> bool
Check if this is already resolved to a SymbolId
Sourcepub fn to_path(&self, registry: &SymbolRegistry) -> Option<SymbolPath>
pub fn to_path(&self, registry: &SymbolRegistry) -> Option<SymbolPath>
Resolve to SymbolPath using the registry.
Returns Some(SymbolPath) if resolution succeeds, None otherwise.
Trait Implementations§
Source§impl Clone for MutationTargetSymbol
impl Clone for MutationTargetSymbol
Source§fn clone(&self) -> MutationTargetSymbol
fn clone(&self) -> MutationTargetSymbol
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 MutationTargetSymbol
impl Debug for MutationTargetSymbol
Source§impl<'de> Deserialize<'de> for MutationTargetSymbol
impl<'de> Deserialize<'de> for MutationTargetSymbol
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
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 Hash for MutationTargetSymbol
impl Hash for MutationTargetSymbol
Source§impl PartialEq for MutationTargetSymbol
impl PartialEq for MutationTargetSymbol
Source§fn eq(&self, other: &MutationTargetSymbol) -> bool
fn eq(&self, other: &MutationTargetSymbol) -> bool
Tests for
self and other values to be equal, and is used by ==.Source§impl Serialize for MutationTargetSymbol
impl Serialize for MutationTargetSymbol
impl Eq for MutationTargetSymbol
impl StructuralPartialEq for MutationTargetSymbol
Auto Trait Implementations§
impl Freeze for MutationTargetSymbol
impl RefUnwindSafe for MutationTargetSymbol
impl Send for MutationTargetSymbol
impl Sync for MutationTargetSymbol
impl Unpin for MutationTargetSymbol
impl UnsafeUnpin for MutationTargetSymbol
impl UnwindSafe for MutationTargetSymbol
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> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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