DefaultSerialization

Trait 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§

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.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§