Skip to content

Commit

Permalink
docs: Update Rust SDK example (#4694)
Browse files Browse the repository at this point in the history
  • Loading branch information
khvn26 authored Oct 7, 2024
1 parent c4faf69 commit b689a62
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions docs/docs/clients/server-side.md
Original file line number Diff line number Diff line change
Expand Up @@ -515,21 +515,21 @@ buttonData, _ := flags.GetFeatureValue("secret_button")
<TabItem value="rust" label="Rust">

```rust
use flagsmith_flag_engine::identities::Trait;
use flagsmith::models::SDKTrait;
use flagsmith_flag_engine::types::{FlagsmithValue, FlagsmithValueType};

let identifier = "[email protected]";

let traits = vec![Trait {
trait_key: "car_type".to_string(),
trait_value: FlagsmithValue {
let traits = vec![SDKTrait::new(
"car_type".to_string(),
FlagsmithValue {
value: "robin_reliant".to_string(),
value_type: FlagsmithValueType::String,
},
}];
)];

// The method below triggers a network request
let identity_flags = flagsmith.get_identity_flags(identifier, Some(traits)).unwrap();
let identity_flags = flagsmith.get_identity_flags(identifier, Some(traits), None).unwrap();

let show_button = identity_flags.is_feature_enabled("secret_button").unwrap();
let button_data = identity_flags.get_feature_value_as_string("secret_button").unwrap();
Expand Down

0 comments on commit b689a62

Please sign in to comment.