Trait bonsaidb::core::schema::DefaultSerialization
source · 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§
sourcefn 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.
Object Safety§
This trait is not object safe.