pub struct DateTimeRangeQuery { /* private fields */ }Expand description
Specialized datetime range query for optimal performance.
Implementations§
Source§impl DateTimeRangeQuery
impl DateTimeRangeQuery
Sourcepub fn new<S: Into<String>>(
field: S,
lower: Option<DateTime<Utc>>,
upper: Option<DateTime<Utc>>,
lower_inclusive: bool,
upper_inclusive: bool,
) -> Self
pub fn new<S: Into<String>>( field: S, lower: Option<DateTime<Utc>>, upper: Option<DateTime<Utc>>, lower_inclusive: bool, upper_inclusive: bool, ) -> Self
Create a new datetime range query.
Sourcepub fn between<S: Into<String>>(
field: S,
start: DateTime<Utc>,
end: DateTime<Utc>,
) -> Self
pub fn between<S: Into<String>>( field: S, start: DateTime<Utc>, end: DateTime<Utc>, ) -> Self
Create a datetime range with both bounds inclusive.
Sourcepub fn after<S: Into<String>>(field: S, datetime: DateTime<Utc>) -> Self
pub fn after<S: Into<String>>(field: S, datetime: DateTime<Utc>) -> Self
Create a query for dates after the given datetime.
Sourcepub fn on_or_after<S: Into<String>>(field: S, datetime: DateTime<Utc>) -> Self
pub fn on_or_after<S: Into<String>>(field: S, datetime: DateTime<Utc>) -> Self
Create a query for dates on or after the given datetime.
Sourcepub fn before<S: Into<String>>(field: S, datetime: DateTime<Utc>) -> Self
pub fn before<S: Into<String>>(field: S, datetime: DateTime<Utc>) -> Self
Create a query for dates before the given datetime.
Sourcepub fn on_or_before<S: Into<String>>(field: S, datetime: DateTime<Utc>) -> Self
pub fn on_or_before<S: Into<String>>(field: S, datetime: DateTime<Utc>) -> Self
Create a query for dates on or before the given datetime.
Sourcepub fn with_boost(self, boost: f32) -> Self
pub fn with_boost(self, boost: f32) -> Self
Set the boost factor for this query.
Sourcepub fn contains_timestamp(&self, timestamp: i64) -> bool
pub fn contains_timestamp(&self, timestamp: i64) -> bool
Check if a timestamp falls within the range.
Sourcepub fn contains_datetime(&self, datetime: &DateTime<Utc>) -> bool
pub fn contains_datetime(&self, datetime: &DateTime<Utc>) -> bool
Check if a datetime falls within the range.
Trait Implementations§
Source§impl Clone for DateTimeRangeQuery
impl Clone for DateTimeRangeQuery
Source§fn clone(&self) -> DateTimeRangeQuery
fn clone(&self) -> DateTimeRangeQuery
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for DateTimeRangeQuery
impl Debug for DateTimeRangeQuery
Source§impl Query for DateTimeRangeQuery
impl Query for DateTimeRangeQuery
Source§fn matcher(&self, _reader: &dyn LexicalIndexReader) -> Result<Box<dyn Matcher>>
fn matcher(&self, _reader: &dyn LexicalIndexReader) -> Result<Box<dyn Matcher>>
Create a matcher for this query.
Source§fn scorer(&self, reader: &dyn LexicalIndexReader) -> Result<Box<dyn Scorer>>
fn scorer(&self, reader: &dyn LexicalIndexReader) -> Result<Box<dyn Scorer>>
Create a scorer for this query.
Source§fn description(&self) -> String
fn description(&self) -> String
Get a human-readable description of this query.
Source§fn is_empty(&self, _reader: &dyn LexicalIndexReader) -> Result<bool>
fn is_empty(&self, _reader: &dyn LexicalIndexReader) -> Result<bool>
Returns
true if this query would match no documents in the given reader. Read moreSource§fn cost(&self, _reader: &dyn LexicalIndexReader) -> Result<u64>
fn cost(&self, _reader: &dyn LexicalIndexReader) -> Result<u64>
Get the estimated cost of executing this query.
Auto Trait Implementations§
impl Freeze for DateTimeRangeQuery
impl RefUnwindSafe for DateTimeRangeQuery
impl Send for DateTimeRangeQuery
impl Sync for DateTimeRangeQuery
impl Unpin for DateTimeRangeQuery
impl UnsafeUnpin for DateTimeRangeQuery
impl UnwindSafe for DateTimeRangeQuery
Blanket Implementations§
Source§impl<T> ArchivePointee for T
impl<T> ArchivePointee for T
Source§type ArchivedMetadata = ()
type ArchivedMetadata = ()
The archived version of the pointer metadata for this type.
Source§fn pointer_metadata(
_: &<T as ArchivePointee>::ArchivedMetadata,
) -> <T as Pointee>::Metadata
fn pointer_metadata( _: &<T as ArchivePointee>::ArchivedMetadata, ) -> <T as Pointee>::Metadata
Converts some archived metadata to the pointer metadata for itself.
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§impl<T> LayoutRaw for T
impl<T> LayoutRaw for T
Source§fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>
fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>
Returns the layout of the type.
Source§impl<T, N1, N2> Niching<NichedOption<T, N1>> for N2
impl<T, N1, N2> Niching<NichedOption<T, N1>> for N2
Source§unsafe fn is_niched(niched: *const NichedOption<T, N1>) -> bool
unsafe fn is_niched(niched: *const NichedOption<T, N1>) -> bool
Returns whether the given value has been niched. Read more
Source§fn resolve_niched(out: Place<NichedOption<T, N1>>)
fn resolve_niched(out: Place<NichedOption<T, N1>>)
Writes data to
out indicating that a T is niched.