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(#[automatically_derived]
impl<Limit: ::core::fmt::Debug, Offset: ::core::fmt::Debug> ::core::fmt::Debug
    for LimitOffsetClause<Limit, Offset> {
    #[inline]
    fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result {
        ::core::fmt::Formatter::debug_struct_field2_finish(f,
            "LimitOffsetClause", "limit_clause", &self.limit_clause,
            "offset_clause", &&self.offset_clause)
    }
}Debug, #[automatically_derived]
impl<Limit: ::core::clone::Clone, Offset: ::core::clone::Clone>
    ::core::clone::Clone for LimitOffsetClause<Limit, Offset> {
    #[inline]
    fn clone(&self) -> LimitOffsetClause<Limit, Offset> {
        LimitOffsetClause {
            limit_clause: ::core::clone::Clone::clone(&self.limit_clause),
            offset_clause: ::core::clone::Clone::clone(&self.offset_clause),
        }
    }
}Clone, #[automatically_derived]
impl<Limit: ::core::marker::Copy, Offset: ::core::marker::Copy>
    ::core::marker::Copy for LimitOffsetClause<Limit, Offset> {
}Copy, const _: () =
    {
        use diesel;
        #[allow(non_camel_case_types)]
        impl<Limit: diesel::query_builder::QueryId,
            Offset: diesel::query_builder::QueryId>
            diesel::query_builder::QueryId for
            LimitOffsetClause<Limit, Offset> {
            type QueryId =
                LimitOffsetClause<<Limit as
                diesel::query_builder::QueryId>::QueryId,
                <Offset as diesel::query_builder::QueryId>::QueryId>;
            const HAS_STATIC_QUERY_ID: bool =
                <Limit as diesel::query_builder::QueryId>::HAS_STATIC_QUERY_ID
                        &&
                        <Offset as
                            diesel::query_builder::QueryId>::HAS_STATIC_QUERY_ID &&
                    true;
            const IS_WINDOW_FUNCTION: bool =
                <Limit as diesel::query_builder::QueryId>::IS_WINDOW_FUNCTION
                        ||
                        <Offset as
                            diesel::query_builder::QueryId>::IS_WINDOW_FUNCTION ||
                    false;
        }
    };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}