#[non_exhaustive]pub enum AtomwriteError {
Show 20 variants
NotFound {
path: PathBuf,
},
InvalidInput {
reason: String,
},
PermissionDenied {
path: PathBuf,
},
DiskFull {
path: PathBuf,
},
QuotaExceeded {
path: PathBuf,
},
CrossDevice {
path: PathBuf,
},
Io {
source: Error,
},
ConfigInvalid {
reason: String,
},
StateDrift {
path: PathBuf,
expected: String,
actual: String,
},
WorkspaceJail {
path: PathBuf,
workspace: PathBuf,
},
SymlinkBlocked {
path: PathBuf,
},
FileImmutable {
path: PathBuf,
},
BinaryFile {
path: PathBuf,
},
FifoDetected {
path: PathBuf,
},
DeviceFile {
path: PathBuf,
},
ChecksumVerifyFailed {
path: PathBuf,
expected: String,
},
FileTooLarge {
path: PathBuf,
size: u64,
max_size: u64,
},
NoMatches,
BrokenPipe,
InternalError {
reason: String,
},
}Expand description
Domain-specific errors for atomic file operations.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
NotFound
Target file does not exist.
InvalidInput
Caller-provided input failed validation.
PermissionDenied
Insufficient filesystem permissions.
DiskFull
No space left on the device.
QuotaExceeded
Filesystem quota exceeded.
CrossDevice
Rename attempted across different mount points.
Io
Wrapped standard I/O error.
ConfigInvalid
Invalid CLI or runtime configuration.
StateDrift
File checksum changed between read and write (optimistic lock failure).
Fields
WorkspaceJail
Path resolved outside the workspace jail boundary.
Fields
SymlinkBlocked
Symbolic link encountered when symlinks are disallowed.
FileImmutable
File has immutable attributes preventing modification.
BinaryFile
File detected as binary when text-only mode is required.
FifoDetected
FIFO or named pipe detected where regular file expected.
DeviceFile
Block or character device file detected.
ChecksumVerifyFailed
Checksum verification failed (hash –verify mismatch).
Fields
FileTooLarge
File exceeds the configured maximum size.
Fields
NoMatches
Search or replace found zero matches.
BrokenPipe
Downstream consumer closed the output pipe.
InternalError
Unexpected internal error.
Implementations§
Source§impl AtomwriteError
impl AtomwriteError
Sourcepub const fn error_class(&self) -> ErrorClass
pub const fn error_class(&self) -> ErrorClass
Classify the error for retry decisions.
Sourcepub fn is_retryable(&self) -> bool
pub fn is_retryable(&self) -> bool
Return true if the error class indicates a retry may succeed.
Retryable variants (transient): Self::DiskFull, Self::QuotaExceeded, Self::Io.
Retryable variants (conflict): Self::StateDrift, Self::CrossDevice.
All other variants are non-retryable (precondition or permanent).
Sourcepub fn is_permanent(&self) -> bool
pub fn is_permanent(&self) -> bool
Return true if retrying this error will never succeed.
Permanent errors include: Self::NotFound, Self::InvalidInput,
Self::PermissionDenied, Self::ConfigInvalid, Self::NoMatches,
Self::BrokenPipe, and Self::InternalError.
Sourcepub const fn error_code(&self) -> &'static str
pub const fn error_code(&self) -> &'static str
Return the machine-readable error code string for NDJSON output.
Trait Implementations§
Source§impl Debug for AtomwriteError
impl Debug for AtomwriteError
Source§impl Display for AtomwriteError
impl Display for AtomwriteError
Source§impl Error for AtomwriteError
impl Error for AtomwriteError
Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
use the Display impl or to_string()
Auto Trait Implementations§
impl !RefUnwindSafe for AtomwriteError
impl !UnwindSafe for AtomwriteError
impl Freeze for AtomwriteError
impl Send for AtomwriteError
impl Sync for AtomwriteError
impl Unpin for AtomwriteError
impl UnsafeUnpin for AtomwriteError
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> 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