ENF News Bot
Automated News Bot
- Joined
- Apr 15, 2022
- Messages
- 2,591
Flagship now has an official Rust SDK. Use it to evaluate feature flags from async Rust server applications through OpenFeature, with the same targeting rules and percentage rollouts as the other Flagship SDKs.
Install the
Then register the provider and evaluate a flag:
The provider evaluates flags over HTTP by default. Turn on local evaluation to download flag definitions and evaluate flags in-process, without a network request per evaluation. The SDK also supports structured evaluation context, an optional response cache, and logging and telemetry hooks.
The SDK requires Rust 1.88 or later and a Tokio runtime. For setup and configuration options, refer to the Rust SDK documentation.
Continue reading...
Install the
cloudflare-flagship ↗︎ crate:cargo add cloudflare-flagshipThen register the provider and evaluate a flag:
Code:
let options = FlagshipClientOptions::builder()
.app_id("<APP_ID>")
.account_id("<ACCOUNT_ID>")
.auth_token("<API_TOKEN>")
.build()?;
let mut api = OpenFeature::default();
api.set_provider(FlagshipServerProvider::new(options)?).await;
let context = EvaluationContext::default().with_targeting_key("user-42");
let enabled = api
.create_client()
.get_bool_value("new-checkout", Some(&context), None)
.await
.unwrap_or(false);
The provider evaluates flags over HTTP by default. Turn on local evaluation to download flag definitions and evaluate flags in-process, without a network request per evaluation. The SDK also supports structured evaluation context, an optional response cache, and logging and telemetry hooks.
The SDK requires Rust 1.88 or later and a Tokio runtime. For setup and configuration options, refer to the Rust SDK documentation.
Continue reading...