pub struct Magic<'m> { /* private fields */ }Expand description
Represents a file magic detection result
Implementations§
Source§impl<'m> Magic<'m>
impl<'m> Magic<'m>
Sourcepub fn into_owned<'owned>(self) -> Magic<'owned>
pub fn into_owned<'owned>(self) -> Magic<'owned>
Sourcepub fn strength(&self) -> u64
pub fn strength(&self) -> u64
Gets the confidence score of the detection. This
value is used to sort Magic in MagicDb::magic_best
and MagicDb::magic_all.
§Returns
u64- The confidence score attributed to thatMagic
Sourcepub fn creator_code(&self) -> Option<&str>
pub fn creator_code(&self) -> Option<&str>
Sourcepub fn extensions(&self) -> &HashSet<Cow<'m, str>>
pub fn extensions(&self) -> &HashSet<Cow<'m, str>>
Sourcepub fn is_default(&self) -> bool
pub fn is_default(&self) -> bool
Trait Implementations§
Auto Trait Implementations§
impl<'m> Freeze for Magic<'m>
impl<'m> RefUnwindSafe for Magic<'m>
impl<'m> Send for Magic<'m>
impl<'m> Sync for Magic<'m>
impl<'m> Unpin for Magic<'m>
impl<'m> UnwindSafe for Magic<'m>
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