1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
#![allow(unused)]

use super::PageDto;

impl<T> dysql_tpl::Content for PageDto<T>
where
    T: dysql_tpl::Content,
{
    #[inline]
    fn capacity_hint(&self, tpl: &dysql_tpl::Template) -> usize {
        tpl.capacity_hint() + self.total.capacity_hint(tpl)
            + self.data.capacity_hint(tpl) + self.is_sort.capacity_hint(tpl)
            + self.total_page.capacity_hint(tpl) + self.page_size.capacity_hint(tpl)
            + self.page_no.capacity_hint(tpl) + self.sort_model.capacity_hint(tpl)
            + self.start.capacity_hint(tpl)
    }
    #[inline]
    fn render_section<C, E, IC>(
        &self,
        section: dysql_tpl::Section<C>,
        encoder: &mut E,
        _content: Option<&IC>,
    ) -> std::result::Result<(), E::Error>
    where
        C: dysql_tpl::traits::ContentSequence,
        E: dysql_tpl::encoding::Encoder,
    {
        section.with(self).render(encoder, Option::<&()>::None)
    }
    #[inline]
    fn apply_section<C>(
        &self,
        section: dysql_tpl::SimpleSection<C>,
    ) -> std::result::Result<dysql_tpl::SimpleValue, dysql_tpl::SimpleError>
    where
        C: dysql_tpl::traits::ContentSequence,
    {
        section.with(self).apply()
    }
    #[inline]
    fn render_notnone_section<C, E, IC>(
        &self,
        section: dysql_tpl::Section<C>,
        encoder: &mut E,
        _content: Option<&IC>,
    ) -> std::result::Result<(), E::Error>
    where
        C: dysql_tpl::traits::ContentSequence,
        E: dysql_tpl::encoding::Encoder,
    {
        section.with(self).render(encoder, Option::<&()>::None)
    }
    #[inline]
    fn render_field_escaped<E>(
        &self,
        hash: u64,
        name: &str,
        encoder: &mut E,
    ) -> std::result::Result<bool, E::Error>
    where
        E: dysql_tpl::encoding::Encoder,
    {
        match hash {
            1212331373962215526u64 => self.total.render_escaped(encoder).map(|_| true),
            4430724373119788750u64 => self.data.render_escaped(encoder).map(|_| true),
            8220941355636662115u64 => self.is_sort.render_escaped(encoder).map(|_| true),
            9928246550803098198u64 => {
                self.total_page.render_escaped(encoder).map(|_| true)
            }
            10087286125916898991u64 => {
                self.page_size.render_escaped(encoder).map(|_| true)
            }
            11609058959308731613u64 => self.page_no.render_escaped(encoder).map(|_| true),
            11721374545196086984u64 => {
                self.sort_model.render_escaped(encoder).map(|_| true)
            }
            13127600857983441824u64 => self.start.render_escaped(encoder).map(|_| true),
            _ => Ok(false),
        }
    }
    #[inline]
    fn render_field_unescaped<E>(
        &self,
        hash: u64,
        name: &str,
        encoder: &mut E,
    ) -> std::result::Result<bool, E::Error>
    where
        E: dysql_tpl::encoding::Encoder,
    {
        match hash {
            1212331373962215526u64 => self.total.render_unescaped(encoder).map(|_| true),
            4430724373119788750u64 => self.data.render_unescaped(encoder).map(|_| true),
            8220941355636662115u64 => {
                self.is_sort.render_unescaped(encoder).map(|_| true)
            }
            9928246550803098198u64 => {
                self.total_page.render_unescaped(encoder).map(|_| true)
            }
            10087286125916898991u64 => {
                self.page_size.render_unescaped(encoder).map(|_| true)
            }
            11609058959308731613u64 => {
                self.page_no.render_unescaped(encoder).map(|_| true)
            }
            11721374545196086984u64 => {
                self.sort_model.render_unescaped(encoder).map(|_| true)
            }
            13127600857983441824u64 => self.start.render_unescaped(encoder).map(|_| true),
            _ => Ok(false),
        }
    }
    #[inline]
    fn apply_field_unescaped(
        &self,
        hash: u64,
        name: &str,
    ) -> std::result::Result<dysql_tpl::SimpleValue, dysql_tpl::SimpleError> {
        match hash {
            1212331373962215526u64 => self.total.apply_unescaped(),
            4430724373119788750u64 => self.data.apply_unescaped(),
            8220941355636662115u64 => self.is_sort.apply_unescaped(),
            9928246550803098198u64 => self.total_page.apply_unescaped(),
            10087286125916898991u64 => self.page_size.apply_unescaped(),
            11609058959308731613u64 => self.page_no.apply_unescaped(),
            11721374545196086984u64 => self.sort_model.apply_unescaped(),
            13127600857983441824u64 => self.start.apply_unescaped(),
            _ => {
                Err(
                    dysql_tpl::SimpleInnerError(std::format!("the data type of field: {0} is not supported ", name)).into()
                )
            }
        }
    }
    fn render_field_section<P, E>(
        &self,
        hash: u64,
        name: &str,
        section: dysql_tpl::Section<P>,
        encoder: &mut E,
    ) -> std::result::Result<bool, E::Error>
    where
        P: dysql_tpl::traits::ContentSequence,
        E: dysql_tpl::encoding::Encoder,
    {
        match hash {
            1212331373962215526u64 => {
                self.total
                    .render_section(section, encoder, Option::<&()>::None)
                    .map(|_| true)
            }
            4430724373119788750u64 => {
                self.data
                    .render_section(section, encoder, Option::<&()>::None)
                    .map(|_| true)
            }
            8220941355636662115u64 => {
                self.is_sort
                    .render_section(section, encoder, Option::<&()>::None)
                    .map(|_| true)
            }
            9928246550803098198u64 => {
                self.total_page
                    .render_section(section, encoder, Option::<&()>::None)
                    .map(|_| true)
            }
            10087286125916898991u64 => {
                self.page_size
                    .render_section(section, encoder, Option::<&()>::None)
                    .map(|_| true)
            }
            11609058959308731613u64 => {
                self.page_no
                    .render_section(section, encoder, Option::<&()>::None)
                    .map(|_| true)
            }
            11721374545196086984u64 => {
                self.sort_model
                    .render_section(section, encoder, Option::<&()>::None)
                    .map(|_| true)
            }
            13127600857983441824u64 => {
                self.start
                    .render_section(section, encoder, Option::<&()>::None)
                    .map(|_| true)
            }
            _ => Ok(false),
        }
    }
    fn apply_field_section<P>(
        &self,
        hash: u64,
        name: &str,
        section: dysql_tpl::SimpleSection<P>,
    ) -> std::result::Result<dysql_tpl::SimpleValue, dysql_tpl::SimpleError>
    where
        P: dysql_tpl::traits::ContentSequence,
    {
        match hash {
            1212331373962215526u64 => self.total.apply_section(section),
            4430724373119788750u64 => self.data.apply_section(section),
            8220941355636662115u64 => self.is_sort.apply_section(section),
            9928246550803098198u64 => self.total_page.apply_section(section),
            10087286125916898991u64 => self.page_size.apply_section(section),
            11609058959308731613u64 => self.page_no.apply_section(section),
            11721374545196086984u64 => self.sort_model.apply_section(section),
            13127600857983441824u64 => self.start.apply_section(section),
            _ => {
                Err(
                    dysql_tpl::SimpleInnerError(std::format!("tthe data type of field is not supported")).into()
                )
            }
        }
    }
    fn render_field_inverse<P, E>(
        &self,
        hash: u64,
        name: &str,
        section: dysql_tpl::Section<P>,
        encoder: &mut E,
    ) -> std::result::Result<bool, E::Error>
    where
        P: dysql_tpl::traits::ContentSequence,
        E: dysql_tpl::encoding::Encoder,
    {
        match hash {
            1212331373962215526u64 => {
                self.total
                    .render_inverse(section, encoder, Option::<&()>::None)
                    .map(|_| true)
            }
            4430724373119788750u64 => {
                self.data
                    .render_inverse(section, encoder, Option::<&()>::None)
                    .map(|_| true)
            }
            8220941355636662115u64 => {
                self.is_sort
                    .render_inverse(section, encoder, Option::<&()>::None)
                    .map(|_| true)
            }
            9928246550803098198u64 => {
                self.total_page
                    .render_inverse(section, encoder, Option::<&()>::None)
                    .map(|_| true)
            }
            10087286125916898991u64 => {
                self.page_size
                    .render_inverse(section, encoder, Option::<&()>::None)
                    .map(|_| true)
            }
            11609058959308731613u64 => {
                self.page_no
                    .render_inverse(section, encoder, Option::<&()>::None)
                    .map(|_| true)
            }
            11721374545196086984u64 => {
                self.sort_model
                    .render_inverse(section, encoder, Option::<&()>::None)
                    .map(|_| true)
            }
            13127600857983441824u64 => {
                self.start
                    .render_inverse(section, encoder, Option::<&()>::None)
                    .map(|_| true)
            }
            _ => Ok(false),
        }
    }
    fn render_field_notnone_section<P, E>(
        &self,
        hash: u64,
        name: &str,
        section: dysql_tpl::Section<P>,
        encoder: &mut E,
    ) -> std::result::Result<bool, E::Error>
    where
        P: dysql_tpl::traits::ContentSequence,
        E: dysql_tpl::encoding::Encoder,
    {
        match hash {
            1212331373962215526u64 => {
                self.total
                    .render_notnone_section(section, encoder, Option::<&()>::None)?;
                Ok(self.total.is_truthy())
            }
            4430724373119788750u64 => {
                self.data.render_notnone_section(section, encoder, Option::<&()>::None)?;
                Ok(self.data.is_truthy())
            }
            8220941355636662115u64 => {
                self.is_sort
                    .render_notnone_section(section, encoder, Option::<&()>::None)?;
                Ok(self.is_sort.is_truthy())
            }
            9928246550803098198u64 => {
                self.total_page
                    .render_notnone_section(section, encoder, Option::<&()>::None)?;
                Ok(self.total_page.is_truthy())
            }
            10087286125916898991u64 => {
                self.page_size
                    .render_notnone_section(section, encoder, Option::<&()>::None)?;
                Ok(self.page_size.is_truthy())
            }
            11609058959308731613u64 => {
                self.page_no
                    .render_notnone_section(section, encoder, Option::<&()>::None)?;
                Ok(self.page_no.is_truthy())
            }
            11721374545196086984u64 => {
                self.sort_model
                    .render_notnone_section(section, encoder, Option::<&()>::None)?;
                Ok(self.sort_model.is_truthy())
            }
            13127600857983441824u64 => {
                self.start
                    .render_notnone_section(section, encoder, Option::<&()>::None)?;
                Ok(self.start.is_truthy())
            }
            _ => Ok(false),
        }
    }
}