2019-10-02 17:34:32 +02:00
|
|
|
use crate::criterion::Criterion;
|
|
|
|
use crate::RawDocument;
|
2019-10-18 13:05:28 +02:00
|
|
|
use std::cmp::Ordering;
|
2019-10-02 17:34:32 +02:00
|
|
|
|
|
|
|
#[derive(Debug, Clone, Copy)]
|
|
|
|
pub struct DocumentId;
|
|
|
|
|
|
|
|
impl Criterion for DocumentId {
|
|
|
|
fn evaluate(&self, lhs: &RawDocument, rhs: &RawDocument) -> Ordering {
|
|
|
|
lhs.id.cmp(&rhs.id)
|
|
|
|
}
|
|
|
|
|
2019-10-09 16:15:31 +02:00
|
|
|
fn name(&self) -> &str {
|
2019-10-02 17:34:32 +02:00
|
|
|
"DocumentId"
|
|
|
|
}
|
|
|
|
}
|