Struct rincon_session::CursorSession
[−]
[src]
pub struct CursorSession<T, C> { /* fields omitted */ }
A session for operating with a specific Cursor
.
Methods
impl<T, C> CursorSession<T, C> where
T: 'static + DeserializeOwned,
C: 'static + Connector,
[src]
T: 'static + DeserializeOwned,
C: 'static + Connector,
pub fn database_name(&self) -> &str
[src]
Returns the name of the database the query has been executed for.
pub fn entity(&self) -> &Cursor<T>
[src]
Returns the Cursor
entity of this session.
pub fn unwrap(self) -> Cursor<T>
[src]
Unwraps the Cursor
entity out of this session.
pub fn id(&self) -> Option<&String>
[src]
Returns the id of this cursor.
pub fn result(&self) -> &[T]
[src]
Returns the slice of result documents retrieved with this cursor.
The query may have more results. Whether a query has more results can
be checked by the has_more()
attribute function. To fetch the next
batch of results use the next_cursor()
function or iterate over all
results by using the Iterator
returned by the into_iter()
function.
pub fn has_more(&self) -> bool
[src]
Returns whether there are more results available for this cursor on the server.
pub fn is_cached(&self) -> bool
[src]
Returns whether the query result was served from the query cache or not.
If the query result is served from the query cache, the stats attribute
will be None
.
pub fn count(&self) -> Option<u64>
[src]
Returns the total number of result documents available (only available if the query was executed with the count attribute set).
pub fn stats(&self) -> Option<&CursorStatistics>
[src]
Returns the statistics about the execution of data modification queries.
The stats will be None
if the query is not a data modification query
or the result is served from the query cache.
pub fn warnings(&self) -> Option<&Vec<Warning>>
[src]
Returns warnings that occurred during query execution.
pub fn next_cursor(&self) -> Option<Result<CursorSession<T, C>>>
[src]
Checks whether this cursor has more results and if yes fetches a
cursor with the next batch of results and returns it as a new
CursorSession
.
This function returns None
if there are no more results for this
cursor. It returns Some(Error)
if fetching the next batch of results
fails.
pub fn delete(self) -> Result<Empty>
[src]
Deletes the cursor represented by this session on the server if it is still existing otherwise those nothing.
Trait Implementations
impl<T: Debug, C: Debug> Debug for CursorSession<T, C>
[src]
fn fmt(&self, __arg_0: &mut Formatter) -> Result
[src]
Formats the value using the given formatter. Read more
impl<T, C> IntoIterator for CursorSession<T, C> where
T: 'static + DeserializeOwned,
C: 'static + Connector,
[src]
T: 'static + DeserializeOwned,
C: 'static + Connector,