Enum multipart::server::ReadEntryResult
[−]
[src]
pub enum ReadEntryResult<M: ReadEntry, Entry = MultipartField<M>> { Entry(Entry), End(M), Error(M, Error), }
Ternary result type returned by ReadEntry::next_entry()
,
Multipart::into_entry()
and MultipartField::next_entry()
.
Variants
Entry(Entry)
The next entry was found.
End(M)
No more entries could be read.
Error(M, Error)
An error occurred.
Methods
impl<M: ReadEntry, Entry> ReadEntryResult<M, Entry>
[src]
fn into_result(self) -> Result<Option<Entry>>
[src]
Convert self
into Result<Option<Entry>>
as follows:
Entry(entry) -> Ok(Some(entry))
End(_) -> Ok(None)
Error(_, err) -> Err(err)
fn unwrap(self) -> Entry
[src]
Attempt to unwrap Entry
, panicking if this is End
or Error
.
fn expect(self, msg: &str) -> Entry
[src]
Attempt to unwrap Entry
, panicking if this is End
or Error
with the given message. Adds the error's message in the Error
case.
fn expect_alt(self, end_msg: &str, err_msg: &str) -> Entry
[src]
Attempt to unwrap Entry
, panicking if this is End
or Error
.
If this is End
, panics with end_msg
; if Error
, panics with err_msg
as well as the error's message.
fn unwrap_opt(self) -> Option<Entry>
[src]
Attempt to unwrap as Option<Entry>
, panicking in the Error
case.
fn expect_opt(self, msg: &str) -> Option<Entry>
[src]
Attempt to unwrap as Option<Entry>
, panicking in the Error
case
with the given message as well as the error's message.