Struct machinebox::suggestionbox::Feature
[−]
[src]
pub struct Feature { pub key: String, pub value: String, pub feature_type: FeatureType, }
A feature is used to describe an input or a choice. For example, age:28 or location:"London"
Fields
key: String
The feature's key
value: String
The value of the feature
feature_type: FeatureType
The type of this feature
Methods
impl Feature
[src]
fn text(key: &str, text: &str) -> Feature
[src]
Shortcut for producing a new text feature
fn number(key: &str, number: f64) -> Feature
[src]
Shortcut for production a numerical feature
fn keyword(key: &str, keyword: &str) -> Feature
[src]
Shortcut for producing a keyword feature
fn list(key: &str, list: Vec<&str>) -> Feature
[src]
Shortcut for producing a keyword list feature
fn image_url(key: &str, url: &str) -> Feature
[src]
Shortcut for producing an image URL feature
fn image_base64(key: &str, data: &str) -> Feature
[src]
Shortcut for producing a base64-encoded image feature