Enum multipart::server::ReadEntryResult[][src]

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

impl<M: ReadEntry, Entry> ReadEntryResult<M, Entry>[src]

pub 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)

pub fn unwrap(self) -> Entry[src]

Attempt to unwrap Entry, panicking if this is End or Error.

pub 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.

pub 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.

pub fn unwrap_opt(self) -> Option<Entry>[src]

Attempt to unwrap as Option<Entry>, panicking in the Error case.

pub 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.

Auto Trait Implementations

impl<M, Entry = MultipartField<M>> !RefUnwindSafe for ReadEntryResult<M, Entry>

impl<M, Entry> Send for ReadEntryResult<M, Entry> where
    Entry: Send,
    M: Send

impl<M, Entry> Sync for ReadEntryResult<M, Entry> where
    Entry: Sync,
    M: Sync

impl<M, Entry> Unpin for ReadEntryResult<M, Entry> where
    Entry: Unpin,
    M: Unpin

impl<M, Entry = MultipartField<M>> !UnwindSafe for ReadEntryResult<M, Entry>

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

pub fn type_id(&self) -> TypeId[src]

Gets the TypeId of self. Read more

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

pub fn borrow(&self) -> &T[src]

Immutably borrows from an owned value. Read more

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

pub fn borrow_mut(&mut self) -> &mut T[src]

Mutably borrows from an owned value. Read more

impl<T> From<T> for T[src]

pub fn from(t: T) -> T[src]

Performs the conversion.

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

pub fn into(self) -> U[src]

Performs the conversion.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>[src]

Performs the conversion.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

pub fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>[src]

Performs the conversion.

impl<T> Typeable for T where
    T: Any

fn get_type(&self) -> TypeId

Get the TypeId of this object.

impl<V, T> VZip<V> for T where
    V: MultiLane<T>, 

pub fn vzip(self) -> V

impl<T> UnsafeAny for T where
    T: Any