Expand description
Determines the type of a file with deep-learning.
§Examples
// A Magika session can be used multiple times across multiple threads.
let magika = magika::Session::new()?;
// Files can be identified from their path.
assert_eq!(magika.identify_file_sync("src/lib.rs")?.info().label, "rust");
// Contents can also be identified directly from memory.
let result = magika.identify_content_sync(&b"#!/bin/sh\necho hello"[..])?;
assert_eq!(result.info().label, "shell");
Structs§
- Builder
- Configures and creates a Magika session.
- Features
- Features to identify a file with deep-learning.
- Inferred
Type - Content type identified with deep-learning.
- Session
- A Magika session to identify files.
- Type
Info - File type information.
Enums§
- Content
Type - Content types for regular files.
- Error
- Errors returned by Magika functions.
- Features
OrRuled - Result of features extraction.
- File
Type - File types.
- Overwrite
Reason - Reason to overwrite an inferred content type.
Constants§
- MODEL_
MAJOR_ VERSION - Model major version.
- MODEL_
NAME - Model name (only comparable with equality).
Traits§
- Async
Input - Asynchronous abstraction over file content.
- Sync
Input - Synchronous abstraction over file content.
Type Aliases§
- Result
- Result type of Magika functions.