Skip to content

About

Example Rust application using Featurevisor SDK

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

3 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

featurevisor-example-rust

A small Rust application showing how to use the published Featurevisor Rust SDK from crates.io.

Learn more about Featurevisor here.

It fetches a production datafile, creates a Featurevisor instance with customer context, then evaluates a flag, a variation, feature variables, and global variables.

Requirements

Rust 1.74 or newer.

Run the example

cargo run

The application evaluates commerce_platform, checkout_experience, max_items, payment_methods, serviceEndpoints, and supportContact from this datafile:

https://featurevisor-example-cloudflare.pages.dev/production/featurevisor-sdk-v3.json

Expected output:

Commerce platform enabled: true
Checkout variation: express
Maximum checkout items: 25
Payment methods: [card, wallet]
Service endpoint: https://api.eu.example.com (timeout: 1200 ms, retries: 4)
Support contact: support-nl@example.com

Change the context in src/main.rs to see how Featurevisor selects different rules, variations, and global variable overrides.

The featurevisor dependency comes from crates.io. It is not a local path dependency, so this project demonstrates the same setup used by a new consumer.

Checks

cargo fmt --all -- --check
cargo clippy --all-targets -- -D warnings
cargo test

Featurevisor project

The datafile is generated by the Featurevisor Cloudflare example.

Learn more in the Featurevisor Rust SDK documentation.

About

Example Rust application using Featurevisor SDK

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages