Struct libqaul::helpers::QueryResult [−][src]
The resulting set of a query operation
Implementations
impl<T> QueryResult<T> where
T: FromRecord<T>,
[src]
T: FromRecord<T>,
pub async fn lock(&self)
[src]
Lock the garbage collection on iteratable items
By default items that are contained in this result set can be deleted by other tasks, resulting in errors when accessing data via this type. To hold the GC from running for deleted types, you can lock the set, meaning that deleted items will only be deleted when the last locked iterator goes out of scope.
This may introduce race coditions for other queries, so be aware of that!
pub fn skip(&self, num: usize)
[src]
Skip a certain number of items in the result set
pub async fn next(&self) -> Result<T>
[src]
Try to get a single element from the query iterator
pub async fn resolve(&self) -> Vec<T>
[src]
Take all elements from the iterator and drop invalid reads
This is a semi-destructive operation because read errors will be dropped, but sometimes that is exactly what you want. Because libqaul stores messages for users separately from the “global” scope (i.e. flooded messages), a specific path query will return two paths: one will fail, the other will not.
Instead of having to filter the query results manually, this function does it internally and folds into an empty vector, meaning: if both reads fail, the resolved set will be empty.
pub async fn take(&self, num: usize) -> Result<Vec<T>>
[src]
Take a number of items from the iterator to advance
If no more items are present, this function will return
Err()
. When less than the requested number of items are
present, it will return Ok()
but with all remaining items.
pub async fn all(&self) -> Result<Vec<T>>
[src]
Take elements from the iterator until a read fails
Once a read fails that does’t mean that there’s no more data
left, just that a read was unsuccessful. If you want to
quietly drop errors, use resolve()
instead!
Auto Trait Implementations
impl<T> !RefUnwindSafe for QueryResult<T>
impl<T> Send for QueryResult<T> where
T: Send,
T: Send,
impl<T> Sync for QueryResult<T> where
T: Sync,
T: Sync,
impl<T> Unpin for QueryResult<T> where
T: Unpin,
T: Unpin,
impl<T> !UnwindSafe for QueryResult<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,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T> Instrument for T
[src]
pub fn instrument(self, span: Span) -> Instrumented<Self>
[src]
pub fn in_current_span(self) -> Instrumented<Self>
[src]
impl<T> Instrument for T
[src]
pub fn instrument(self, span: Span) -> Instrumented<Self>
[src]
pub fn in_current_span(self) -> Instrumented<Self>
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> Same<T> for T
type Output = T
Should always be Self
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.
pub 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.
pub 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>,
pub fn vzip(self) -> V
impl<T> WithSubscriber for T
[src]
pub fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
[src]
S: Into<Dispatch>,