var searchIndex = {}; searchIndex["multipart"] = {"doc":"Client- and server-side abstractions for HTTP `multipart/form-data` requests.","items":[[0,"client","multipart","The client-side abstraction for multipart requests.",null,null],[3,"SizedRequest","multipart::client","A wrapper around a request object that measures the request body and sets the `Content-Length`\nheader to its size in bytes.",null,null],[3,"Multipart","","The entry point of the client-side multipart API.",null,null],[11,"write","","",0,null],[11,"flush","","",0,null],[11,"apply_headers","","`SizedRequest` ignores `_content_len` because it sets its own later.",0,null],[11,"open_stream","","",0,null],[11,"finish","","",0,null],[8,"HttpRequest","","A trait describing an HTTP request that can be used to send multipart data.",null,null],[16,"Stream","","The HTTP stream type that can be opend by this request, to which the multipart data will be\nwritten.",1,null],[16,"Error","","The error type for this request.\nMust be compatible with `io::Error` as well as `Self::HttpStream::Error`",1,null],[10,"apply_headers","","Set the `Content-Type` header to `multipart/form-data` and supply the `boundary` value.\nIf `content_len` is given, set the `Content-Length` header to its value.",1,null],[10,"open_stream","","Open the request stream and return it or any error otherwise.",1,null],[8,"HttpStream","","A trait describing an open HTTP stream that can be written to.",null,null],[16,"Request","","The request type that opened this stream.",2,null],[16,"Response","","The response type that will be returned after the request is completed.",2,null],[16,"Error","","The error type for this stream.\nMust be compatible with `io::Error` as well as `Self::Request::Error`.",2,null],[10,"finish","","Finalize and close the stream and return the response object, or any error otherwise.",2,null],[11,"from_request","","Create a new `Multipart` to wrap a request.",3,{"inputs":[{"name":"r"}],"output":{"name":"result"}}],[11,"last_err","","Get a reference to the last error returned from writing to the HTTP stream, if any.",3,null],[11,"take_err","","Remove and return the last error to occur, allowing subsequent API calls to proceed\nnormally.",3,null],[11,"write_text","","Write a text field to this multipart request.\n`name` and `val` can be either owned `String` or `&str`.",3,null],[11,"write_file","","Open a file pointed to by `path` and write its contents to the multipart request,\nsupplying its filename and guessing its `Content-Type` from its extension.",3,null],[11,"write_stream","","Write a byte stream to the multipart request as a file field, supplying `filename` if given,\nand `content_type` if given or `"application/octet-stream"` if not.",3,null],[11,"send","","Finalize the request and return the response from the server, or the last error if set.",3,null],[11,"from_request_sized","","Create a new `Multipart` using the `SizedRequest` wrapper around `req`.",3,{"inputs":[{"name":"r"}],"output":{"name":"result"}}],[0,"server","multipart","The server-side abstraction for multipart requests.",null,null],[3,"BoundaryReader","multipart::server","A struct implementing `Read` and `BufRead` that will yield bytes until it sees a given sequence.",null,null],[3,"Multipart","","The server-side implementation of `multipart/form-data` requests.",null,null],[12,"save_dir","","The directory for saving files in this request.\nBy default, this is set to a subdirectory of `std::env::temp_dir()` with a \nrandom alphanumeric name.",4,null],[3,"MultipartField","","A field in a multipart request. May be either text or a binary stream (file).",null,null],[12,"name","","The field's name from the form",5,null],[12,"data","","The data of the field. Can be text or binary.",5,null],[3,"MultipartFile","","A representation of a file in HTTP `multipart/form-data`.",null,null],[3,"Entries","","A result of `Multipart::save_all()`.",null,null],[12,"fields","","The text fields of the multipart request.",6,null],[12,"files","","A map of file field names to their save results.",6,null],[12,"dir","","The directory the files were saved under.",6,null],[4,"MultipartData","","The data of a field in a `multipart/form-data` request.",null,null],[13,"Text","","The field's payload is a text string.",7,null],[13,"File","","The field's payload is a binary stream (file).",7,null],[11,"fmt","","",8,null],[11,"borrow","","",8,null],[11,"read","","",8,null],[11,"fill_buf","","",8,null],[11,"consume","","",8,null],[8,"HttpRequest","","A server-side HTTP request that may or may not be multipart.",null,null],[10,"is_multipart","","Return `true` if this request is a `multipart/form-data` request, `false` otherwise.",9,null],[10,"boundary","","Get the boundary string of this request if it is `multipart/form-data`.",9,null],[11,"from_request","","If the given `R: HttpRequest` is a POST request of `Content-Type: multipart/form-data`,\nreturn the wrapped request as `Ok(Multipart<R>)`, otherwise `Err(R)`.",4,{"inputs":[{"name":"r"}],"output":{"name":"result"}}],[11,"read_entry","","Read the next entry from this multipart request, returning a struct with the field's name and\ndata. See `MultipartField` for more info.",4,null],[11,"foreach_entry","","Call `f` for each entry in the multipart request.",4,null],[11,"save_all","","Read the request fully, parsing all fields and saving all files in `self.save_dir`.",4,null],[11,"borrow","","",4,null],[11,"fmt","","",5,null],[11,"fmt","","",7,null],[11,"as_text","","Borrow this payload as a text field, if possible.",7,null],[11,"as_file","","Borrow this payload as a file field, if possible.\nMutably borrows so the contents can be read.",7,null],[11,"fmt","","",10,null],[11,"save_as","","Save this file to `path`.",10,null],[11,"save_in","","Save this file in the directory pointed at by `dir`,\nusing `self.filename()` if present, or a random alphanumeric string otherwise.",10,null],[11,"save","","Save this file in the directory pointed at by `self.save_dir`,\nusing `self.filename()` if present, or a random alphanumeric string otherwise.",10,null],[11,"filename","","Get the filename of this entry, if supplied.",10,null],[11,"content_type","","Get the MIME type (`Content-Type` value) of this file, if supplied by the client,\nor `"applicaton/octet-stream"` otherwise.",10,null],[11,"save_dir","","The save directory assigned to this file field by the `Multipart` instance it was read\nfrom.",10,null],[11,"read","","",10,null],[11,"fill_buf","","",10,null],[11,"consume","","",10,null]],"paths":[[3,"SizedRequest"],[8,"HttpRequest"],[8,"HttpStream"],[3,"Multipart"],[3,"Multipart"],[3,"MultipartField"],[3,"Entries"],[4,"MultipartData"],[3,"BoundaryReader"],[8,"HttpRequest"],[3,"MultipartFile"]]}; initSearch(searchIndex);