mongo_orm/
entity.rs

1
2
3
4
5
6
7
8
use bson::Document;

pub trait MongoEntity:  Unpin + Send + Sync {
    fn to_document(&self) -> Document;

    /// Create the struct from a BSON document
    fn from_document(doc: Document) -> Self;
}