HTTP version
This module contains a definition of the Version
type. The Version
type is intended to be accessed through the root of the crate (http::Version
) rather than this module.
The Version
type contains constants that represent the various versions of the HTTP protocol.
Examples
use Version;
let http11 = HTTP_11;
let http2 = HTTP_2;
assert!;
println!;
Trait Implementations
Compare two values for equality.
Examples
assert_eq!;
assert_eq!;
assert_eq!;
Compare two values for inequality.
Examples
assert_eq!;
assert_eq!;
assert_eq!;
Compare two values.
Examples
use Ordering;
assert_eq!;
assert_eq!;
assert_eq!;
Tests less than (for self
and other
) and is used by the <
operator.
Examples
assert_eq!;
assert_eq!;
assert_eq!;
Tests less than or equal to (for self
and other
) and is used by the <=
operator.
Examples
assert_eq!;
assert_eq!;
assert_eq!;
Tests greater than (for self
and other
) and is used by the >
operator.
Examples
assert_eq!;
assert_eq!;
assert_eq!;
Tests greater than or equal to (for self
and other
) and is used by the >=
operator.
Examples
assert_eq!;
assert_eq!;
assert_eq!;
Compare two values.
Examples
use Ordering;
assert_eq!;
assert_eq!;
assert_eq!;
Return the minimum of two values.
Examples
assert_eq!;
assert_eq!;
assert_eq!;
Return the maximum of two values.
Examples
assert_eq!;
assert_eq!;
assert_eq!;
Protocols
if value == b
Test two versions for partial equality.
Examples
use partial_eq;
use Version;
let http11 = HTTP_11;
let http2 = HTTP_2;
assert_eq!;
assert_eq!;
assert_eq!;
if value == b
Test two versions for total equality.
Examples
use eq;
use Version;
let http11 = HTTP_11;
let http2 = HTTP_2;
assert_eq!;
assert_eq!;
assert_eq!;
if value < b
Perform a partial ordered comparison between two versions.
Examples
use Version;
let http11 = HTTP_11;
let http2 = HTTP_2;
assert!;
assert!;
assert!;
Using explicit functions:
use Ordering;
use partial_cmp;
use Version;
let http11 = HTTP_11;
let http2 = HTTP_2;
assert_eq!;
assert_eq!;
assert_eq!;
if value < b
Perform a totally ordered comparison between two versions.
Examples
use Ordering;
use cmp;
use Version;
let http11 = HTTP_11;
let http2 = HTTP_2;
assert_eq!;
assert_eq!;
assert_eq!;
let $out = hash
Hash the version.
Examples
use hash;
use Version;
let http2 = HTTP_2;
assert_eq!;
format!
Debug print the Version.
Examples
use Version;
let http11 = HTTP_11;
let http2 = HTTP_2;
println!;