#[non_exhaustive]pub enum Error {
CompatibilityViolation(&'static str),
InvalidBuilderConfiguration(&'static str),
#[non_exhaustive] SinkWriteFailed {
sink_index: usize,
source: Error,
},
Io(Error),
}Expand description
Errors returned by the rusty_pee library API.
Per FR-028 + FR-029, the enum carries the enum-level #[non_exhaustive]
marker (protects future variant additions) AND each non-unit variant
individually carries #[non_exhaustive] (protects future field additions
inside variants).
§Examples
use rusty_pee::Error;
let e = Error::CompatibilityViolation("--capture not honored in Strict mode");
assert_eq!(e.to_string(), "compatibility violation: --capture not honored in Strict mode");Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
CompatibilityViolation(&'static str)
A Default-mode-only setting was passed to Strict mode (or vice versa).
Returned from PeeBuilder::build() only — before any IO occurs, so
no sinks are touched.
InvalidBuilderConfiguration(&'static str)
The builder was configured into an impossible state (e.g., explicit
settings whose combination is logically invalid).
Returned from PeeBuilder::build() only.
#[non_exhaustive]SinkWriteFailed
A sink’s write failed mid-stream. Surfaced only when the builder
was configured with ignore_write_errors(false). Carries the
registration index of the failing sink and the underlying io error.
Observable state: surviving sinks have received the complete current chunk in registration order (per FR-036). The failing sink is dropped from the live-set.
Fields
This variant is marked as non-exhaustive
Io(Error)
An underlying IO error from the reader or process layer.
Observable state: may leave sinks in a partially-written state for the current chunk.
Trait Implementations§
Source§impl Error for Error
impl Error for Error
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()