diff --git a/src/core/executor.rs b/src/core/executor.rs index 8e058e932..922ea3950 100644 --- a/src/core/executor.rs +++ b/src/core/executor.rs @@ -10,7 +10,9 @@ use rayon::{ThreadPool, ThreadPoolBuilder}; /// API of a dependency, knowing it might conflict with a different version /// used by the client. Second, we may stop using rayon in the future. pub enum Executor { + /// Single thread variant of an Executor SingleThread, + /// Thread pool variant of an Executor ThreadPool(ThreadPool), } @@ -20,7 +22,7 @@ impl Executor { Executor::SingleThread } - // Creates an Executor that dispatches the tasks in a thread pool. + /// Creates an Executor that dispatches the tasks in a thread pool. pub fn multi_thread(num_threads: usize, prefix: &'static str) -> Result { let pool = ThreadPoolBuilder::new() .num_threads(num_threads) @@ -29,10 +31,10 @@ impl Executor { Ok(Executor::ThreadPool(pool)) } - // Perform a map in the thread pool. - // - // Regardless of the executor (`SingleThread` or `ThreadPool`), panics in the task - // will propagate to the caller. + /// Perform a map in the thread pool. + /// + /// Regardless of the executor (`SingleThread` or `ThreadPool`), panics in the task + /// will propagate to the caller. pub fn map< A: Send, R: Send, diff --git a/src/lib.rs b/src/lib.rs index 9f0570d16..5a5fd4daf 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -161,7 +161,7 @@ pub use self::snippet::{Snippet, SnippetGenerator}; mod docset; pub use self::docset::{DocSet, SkipResult}; pub use crate::common::{f64_to_u64, i64_to_u64, u64_to_f64, u64_to_i64}; -pub use crate::core::SegmentComponent; +pub use crate::core::{Executor, SegmentComponent}; pub use crate::core::{Index, IndexMeta, Searcher, Segment, SegmentId, SegmentMeta}; pub use crate::core::{InvertedIndexReader, SegmentReader}; pub use crate::directory::Directory;