@@ -294,7 +294,8 @@ impl fmt::Display for ServerAddress {
294
294
/// Specifies the server API version to declare
295
295
#[ derive( Clone , Debug , PartialEq ) ]
296
296
#[ non_exhaustive]
297
- pub ( crate ) enum ServerApiVersion {
297
+ pub enum ServerApiVersion {
298
+ /// Use API version 1.
298
299
V1 ,
299
300
}
300
301
@@ -332,12 +333,13 @@ impl<'de> Deserialize<'de> for ServerApiVersion {
332
333
}
333
334
}
334
335
335
- /// Options used to declare a versioned server API.
336
+ /// Options used to declare a versioned server API. For more information, see the [Versioned API](
337
+ /// https://docs.mongodb.com/v5.0/reference/versioned-api/) manual page.
336
338
#[ derive( Clone , Debug , Deserialize , PartialEq , TypedBuilder ) ]
337
339
#[ builder( field_defaults( setter( into) ) ) ]
338
340
#[ serde( rename_all = "camelCase" ) ]
339
341
#[ non_exhaustive]
340
- pub ( crate ) struct ServerApi {
342
+ pub struct ServerApi {
341
343
/// The declared API version.
342
344
pub version : ServerApiVersion ,
343
345
@@ -493,15 +495,17 @@ pub struct ClientOptions {
493
495
494
496
/// The declared API version for this client.
495
497
/// The declared API version is applied to all commands run through the client, including those
496
- /// sent through any [crate::Database] or [crate::Collection] derived from the client.
498
+ /// sent through any handle derived from the client.
497
499
///
498
- /// Specifying versioned API options in the command document passed to
499
- /// [crate::Database::run_command] AND declaring an API version on the client is not
500
- /// supported and is considered undefined behaviour. To run any command with a different API
501
- /// version or without declaring one, create a separate client that declares the
502
- /// appropriate API version.
503
- #[ builder( default , setter( skip) ) ]
504
- pub ( crate ) server_api : Option < ServerApi > ,
500
+ /// Specifying versioned API options in the command document passed to `run_command` AND
501
+ /// declaring an API version on the client is not supported and is considered undefined
502
+ /// behaviour. To run any command with a different API version or without declaring one, create
503
+ /// a separate client that declares the appropriate API version.
504
+ ///
505
+ /// For more information, see the [Versioned API](
506
+ /// https://docs.mongodb.com/v5.0/reference/versioned-api/) manual page.
507
+ #[ builder( default ) ]
508
+ pub server_api : Option < ServerApi > ,
505
509
506
510
/// The amount of time the Client should attempt to select a server for an operation before
507
511
/// timing outs
0 commit comments