pub struct AuditedObjectSpace { /* private fields */ }Expand description
A unit of work that writes what it commits to the audit trail, in the same commit, so a change and its trail stay or go together. Changes made to the database some other way are not seen.
Implementations§
Source§impl AuditedObjectSpace
impl AuditedObjectSpace
Sourcepub fn new(inner: Box<dyn ObjectSpace>, trail: Rc<AuditTrail>) -> Self
pub fn new(inner: Box<dyn ObjectSpace>, trail: Rc<AuditTrail>) -> Self
Over this, writing to this trail.
Trait Implementations§
Source§impl Debug for AuditedObjectSpace
impl Debug for AuditedObjectSpace
Source§impl ObjectSpace for AuditedObjectSpace
impl ObjectSpace for AuditedObjectSpace
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 !RefUnwindSafe for AuditedObjectSpace
impl !Send for AuditedObjectSpace
impl !Sync for AuditedObjectSpace
impl !UnwindSafe for AuditedObjectSpace
impl Freeze for AuditedObjectSpace
impl Unpin for AuditedObjectSpace
impl UnsafeUnpin for AuditedObjectSpace
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.