#[non_exhaustive]pub enum SliceError {
OverCap {
slicer: String,
produced: usize,
cap: usize,
},
CapTooSmall {
cap: usize,
minimum: usize,
},
Store(StoreError),
Unsuitable {
slicer: String,
detail: String,
},
}Expand description
Slicing failed.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
OverCap
The slicer produced more than the cap allows.
A bug in the slicer, not a condition to handle: see the module documentation for why this is not silently truncated.
Fields
CapTooSmall
The cap is too small to say anything at all.
Distinct from OverCap: the slicer did nothing wrong,
the step declared a window that cannot hold even a summary. That is a
flow authoring error and the message says so.
Store(StoreError)
The raw output could not be preserved.
Unsuitable
The input was not what this slicer handles.
Carries the reason so a caller can decide to fall back — which is what the AST slicer does when a file does not parse (US-0702).
Implementations§
Source§impl SliceError
impl SliceError
Sourcepub fn can_fall_back(&self) -> bool
pub fn can_fall_back(&self) -> bool
Whether another slicer might succeed where this one did not.
True only for Unsuitable. An over-cap slicer is
broken and a too-small cap is a flow error; neither is fixed by trying
something else, and falling back on them would hide a real problem.
Trait Implementations§
Source§impl Clone for SliceError
impl Clone for SliceError
Source§impl Debug for SliceError
impl Debug for SliceError
Source§impl Display for SliceError
impl Display for SliceError
impl Eq for SliceError
Source§impl Error for SliceError
impl Error for SliceError
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()