diesel/query_builder/limit_offset_clause.rs
1use super::QueryFragment;
2use crate::query_builder::QueryId;
3
4/// A helper query node that contains both limit and offset clauses
5///
6/// This type is only relevant for implementing custom backends
7#[derive(Debug, Clone, Copy, QueryId)]
8#[cfg_attr(
9 diesel_docsrs,
10 doc(cfg(feature = "i-implement-a-third-party-backend-and-opt-into-breaking-changes"))
11)]
12pub struct LimitOffsetClause<Limit, Offset> {
13 /// The limit clause
14 pub limit_clause: Limit,
15 /// The offset clause
16 pub offset_clause: Offset,
17}
18
19/// A boxed variant of [`LimitOffsetClause`](LimitOffsetClause)
20///
21/// This type is only relevant for implementing custom backends
22#[allow(missing_debug_implementations)]
23#[cfg_attr(
24 diesel_docsrs,
25 doc(cfg(feature = "i-implement-a-third-party-backend-and-opt-into-breaking-changes"))
26)]
27pub struct BoxedLimitOffsetClause<'a, DB> {
28 /// The limit clause
29 pub limit: Option<Box<dyn QueryFragment<DB> + Send + 'a>>,
30 /// The offset clause
31 pub offset: Option<Box<dyn QueryFragment<DB> + Send + 'a>>,
32}