Expand description
File extension parsing and category classification helpers.
This crate turns filenames, MIME hints, and extension filter strings into stable high-level categories used by API filtering and UI grouping. It intentionally avoids product-specific enum derives so services can map categories into their own database or OpenAPI representations.
Structs§
- File
Category Enum - Generated by sea-orm-macros
- File
Category Iter - An iterator over the variants of FileCategory
- File
Category Variant Iter - An iterator over the variants of FileCategoryVariant
- File
Classification - Parsed classification details for a file name and MIME type.
- File
Classification Error - Error returned when extension or category parsing fails.
Enums§
- File
Category - High-level file category inferred from extension and MIME type.
- File
Category Variant - Generated by sea-orm-macros
Constants§
- FILE_
CLASSIFICATION_ STORAGE_ LEN - Storage width required for persisted extension and category values.
- MAX_
EXTENSION_ FILTERS - Maximum number of extension filters accepted in one filter string.
- MAX_
EXTENSION_ LEN - Maximum accepted extension filter length.
Functions§
- classify_
file - Classifies a file from its name and MIME type.
- compound_
extension_ from_ name - Extracts a recognized compound extension from a file name.
- extension_
from_ name - Extracts the lowercase final extension from a file name.
- normalize_
extension_ filter - Normalizes one extension filter value.
- parse_
extension_ filters - Parses a comma-separated list of extension filters.
- parse_
file_ category - Parses a file category from its lowercase string representation.
Type Aliases§
- Result
- Result type returned by file classification helpers.