I need to connect to a Postgres database on Heroku, which requires SSL certification. lldb Rust debugger breaks in VSCode when using openssl crate.Add a new section and under it, crate_type =. We need to make a couple of changes to Cargo.toml before we do anything else. This will create a directory mylib that has everything needed to build an basic crate with cargo. Fast, lightweight, opinionated, unofficial alternative to crates.io. Index of 120,203 Rust libraries and applications. Some people don’t want to pull in more dependencies than they need to, but these are as essential as the chrono or log crates. An async application should pull in at least two crates from Rusts ecosystem: futures, an official Rust crate that lives in the rust-lang repository A runtime of your choosing, such as Tokio, async_std, smol, etc.Note: The integration tests will clear out the databases/collections they need to use, but they do not clean up after themselves. If MONGODB_URI is unset, the tests will attempt to connect to a local deployment on port 27017. You may specify a MongoDB connection string in the MONGODB_URI environment variable, and the tests will use it to connect to the deployment. In order to run the tests (which are mostly integration tests), you must have access to a MongoDB deployment. Running the tests Integration and unit tests Remember to always run the linter tests before opening a pull request. Once you open a pull request, your branch will be run against the same testing matrix that we use for our continuous integration system, so it is usually sufficient to only run the integration tests locally against a standalone. Before opening one, be sure to run the tests locally check out the testing section for information on how to do that. We encourage and would happily accept contributions in the form of GitHub pull requests. Click Create Issue - If the ticket you are filing is a bug report, please include as much detail as possible about the issue and how to reproduce it.īefore filing a ticket, please use the search functionality of Jira to see if a similar issue has already been filed.Navigate to the RUST project at /browse/RUST.To file a bug report or submit a feature request, please open a ticket on our Jira project: Tokio ::time :: timeout ( Duration :: from_secs ( 5 ), handle ). collection :: ( "books" ) let docs = vec ! [ Book ) database ( "mydb" ) let collection = database. Let client = Client :: with_uri_str ( "mongodb://localhost:27017" )? let database = client. Using the async API Connecting to a MongoDB deployment For more specific examples and the API reference, see the driver's docs.rs page. Switch TLS connection handling to use 'openssl'.īelow are simple examples of using the driver. This flag requires Rust version 1.54.Įnable support for compressing messages with snappy This flag cannot be used in conjunction with either of the async runtime feature flags.Įnable support for the MONGODB-AWS authentication mechanism.Įnable support for v0.8 of the uuid crate in the public API of the re-exported bson crate.Įnable support for v1.x of the uuid crate in the public API of the re-exported bson crate.Įnable support for v0.4 of the chrono crate in the public API of the re-exported bson crate.Įnable support for the serde_with crate in the public API of the re-exported bson crate.Įnable support for compressing messages with zlibĮnable support for compressing messages with zstd. All Feature Flags FeatureĮnable support for the tokio async runtimeĮxpose the synchronous API ( mongodb::sync). Note: The sync-specific types can be imported from mongodb::sync (e.g. Using the "sync" feature also requires using default-features = false. To use the driver in your application, simply add it to your project's Cargo.toml. The driver tests against Linux, MacOS, and Windows in CI. Rust 1.57+ (See the MSRV policy for more information).Minimum supported Rust version (MSRV) policy.Note on connecting to Atlas deployments.The driver also has a sync API that may be enabled via feature flag.įor more detailed documentation, see the manual. The driver contains a fully async API that supports either tokio (default) or async-std, depending on the feature flags set. This repository contains the officially supported MongoDB Rust driver, a client side library that can be used to interact with MongoDB deployments in Rust applications.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |