mirror of
https://github.com/BLAKE3-team/BLAKE3
synced 2024-03-29 07:09:54 +01:00
document optional Cargo features on docs.rs
This commit is contained in:
parent
1c4d7fdd8d
commit
38a46ba8ae
|
@ -45,6 +45,8 @@
|
|||
//! [`rayon::join`]: https://docs.rs/rayon/1.3.0/rayon/fn.join.html
|
||||
|
||||
/// The trait that abstracts over single-threaded and multi-threaded recursion.
|
||||
///
|
||||
/// See the [`join` module docs](index.html) for more details.
|
||||
pub trait Join {
|
||||
fn join<A, B, RA, RB>(oper_a: A, oper_b: B, len_a: usize, len_b: usize) -> (RA, RB)
|
||||
where
|
||||
|
@ -58,6 +60,8 @@ pub trait Join {
|
|||
/// executed one after the other, on the calling thread. The standalone hashing
|
||||
/// functions and the `Hasher::update` method use this implementation
|
||||
/// internally.
|
||||
///
|
||||
/// See the [`join` module docs](index.html) for more details.
|
||||
pub enum SerialJoin {}
|
||||
|
||||
impl Join for SerialJoin {
|
||||
|
@ -76,6 +80,8 @@ impl Join for SerialJoin {
|
|||
/// The Rayon-based implementation of `Join`. The left and right sides are
|
||||
/// executed on the Rayon thread pool, potentially in parallel. This
|
||||
/// implementation is gated by the `rayon` feature, which is off by default.
|
||||
///
|
||||
/// See the [`join` module docs](index.html) for more details.
|
||||
#[cfg(feature = "rayon")]
|
||||
pub enum RayonJoin {}
|
||||
|
||||
|
|
20
src/lib.rs
20
src/lib.rs
|
@ -1,5 +1,5 @@
|
|||
//! The official Rust implementation of the [BLAKE3](https://blake3.io)
|
||||
//! cryptographic hash function.
|
||||
//! The official Rust implementation of the [BLAKE3] cryptographic hash
|
||||
//! function.
|
||||
//!
|
||||
//! # Examples
|
||||
//!
|
||||
|
@ -26,6 +26,22 @@
|
|||
//! # Ok(())
|
||||
//! # }
|
||||
//! ```
|
||||
//!
|
||||
//! # Cargo Features
|
||||
//!
|
||||
//! The `c` feature provides optimized assembly implementations and also
|
||||
//! AVX-512 support. It is off by default. If activated, a C compiler for the
|
||||
//! target platform is required.
|
||||
//!
|
||||
//! The `rayon` feature provides [Rayon]-based multi-threading, in particular
|
||||
//! the [`join::RayonJoin`] type for use with [`Hasher::update_with_join`]. It
|
||||
//! is also off by default, but on for [docs.rs].
|
||||
//!
|
||||
//! [BLAKE3]: https://blake3.io
|
||||
//! [Rayon]: https://github.com/rayon-rs/rayon
|
||||
//! [`join::RayonJoin`]: join/enum.RayonJoin.html
|
||||
//! [`Hasher::update_with_join`]: struct.Hasher.html#method.update_with_join
|
||||
//! [docs.rs]: https://docs.rs/
|
||||
|
||||
#![cfg_attr(not(feature = "std"), no_std)]
|
||||
|
||||
|
|
Loading…
Reference in New Issue