#[non_exhaustive]pub struct EvaluationMetadata {
pub file_size: u64,
pub evaluation_time_ms: f64,
pub rules_evaluated: usize,
pub magic_file: Option<PathBuf>,
pub timed_out: bool,
}Expand description
Metadata about the evaluation process
Contains diagnostic information about how the evaluation was performed, including performance metrics and statistics about rule processing.
§Examples
use libmagic_rs::EvaluationMetadata;
use std::path::PathBuf;
let metadata = EvaluationMetadata::new(
8192,
2.5,
42,
Some(PathBuf::from("/usr/share/misc/magic")),
false,
);
assert_eq!(metadata.file_size, 8192);
assert!(!metadata.timed_out);Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.file_size: u64Size of the analyzed file or buffer in bytes
evaluation_time_ms: f64Time taken to evaluate rules in milliseconds
rules_evaluated: usizeNumber of top-level rules that were evaluated
magic_file: Option<PathBuf>Path to the magic file used, or None for built-in rules
timed_out: boolWhether evaluation was stopped due to timeout
Implementations§
Source§impl EvaluationMetadata
impl EvaluationMetadata
Sourcepub fn new(
file_size: u64,
evaluation_time_ms: f64,
rules_evaluated: usize,
magic_file: Option<PathBuf>,
timed_out: bool,
) -> Self
pub fn new( file_size: u64, evaluation_time_ms: f64, rules_evaluated: usize, magic_file: Option<PathBuf>, timed_out: bool, ) -> Self
Construct a new library-side EvaluationMetadata from the four
always-set fields. magic_file and timed_out default to None
/ false; use struct-update syntax with EvaluationMetadata::default()
to set them explicitly.
Trait Implementations§
Source§impl Clone for EvaluationMetadata
impl Clone for EvaluationMetadata
Source§fn clone(&self) -> EvaluationMetadata
fn clone(&self) -> EvaluationMetadata
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for EvaluationMetadata
impl Debug for EvaluationMetadata
Source§impl Default for EvaluationMetadata
impl Default for EvaluationMetadata
Auto Trait Implementations§
impl Freeze for EvaluationMetadata
impl RefUnwindSafe for EvaluationMetadata
impl Send for EvaluationMetadata
impl Sync for EvaluationMetadata
impl Unpin for EvaluationMetadata
impl UnsafeUnpin for EvaluationMetadata
impl UnwindSafe for EvaluationMetadata
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