Make Weight Send+Sync for parallelization purposes

This commit is contained in:
jwolfe
2018-05-16 10:49:38 +09:00
parent 16ca6a0e5c
commit 327ca2ab02

View File

@@ -6,7 +6,7 @@ use Result;
/// for a given set of segments.
///
/// See [`Query`](./trait.Query.html).
pub trait Weight {
pub trait Weight: Send + Sync + 'static {
/// Returns the scorer for the given segment.
/// See [`Query`](./trait.Query.html).
fn scorer(&self, reader: &SegmentReader) -> Result<Box<Scorer>>;