pub enum ReadEntryResult<M: ReadEntry, Entry = MultipartField<M>> {
Entry(Entry),
End(M),
Error(M, Error),
}
Expand description
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.
Implementations§
Source§impl<M: ReadEntry, Entry> ReadEntryResult<M, Entry>
impl<M: ReadEntry, Entry> ReadEntryResult<M, Entry>
Sourcepub fn into_result(self) -> Result<Option<Entry>>
pub fn into_result(self) -> Result<Option<Entry>>
Convert self
into Result<Option<Entry>>
as follows:
Entry(entry) -> Ok(Some(entry))
End(_) -> Ok(None)
Error(_, err) -> Err(err)
Sourcepub fn expect(self, msg: &str) -> Entry
pub fn expect(self, msg: &str) -> Entry
Attempt to unwrap Entry
, panicking if this is End
or Error
with the given message. Adds the error’s message in the Error
case.
Sourcepub fn expect_alt(self, end_msg: &str, err_msg: &str) -> Entry
pub fn expect_alt(self, end_msg: &str, err_msg: &str) -> Entry
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.
Sourcepub fn unwrap_opt(self) -> Option<Entry>
pub fn unwrap_opt(self) -> Option<Entry>
Attempt to unwrap as Option<Entry>
, panicking in the Error
case.
Sourcepub fn expect_opt(self, msg: &str) -> Option<Entry>
pub fn expect_opt(self, msg: &str) -> Option<Entry>
Attempt to unwrap as Option<Entry>
, panicking in the Error
case
with the given message as well as the error’s message.
Auto Trait Implementations§
impl<M, Entry> Freeze for ReadEntryResult<M, Entry>
impl<M, Entry = MultipartField<M>> !RefUnwindSafe for ReadEntryResult<M, Entry>
impl<M, Entry> Send for ReadEntryResult<M, Entry>
impl<M, Entry> Sync for ReadEntryResult<M, Entry>
impl<M, Entry> Unpin for ReadEntryResult<M, Entry>
impl<M, Entry = MultipartField<M>> !UnwindSafe for ReadEntryResult<M, Entry>
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