multipart_async/lib.rs
1// Copyright 2017 `multipart-async` Crate Developers
2//
3// Licensed under the Apache License, Version 2.0, <LICENSE-APACHE or
4// http://apache.org/licenses/LICENSE-2.0> or the MIT license <LICENSE-MIT or
5// http://opensource.org/licenses/MIT>, at your option. This file may not be
6// copied, modified, or distributed except according to those terms.
7//! Client- and server-side abstractions for HTTP `multipart/form-data` requests using asynchronous
8//! I/O.
9//!
10//! Features:
11//!
12//! * `client` (default): Enable the client-side abstractions for multipart requests. If the
13//! `hyper` feature is also set, enables integration with the Hyper HTTP client API.
14//!
15//! * `server` (default): Enable the server-side abstractions for multipart requests. If the
16//! `hyper` feature is also set, enables integration with the Hyper HTTP server API.
17//!
18//! * `hyper` (default): Enable integration with the [Hyper](https://github.com/hyperium/hyper) HTTP library
19//! for client and/or server depending on which other feature flags are set.
20#![deny(missing_docs)]
21#[macro_use] extern crate log;
22extern crate env_logger;
23
24extern crate display_bytes;
25
26#[macro_use]
27extern crate futures;
28
29extern crate mime_guess;
30extern crate rand;
31
32extern crate tempdir;
33
34#[cfg(feature = "hyper")]
35extern crate hyper;
36
37pub extern crate mime;
38
39use rand::Rng;
40
41use std::rc::Rc;
42use std::sync::Arc;
43
44// FIXME: after server prototype is working
45//#[cfg(feature = "client")]
46//pub mod client;
47
48#[cfg(feature = "server")]
49pub mod server;
50
51mod helpers;
52
53/*#[cfg(all(test, feature = "client", feature = "server"))]
54mod local_test;
55*/
56fn random_alphanumeric(len: usize) -> String {
57 rand::thread_rng().gen_ascii_chars().take(len).collect()
58}