pub struct LogQuery {
pub topic_partition: TopicPartition,
pub terms: Vec<Arc<str>>,
pub exact_fields: Vec<MetadataField>,
pub predicate: LogPredicate,
pub start_offset: Option<LogicalOffset>,
pub end_offset: Option<LogicalOffset>,
pub start_timestamp_unix_nanos: Option<u64>,
pub end_timestamp_unix_nanos: Option<u64>,
pub limit: Option<usize>,
pub order: QueryOrder,
pub sort: QuerySort,
pub after: Option<QueryCursor>,
}Expand description
Boolean log lookup against one logical partition.
Fields§
§topic_partition: TopicPartitionPartition to search. Query fan-out is intentionally an explicit higher layer.
terms: Vec<Arc<str>>Case-insensitive message terms, combined with AND semantics.
exact_fields: Vec<MetadataField>Exact metadata fields, combined with AND semantics.
predicate: LogPredicateAdditional exact Boolean predicate.
start_offset: Option<LogicalOffset>Inclusive lowest durable offset.
end_offset: Option<LogicalOffset>Exclusive highest durable offset.
start_timestamp_unix_nanos: Option<u64>Inclusive lowest event timestamp in Unix nanoseconds.
end_timestamp_unix_nanos: Option<u64>Exclusive highest event timestamp in Unix nanoseconds.
limit: Option<usize>Maximum number of records to return.
order: QueryOrderDurable-offset result order.
sort: QuerySortStable record sort key.
after: Option<QueryCursor>Exclusive continuation point from the previous page.
Implementations§
Source§impl LogQuery
impl LogQuery
Sourcepub fn matches<R: StructuralRecordView>(&self, record: &R) -> bool
pub fn matches<R: StructuralRecordView>(&self, record: &R) -> bool
Returns whether a normalized structural record satisfies every lookup range, legacy exact constraint, Boolean predicate, and page cursor.
Sourcepub fn compare<R: StructuralRecordView>(&self, left: &R, right: &R) -> Ordering
pub fn compare<R: StructuralRecordView>(&self, left: &R, right: &R) -> Ordering
Compares two matching records in the query’s deterministic result order.
Sourcepub fn cursor_for<R: StructuralRecordView>(&self, record: &R) -> QueryCursor
pub fn cursor_for<R: StructuralRecordView>(&self, record: &R) -> QueryCursor
Creates the stable continuation point represented by one result.
Sourcepub fn select<R: StructuralRecordView>(
&self,
records: impl IntoIterator<Item = R>,
) -> Vec<R>
pub fn select<R: StructuralRecordView>( &self, records: impl IntoIterator<Item = R>, ) -> Vec<R>
Applies exact residual filtering, deterministic ordering, and the result limit to decoded candidate records from a sealed-block lookup.
Sourcepub fn requires_post_decode(&self) -> bool
pub fn requires_post_decode(&self) -> bool
Returns whether sealed candidates require record decoding before the query can be limited safely.
Callers serving sealed blocks should stream these queries block by block instead of materializing the complete candidate set.
Source§impl LogQuery
impl LogQuery
Sourcepub fn new(topic_partition: TopicPartition) -> Self
pub fn new(topic_partition: TopicPartition) -> Self
Creates an empty query for a logical partition.
Sourcepub fn with_term(self, term: impl Into<Arc<str>>) -> Self
pub fn with_term(self, term: impl Into<Arc<str>>) -> Self
Adds a case-insensitive exact token constraint.
Sourcepub fn with_field(
self,
key: impl Into<Arc<str>>,
value: impl Into<Arc<str>>,
) -> Self
pub fn with_field( self, key: impl Into<Arc<str>>, value: impl Into<Arc<str>>, ) -> Self
Adds an exact metadata constraint.
Sourcepub fn with_predicate(self, predicate: LogPredicate) -> Self
pub fn with_predicate(self, predicate: LogPredicate) -> Self
Adds an arbitrary predicate with AND semantics.
Sourcepub fn where_predicate(self, predicate: LogPredicate) -> Self
pub fn where_predicate(self, predicate: LogPredicate) -> Self
Replaces the additional Boolean predicate.
Sourcepub fn with_offset_range(self, start: LogicalOffset, end: LogicalOffset) -> Self
pub fn with_offset_range(self, start: LogicalOffset, end: LogicalOffset) -> Self
Restricts results to start..end durable offsets.
Sourcepub fn with_timestamp_range(self, start: u64, end: u64) -> Self
pub fn with_timestamp_range(self, start: u64, end: u64) -> Self
Restricts results to start..end event timestamps.
Sourcepub fn with_limit(self, limit: usize) -> Self
pub fn with_limit(self, limit: usize) -> Self
Caps the number of materialized results.
Sourcepub fn newest_first(self) -> Self
pub fn newest_first(self) -> Self
Returns the highest durable offsets first.
Sourcepub fn oldest_first(self) -> Self
pub fn oldest_first(self) -> Self
Returns the lowest sort keys first.
Sourcepub fn sort_by_timestamp(self) -> Self
pub fn sort_by_timestamp(self) -> Self
Sorts by event timestamp with durable offset as the tie-breaker.
Sourcepub fn sort_by_offset(self) -> Self
pub fn sort_by_offset(self) -> Self
Sorts by durable logical offset.
Sourcepub fn after(self, cursor: QueryCursor) -> Self
pub fn after(self, cursor: QueryCursor) -> Self
Continues strictly after a previous page’s final record in query order.
Trait Implementations§
impl Eq for LogQuery
impl StructuralPartialEq for LogQuery
Auto Trait Implementations§
impl Freeze for LogQuery
impl RefUnwindSafe for LogQuery
impl Send for LogQuery
impl Sync for LogQuery
impl Unpin for LogQuery
impl UnsafeUnpin for LogQuery
impl UnwindSafe for LogQuery
Blanket Implementations§
impl<T> Allocation for T
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.Source§impl<T> FutureExt for T
impl<T> FutureExt for T
Source§fn with_context(self, otel_cx: Context) -> WithContext<Self> ⓘ
fn with_context(self, otel_cx: Context) -> WithContext<Self> ⓘ
Source§fn with_current_context(self) -> WithContext<Self> ⓘ
fn with_current_context(self) -> WithContext<Self> ⓘ
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
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> ⓘ
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> ⓘ
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> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T in a tonic::Request