Struct mime_multipart::FilePart [] [src]

pub struct FilePart {
    pub headers: Headers,
    pub path: PathBuf,
    pub size: Option<usize>,
    // some fields omitted
}

A file that is to be inserted into a multipart/* or alternatively an uploaded file that was received as part of multipart/* parsing.

Fields

headers: Headers

The headers of the part

path: PathBuf

A temporary file containing the file content

size: Option<usize>

Optionally, the size of the file. This is filled when multiparts are parsed, but is not necessary when they are generated.

Methods

impl FilePart
[src]

fn new(headers: Headers, path: &Path) -> FilePart

fn do_not_delete_on_drop(&mut self)

If you do not want the file on disk to be deleted when Self drops, call this function. It will become your responsability to clean up.

fn create(headers: Headers) -> Result<FilePartError>

Create a new temporary FilePart (when created this way, the file will be deleted once the FilePart object goes out of scope).

fn filename(&self) -> Result<Option<String>, Error>

Filename that was specified when the file was uploaded. Returns Ok<None> if there was no content-disposition header supplied.

fn content_type(&self) -> Option<Mime>

Mime content-type specified in the header

Trait Implementations

impl PartialEq for FilePart
[src]

fn eq(&self, __arg_0: &FilePart) -> bool

This method tests for self and other values to be equal, and is used by ==. Read more

fn ne(&self, __arg_0: &FilePart) -> bool

This method tests for !=.

impl Debug for FilePart
[src]

fn fmt(&self, __arg_0: &mut Formatter) -> Result

Formats the value using the given formatter.

impl Clone for FilePart
[src]

fn clone(&self) -> FilePart

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 Drop for FilePart
[src]

fn drop(&mut self)

A method called when the value goes out of scope. Read more