small tweaks, typos (#8)
This commit is contained in:
committed by
Lucio Franco
parent
5f7c39faad
commit
25e4dcc5d9
@@ -22,8 +22,8 @@ use std::fmt;
|
||||
/// Each request method takes a [`Request`], a [`PathAndQuery`], and a
|
||||
/// [`Codec`]. The request contains the message to send via the
|
||||
/// [`Codec::encoder`]. The path determines the fully qualified path
|
||||
/// that will be appened to the outgoing uri. The path must follow
|
||||
/// the convetions explained in the [gRPC protocol definition] under `Path →`. An
|
||||
/// that will be append to the outgoing uri. The path must follow
|
||||
/// the conventions explained in the [gRPC protocol definition] under `Path →`. An
|
||||
/// example of this path could look like `/greeter.Greeter/SayHello`.
|
||||
///
|
||||
/// [gRPC protocol definition]: https://github.com/grpc/grpc/blob/master/doc/PROTOCOL-HTTP2.md#requests
|
||||
|
||||
@@ -101,7 +101,7 @@ impl<T> Streaming<T> {
|
||||
|
||||
/// Fetch the trailing metadata.
|
||||
///
|
||||
/// This will drain the stream of all its messages to recieve the trailing
|
||||
/// This will drain the stream of all its messages to receive the trailing
|
||||
/// metadata. If [`Streaming::message`] returns `None` then this function
|
||||
/// will not need to poll for trailers since the body was totally consumed.
|
||||
pub async fn trailers(&mut self) -> Result<Option<MetadataMap>, Status> {
|
||||
@@ -192,7 +192,7 @@ impl<T> Stream for Streaming<T> {
|
||||
fn poll_next(mut self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll<Option<Self::Item>> {
|
||||
loop {
|
||||
// TODO: implement the ability to poll trailers when we _know_ that
|
||||
// the comnsumer of this stream will only poll for the first message.
|
||||
// the consumer of this stream will only poll for the first message.
|
||||
// This means we skip the poll_trailers step.
|
||||
match self.decode_chunk()? {
|
||||
Some(item) => return Poll::Ready(Some(Ok(item))),
|
||||
|
||||
@@ -217,7 +217,7 @@ impl MetadataMap {
|
||||
|
||||
/// Convert an HTTP HeaderMap to a MetadataMap
|
||||
pub fn from_headers(headers: http::HeaderMap) -> Self {
|
||||
MetadataMap { headers: headers }
|
||||
MetadataMap { headers }
|
||||
}
|
||||
|
||||
/// Convert a MetadataMap into a HTTP HeaderMap
|
||||
|
||||
Reference in New Issue
Block a user