[−][src]Struct structsy::StructsyQueryTx
Query for a persistent struct considering in transaction changes.
Example
use structsy::{ Structsy, StructsyTx, StructsyError}; use structsy_derive::{queries, Persistent}; #[derive(Persistent)] struct Basic { name: String, } impl Basic { fn new(name: &str) -> Basic { Basic { name: name.to_string() } } } #[queries(Basic)] trait BasicQuery { fn by_name(self, name: String) -> Self; } fn basic_query() -> Result<(), StructsyError> { let structsy = Structsy::open("file.structsy")?; structsy.define::<Basic>()?; let mut tx = structsy.begin()?; tx.insert(&Basic::new("aaa"))?; let count = tx.query::<Basic>().by_name("aaa".to_string()).into_iter().count(); assert_eq!(count, 1); tx.commit()?; Ok(()) }
Trait Implementations
impl<'a, T: Persistent> IntoIterator for StructsyQueryTx<'a, T>
[src]
type Item = (Ref<T>, T)
The type of the elements being iterated over.
type IntoIter = StructsyIter<'a, T>
Which kind of iterator are we turning this into?
fn into_iter(self) -> Self::IntoIter
[src]
impl<'a, T: Persistent + 'static> Query<T> for StructsyQueryTx<'a, T>
[src]
fn filter_builder(&mut self) -> &mut FilterBuilder<T>
[src]
Auto Trait Implementations
impl<'a, T> !RefUnwindSafe for StructsyQueryTx<'a, T>
impl<'a, T> !Send for StructsyQueryTx<'a, T>
impl<'a, T> !Sync for StructsyQueryTx<'a, T>
impl<'a, T> Unpin for StructsyQueryTx<'a, T>
impl<'a, T> !UnwindSafe for StructsyQueryTx<'a, T>
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<I> IntoIterator for I where
I: Iterator,
[src]
I: Iterator,
type Item = <I as Iterator>::Item
The type of the elements being iterated over.
type IntoIter = I
Which kind of iterator are we turning this into?
fn into_iter(self) -> I
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
V: MultiLane<T>,