Trait bonsaidb_core::schema::DefaultSerialization
source · [−]pub trait DefaultSerialization: Collection {
fn natural_id(&self) -> Option<Self::PrimaryKey> { ... }
}Expand description
A convenience trait for easily storing Serde-compatible types in documents.
Provided methods
fn natural_id(&self) -> Option<Self::PrimaryKey>
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.