[][src]Trait elastic_types::document::DocumentType

pub trait DocumentType: ObjectFieldType {
    fn index(&self) -> Cow<str>;
fn ty(&self) -> Cow<str>;
fn partial_id(&self) -> Option<Cow<str>>;
fn partial_static_index() -> Option<&'static str>;
fn partial_static_ty() -> Option<&'static str>; fn field_mapping() -> FieldDocumentMapping<Self::Mapping> { ... }
fn index_mapping() -> IndexDocumentMapping<Self::Mapping> { ... } }

An indexable Elasticsearch type.

This trait is implemented for the type being mapped, rather than the mapping type itself.

Required methods

fn index(&self) -> Cow<str>

Get the name of the index this document belongs to.

fn ty(&self) -> Cow<str>

Get the name of the type this document belongs to.

fn partial_id(&self) -> Option<Cow<str>>

Try get an id for this document.

fn partial_static_index() -> Option<&'static str>

Try get a statically known index this document belongs to.

fn partial_static_ty() -> Option<&'static str>

Try get a statically known type this document belongs to.

Loading content...

Provided methods

fn field_mapping() -> FieldDocumentMapping<Self::Mapping>

Get a serialisable instance of the type mapping as a field.

fn index_mapping() -> IndexDocumentMapping<Self::Mapping>

Get a serialisable instance of the type mapping as an indexable type

Loading content...

Implementations on Foreign Types

impl<'a, TDocument> DocumentType for &'a TDocument where
    TDocument: DocumentType
[src]

impl<'a, TDocument> DocumentType for Cow<'a, TDocument> where
    TDocument: DocumentType + Clone
[src]

Loading content...

Implementors

Loading content...