use super::QueryFragment;
use crate::query_builder::QueryId;
use alloc::boxed::Box;
use alloc::sync::Arc;
#[derive(Debug, Clone, Copy, QueryId)]
#[cfg_attr(
diesel_docsrs,
doc(cfg(feature = "i-implement-a-third-party-backend-and-opt-into-breaking-changes"))
)]
pub struct LimitOffsetClause<Limit, Offset> {
pub limit_clause: Limit,
pub offset_clause: Offset,
}
#[allow(missing_debug_implementations)]
#[cfg_attr(
diesel_docsrs,
doc(cfg(feature = "i-implement-a-third-party-backend-and-opt-into-breaking-changes"))
)]
pub struct BoxedLimitOffsetClause<'a, DB> {
pub limit: Option<Box<dyn QueryFragment<DB> + Send + 'a>>,
pub offset: Option<Box<dyn QueryFragment<DB> + Send + 'a>>,
}
#[allow(missing_debug_implementations)]
#[cfg_attr(
diesel_docsrs,
doc(cfg(feature = "i-implement-a-third-party-backend-and-opt-into-breaking-changes"))
)]
pub struct BoxedCloneLimitOffsetClause<'a, DB> {
pub limit: Option<Arc<dyn QueryFragment<DB> + Send + Sync + 'a>>,
pub offset: Option<Arc<dyn QueryFragment<DB> + Send + Sync + 'a>>,
}
impl<DB> Clone for BoxedCloneLimitOffsetClause<'_, DB> {
fn clone(&self) -> Self {
Self {
limit: self.limit.as_ref().map(Arc::clone),
offset: self.offset.as_ref().map(Arc::clone),
}
}
}