#[non_exhaustive]pub enum SkipReason {
Empty,
TooSmall,
Utf16Bom,
NotUtf8,
}Expand description
Why read_file_with_eol_classified declined to hand a file’s bytes to
the metric engine.
read_file_with_eol collapses every one of these into Ok(None), which
left front-ends unable to name the real cause — bca reported a
multi-kilobyte binary and a one-byte source alike as “empty” (#1287). This
enum is the classified form of that same decision; the variants map 1:1 onto
the skip branches of read_file_with_eol_classified.
Marked #[non_exhaustive]: a future gate (a size ceiling, a further
encoding) adds a variant additively, so match on it with a wildcard arm or
render it through Display.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Empty
The file is zero bytes long.
TooSmall
The file holds 1–3 bytes — too little to be worth parsing — or it
shrank below the UTF-8 probe window between the stat and the read.
Utf16Bom
The file opens with a UTF-16 BE or LE byte-order mark. Its interleaved-NUL body would pass a byte-level UTF-8 check and reach the parser as garbage, so it is skipped rather than decoded (#803).
NotUtf8
The file’s leading window is not valid UTF-8 — the shape a binary file takes here.
Trait Implementations§
Source§impl Clone for SkipReason
impl Clone for SkipReason
Source§fn clone(&self) -> SkipReason
fn clone(&self) -> SkipReason
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 SkipReason
Source§impl Debug for SkipReason
impl Debug for SkipReason
Source§impl Display for SkipReason
impl Display for SkipReason
Source§fn fmt(&self, f: &mut Formatter<'_>) -> Result
fn fmt(&self, f: &mut Formatter<'_>) -> Result
Renders the reason as a noun phrase naming the skipped file, so a
caller can splice it into a diagnostic: skipping {reason}: {path}.
Per the project diagnostic convention the phrase carries no severity word — the presenting layer owns that prefix.
impl Eq for SkipReason
Source§impl Hash for SkipReason
impl Hash for SkipReason
Source§impl PartialEq for SkipReason
impl PartialEq for SkipReason
impl StructuralPartialEq for SkipReason
Auto Trait Implementations§
impl Freeze for SkipReason
impl RefUnwindSafe for SkipReason
impl Send for SkipReason
impl Sync for SkipReason
impl Unpin for SkipReason
impl UnsafeUnpin for SkipReason
impl UnwindSafe for SkipReason
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,
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.