--- sidebar_label: Rust title: Connect with Rust Connector pagination_next: develop/insert-data --- import Tabs from '@theme/Tabs'; import TabItem from '@theme/TabItem'; ## Create Project ``` cargo new cloud_example ``` ## Add Dependency Add dependency to `Cargo.toml`. ```toml title="Cargo.toml" [dependencies] libtaos = { version="*", feature=["rest"]} ``` ## Config Run this command in your terminal to save TDengine cloud token as variables: ```bash export TDENGINE_CLOUD_TOKEN="" export TDENGINE_CLOUD_URL="" ``` ```bash set TDENGINE_CLOUD_TOKEN="" set TDENGINE_CLOUD_URL="" ``` ```powershell $env:TDENGINE_CLOUD_TOKEN="" $env:TDENGINE_CLOUD_URL="" ``` :::note Replace and with cloud token and URL. To obtain the value of cloud token and URL, please log in [TDengine Cloud](https://cloud.tdengine.com) and click "Connector" and then select "Rust". ::: ## Connect Copy following code to `main.rs`. ```rust title="main.rs" {{#include docs/examples/rust/cloud_example/src/main.rs}} ``` Then you can execute `cargo run` to test the connection.