@@ -40,25 +40,20 @@ pub const DEFAULT_BATCH_SIZE: i32 = 20;
40
40
41
41
/// Maintains a connection to the server and lazily returns documents from a
42
42
/// 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.
55
43
pub struct Cursor {
44
+ // The client to read from.
56
45
client : Client ,
46
+ // The namespace to read and write from.
57
47
namespace : String ,
48
+ // How many documents to fetch at a given time from the server.
58
49
batch_size : i32 ,
50
+ // Uniquely identifies the cursor being returned by the reply.
59
51
cursor_id : i64 ,
52
+ // An upper bound on the total number of documents this cursor should return.
60
53
limit : i32 ,
54
+ // How many documents have been returned so far.
61
55
count : i32 ,
56
+ // A cache for documents received from the query that have not yet been returned.
62
57
buffer : VecDeque < bson:: Document > ,
63
58
read_preference : ReadPreference ,
64
59
cmd_type : CommandType ,
@@ -98,6 +93,8 @@ impl Cursor {
98
93
/// `client` - Client making the request.
99
94
/// `db` - Which database the command is being sent to.
100
95
/// `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.
101
98
///
102
99
/// # Return value
103
100
///
@@ -194,17 +191,13 @@ impl Cursor {
194
191
///
195
192
/// `client` - The client to read from.
196
193
/// `namespace` - The namespace to read and write from.
197
- /// `batch_size` - How many documents the cursor should return at a time.
198
194
/// `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.
206
198
/// `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
+ ///
208
201
/// # Return value
209
202
///
210
203
/// Returns the cursor for the query results on success, or an Error on
0 commit comments