pub trait DefaultSerialization: Collection {
    // Provided method
    fn natural_id(&self) -> Option<Self::PrimaryKey> { ... }
}
Expand description

A convenience trait for easily storing Serde-compatible types in documents.

Provided Methods§

source

fn natural_id(&self) -> Option<Self::PrimaryKey>

Returns the natural identifier of contents. This is called when pushing values into a collection, before attempting to automatically assign a unique id.

Implementors§