pub trait MappingType {
// Required method
fn field_type() -> &'static str;
// Provided methods
fn fields() -> Map<String, Value> { ... }
fn mapping() -> Map<String, Value> { ... }
}Expand description
Trait for types that can be mapped to Elasticsearch field types.
This trait is implemented for all Rust primitive types and can be implemented
for custom types. It’s automatically implemented by the #[derive(Document)] macro
for structs.
You generally don’t need to implement this trait manually unless you’re adding support for custom types.
Required Methods§
Sourcefn field_type() -> &'static str
fn field_type() -> &'static str
Returns the Elasticsearch field type name.
Examples: "text", "long", "boolean", "object", etc.
Provided Methods§
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.