pub fn from_parts(
        method: Method,
        uri: URI,
        version: Version,
        headers: HeaderMap,
        body: TBody,
    ) -> Result<Self, RequestError> {
        let mut builder = Request::<()>::builder()
            .with_method(method)
            .with_uri(uri)
            .with_body(body)
            .with_version(version);
        builder.headers = headers;
        builder.build()
    }
/// Constructs a request from its individual parts.
///
/// # Errors
///
/// An error will be returned if the combination of parts creates an invalid request.
///
/// # Examples
///
/// ```
/// use std::convert::TryFrom;
/// use std::iter::FromIterator;
///
/// use rtsp::header::map::HeaderMap;
/// use rtsp::header::name::HeaderName;
/// use rtsp::header::value::HeaderValue;
/// use rtsp::method::Method;
/// use rtsp::request::Request;
/// use rtsp::uri::request::URI;
/// use rtsp::version::Version;
///
/// let request = Request::from_parts(
///     Method::Setup,
///     URI::try_from("rtsp://example.com").unwrap(),
///     Version::Rtsp2_0,
///     HeaderMap::from_iter(vec![
///         (HeaderName::ContentLength, HeaderValue::try_from("0").unwrap())
///     ]),
///     "",
/// ).unwrap();
/// assert_eq!(request.method(), &Method::Setup);
/// assert_eq!(request.uri(), &URI::try_from("rtsp://example.com").unwrap());
/// assert_eq!(request.version(), Version::Rtsp2_0);
/// assert_eq!(
///     request.headers().get(&HeaderName::ContentLength),
///     Some(&HeaderValue::try_from("0").unwrap())
/// );
/// assert_eq!(request.body(), &"");
/// ```
Constructs a request from its individual parts.
Constructs a request from its individual parts .
pub fn from_parts(
        method: Method,
        uri: URI,
        version: Version,
        headers: HeaderMap,
        body: TBody,
    ) -> Result<Self, RequestError> {
        let mut builder = Request::<()>::builder()
            .with_method(method)
            .with_uri(uri)
            .with_body(body)
            .with_version(version);
        builder.headers = headers;
        builder.build()
    }
pub fn from_parts ( method : Method , uri : URI , version : Version , headers : HeaderMap , body : TBody , ) -> Result < Self , RequestError > { let mut builder = Request :: < ( ) > :: builder ( ) . with_method ( method ) . with_uri ( uri ) . with_body ( body ) . with_version ( version ) ; builder . headers = headers ; builder . build ( ) }
Constructs a request from its individual parts.
Constructs a request from its individual parts .
method
Method
uri
URI
version
Version
headers
HeaderMap
body
TBody
method
Method
uri
URI
version
Version
headers
HeaderMap
body
TBody
errors
An error will be returned if the combination of parts creates an invalid request.
An error will be returned if the combination of parts creates an invalid request .
examples
```
use std::convert::TryFrom;
use std::iter::FromIterator.

use rtsp::header::map::HeaderMap;
use rtsp::header::name::HeaderName;
use rtsp::header::value::HeaderValue;
use rtsp::method::Method;
use rtsp::request::Request;
use rtsp::uri::request::URI;
use rtsp::version::Version.

let request = Request::from_parts(
Method::Setup,
URI::try_from("rtsp://example.com").unwrap(),
Version::Rtsp2_0,
HeaderMap::from_iter(vec![
(HeaderName::ContentLength, HeaderValue::try_from("0").unwrap())
]),
"",
).unwrap();
assert_eq!(request.method(), &Method::Setup);
assert_eq!(request.uri(), &URI::try_from("rtsp://example.com").unwrap());
assert_eq!(request.version(), Version::Rtsp2_0);
assert_eq!(
request.headers().get(&HeaderName::ContentLength),
Some(&HeaderValue::try_from("0").unwrap())
);
assert_eq!(request.body(), &"");
```
` ` ` use std :: convert :: TryFrom ; use std :: iter :: FromIterator . use rtsp :: header :: map :: HeaderMap ; use rtsp :: header :: name :: HeaderName ; use rtsp :: header :: value :: HeaderValue ; use rtsp :: method :: Method ; use rtsp :: request :: Request ; use rtsp :: uri :: request :: URI ; use rtsp :: version :: Version . let request = Request :: from_parts ( Method :: Setup URI :: try_from ( " rtsp : // example . com " ) . unwrap () Version :: Rtsp2_0 HeaderMap :: from_iter ( vec! [ ( HeaderName :: ContentLength HeaderValue :: try_from ( " 0 " ) . unwrap () ) ] ) " " ) . unwrap () ; assert_eq! ( request . method () &Method :: Setup ) ; assert_eq! ( request . uri () &URI :: try_from ( " rtsp : // example . com " ) . unwrap () ) ; assert_eq! ( request . version () Version :: Rtsp2_0 ) ; assert_eq! ( request . headers () . get ( &HeaderName :: ContentLength ) Some ( &HeaderValue :: try_from ( " 0 " ) . unwrap () ) ) ; assert_eq! ( request . body () & " " ) ; ` ` `