Skip to main content

EditErrorKind

Enum EditErrorKind 

Source
#[non_exhaustive]
pub enum EditErrorKind {
Show 17 variants AmbiguousTarget, NoMatch, SyntaxInvalid, ConflictingEdit, ParseError, GuardRejected, InvalidInput, TypeError, OperationFailed, FormatFailed, AlreadyExists, NotFound, Conflicts, ChangesDetected, Binary, InvalidEncoding, FuzzySpanSuspicious,
}
Expand description

Classification of edit errors.

Marked non_exhaustive so new honesty kinds (for example Self::TypeError) can land in minor releases without breaking external exhaustive matches.

Append-only variants: new kinds must be added after the last existing variant. Inserting in the middle shifts discriminants of later variants and fails cargo-semver-checks (enum_no_repr_variant_discriminant_changed), which blocks patch releases (see #1950 order fix for #1951).

Variants (Non-exhaustive)§

This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
§

AmbiguousTarget

The edit target matched multiple locations in the file.

§

NoMatch

The edit target was not found in the file.

§

SyntaxInvalid

The edit would produce invalid syntax.

§

ConflictingEdit

Another edit already modified this region (for batch operations).

§

ParseError

The file could not be parsed.

§

GuardRejected

Path rejected by workspace PathGuard (#1492).

§

InvalidInput

Invalid arguments or options for the edit.

§

TypeError

Wrong value type for a doc selector (multi-document YAML bare key, navigate into array as object, etc.). CLI JSON uses error_kind: "type_error". Distinct from Self::InvalidInput so hosts can recover with 0.key / [0].key without scraping English (#1883).

§

OperationFailed

I/O or other operational failure.

§

FormatFailed

Post-write format/lint hook failed (format_failed / #1663). Distinct from generic Self::OperationFailed so hosts can branch without scraping English.

§

AlreadyExists

Create/rename destination already exists without force. CLI JSON uses error_kind: "already_exists". Distinct from Self::InvalidInput (empty path, directory target) and content SoftSkip (Self::Binary / Self::InvalidEncoding) so hosts can hint overwrite/force without scraping English (#1947 / #1963). Appended after Self::FormatFailed so 0.18.0 discriminants stay stable.

§

NotFound

Path not found (std::io::ErrorKind::NotFound). CLI JSON uses error_kind: "not_found". Distinct from generic Self::OperationFailed so hosts can treat missing paths separately from other I/O failures.

§

Conflicts

Patch/apply produced merge conflict markers. CLI JSON uses error_kind: "conflicts". Distinct from Self::ConflictingEdit (batch region overlap) and generic Self::OperationFailed.

§

ChangesDetected

Check/preview reported pending changes, or soft assert-count mismatch (error_kind: "changes_detected", exit 2). Distinct from Self::OperationFailed so hosts can mirror CLI exit-2 semantics without scraping English.

§

Binary

Target contains NUL in the binary probe window (not agent-editable text). CLI JSON uses error_kind: "binary". Distinct from Self::InvalidInput (empty path, directory target, empty pattern) so hosts can recover overwrite/delete/rename without treating all invalid input as binary (#1963). Appended after Self::ChangesDetected so 0.18/0.19 discriminants stay stable.

§

InvalidEncoding

Target is not valid UTF-8 (and not binary by NUL probe). CLI JSON uses error_kind: "invalid_encoding". Distinct from Self::Binary and Self::InvalidInput (#1963).

§

FuzzySpanSuspicious

Fuzzy match span is over-wide vs old under crate::api::FuzzySpanPolicy (or the host refused via ReplaceOptions::refuse_suspicious_fuzzy). CLI/library JSON uses error_kind: "fuzzy_span_suspicious" (#2005). Appended after Self::InvalidEncoding so 0.20/0.21 discriminants stay stable.

Trait Implementations§

Source§

impl Clone for EditErrorKind

Source§

fn clone(&self) -> EditErrorKind

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 Copy for EditErrorKind

Source§

impl Debug for EditErrorKind

Source§

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

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

impl<'de> Deserialize<'de> for EditErrorKind

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 Display for EditErrorKind

Source§

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

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

impl Eq for EditErrorKind

Source§

impl PartialEq for EditErrorKind

Source§

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

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

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

Inequality operator !=. Read more
Source§

impl Serialize for EditErrorKind

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 StructuralPartialEq for EditErrorKind

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> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,

Source§

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

Source§

fn __clone_box(&self, _: Private) -> *mut ()

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<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<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

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

Source§

fn from_ref(input: &T) -> T

Converts to this type from a reference to the input type.
Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
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> IntoEither for T

Source§

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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

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

impl<T> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
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> ToString for T
where T: Display + ?Sized,

Source§

fn to_string(&self) -> String

Converts the given value to a String. 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> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more