1 2 3 4 5 6 7
use bson::oid::ObjectId; /// Trait which all documents must implement in order to be identified as a document pub trait BaseDocument { fn set_id(&mut self, id: Option<ObjectId>); fn get_id(&self) -> Option<ObjectId>; }