Struct mentat_transaction::InProgress
[−]
[src]
pub struct InProgress<'a, 'c> { pub transaction: Transaction<'c>, pub mutex: &'a Mutex<Metadata>, pub generation: u64, pub partition_map: PartitionMap, pub schema: Schema, pub cache: InProgressSQLiteAttributeCache, pub use_caching: bool, pub tx_observer: &'a Mutex<TxObservationService>, pub tx_observer_watcher: InProgressObserverTransactWatcher, }
Represents an in-progress, not yet committed, set of changes to the store.
Call commit
to commit your changes, or rollback
to discard them.
A transaction is held open until you do so.
Your changes will be implicitly dropped along with this struct.
Fields
transaction: Transaction<'c>
mutex: &'a Mutex<Metadata>
generation: u64
partition_map: PartitionMap
schema: Schema
cache: InProgressSQLiteAttributeCache
use_caching: bool
tx_observer: &'a Mutex<TxObservationService>
tx_observer_watcher: InProgressObserverTransactWatcher
Methods
impl<'a, 'c> InProgress<'a, 'c>
[src]
pub fn builder(self) -> InProgressBuilder<'a, 'c>
[src]
pub fn use_caching(&mut self, yesno: bool)
[src]
Choose whether to use in-memory caches for running queries.
pub fn transact_builder(&mut self, builder: TermBuilder) -> Result<TxReport>
[src]
If you only have a reference to an InProgress
, you can't use the easy builder.
This exists so you can make your own.
pub fn transact_terms<I>(
&mut self,
terms: I,
tempid_set: InternSet<TempId>
) -> Result<TxReport> where
I: IntoIterator<Item = TermWithTempIds>,
[src]
&mut self,
terms: I,
tempid_set: InternSet<TempId>
) -> Result<TxReport> where
I: IntoIterator<Item = TermWithTempIds>,
pub fn transact_entities<I, V: TransactableValue>(
&mut self,
entities: I
) -> Result<TxReport> where
I: IntoIterator<Item = Entity<V>>,
[src]
&mut self,
entities: I
) -> Result<TxReport> where
I: IntoIterator<Item = Entity<V>>,
pub fn transact<B>(&mut self, transaction: B) -> Result<TxReport> where
B: Borrow<str>,
[src]
B: Borrow<str>,
pub fn import<P>(&mut self, path: P) -> Result<TxReport> where
P: AsRef<Path>,
[src]
P: AsRef<Path>,
pub fn rollback(self) -> Result<()>
[src]
pub fn commit(self) -> Result<()>
[src]
pub fn cache(
&mut self,
attribute: &Keyword,
cache_direction: CacheDirection,
cache_action: CacheAction
) -> Result<()>
[src]
&mut self,
attribute: &Keyword,
cache_direction: CacheDirection,
cache_action: CacheAction
) -> Result<()>
pub fn last_tx_id(&self) -> Entid
[src]
Trait Implementations
impl<'a, 'c> Queryable for InProgress<'a, 'c>
[src]
fn q_once<T>(&self, query: &str, inputs: T) -> Result<QueryOutput> where
T: Into<Option<QueryInputs>>,
[src]
T: Into<Option<QueryInputs>>,
fn q_prepare<T>(&self, query: &str, inputs: T) -> PreparedResult where
T: Into<Option<QueryInputs>>,
[src]
T: Into<Option<QueryInputs>>,
fn q_explain<T>(&self, query: &str, inputs: T) -> Result<QueryExplanation> where
T: Into<Option<QueryInputs>>,
[src]
T: Into<Option<QueryInputs>>,
fn lookup_values_for_attribute<E>(
&self,
entity: E,
attribute: &Keyword
) -> Result<Vec<TypedValue>> where
E: Into<Entid>,
[src]
&self,
entity: E,
attribute: &Keyword
) -> Result<Vec<TypedValue>> where
E: Into<Entid>,
fn lookup_value_for_attribute<E>(
&self,
entity: E,
attribute: &Keyword
) -> Result<Option<TypedValue>> where
E: Into<Entid>,
[src]
&self,
entity: E,
attribute: &Keyword
) -> Result<Option<TypedValue>> where
E: Into<Entid>,
impl<'a, 'c> Pullable for InProgress<'a, 'c>
[src]
fn pull_attributes_for_entities<E, A>(
&self,
entities: E,
attributes: A
) -> Result<BTreeMap<Entid, ValueRc<StructuredMap>>> where
E: IntoIterator<Item = Entid>,
A: IntoIterator<Item = Entid>,
[src]
&self,
entities: E,
attributes: A
) -> Result<BTreeMap<Entid, ValueRc<StructuredMap>>> where
E: IntoIterator<Item = Entid>,
A: IntoIterator<Item = Entid>,
fn pull_attributes_for_entity<A>(
&self,
entity: Entid,
attributes: A
) -> Result<StructuredMap> where
A: IntoIterator<Item = Entid>,
[src]
&self,
entity: Entid,
attributes: A
) -> Result<StructuredMap> where
A: IntoIterator<Item = Entid>,
impl<'a, 'c> HasSchema for InProgress<'a, 'c>
[src]
fn entid_for_type(&self, t: ValueType) -> Option<KnownEntid>
[src]
fn get_ident<T>(&self, x: T) -> Option<&Keyword> where
T: Into<Entid>,
[src]
T: Into<Entid>,
fn get_entid(&self, x: &Keyword) -> Option<KnownEntid>
[src]
fn attribute_for_entid<T>(&self, x: T) -> Option<&Attribute> where
T: Into<Entid>,
[src]
T: Into<Entid>,
fn attribute_for_ident(
&self,
ident: &Keyword
) -> Option<(&Attribute, KnownEntid)>
[src]
&self,
ident: &Keyword
) -> Option<(&Attribute, KnownEntid)>
fn is_attribute<T>(&self, x: T) -> bool where
T: Into<Entid>,
[src]
T: Into<Entid>,
Return true if the provided entid identifies an attribute in this schema.
fn identifies_attribute(&self, x: &Keyword) -> bool
[src]
Return true if the provided ident identifies an attribute in this schema.