pub enum OperationKind {
AddFunction {
sig_id: SigId,
stage_id: StageId,
effects: EffectSet,
},
RemoveFunction {
sig_id: SigId,
last_stage_id: StageId,
},
ModifyBody {
sig_id: SigId,
from_stage_id: StageId,
to_stage_id: StageId,
},
RenameSymbol {
from: SigId,
to: SigId,
body_stage_id: StageId,
},
ChangeEffectSig {
sig_id: SigId,
from_stage_id: StageId,
to_stage_id: StageId,
from_effects: EffectSet,
to_effects: EffectSet,
},
AddImport {
in_file: String,
module: ModuleRef,
},
RemoveImport {
in_file: String,
module: ModuleRef,
},
AddType {
sig_id: SigId,
stage_id: StageId,
},
RemoveType {
sig_id: SigId,
last_stage_id: StageId,
},
ModifyType {
sig_id: SigId,
from_stage_id: StageId,
to_stage_id: StageId,
},
Merge {
resolved: usize,
},
}Expand description
The kinds of operations that produce stage transitions. Mirrors
the initial set in #129; new kinds (MoveBetweenFiles,
SplitFunction, ExtractType) can be added later as long as
they’re appended at the end of this enum or use explicit
#[serde(rename = "...")] tags so existing OpIds stay stable.
Variants§
AddFunction
New function published. effects is the effect set declared
in the signature; tracked here (not just inside the stage)
so #130’s write-time gate has a cheap path to check effect
changes without rehydrating the AST.
RemoveFunction
Function removed; last_stage_id is the head before the
remove (so blame can walk the predecessor without scanning).
ModifyBody
Function body changed; signature unchanged.
RenameSymbol
Symbol renamed. The body hash is preserved (body_stage_id)
so two renames of the same body collapse to the same OpId
and lex blame walks the rename as a single causal event
rather than delete + add.
ChangeEffectSig
Effect signature changed. Captures both old and new effect sets so the write-time gate (#130) can verify importers haven’t silently broken.
Fields
AddImport
Import added to a file. in_file is the canonical path
(relative to the repo root, forward-slashes) so two
machines hashing the same edit get the same OpId.
RemoveImport
AddType
RemoveType
ModifyType
Merge
Merge of two branch heads. Carries only an informational count
of resolved sigs so two structurally identical merges of
different sizes don’t collide on op_id; the per-sig deltas live
in OperationRecord::produces (StageTransition::Merge).
Implementations§
Source§impl OperationKind
impl OperationKind
Sourcepub fn merge_target(&self) -> Option<(SigId, Option<StageId>)>
pub fn merge_target(&self) -> Option<(SigId, Option<StageId>)>
The (SigId, Option<StageId>) an op kind targets, as used by
StageTransition::Merge::entries. Used by the merge-commit
path (#134) to translate a Resolution::Custom { op } into
the head-map delta the merge op records:
- Adds →
(sig, Some(stage_id)) - Modifies →
(sig, Some(to_stage_id)) - Removes →
(sig, None) - Renames →
(to_sig, Some(body_stage_id)) AddImport/RemoveImport/ nestedMerge→None(no single sig→stage delta)
Trait Implementations§
Source§impl Clone for OperationKind
impl Clone for OperationKind
Source§fn clone(&self) -> OperationKind
fn clone(&self) -> OperationKind
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for OperationKind
impl Debug for OperationKind
Source§impl<'de> Deserialize<'de> for OperationKind
impl<'de> Deserialize<'de> for OperationKind
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>,
Source§impl PartialEq for OperationKind
impl PartialEq for OperationKind
Source§fn eq(&self, other: &OperationKind) -> bool
fn eq(&self, other: &OperationKind) -> bool
self and other values to be equal, and is used by ==.Source§impl Serialize for OperationKind
impl Serialize for OperationKind
impl Eq for OperationKind
impl StructuralPartialEq for OperationKind
Auto Trait Implementations§
impl Freeze for OperationKind
impl RefUnwindSafe for OperationKind
impl Send for OperationKind
impl Sync for OperationKind
impl Unpin for OperationKind
impl UnsafeUnpin for OperationKind
impl UnwindSafe for OperationKind
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.