Skip to content

Commit ed0d520

Browse files
authored
RUST-1632 provide a parse_async method (#855)
1 parent 8856428 commit ed0d520

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/client/options/mod.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1083,6 +1083,12 @@ impl ClientOptions {
10831083
runtime::block_on(Self::parse_uri(s.as_ref(), None))
10841084
}
10851085

1086+
/// This method is the same as `parse`, but is provided to make the async version available when
1087+
/// the `sync` feature is enabled.
1088+
pub async fn parse_async(s: impl AsRef<str>) -> Result<Self> {
1089+
Self::parse_uri(s, None).await
1090+
}
1091+
10861092
/// Parses a MongoDB connection string into a `ClientOptions` struct.
10871093
/// If the string is malformed or one of the options has an invalid value, an error will be
10881094
/// returned.

0 commit comments

Comments
 (0)