pub struct MemoryObjectSpace { /* private fields */ }Expand description
A unit of work over a MemoryDatabase.
Trait Implementations§
Source§impl Debug for MemoryObjectSpace
impl Debug for MemoryObjectSpace
Source§impl ObjectSpace for MemoryObjectSpace
impl ObjectSpace for MemoryObjectSpace
Source§fn entities(&self) -> Vec<EntityInfo>
fn entities(&self) -> Vec<EntityInfo>
The entities it knows.
Source§fn query(&self, entity: &str, query: &Query) -> Result<Vec<Object>, SpaceError>
fn query(&self, entity: &str, query: &Query) -> Result<Vec<Object>, SpaceError>
Reads records.
Source§fn find(&self, entity: &str, key: &Value) -> Result<Option<Object>, SpaceError>
fn find(&self, entity: &str, key: &Value) -> Result<Option<Object>, SpaceError>
Reads one record by its key.
Source§fn new_object(&mut self, entity: &str) -> Result<Object, SpaceError>
fn new_object(&mut self, entity: &str) -> Result<Object, SpaceError>
A record with what a new one starts with, kept only once
saved.Source§fn save(&mut self, object: Object) -> Result<(), SpaceError>
fn save(&mut self, object: Object) -> Result<(), SpaceError>
Marks a record as new or changed, by its key.
Source§fn insert(&mut self, object: Object) -> Result<(), SpaceError>
fn insert(&mut self, object: Object) -> Result<(), SpaceError>
Marks a record as new, refusing a key already in use, as a form creating
a record has to: it must not take over the record with that key.
Source§fn delete(&mut self, entity: &str, key: &Value) -> Result<(), SpaceError>
fn delete(&mut self, entity: &str, key: &Value) -> Result<(), SpaceError>
Marks a record to go away.
Source§fn on_event(&mut self, watcher: SpaceWatcher)
fn on_event(&mut self, watcher: SpaceWatcher)
Calls this when something happens to the space.
Source§fn is_modified(&self) -> bool
fn is_modified(&self) -> bool
Whether anything waits for a commit.
Auto Trait Implementations§
impl !Freeze for MemoryObjectSpace
impl !RefUnwindSafe for MemoryObjectSpace
impl !Send for MemoryObjectSpace
impl !Sync for MemoryObjectSpace
impl !UnwindSafe for MemoryObjectSpace
impl Unpin for MemoryObjectSpace
impl UnsafeUnpin for MemoryObjectSpace
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
Source§impl<S> ObjectSpaceExt for Swhere
S: ObjectSpace + ?Sized,
impl<S> ObjectSpaceExt for Swhere
S: ObjectSpace + ?Sized,
Source§fn add<T>(&mut self, record: &T) -> Result<(), SpaceError>where
T: BusinessObject,
fn add<T>(&mut self, record: &T) -> Result<(), SpaceError>where
T: BusinessObject,
Marks this as a new record. A numbered key left at zero gets the next number.
Source§fn read<T>(&self, query: &Query) -> Result<Vec<T>, SpaceError>where
T: BusinessObject,
fn read<T>(&self, query: &Query) -> Result<Vec<T>, SpaceError>where
T: BusinessObject,
Reads records.