pub struct FileType { /* private fields */ }Expand description
A File type, this has a display name and a reader function. The FileTypeRegistry
uses these to map one ot more file types to reader functions (FileReader).
Implementations§
Source§impl FileType
impl FileType
Sourcepub fn new(name: &str, reader_fn: FileReader) -> Rc<Self>
pub fn new(name: &str, reader_fn: FileReader) -> Rc<Self>
Construct a new file type with the provided display name and reader function.
Sourcepub fn new_with_mime_type(
name: &str,
reader_fn: FileReader,
mime_type: &str,
) -> Rc<Self>
pub fn new_with_mime_type( name: &str, reader_fn: FileReader, mime_type: &str, ) -> Rc<Self>
Construct a new file type with the provided display name, MIME type, and reader function.
Sourcepub fn reader(&self) -> &FileReader
pub fn reader(&self) -> &FileReader
Return this file type’s reader function.
Trait Implementations§
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