Module elastic_types::number::mapping
[−]
[src]
Mapping for the Elasticsearch number
types.
Custom mappings can be defined by implementing the right number mapping for some Rust primitive number type.
The implementation is the same for all number types, the only difference is the return type of null_value
.
Examples
Define a custom IntegerMapping
:
#[derive(Default)] struct MyIntegerMapping; impl IntegerMapping for MyIntegerMapping { //Overload the mapping functions here fn null_value() -> Option<i32> { Some(42) } }
This will produce the following mapping:
{ "type": "integer", "null_value": 42 }
Structs
DefaultByteMapping |
Default mapping for a |
DefaultDoubleMapping |
Default mapping for a |
DefaultFloatMapping |
Default mapping for a |
DefaultIntegerMapping |
Default mapping for an |
DefaultLongMapping |
Default mapping for a |
DefaultShortMapping |
Default mapping for a |
Traits
ByteFieldType |
A field that will be mapped as a number. |
ByteMapping |
Base |
DoubleFieldType |
A field that will be mapped as a number. |
DoubleMapping |
Base |
FloatFieldType |
A field that will be mapped as a number. |
FloatMapping |
Base |
IntegerFieldType |
A field that will be mapped as a number. |
IntegerMapping |
Base |
LongFieldType |
A field that will be mapped as a number. |
LongMapping |
Base |
ShortFieldType |
A field that will be mapped as a number. |
ShortMapping |
Base |