Struct params::File
[−]
[src]
pub struct File(_);
An uploaded file that was received as part of multipart/form-data
parsing.
Files are streamed to disk because they may not fit in memory.
Methods
impl File
[src]
fn open(&self) -> Result<File>
Attempts to open the file in read-only mode.
fn path(&self) -> &Path
The path to the temporary file where the data was saved.
fn filename(&self) -> Option<&str>
The filename that was specified in the request, unfiltered.
Warning
This may or may not be legal on the local filesystem, and so you should not blindly
append it to a Path
, as such behavior could easily be exploited by a malicious client.
fn size(&self) -> u64
The size of the file, in bytes.
Trait Implementations
impl FromValue for File
[src]
Extracts from File
variant.
fn from_value(value: &Value) -> Option<File>
Returns Some
if the conversion was successful, None
otherwise.
impl Clone for File
[src]
This implementation does not copy or modify the underlying file.
fn clone(&self) -> File
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0
Performs copy-assignment from source
. Read more
impl Debug for File
[src]
impl PartialEq for File
[src]
Checks only for equality of the file's path.
fn eq(&self, other: &File) -> bool
This method tests for self
and other
values to be equal, and is used by ==
. Read more
fn ne(&self, other: &Rhs) -> bool
1.0.0
This method tests for !=
.