Crates.io | configcat |
lib.rs | configcat |
version | 0.1.2 |
source | src |
created_at | 2024-06-18 12:54:25.073803 |
updated_at | 2024-07-29 12:11:01.243642 |
description | ConfigCat Rust SDK |
homepage | https://configcat.com |
repository | https://github.com/configcat/rust-sdk |
max_upload_size | |
id | 1275451 |
size | 597,773 |
ConfigCat SDK for Rust provides easy integration for your application to ConfigCat.
Run the following Cargo command in your project directory:
cargo add configcat
Or add the following to your Cargo.toml
:
[dependencies]
configcat = "0.1"
configcat
module to your applicationuse configcat::*;
use configcat::*;
#[tokio::main]
async fn main() {
let client = Client::new("#YOUR-SDK-KEY#").unwrap();
}
use configcat::*;
#[tokio::main]
async fn main() {
let client = Client::new("#YOUR-SDK-KEY#").unwrap();
let is_awesome_feature_enabled = client.get_value("isAwesomeFeatureEnabled", false, None).await;
if is_awesome_feature_enabled {
do_the_new_thing();
} else {
do_the_old_thing();
}
}
Using this feature, you will be able to get different setting values for different users in your application by passing a User Object
to the get_value()
function.
Read more about Targeting here.
use configcat::*;
#[tokio::main]
async fn main() {
let client = Client::new("#YOUR-SDK-KEY#").unwrap();
let user = User::new("#USER-IDENTIFIER#");
let is_awesome_feature_enabled = client.get_value("isAwesomeFeatureEnabled", false, Some(user)).await;
if is_awesome_feature_enabled {
do_the_new_thing();
} else {
do_the_old_thing();
}
}
This repository contains a simple example application that you can run with:
cargo run --example print_eval
The ConfigCat SDK supports 3 different polling mechanisms to acquire the setting values from ConfigCat. After latest setting values are downloaded, they are stored in the internal cache then all requests are served from there. Read more about Polling Modes and how to use them at ConfigCat Docs.
Contributions are welcome. For more info please read the Contribution Guideline.
ConfigCat is a feature flag and configuration management service that lets you separate releases from deployments. You can turn your features ON/OFF using ConfigCat Dashboard even after they are deployed. ConfigCat lets you target specific groups of users based on region, email or any other custom user attribute.
ConfigCat is a hosted feature flag service. Manage feature toggles across frontend, backend, mobile, desktop apps. Alternative to LaunchDarkly. Management app + feature flag SDKs.