[−][src]Struct octane::file_handler::FileHandler
The FileHandler structure is a helper struct to manage files, contents and extensions also to decide their mime types accordingly
Fields
file_name: String
file: AsyncReader<File>
extension: String
meta: Metadata
Implementations
impl FileHandler
[src]
pub fn handle_file(path: &PathBuf) -> Result<Self, Box<dyn Error>>
[src]
Takes a Pathbuf and returns a FileHandler struct
pub fn get_extension(path: &PathBuf) -> String
[src]
A helper method to get extension from a PathBuf
pub fn mime_type(extension: String) -> String
[src]
Perform a match on the extension and return the mime type accordingly
Auto Trait Implementations
impl RefUnwindSafe for FileHandler
impl Send for FileHandler
impl Sync for FileHandler
impl Unpin for FileHandler
impl UnwindSafe for FileHandler
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,