Skip to main content

Crate aster_forge_file_classification

Crate aster_forge_file_classification 

Source
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§

FileCategoryEnum
Generated by sea-orm-macros
FileCategoryIter
An iterator over the variants of FileCategory
FileCategoryVariantIter
An iterator over the variants of FileCategoryVariant
FileClassification
Parsed classification details for a file name and MIME type.
FileClassificationError
Error returned when extension or category parsing fails.

Enums§

FileCategory
High-level file category inferred from extension and MIME type.
FileCategoryVariant
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.