mongo_orm::entity

Trait MongoEntity

Source
pub trait MongoEntity:
    Unpin
    + Send
    + Sync {
    // Required methods
    fn to_document(&self) -> Document;
    fn from_document(doc: Document) -> Self;
}

Required Methods§

Source

fn to_document(&self) -> Document

Source

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.

Implementors§