docs: redraw layout diagram with box drawing characters. (#539)

I find this diagram very helpful, but a little hard to distinguish
between the boxes and the lines that connect them. This commit redraws
the boxes with line drawing characters so that the boxes appear a
little more solid, and stand out from the other lines.
This commit is contained in:
Anthony Deschamps
2022-03-25 10:55:13 +01:00
committed by GitHub
parent d4f5023383
commit e4c723697d
+10 -10
View File
@@ -55,7 +55,7 @@ use crate::Buf;
/// # Sharing /// # Sharing
/// ///
/// `Bytes` contains a vtable, which allows implementations of `Bytes` to define /// `Bytes` contains a vtable, which allows implementations of `Bytes` to define
/// how sharing/cloneing is implemented in detail. /// how sharing/cloning is implemented in detail.
/// When `Bytes::clone()` is called, `Bytes` will call the vtable function for /// When `Bytes::clone()` is called, `Bytes` will call the vtable function for
/// cloning the backing storage in order to share it behind between multiple /// cloning the backing storage in order to share it behind between multiple
/// `Bytes` instances. /// `Bytes` instances.
@@ -78,18 +78,18 @@ use crate::Buf;
/// ///
/// ```text /// ```text
/// ///
/// Arc ptrs +---------+ /// Arc ptrs ┌─────────┐
/// ________________________ / | Bytes 2 | /// ________________________ / Bytes 2
/// / +---------+ /// / └─────────┘
/// / +-----------+ | | /// / ┌───────────┐ | |
/// |_________/ | Bytes 1 | | | /// |_________/ Bytes 1 | |
/// | +-----------+ | | /// | └───────────┘ | |
/// | | | ___/ data | tail /// | | | ___/ data | tail
/// | data | tail |/ | /// | data | tail |/ |
/// v v v v /// v v v v
/// +-----+---------------------------------+-----+ /// ┌─────┬─────┬───────────┬───────────────┬─────┐
/// | Arc | | | | | /// Arc
/// +-----+---------------------------------+-----+ /// └─────┴─────┴───────────┴───────────────┴─────┘
/// ``` /// ```
pub struct Bytes { pub struct Bytes {
ptr: *const u8, ptr: *const u8,