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§
Sourceconst COLLECTION_NAME: &'static str
const COLLECTION_NAME: &'static str
Collection name
Required Associated Types§
Sourcetype Partial: DocumentPartial
type Partial: DocumentPartial
A struct for partial updates
Required Methods§
Sourcefn collection_schema() -> CollectionSchema<'static>
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".