Debian Codegraph @

src/query_dsl/offset_dsl.rs

raw
1 use crate::query_source::Table;
2
3 /// The `offset` method
4 ///
5 /// This trait should not be relied on directly by most apps. Its behavior is
6 /// provided by [`QueryDsl`]. However, you may need a where clause on this trait
7 /// to call `offset` from generic code.
8 ///
9 /// [`QueryDsl`]: crate::QueryDsl
10 pub trait OffsetDsl<DummyArgForAutoType = i64> {
11 /// The type returned by `.offset`.
12 type Output;
13
14 /// See the trait documentation
15 fn offset(self, offset: i64) -> Self::Output;
16 }
17
18 impl<T> OffsetDsl for T
19 where
20 T: Table,
21 T::Query: OffsetDsl,
22 {
23 type Output = <T::Query as OffsetDsl>::Output;
24
25 fn offset(self, offset: i64) -> Self::Output {
26 self.as_query().offset(offset)
27 }
28 }