#[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
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
impl Clone for EditErrorKind
Source§fn clone(&self) -> EditErrorKind
fn clone(&self) -> EditErrorKind
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreimpl Copy for EditErrorKind
Source§impl Debug for EditErrorKind
impl Debug for EditErrorKind
Source§impl<'de> Deserialize<'de> for EditErrorKind
impl<'de> Deserialize<'de> for EditErrorKind
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 Display for EditErrorKind
impl Display for EditErrorKind
impl Eq for EditErrorKind
Source§impl PartialEq for EditErrorKind
impl PartialEq for EditErrorKind
Source§impl Serialize for EditErrorKind
impl Serialize for EditErrorKind
impl StructuralPartialEq for EditErrorKind
Auto Trait Implementations§
impl Freeze for EditErrorKind
impl RefUnwindSafe for EditErrorKind
impl Send for EditErrorKind
impl Sync for EditErrorKind
impl Unpin for EditErrorKind
impl UnsafeUnpin for EditErrorKind
impl UnwindSafe for EditErrorKind
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,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
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.Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
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>
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>
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