pub struct MemDb(/* private fields */);
Implementations§
Source§impl MemDb
impl MemDb
pub fn new(is_server: bool) -> MemDb
pub async fn recreate_all<T: Object>( &self, event_id: EventId, updatedness: Option<Updatedness>, ) -> Result<()>
pub async fn memdb_query<T: Object>( &self, user: User, only_updated_since: Option<Updatedness>, query: &Query, ) -> Result<Vec<ObjectId>>
Trait Implementations§
Source§impl ClientSideDb for MemDb
impl ClientSideDb for MemDb
async fn storage_info(&self) -> Result<ClientStorageInfo>
async fn save_login(&self, _info: LoginInfo) -> Result<()>
async fn get_saved_login(&self) -> Result<Option<LoginInfo>>
async fn get_json( &self, _object_id: ObjectId, _importance: Importance, ) -> Result<Value>
async fn remove_everything(&self) -> Result<()>
Source§async fn recreate<T: Object>(
&self,
object_id: ObjectId,
new_created_at: EventId,
object: Arc<T>,
updatedness: Option<Updatedness>,
additional_importance: Importance,
) -> Result<Option<Arc<T>>>
async fn recreate<T: Object>( &self, object_id: ObjectId, new_created_at: EventId, object: Arc<T>, updatedness: Option<Updatedness>, additional_importance: Importance, ) -> Result<Option<Arc<T>>>
Either create an object if it did not exist yet, or recreate it Read more
async fn client_query( &self, _type_id: TypeId, _query: Arc<Query>, ) -> Result<Vec<ObjectId>>
async fn remove(&self, object_id: ObjectId) -> Result<()>
async fn remove_event<T: Object>( &self, _object_id: ObjectId, _event_id: EventId, ) -> Result<()>
async fn set_object_importance( &self, object_id: ObjectId, new_importance: Importance, ) -> Result<()>
async fn set_importance_from_queries( &self, object_id: ObjectId, new_importance_from_queries: Importance, ) -> Result<()>
async fn client_vacuum( &self, _notify_removals: impl 'static + CrdbSyncFn<ObjectId>, _notify_query_removals: impl 'static + CrdbSyncFn<QueryId>, ) -> Result<()>
async fn list_uploads(&self) -> Result<Vec<UploadId>>
async fn get_upload(&self, _upload_id: UploadId) -> Result<Option<Upload>>
async fn enqueue_upload( &self, _upload: Upload, _required_binaries: Vec<BinPtr>, ) -> Result<UploadId>
async fn upload_finished(&self, _upload_id: UploadId) -> Result<()>
async fn get_saved_objects(&self) -> Result<HashMap<ObjectId, SavedObjectMeta>>
async fn get_saved_queries(&self) -> Result<HashMap<QueryId, SavedQuery>>
async fn record_query( &self, _query_id: QueryId, _query: Arc<Query>, _type_id: TypeId, _importance: Importance, ) -> Result<()>
async fn set_query_importance( &self, _query_id: QueryId, _importance: Importance, _objects_matching_query: Vec<ObjectId>, ) -> Result<()>
async fn forget_query( &self, _query_id: QueryId, _objects_to_unlock: Vec<ObjectId>, ) -> Result<()>
async fn update_queries( &self, _queries: &HashSet<QueryId>, _now_have_all_until: Updatedness, ) -> Result<()>
Source§impl Db for MemDb
impl Db for MemDb
Source§async fn create<T: Object>(
&self,
object_id: ObjectId,
created_at: EventId,
object: Arc<T>,
updatedness: Option<Updatedness>,
importance: Importance,
) -> Result<Option<Arc<T>>>
async fn create<T: Object>( &self, object_id: ObjectId, created_at: EventId, object: Arc<T>, updatedness: Option<Updatedness>, importance: Importance, ) -> Result<Option<Arc<T>>>
Returns the new latest snapshot if it actually changed Read more
Source§async fn submit<T: Object>(
&self,
object_id: ObjectId,
event_id: EventId,
event: Arc<T::Event>,
updatedness: Option<Updatedness>,
additional_importance: Importance,
) -> Result<Option<Arc<T>>>
async fn submit<T: Object>( &self, object_id: ObjectId, event_id: EventId, event: Arc<T::Event>, updatedness: Option<Updatedness>, additional_importance: Importance, ) -> Result<Option<Arc<T>>>
Returns the new latest snapshot if it actually changed Read more
async fn get_latest<T: Object>( &self, object_id: ObjectId, importance: Importance, ) -> Result<Arc<T>>
async fn create_binary(&self, binary_id: BinPtr, data: Arc<[u8]>) -> Result<()>
async fn get_binary(&self, binary_id: BinPtr) -> Result<Option<Arc<[u8]>>>
Source§async fn reencode_old_versions<T: Object>(&self) -> usize
async fn reencode_old_versions<T: Object>(&self) -> usize
Returns the number of errors that happened while re-encoding
async fn assert_invariants_generic(&self)
async fn assert_invariants_for<T: Object>(&self)
Auto Trait Implementations§
impl Freeze for MemDb
impl !RefUnwindSafe for MemDb
impl Send for MemDb
impl Sync for MemDb
impl Unpin for MemDb
impl !UnwindSafe for MemDb
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more