pub struct Entries {
pub fields: HashMap<Arc<str>, Vec<SavedField>>,
pub save_dir: SaveDir,
/* private fields */
}
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§
Source§impl Entries
impl Entries
Sourcepub fn fields_count(&self) -> u32
pub fn fields_count(&self) -> u32
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.
Sourcepub fn recount_fields(&mut self) -> u32
pub fn recount_fields(&mut self) -> u32
Sum the number of fields in this Entries
and then return the updated value.
Sourcepub fn print_debug(&self) -> Result<()>
pub fn print_debug(&self) -> Result<()>
Print all fields and their contents to stdout. Mostly for testing purposes.
Sourcepub fn write_debug<W: Write>(&self, writer: W) -> Result<()>
pub fn write_debug<W: Write>(&self, writer: W) -> Result<()>
Write all fields and their contents to the given output. Mostly for testing purposes.