Skip to content
This repository was archived by the owner on Oct 18, 2021. It is now read-only.

Commit fb204d6

Browse files
authored
fix cursor documentation (#210)
1 parent 5093c45 commit fb204d6

File tree

1 file changed

+14
-21
lines changed

1 file changed

+14
-21
lines changed

src/cursor.rs

Lines changed: 14 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -40,25 +40,20 @@ pub const DEFAULT_BATCH_SIZE: i32 = 20;
4040

4141
/// Maintains a connection to the server and lazily returns documents from a
4242
/// query.
43-
///
44-
/// # Fields
45-
///
46-
/// `client` - The client to read from.
47-
/// `namespace` - The namespace to read and write from.
48-
/// `batch_size` - How many documents to fetch at a given time from the server.
49-
/// `cursor_id` - Uniquely identifies the cursor being returned by the reply.
50-
/// `limit` - An upper bound on the total number of documents this cursor
51-
/// should return.
52-
/// `count` - How many documents have been returned so far.
53-
/// `buffer` - A cache for documents received from the query that have not
54-
/// yet been returned.
5543
pub struct Cursor {
44+
// The client to read from.
5645
client: Client,
46+
// The namespace to read and write from.
5747
namespace: String,
48+
// How many documents to fetch at a given time from the server.
5849
batch_size: i32,
50+
// Uniquely identifies the cursor being returned by the reply.
5951
cursor_id: i64,
52+
// An upper bound on the total number of documents this cursor should return.
6053
limit: i32,
54+
// How many documents have been returned so far.
6155
count: i32,
56+
// A cache for documents received from the query that have not yet been returned.
6257
buffer: VecDeque<bson::Document>,
6358
read_preference: ReadPreference,
6459
cmd_type: CommandType,
@@ -98,6 +93,8 @@ impl Cursor {
9893
/// `client` - Client making the request.
9994
/// `db` - Which database the command is being sent to.
10095
/// `doc` - Specifies the command that is being run.
96+
/// `cmd_type` - The type of command, which will be used for monitoring events.
97+
/// `read_pref` - The read preference for the query.
10198
///
10299
/// # Return value
103100
///
@@ -194,17 +191,13 @@ impl Cursor {
194191
///
195192
/// `client` - The client to read from.
196193
/// `namespace` - The namespace to read and write from.
197-
/// `batch_size` - How many documents the cursor should return at a time.
198194
/// `flags` - Bit vector of query options.
199-
/// `number_to_skip` - The number of initial documents to skip over in the
200-
/// query results.
201-
/// `number_to_return - The total number of documents that should be
202-
/// returned by the query.
203-
/// `return_field_selector - An optional projection of which fields should
204-
/// be present in the documents to be returned by
205-
/// the query.
195+
/// `query` - Document describing the query to make.
196+
/// `options` - Options for the query.
197+
/// `cmd_type` - The type of command, which will be used for monitoring events.
206198
/// `is_cmd_cursor` - Whether or not the Cursor is for a database command.
207-
/// `monitor_host` - The host being monitored, if this is a query from a server monitor.
199+
/// `read_pref` - The read preference for the query.
200+
///
208201
/// # Return value
209202
///
210203
/// Returns the cursor for the query results on success, or an Error on

0 commit comments

Comments
 (0)