pub struct DetectEncodingItem {
pub path: String,
pub status: &'static str,
pub encoding: Option<String>,
pub confidence: Option<f32>,
pub has_bom: Option<bool>,
pub bytes_sampled: Option<u64>,
pub error: Option<DetectEncodingItemError>,
}Expand description
Per-file encoding-detection record emitted in JSON mode.
Successful entries carry encoding/confidence/has_bom/
bytes_sampled and omit error. Failed entries carry error and
omit the detection fields.
Fields§
§path: StringPath as supplied on the command line (or as resolved through
-i/recursive directory walk).
status: &'static str"ok" when the file was successfully sampled, "error"
otherwise.
encoding: Option<String>Canonical encoding label (e.g. "UTF-8", "GBK", "Big5").
confidence: Option<f32>Detection confidence in [0.0, 1.0].
has_bom: Option<bool>Whether a Byte Order Mark was detected.
bytes_sampled: Option<u64>Number of bytes the detector inspected. Capped at the detector’s internal sample window (currently 8 KiB).
error: Option<DetectEncodingItemError>Per-item error envelope when status == "error".
Trait Implementations§
Source§impl Debug for DetectEncodingItem
impl Debug for DetectEncodingItem
Auto Trait Implementations§
impl Freeze for DetectEncodingItem
impl RefUnwindSafe for DetectEncodingItem
impl Send for DetectEncodingItem
impl Sync for DetectEncodingItem
impl Unpin for DetectEncodingItem
impl UnsafeUnpin for DetectEncodingItem
impl UnwindSafe for DetectEncodingItem
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
Mutably borrows from an owned value. Read more