pub trait MongoEntity:
Unpin
+ Send
+ Sync {
// Required methods
fn to_document(&self) -> Document;
fn from_document(doc: Document) -> Self;
}Required Methods§
fn to_document(&self) -> Document
Sourcefn from_document(doc: Document) -> Self
fn from_document(doc: Document) -> Self
Create the struct from a BSON document
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.