Skip to main content

StructuredConflict

Struct StructuredConflict 

Source
pub struct StructuredConflict {
    pub id: String,
    pub path: String,
    pub symbol: Option<String>,
    pub occurrence: u32,
    pub merged_range: Option<ConflictRange>,
    pub base: Option<ConflictSide>,
    pub ours: Option<ConflictSide>,
    pub theirs: Option<ConflictSide>,
    pub status: i32,
    pub resolution: Option<String>,
    pub mode: Option<i32>,
    pub resolver: Option<ConflictResolverAttribution>,
}
Expand description

One independently addressable three-way conflict region, with lifecycle.

Fuses heddle’s ConflictRegionReport (region + three sides) and ConflictResolutionReport (mode / resolution text / resolver) into a single status-tagged message so clients never join two lists.

§Pin / addressability

id is a stable, content-addressed region identity — the same addressability class DiscussionReference.id gained. It is referenceable across states: a conflict discovered in one capture and resolved in another is one conflict to a human, and the same id is the join key.

Heddle derives id as a deterministic BLAKE3 address over (path, symbol, occurrence, base/ours/theirs hunk hashes) with domain separator heddle-conflict-region-v1 (format conflict-<hex>). That derivation is content-stable: unrelated line shifts and blob rewrites that leave the three hunks unchanged preserve the id (heddle object-model test stable_id_survives_unrelated_line_shifts_and_blob_rewrites).

Heddle follow-up (do not block this contract): producers that materialize resolved status into a later state’s attachment MUST keep emitting that same derived id rather than re-keying on state id or merged_range. Resolution rows in the CLI report already key on conflict_id matching the region id; attachment publishers must preserve that continuity.

Fields§

§id: String

Stable conflict-region id (e.g. conflict-<hex>). NEVER display text: clients resolve a label at render from path / symbol / current data.

§path: String

Repository-relative path of the conflicted file.

§symbol: Option<String>

Stable semantic address when the source language can be parsed. Omit (do not send empty string) when unknown.

§occurrence: u32

Disambiguates byte-identical conflicts under the same path/symbol anchor.

§merged_range: Option<ConflictRange>

Range occupied by the rendered conflict-marker block in the merged view. Zero-based, half-open [start_line, end_line).

§base: Option<ConflictSide>

Three-way sides. base / ours / theirs — NOT {left, right}. A three-way view is the whole reason a conflict is inspectable rather than a diff. Round-trips must carry cases where base differs from both ours and theirs.

§ours: Option<ConflictSide>§theirs: Option<ConflictSide>§status: i32

Lifecycle. Clients read status alone to answer “is this still open”.

§resolution: Option<String>

— Resolution fields: populated only when status is AUTO_RESOLVED or RESOLVED; omit while OPEN. Maps heddle ConflictResolutionReport. — Mode-as-string surface from heddle (ours / theirs / edit / auto). Prefer mode for typed consumers; resolution is retained for report parity and free-form edit summaries when mode == EDIT.

§mode: Option<i32>§resolver: Option<ConflictResolverAttribution>

Implementations§

Source§

impl StructuredConflict

Source

pub fn symbol(&self) -> &str

Returns the value of symbol, or the default value if symbol is unset.

Source

pub fn status(&self) -> StructuredConflictStatus

Returns the enum value of status, or the default if the field is set to an invalid enum value.

Source

pub fn set_status(&mut self, value: StructuredConflictStatus)

Sets status to the provided enum value.

Source

pub fn resolution(&self) -> &str

Returns the value of resolution, or the default value if resolution is unset.

Source

pub fn mode(&self) -> ConflictResolutionMode

Returns the enum value of mode, or the default if the field is unset or set to an invalid enum value.

Source

pub fn set_mode(&mut self, value: ConflictResolutionMode)

Sets mode to the provided enum value.

Trait Implementations§

Source§

impl Clone for StructuredConflict

Source§

fn clone(&self) -> StructuredConflict

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 StructuredConflict

Source§

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

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

impl Default for StructuredConflict

Source§

fn default() -> Self

Returns the “default value” for a type. Read more
Source§

impl Eq for StructuredConflict

Source§

impl Hash for StructuredConflict

Source§

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given Hasher. Read more
1.3.0 · Source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
Source§

impl Message for StructuredConflict

Source§

fn encoded_len(&self) -> usize

Returns the encoded length of the message without a length delimiter.
Source§

fn clear(&mut self)

Clears the message, resetting all fields to their default.
Source§

fn encode(&self, buf: &mut impl BufMut) -> Result<(), EncodeError>
where Self: Sized,

Encodes the message to a buffer. Read more
Source§

fn encode_to_vec(&self) -> Vec<u8>
where Self: Sized,

Encodes the message to a newly allocated buffer.
Source§

fn encode_length_delimited( &self, buf: &mut impl BufMut, ) -> Result<(), EncodeError>
where Self: Sized,

Encodes the message with a length-delimiter to a buffer. Read more
Source§

fn encode_length_delimited_to_vec(&self) -> Vec<u8>
where Self: Sized,

Encodes the message with a length-delimiter to a newly allocated buffer.
Source§

fn decode(buf: impl Buf) -> Result<Self, DecodeError>
where Self: Default,

Decodes an instance of the message from a buffer. Read more
Source§

fn decode_length_delimited(buf: impl Buf) -> Result<Self, DecodeError>
where Self: Default,

Decodes a length-delimited instance of the message from the buffer.
Source§

fn merge(&mut self, buf: impl Buf) -> Result<(), DecodeError>
where Self: Sized,

Decodes an instance of the message from a buffer, and merges it into self. Read more
Source§

fn merge_length_delimited(&mut self, buf: impl Buf) -> Result<(), DecodeError>
where Self: Sized,

Decodes a length-delimited instance of the message from buffer, and merges it into self.
Source§

impl PartialEq for StructuredConflict

Source§

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

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

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

Inequality operator !=. Read more
Source§

impl StructuralPartialEq for StructuredConflict

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