Skip to main content

Document

Trait Document 

Source
pub trait Document: DeserializeOwned + Serialize {
    type Partial: DocumentPartial;

    const COLLECTION_NAME: &'static str;

    // Required method
    fn collection_schema() -> CollectionSchema<'static>;
}
Expand description

Trait that every struct should implement that wants to be represented as a Typesense Document

Required Associated Constants§

Source

const COLLECTION_NAME: &'static str

Collection name

Required Associated Types§

Source

type Partial: DocumentPartial

A struct for partial updates

Required Methods§

Source

fn collection_schema() -> CollectionSchema<'static>

Collection schema associated with the document.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§