Struct multipart::server::save::Entries[][src]

pub struct Entries {
    pub fields: HashMap<Arc<str>, Vec<SavedField>>,
    pub save_dir: SaveDir,
    // some fields omitted
}
Expand description

A result of Multipart::save().

Fields

fields: HashMap<Arc<str>, Vec<SavedField>>

The fields of the multipart request, mapped by field name -> value.

A field name may have multiple actual fields associated with it, but the most common case is a single field.

Each vector is guaranteed not to be empty unless externally modified.

save_dir: SaveDir

The directory that the entries in fields were saved into.

Implementations

impl Entries[src]

pub fn new(save_dir: SaveDir) -> Self[src]

Create a new Entries with the given SaveDir

pub fn is_empty(&self) -> bool[src]

Returns true if fields is empty, false otherwise.

pub fn fields_count(&self) -> u32[src]

The number of actual fields contained within this Entries.

Effectively self.fields.values().map(Vec::len).sum() but maintained separately.

Note

This will be incorrect if fields is modified externally. Call recount_fields() to get the correct count.

pub fn recount_fields(&mut self) -> u32[src]

Sum the number of fields in this Entries and then return the updated value.

pub fn print_debug(&self) -> Result<()>[src]

Print all fields and their contents to stdout. Mostly for testing purposes.

pub fn write_debug<W: Write>(&self, writer: W) -> Result<()>[src]

Write all fields and their contents to the given output. Mostly for testing purposes.

Trait Implementations

impl Debug for Entries[src]

fn fmt(&self, f: &mut Formatter<'_>) -> Result[src]

Formats the value using the given formatter. Read more

impl<M: ReadEntry> Into<Entries> for PartialEntries<M>[src]

Discards partial

fn into(self) -> Entries[src]

Performs the conversion.

impl Key for Entries[src]

type Value = Self

The value type associated with this key type.

Auto Trait Implementations

impl RefUnwindSafe for Entries

impl Send for Entries

impl Sync for Entries

impl Unpin for Entries

impl UnwindSafe for Entries

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> DebugAny for T where
    T: Any + Debug

impl<T> UnsafeAny for T where
    T: Any