1 use 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`]: ../trait.QueryDsl.html
10 pub trait OffsetDsl {
11     /// The type returned by `.offset`.
12     type Output;
13 
14     /// See the trait documentation
offset(self, offset: i64) -> Self::Output15     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 
offset(self, offset: i64) -> Self::Output25     fn offset(self, offset: i64) -> Self::Output {
26         self.as_query().offset(offset)
27     }
28 }
29