mirror of
https://github.com/tokio-rs/bytes.git
synced 2026-08-25 00:00:22 +02:00
docs: fix broken links (#639)
Fixed a few broken links and converted a lot of them from the html-link to intra-doc links.
This commit is contained in:
+1
-3
@@ -25,9 +25,7 @@ use std::io::IoSlice;
|
|||||||
/// assert_eq!(full[..], b"hello world"[..]);
|
/// assert_eq!(full[..], b"hello world"[..]);
|
||||||
/// ```
|
/// ```
|
||||||
///
|
///
|
||||||
/// [`Buf::chain`]: trait.Buf.html#method.chain
|
/// [`Buf::chain`]: Buf::chain
|
||||||
/// [`Buf`]: trait.Buf.html
|
|
||||||
/// [`BufMut`]: trait.BufMut.html
|
|
||||||
#[derive(Debug)]
|
#[derive(Debug)]
|
||||||
pub struct Chain<T, U> {
|
pub struct Chain<T, U> {
|
||||||
a: T,
|
a: T,
|
||||||
|
|||||||
@@ -17,9 +17,6 @@ use crate::Buf;
|
|||||||
/// assert_eq!(iter.next(), Some(b'c'));
|
/// assert_eq!(iter.next(), Some(b'c'));
|
||||||
/// assert_eq!(iter.next(), None);
|
/// assert_eq!(iter.next(), None);
|
||||||
/// ```
|
/// ```
|
||||||
///
|
|
||||||
/// [`iter`]: trait.Buf.html#method.iter
|
|
||||||
/// [`Buf`]: trait.Buf.html
|
|
||||||
#[derive(Debug)]
|
#[derive(Debug)]
|
||||||
pub struct IntoIter<T> {
|
pub struct IntoIter<T> {
|
||||||
inner: T,
|
inner: T,
|
||||||
|
|||||||
@@ -13,8 +13,6 @@
|
|||||||
//! See [`Buf`] and [`BufMut`] for more details.
|
//! See [`Buf`] and [`BufMut`] for more details.
|
||||||
//!
|
//!
|
||||||
//! [rope]: https://en.wikipedia.org/wiki/Rope_(data_structure)
|
//! [rope]: https://en.wikipedia.org/wiki/Rope_(data_structure)
|
||||||
//! [`Buf`]: trait.Buf.html
|
|
||||||
//! [`BufMut`]: trait.BufMut.html
|
|
||||||
|
|
||||||
mod buf_impl;
|
mod buf_impl;
|
||||||
mod buf_mut;
|
mod buf_mut;
|
||||||
|
|||||||
+1
-1
@@ -5,7 +5,7 @@ use std::{cmp, io};
|
|||||||
/// A `Buf` adapter which implements `io::Read` for the inner value.
|
/// A `Buf` adapter which implements `io::Read` for the inner value.
|
||||||
///
|
///
|
||||||
/// This struct is generally created by calling `reader()` on `Buf`. See
|
/// This struct is generally created by calling `reader()` on `Buf`. See
|
||||||
/// documentation of [`reader()`](trait.Buf.html#method.reader) for more
|
/// documentation of [`reader()`](Buf::reader) for more
|
||||||
/// details.
|
/// details.
|
||||||
#[derive(Debug)]
|
#[derive(Debug)]
|
||||||
pub struct Reader<B> {
|
pub struct Reader<B> {
|
||||||
|
|||||||
+1
-1
@@ -5,7 +5,7 @@ use core::cmp;
|
|||||||
/// A `Buf` adapter which limits the bytes read from an underlying buffer.
|
/// A `Buf` adapter which limits the bytes read from an underlying buffer.
|
||||||
///
|
///
|
||||||
/// This struct is generally created by calling `take()` on `Buf`. See
|
/// This struct is generally created by calling `take()` on `Buf`. See
|
||||||
/// documentation of [`take()`](trait.Buf.html#method.take) for more details.
|
/// documentation of [`take()`](Buf::take) for more details.
|
||||||
#[derive(Debug)]
|
#[derive(Debug)]
|
||||||
pub struct Take<T> {
|
pub struct Take<T> {
|
||||||
inner: T,
|
inner: T,
|
||||||
|
|||||||
+1
-1
@@ -5,7 +5,7 @@ use std::{cmp, io};
|
|||||||
/// A `BufMut` adapter which implements `io::Write` for the inner value.
|
/// A `BufMut` adapter which implements `io::Write` for the inner value.
|
||||||
///
|
///
|
||||||
/// This struct is generally created by calling `writer()` on `BufMut`. See
|
/// This struct is generally created by calling `writer()` on `BufMut`. See
|
||||||
/// documentation of [`writer()`](trait.BufMut.html#method.writer) for more
|
/// documentation of [`writer()`](BufMut::writer) for more
|
||||||
/// details.
|
/// details.
|
||||||
#[derive(Debug)]
|
#[derive(Debug)]
|
||||||
pub struct Writer<B> {
|
pub struct Writer<B> {
|
||||||
|
|||||||
+1
-3
@@ -438,7 +438,7 @@ impl Bytes {
|
|||||||
/// If `len` is greater than the buffer's current length, this has no
|
/// If `len` is greater than the buffer's current length, this has no
|
||||||
/// effect.
|
/// effect.
|
||||||
///
|
///
|
||||||
/// The [`split_off`] method can emulate `truncate`, but this causes the
|
/// The [split_off](`Self::split_off()`) method can emulate `truncate`, but this causes the
|
||||||
/// excess bytes to be returned instead of dropped.
|
/// excess bytes to be returned instead of dropped.
|
||||||
///
|
///
|
||||||
/// # Examples
|
/// # Examples
|
||||||
@@ -450,8 +450,6 @@ impl Bytes {
|
|||||||
/// buf.truncate(5);
|
/// buf.truncate(5);
|
||||||
/// assert_eq!(buf, b"hello"[..]);
|
/// assert_eq!(buf, b"hello"[..]);
|
||||||
/// ```
|
/// ```
|
||||||
///
|
|
||||||
/// [`split_off`]: #method.split_off
|
|
||||||
#[inline]
|
#[inline]
|
||||||
pub fn truncate(&mut self, len: usize) {
|
pub fn truncate(&mut self, len: usize) {
|
||||||
if len < self.len {
|
if len < self.len {
|
||||||
|
|||||||
+1
-3
@@ -399,7 +399,7 @@ impl BytesMut {
|
|||||||
///
|
///
|
||||||
/// Existing underlying capacity is preserved.
|
/// Existing underlying capacity is preserved.
|
||||||
///
|
///
|
||||||
/// The [`split_off`] method can emulate `truncate`, but this causes the
|
/// The [split_off](`Self::split_off()`) method can emulate `truncate`, but this causes the
|
||||||
/// excess bytes to be returned instead of dropped.
|
/// excess bytes to be returned instead of dropped.
|
||||||
///
|
///
|
||||||
/// # Examples
|
/// # Examples
|
||||||
@@ -411,8 +411,6 @@ impl BytesMut {
|
|||||||
/// buf.truncate(5);
|
/// buf.truncate(5);
|
||||||
/// assert_eq!(buf, b"hello"[..]);
|
/// assert_eq!(buf, b"hello"[..]);
|
||||||
/// ```
|
/// ```
|
||||||
///
|
|
||||||
/// [`split_off`]: #method.split_off
|
|
||||||
pub fn truncate(&mut self, len: usize) {
|
pub fn truncate(&mut self, len: usize) {
|
||||||
if len <= self.len() {
|
if len <= self.len() {
|
||||||
unsafe {
|
unsafe {
|
||||||
|
|||||||
+3
-8
@@ -9,12 +9,9 @@
|
|||||||
//! Provides abstractions for working with bytes.
|
//! Provides abstractions for working with bytes.
|
||||||
//!
|
//!
|
||||||
//! The `bytes` crate provides an efficient byte buffer structure
|
//! The `bytes` crate provides an efficient byte buffer structure
|
||||||
//! ([`Bytes`](struct.Bytes.html)) and traits for working with buffer
|
//! ([`Bytes`]) and traits for working with buffer
|
||||||
//! implementations ([`Buf`], [`BufMut`]).
|
//! implementations ([`Buf`], [`BufMut`]).
|
||||||
//!
|
//!
|
||||||
//! [`Buf`]: trait.Buf.html
|
|
||||||
//! [`BufMut`]: trait.BufMut.html
|
|
||||||
//!
|
|
||||||
//! # `Bytes`
|
//! # `Bytes`
|
||||||
//!
|
//!
|
||||||
//! `Bytes` is an efficient container for storing and operating on contiguous
|
//! `Bytes` is an efficient container for storing and operating on contiguous
|
||||||
@@ -52,9 +49,7 @@
|
|||||||
//! `a` and `b` will share the underlying buffer and maintain indices tracking
|
//! `a` and `b` will share the underlying buffer and maintain indices tracking
|
||||||
//! the view into the buffer represented by the handle.
|
//! the view into the buffer represented by the handle.
|
||||||
//!
|
//!
|
||||||
//! See the [struct docs] for more details.
|
//! See the [struct docs](`Bytes`) for more details.
|
||||||
//!
|
|
||||||
//! [struct docs]: struct.Bytes.html
|
|
||||||
//!
|
//!
|
||||||
//! # `Buf`, `BufMut`
|
//! # `Buf`, `BufMut`
|
||||||
//!
|
//!
|
||||||
@@ -70,7 +65,7 @@
|
|||||||
//! ## Relation with `Read` and `Write`
|
//! ## Relation with `Read` and `Write`
|
||||||
//!
|
//!
|
||||||
//! At first glance, it may seem that `Buf` and `BufMut` overlap in
|
//! At first glance, it may seem that `Buf` and `BufMut` overlap in
|
||||||
//! functionality with `std::io::Read` and `std::io::Write`. However, they
|
//! functionality with [`std::io::Read`] and [`std::io::Write`]. However, they
|
||||||
//! serve different purposes. A buffer is the value that is provided as an
|
//! serve different purposes. A buffer is the value that is provided as an
|
||||||
//! argument to `Read::read` and `Write::write`. `Read` and `Write` may then
|
//! argument to `Read::read` and `Write::write`. `Read` and `Write` may then
|
||||||
//! perform a syscall, which has the potential of failing. Operations on `Buf`
|
//! perform a syscall, which has the potential of failing. Operations on `Buf`
|
||||||
|
|||||||
Reference in New Issue
Block a user