[][src]Module elastic_types::number::mapping

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 byte type.

DefaultDoubleMapping

Default mapping for a double type.

DefaultFloatMapping

Default mapping for a float type.

DefaultIntegerMapping

Default mapping for an integer type.

DefaultLongMapping

Default mapping for a long type.

DefaultShortMapping

Default mapping for a short type.

Traits

ByteFieldType

A field that will be mapped as a number.

ByteMapping

Base number mapping.

DoubleFieldType

A field that will be mapped as a number.

DoubleMapping

Base number mapping.

FloatFieldType

A field that will be mapped as a number.

FloatMapping

Base number mapping.

IntegerFieldType

A field that will be mapped as a number.

IntegerMapping

Base number mapping.

LongFieldType

A field that will be mapped as a number.

LongMapping

Base number mapping.

ShortFieldType

A field that will be mapped as a number.

ShortMapping

Base number mapping.