Struct rincon_client::cursor::types::Cursor
[−]
[src]
pub struct Cursor<T> { /* fields omitted */ }
A temporary cursor for retrieving query results.
If the result set contains more documents than should be transferred in a
single round-trip (i.e. as set via the batch_size
attribute), the server
will return the first few documents and create a temporary cursor. The
cursor identifier will also be returned to the client. The server will put
the cursor identifier in the id attribute of the response object.
Furthermore, the has_more
attribute of the response object will be set to
true. This is an indication for the client that there are additional
results to fetch from the server.
The cursor will automatically be destroyed on the server when the client
has retrieved all documents from it. The client can also explicitly destroy
the cursor at any earlier time using the DeleteCursor
method.
Note: the server will also destroy abandoned cursors automatically after a certain server-controlled timeout to avoid resource leakage.
Methods
impl<T> Cursor<T>
[src]
pub fn id(&self) -> Option<&String>
[src]
Returns the id of the cursor created on the server.
pub fn result(&self) -> &[T]
[src]
Returns a slice of result documents (might be empty if query has no results).
pub fn has_more(&self) -> bool
[src]
Returns whether there are more results available for this cursor on the server.
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 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 extra return attribute will not contain any stats sub-attribute and no profile sub-attribute.
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 unwrap(self) -> (Option<String>, Option<u64>, Vec<T>)
[src]
Unwraps this cursor into a tuple of id, count and result.
Trait Implementations
impl<T: Debug> Debug for Cursor<T>
[src]
fn fmt(&self, __arg_0: &mut Formatter) -> Result
[src]
Formats the value using the given formatter. Read more