#[non_exhaustive]pub enum SnipError {
Io {
operation: String,
path: Option<PathBuf>,
source: Error,
},
Toml {
operation: String,
source: Box<dyn Error + Send + Sync>,
},
Clipboard {
operation: String,
message: String,
},
Command {
command: String,
args: Vec<String>,
source: Error,
},
Runtime {
message: String,
detail: Option<String>,
},
}Expand description
All possible errors that can occur in snp.
Errors are categorized by domain to make debugging and handling easier. Each variant includes context about the operation that failed.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Io
I/O operation failures.
Includes file read/write errors, directory creation failures, etc.
Toml
TOML parsing or serialization errors.
Indicates malformed TOML content or serialization failures.
Clipboard
Clipboard operation failures.
Includes clipboard access errors and content transfer failures.
Command
Command execution failures.
Indicates errors when spawning or running external commands.
Runtime
Runtime errors during operation.
General-purpose errors for sync failures, validation errors, etc.
Implementations§
Source§impl SnipError
impl SnipError
Sourcepub fn io_error(
operation: &str,
path: impl Into<PathBuf>,
source: Error,
) -> Self
pub fn io_error( operation: &str, path: impl Into<PathBuf>, source: Error, ) -> Self
Create an I/O error with operation context and optional file path.
Sourcepub fn toml_error(
operation: &str,
source: impl Error + Send + Sync + 'static,
) -> Self
pub fn toml_error( operation: &str, source: impl Error + Send + Sync + 'static, ) -> Self
Create a TOML parsing or serialization error with operation context.
Sourcepub fn clipboard_error(operation: &str, message: impl Into<String>) -> Self
pub fn clipboard_error(operation: &str, message: impl Into<String>) -> Self
Create a clipboard error with operation context and message.
Sourcepub fn command_error(command: &str, args: Vec<String>, source: Error) -> Self
pub fn command_error(command: &str, args: Vec<String>, source: Error) -> Self
Create a command execution error with command name, arguments, and source error.
Sourcepub fn runtime_error(message: &str, detail: Option<&str>) -> Self
pub fn runtime_error(message: &str, detail: Option<&str>) -> Self
Create a runtime error with a message and optional detail string.
Trait Implementations§
Source§impl Error for SnipError
impl Error for SnipError
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()
Source§impl From<CryptoError> for SnipError
impl From<CryptoError> for SnipError
Source§fn from(e: CryptoError) -> Self
fn from(e: CryptoError) -> Self
Auto Trait Implementations§
impl !RefUnwindSafe for SnipError
impl !UnwindSafe for SnipError
impl Freeze for SnipError
impl Send for SnipError
impl Sync for SnipError
impl Unpin for SnipError
impl UnsafeUnpin for SnipError
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 moreSource§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T in a tonic::RequestSource§impl<T> ToCompactString for Twhere
T: Display,
impl<T> ToCompactString for Twhere
T: Display,
Source§fn try_to_compact_string(&self) -> Result<CompactString, ToCompactStringError>
fn try_to_compact_string(&self) -> Result<CompactString, ToCompactStringError>
ToCompactString::to_compact_string() Read moreSource§fn to_compact_string(&self) -> CompactString
fn to_compact_string(&self) -> CompactString
CompactString. Read more