Skip to content

Commit

Permalink
update readme
Browse files Browse the repository at this point in the history
  • Loading branch information
fafhrd91 committed Jun 27, 2021
1 parent 140f72f commit 3482ce5
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 26 deletions.
9 changes: 4 additions & 5 deletions ntex-bytes/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
A utility library for working with bytes. This is fork of bytes crate (https://github.com/tokio-rs/bytes)

[![Crates.io][crates-badge]][crates-url]
[![Build Status][azure-badge]][azure-url]

[crates-badge]: https://img.shields.io/crates/v/ntex-bytes.svg
[crates-url]: https://crates.io/crates/ntex-bytes
Expand All @@ -16,13 +15,13 @@ To use `bytes`, first add this to your `Cargo.toml`:

```toml
[dependencies]
bytes = "0.4.12"
ntex-bytes = "0.1"
```

Next, add this to your crate:

```rust
use bytes::{Bytes, BytesMut, Buf, BufMut};
use ntex_bytes::{Bytes, BytesMut, Buf, BufMut};
```

## Serde support
Expand All @@ -31,7 +30,7 @@ Serde support is optional and disabled by default. To enable use the feature `se

```toml
[dependencies]
bytes = { version = "0.4.12", features = ["serde"] }
ntex-bytes = { version = "0.1", features = ["serde"] }
```

## License
Expand All @@ -41,5 +40,5 @@ This project is licensed under the [MIT license](LICENSE).
### Contribution

Unless you explicitly state otherwise, any contribution intentionally submitted
for inclusion in `bytes` by you, shall be licensed as MIT, without any additional
for inclusion in `ntex-bytes` by you, shall be licensed as MIT, without any additional
terms or conditions.
22 changes: 1 addition & 21 deletions ntex-bytes/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
//!
//! This is fork of bytes crate (https://github.com/tokio-rs/bytes)
//!
//! The `bytes` crate provides an efficient byte buffer structure
//! The `ntex-bytes` crate provides an efficient byte buffer structure
//! ([`Bytes`](struct.Bytes.html)) and traits for working with buffer
//! implementations ([`Buf`], [`BufMut`]).
//!
Expand Down Expand Up @@ -49,26 +49,6 @@
//! See the [struct docs] for more details.
//!
//! [struct docs]: struct.Bytes.html
//!
//! # `Buf`, `BufMut`
//!
//! These two traits provide read and write access to buffers. The underlying
//! storage may or may not be in contiguous memory. For example, `Bytes` is a
//! buffer that guarantees contiguous memory, but a [rope] stores the bytes in
//! disjoint chunks. `Buf` and `BufMut` maintain cursors tracking the current
//! position in the underlying byte storage. When bytes are read or written, the
//! cursor is advanced.
//!
//! [rope]: https://en.wikipedia.org/wiki/Rope_(data_structure)
//!
//! ## Relation with `Read` and `Write`
//!
//! At first glance, it may seem that `Buf` and `BufMut` overlap in
//! functionality with `std::io::Read` and `std::io::Write`. However, they
//! 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
//! perform a syscall, which has the potential of failing. Operations on `Buf`
//! and `BufMut` are infallible.
#![deny(
warnings,
Expand Down

0 comments on commit 3482ce5

Please sign in to comment.