Add docs for shared types (#216)

Add documentation for types shared between the client and server.
This commit is contained in:
Carl Lerche
2018-01-11 15:00:16 -08:00
committed by GitHub
parent 5604372a8b
commit 78455a4496
4 changed files with 233 additions and 28 deletions

View File

@@ -1,11 +1,21 @@
use std::fmt;
/// HTTP2 Error codes
/// HTTP/2.0 error codes.
///
/// Error codes are used in `RST_STREAM` and `GOAWAY` frames to convey the
/// reasons for the stream or connection error. For example,
/// [`SendStream::send_reset`] takes a `Reason` argument. Also, the `Error` type
/// may contain a `Reason`.
///
/// Error codes share a common code space. Some error codes apply only to
/// streams, others apply only to connections, and others may apply to either.
/// See [RFC 7540] for more information.
///
/// See [Error Codes in the spec][spec].
///
/// [spec}: http://httpwg.org/specs/rfc7540.html#ErrorCodes
/// [spec]: http://httpwg.org/specs/rfc7540.html#ErrorCodes
/// [`SendStream::send_reset`]: struct.SendStream.html#method.send_reset
#[derive(PartialEq, Eq, Clone, Copy)]
pub struct Reason(u32);