Trait elastic::types::document::prelude::FieldType
[−]
[src]
pub trait FieldType<M, F> where
F: Default,
M: FieldMapping<F>, { fn mapping() -> M { ... } }
The base representation of an Elasticsearch data type.
FieldType
is the main trait
you need to care about when building your own Elasticsearch types.
Each type has two generic arguments that help define its mapping:
- A mapping type, which implements
FieldMapping
- A format type, which is usually
()
. Types with multiple formats, likeDate
, can use the format in the type definition.
Links
Provided Methods
fn mapping() -> M
Get the mapping for this type.
Implementors
impl<K, V> FieldType<DefaultMapping, ()> for HashMap<K, V, RandomState> where
K: AsRef<str> + Eq + Hash + Serialize,
V: Serialize,impl<T, F, M> FieldType<M, DateFormatWrapper<F>> for T where
F: DateFormat,
M: DateMapping<Format = F>,
T: DateFieldType<M, F> + Serialize,impl<T, F, M> FieldType<M, GeoPointFormatWrapper<F>> for T where
F: GeoPointFormat,
M: GeoPointMapping<Format = F>,
T: GeoPointFieldType<M, F> + Serialize,impl<T, M> FieldType<M, LongFormat> for T where
M: LongMapping,
T: LongFieldType<M> + Serialize,impl<K, V> FieldType<DefaultMapping, ()> for BTreeMap<K, V> where
K: AsRef<str> + Ord + Serialize,
V: Serialize,impl<T, M> FieldType<M, KeywordFormat> for T where
M: KeywordMapping,
T: KeywordFieldType<M> + Serialize,impl<T, M> FieldType<M, ByteFormat> for T where
M: ByteMapping,
T: ByteFieldType<M> + Serialize,impl<T, M> FieldType<M, BooleanFormat> for T where
M: BooleanMapping,
T: BooleanFieldType<M> + Serialize,impl<T, M> FieldType<M, DoubleFormat> for T where
M: DoubleMapping,
T: DoubleFieldType<M> + Serialize,impl<T, M> FieldType<M, ShortFormat> for T where
M: ShortMapping,
T: ShortFieldType<M> + Serialize,impl<T, M, F> FieldType<WrappedMapping<M, F>, F> for Vec<T> where
F: Default,
M: FieldMapping<F>,
T: FieldType<M, F>,
DocumentField<M, F>: Serialize,impl<T, M> FieldType<M, IpFormat> for T where
M: IpMapping,
T: IpFieldType<M> + Serialize,impl<T, M> FieldType<M, DocumentFormat> for T where
M: DocumentMapping,
T: DocumentFieldType<M>,impl<T, M> FieldType<M, GeoShapeFormat> for T where
M: GeoShapeMapping,
T: GeoShapeFieldType<M> + Serialize,impl<T, M> FieldType<M, FloatFormat> for T where
M: FloatMapping,
T: FloatFieldType<M> + Serialize,impl<T, M> FieldType<M, TextFormat> for T where
M: TextMapping,
T: TextFieldType<M> + Serialize,impl<T, M, F> FieldType<WrappedMapping<M, F>, F> for Option<T> where
F: Default,
M: FieldMapping<F>,
T: FieldType<M, F>,
DocumentField<M, F>: Serialize,impl<T, M> FieldType<M, IntegerFormat> for T where
M: IntegerMapping,
T: IntegerFieldType<M> + Serialize,