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
//! Support for the **flat**, ungrouped `Select2` output format.
//!
//! What is the difference between `flat` and `grouped`? A `grouped` response
//! means that there is support for [\<optgroup\>](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/optgroup)
//! and `flat` means there are no support.
// -----------------------------------------------------------------------------
use crate;
use ;
use ;
use Debug;
use Hash;
use FromStr;
use ToString;
// -----------------------------------------------------------------------------
//
/// For the `select2::flat` module to work with your records, you must implement
/// this `Selectable` trait for it. The trait returns a `FlatRecord` with the
/// content needed to make it usable with the `Select2` jQuery plug-in.
// Selectable
// -----------------------------------------------------------------------------
//
/// For the `select2::flat` module to work with your records, you must implement
/// the `Selectable` trait it. This trait will return a `FlatRecord` struct. In
/// other words, you must implement a trait that converts your record into this
/// struct.
///
/// Select2 can render programmatically supplied data from an array or remote
/// data source (AJAX) as dropdown options. In order to accomplish this, Select2
/// expects a very specific data format. This format consists of a JSON object
/// containing an array of objects keyed by the `results` key.
// FlatRecord
// -----------------------------------------------------------------------------
// impl
// -----------------------------------------------------------------------------
//
/// This `struct` represents the results of the search query. This should be
/// converted to `JSON` using your web framework (or something like
/// `serde_json`), and then returned to the `Select2` jQuery plug-in.
// FlatResults