Skip to main content

SqliteObjectSpace

Struct SqliteObjectSpace 

Source
pub struct SqliteObjectSpace { /* private fields */ }
Expand description

A unit of work over a SqliteDatabase. A commit is one transaction.

Trait Implementations§

Source§

impl Debug for SqliteObjectSpace

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl ObjectSpace for SqliteObjectSpace

Source§

fn entities(&self) -> Vec<EntityInfo>

The entities it knows.
Source§

fn query(&self, name: &str, query: &Query) -> Result<Vec<Object>, SpaceError>

Reads records.
Source§

fn find(&self, name: &str, key: &Value) -> Result<Option<Object>, SpaceError>

Reads one record by its key.
Source§

fn new_object(&mut self, name: &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>

Marks a record as new or changed, by its key.
Source§

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, name: &str, key: &Value) -> Result<(), SpaceError>

Marks a record to go away.
Source§

fn changes(&self) -> Vec<Change>

What waits for a commit.
Source§

fn commit(&mut self) -> Result<(), SpaceError>

Keeps every change, or none of them.
Source§

fn rollback(&mut self)

Throws away every change.
Source§

fn on_event(&mut self, watcher: SpaceWatcher)

Calls this when something happens to the space.
Source§

fn is_modified(&self) -> bool

Whether anything waits for a commit.
Source§

fn refresh(&mut self)

Throws away every change and reads again from storage.

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<S> ObjectSpaceExt for S
where S: ObjectSpace + ?Sized,

Source§

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,

Reads records.
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.