#[non_exhaustive]pub struct Finding {
pub kind: MetadataKind,
pub location: String,
pub field: Option<String>,
pub bytes: u64,
pub value: Option<MetadataValue>,
}Expand description
One piece of metadata found in a file.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.kind: MetadataKindWhat kind of identifying information this is.
location: StringWhere it lives in the file’s structure, as a format-domain identifier — APP1 (Exif),
tEXt, /Info /Author. Stable across releases; front-ends may show it verbatim.
field: Option<String>The field’s name within that structure, where the format names its fields.
bytes: u64Size of the item in bytes.
value: Option<MetadataValue>The value — present only when InspectOptions::include_values was set.
Implementations§
Source§impl Finding
impl Finding
Sourcepub fn new(kind: MetadataKind, location: impl Into<String>, bytes: u64) -> Self
pub fn new(kind: MetadataKind, location: impl Into<String>, bytes: u64) -> Self
A finding with no field name and no value.
Sourcepub fn with_field(self, field: impl Into<String>) -> Self
pub fn with_field(self, field: impl Into<String>) -> Self
Attach the field name this item was stored under.
Sourcepub fn with_value(
self,
options: &InspectOptions,
value: impl FnOnce() -> MetadataValue,
) -> Self
pub fn with_value( self, options: &InspectOptions, value: impl FnOnce() -> MetadataValue, ) -> Self
Attach the value, but only if options asked for it.
Taking the options here rather than at the call site means a handler cannot leak a value by forgetting to check — the check lives in one place and every handler goes through it.
Sourcepub const fn sensitivity(&self) -> Sensitivity
pub const fn sensitivity(&self) -> Sensitivity
How directly this finding exposes its subject.
Trait Implementations§
impl Eq for Finding
impl StructuralPartialEq for Finding
Auto Trait Implementations§
impl Freeze for Finding
impl RefUnwindSafe for Finding
impl Send for Finding
impl Sync for Finding
impl Unpin for Finding
impl UnsafeUnpin for Finding
impl UnwindSafe for Finding
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.