Skip to main content

OperationKind

Enum OperationKind 

Source
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.

Fields

§sig_id: SigId
§stage_id: StageId
§effects: EffectSet
§

RemoveFunction

Function removed; last_stage_id is the head before the remove (so blame can walk the predecessor without scanning).

Fields

§sig_id: SigId
§last_stage_id: StageId
§

ModifyBody

Function body changed; signature unchanged.

Fields

§sig_id: SigId
§from_stage_id: StageId
§to_stage_id: StageId
§

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.

Fields

§from: SigId
§body_stage_id: StageId
§

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

§sig_id: SigId
§from_stage_id: StageId
§to_stage_id: StageId
§from_effects: EffectSet
§to_effects: EffectSet
§

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.

Fields

§in_file: String
§module: ModuleRef
§

RemoveImport

Fields

§in_file: String
§module: ModuleRef
§

AddType

Fields

§sig_id: SigId
§stage_id: StageId
§

RemoveType

Fields

§sig_id: SigId
§last_stage_id: StageId
§

ModifyType

Fields

§sig_id: SigId
§from_stage_id: StageId
§to_stage_id: StageId
§

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).

Fields

§resolved: usize

Implementations§

Source§

impl OperationKind

Source

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 / nested MergeNone (no single sig→stage delta)

Trait Implementations§

Source§

impl Clone for OperationKind

Source§

fn clone(&self) -> OperationKind

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for OperationKind

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<'de> Deserialize<'de> for OperationKind

Source§

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 PartialEq for OperationKind

Source§

fn eq(&self, other: &OperationKind) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl Serialize for OperationKind

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
Source§

impl Eq for OperationKind

Source§

impl StructuralPartialEq for OperationKind

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Checks if this value is equivalent to the given key. Read more
Source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,