Skip to content

Commit 619ba28

Browse files
authored
util: Update docs (#86)
1 parent 1ab0df8 commit 619ba28

File tree

8 files changed

+18
-9
lines changed

8 files changed

+18
-9
lines changed

http-body-util/src/collected.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@ use crate::util::BufList;
1212

1313
/// A collected body produced by [`BodyExt::collect`] which collects all the DATA frames
1414
/// and trailers.
15+
///
16+
/// [`BodyExt::collect`]: crate::BodyExt::collect
1517
#[derive(Debug)]
1618
pub struct Collected<B> {
1719
bufs: BufList<B>,

http-body-util/src/combinators/collect.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,9 @@ use http_body::Body;
88
use pin_project_lite::pin_project;
99

1010
pin_project! {
11-
/// Future that resolves into a `Collected`.
11+
/// Future that resolves into a [`Collected`].
12+
///
13+
/// [`Collected`]: crate::Collected
1214
pub struct Collect<T>
1315
where
1416
T: Body,

http-body-util/src/combinators/frame.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ use core::task;
66

77
#[must_use = "futures don't do anything unless polled"]
88
#[derive(Debug)]
9-
/// Future that resolves to the next frame from a `Body`.
9+
/// Future that resolves to the next frame from a [`Body`].
1010
pub struct Frame<'a, T: ?Sized>(pub(crate) &'a mut T);
1111

1212
impl<'a, T: Body + Unpin + ?Sized> Future for Frame<'a, T> {

http-body-util/src/combinators/map_err.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ use std::{
1010
pin_project! {
1111
/// Body returned by the [`map_err`] combinator.
1212
///
13-
/// [`map_err`]: crate::util::BodyExt::map_err
13+
/// [`map_err`]: crate::BodyExt::map_err
1414
#[derive(Clone, Copy)]
1515
pub struct MapErr<B, F> {
1616
#[pin]

http-body-util/src/combinators/map_frame.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,9 @@ use std::{
99
};
1010

1111
pin_project! {
12-
/// Body returned by the [`map_data`] combinator.
12+
/// Body returned by the [`map_frame`] combinator.
1313
///
14-
/// [`map_data`]: crate::util::BodyExt::map_data
14+
/// [`map_frame`]: crate::BodyExt::map_frame
1515
#[derive(Clone, Copy)]
1616
pub struct MapFrame<B, F> {
1717
#[pin]

http-body-util/src/either.rs

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,11 @@ use bytes::Buf;
77
use http_body::{Body, Frame, SizeHint};
88
use proj::EitherProj;
99

10-
/// Sum type with two cases: `Left` and `Right`, used if a body can be one of
10+
/// Sum type with two cases: [`Left`] and [`Right`], used if a body can be one of
1111
/// two distinct types.
12+
///
13+
/// [`Left`]: Either::Left
14+
/// [`Right`]: Either::Right
1215
#[derive(Debug, Clone, Copy)]
1316
pub enum Either<L, R> {
1417
/// A value of type `L`
@@ -99,7 +102,7 @@ pub(crate) mod proj {
99102
//! Right {#[pin] right: R}
100103
//! }
101104
//! }
102-
//! ```
105+
//! ```
103106
//!
104107
//! [pin-project-lite]: https://docs.rs/pin-project-lite/latest/pin_project_lite/
105108
use std::marker::PhantomData;

http-body-util/src/lib.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,9 @@ pub use self::stream::StreamBody;
3333

3434
/// An extension trait for [`http_body::Body`] adding various combinators and adapters
3535
pub trait BodyExt: http_body::Body {
36-
/// Returns a future that resolves to the next `Frame`, if any.
36+
/// Returns a future that resolves to the next [`Frame`], if any.
37+
///
38+
/// [`Frame`]: combinators::Frame
3739
fn frame(&mut self) -> combinators::Frame<'_, Self>
3840
where
3941
Self: Unpin,

http-body-util/src/stream.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ use std::{
88
};
99

1010
pin_project! {
11-
/// A body created from a `Stream`.
11+
/// A body created from a [`Stream`].
1212
#[derive(Clone, Copy, Debug)]
1313
pub struct StreamBody<S> {
1414
#[pin]

0 commit comments

Comments
 (0)