pub enum FileType {
Show 20 variants
Unknown,
Text,
Image,
Video,
Audio,
Document,
Archive,
Executable,
Config,
Log,
Database,
Code,
Font,
Model3D,
Spreadsheet,
Presentation,
Pdf,
Directory,
Symlink,
Device,
}Expand description
文件类型枚举
Variants§
Unknown
未知类型
Text
文本文件
Image
图片文件
Video
视频文件
Audio
音频文件
Document
文档文件
Archive
压缩文件
Executable
可执行文件
Config
配置文件
Log
日志文件
Database
数据库文件
Code
代码文件
Font
字体文件
Model3D
3D模型文件
Spreadsheet
电子表格
Presentation
演示文稿
PDF文档
Directory
目录
Symlink
符号链接
Device
设备文件
Implementations§
Source§impl FileType
impl FileType
pub fn from_extension(extension: &str) -> Self
pub fn from_path(path: &Path) -> Self
pub fn from_metadata(metadata: &FileMetadata) -> Self
pub fn from_mime_type(mime_type: &str) -> Self
pub fn as_str(&self) -> &'static str
pub fn emoji(&self) -> &'static str
pub fn is_compressible(&self) -> bool
pub fn is_binary(&self) -> bool
Trait Implementations§
Source§impl<'de> Deserialize<'de> for FileType
impl<'de> Deserialize<'de> for FileType
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
impl Copy for FileType
impl Eq for FileType
impl StructuralPartialEq for FileType
Auto Trait Implementations§
impl Freeze for FileType
impl RefUnwindSafe for FileType
impl Send for FileType
impl Sync for FileType
impl Unpin for FileType
impl UnwindSafe for FileType
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
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§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.