> ## Documentation Index
> Fetch the complete documentation index at: https://launchdarkly-preview.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Flag evaluation reasons: Server-side SDKs

> This topic explains how to use the flag evaluation reason feature to get more information about the flag variations LaunchDarkly serves to contexts or users. This page covers server-side sdks.

> For the complete documentation index, see [llms.txt](/llms.txt). For the full documentation snapshot, see [llms-full.txt](/llms-full.txt).

## Server-side SDKs

Unlike client-side SDKs, you do not need to enable an evaluation reason configuration option in server-side SDKs for this feature to work.

This feature is available in the following server-side SDKs:

* [.NET (server-side)](#net-server-side)
* [Apex](#apex)
* [C++ (server-side)](#c-server-side)
* [Erlang](#erlang)
* [Go](#go)
* [Haskell](#haskell)
* [Java](#java)
* [Lua](#lua)
* [Node.js (server-side)](#nodejs-server-side)
* [PHP](#php)
* [Python](#python)
* [Ruby](#ruby)
* [Rust](#rust)

### .NET (server-side)

<Accordion title="Expand .NET (server-side) code sample">
  The `VariationDetail` methods, such as [`BoolVariationDetail`](https://launchdarkly.github.io/dotnet-core/pkgs/sdk/server/api/LaunchDarkly.Sdk.Server.LdClient.html#LaunchDarkly_Sdk_Server_LdClient_BoolVariationDetail_), work the same as the `Variation` methods, but also provide additional "reason" information about how a flag value was calculated. For example, you can find out if the context was individually targeted for the flag or was matched by one of the flag's rules. You can examine the "reason" data programmatically, or, if you capture detailed analytics events for flags, view it with Data Export.

  Here is an example:

  <CodeGroup>
    ```csharp title=".NET SDK v7.0 (C#)" theme={null}
          EvaluationDetail<bool> detail =
              client.BoolVariationDetail("example-flag-key", myContext, false);
              // or StringVariationDetail for a string-valued flag, etc.

          bool value = detail.Value;
          int? index = detail.VariationIndex;
          EvaluationReason reason = detail.Reason;
    ```
  </CodeGroup>

  To learn more, read [`EvaluationDetail`](https://launchdarkly.github.io/dotnet-core/pkgs/sdk/server/api/LaunchDarkly.Sdk.EvaluationDetail-1.html), [`BoolVariationDetail`](https://launchdarkly.github.io/dotnet-core/pkgs/sdk/server/api/LaunchDarkly.Sdk.Server.LdClient.html#LaunchDarkly_Sdk_Server_LdClient_BoolVariationDetail_).

  Here is an example of how to access the details of a reason object:

  <CodeGroup>
    ```csharp title="C#" theme={null}
          void PrintReason(EvaluationReason reason)
          {
            switch (reason.Kind)
            {
              case EvaluationReasonKind.OFF:
                Console.WriteLine("it's off");
                break;
              case EvaluationReasonKind.FALLTHROUGH:
                Console.WriteLine("fell through");
                break;
              case EvaluationReasonKind.TARGET_MATCH:
                Console.WriteLine("targeted");
                break;
              case EvaluationReasonKind.RULE_MATCH:
                var rm = reason as EvaluationReason.RuleMatch;
                Console.WriteLine("matched rule " + rm.RuleIndex + "/" + rm.RuleID);
                break;
              case EvaluationReasonKind.PREREQUISITE_FAILED:
                var pf = reason as EvaluationReason.PrerequisiteFailed;
                Console.WriteLine("prereq failed: " + pf.PrerequisiteKey);
                break;
              case EvaluationReasonKind.ERROR:
                var e = reason as EvaluationReason.Error;
                Console.WriteLine("error: " + e.ErrorKind);
                break;
            }
            // or, if all you want is a simple descriptive string:
            System.out.println(reason.ToString());
          }
    ```
  </CodeGroup>

  To learn more, read [`EvaluationReason`](https://launchdarkly.github.io/dotnet-core/pkgs/sdk/server/api/LaunchDarkly.Sdk.EvaluationReason.html).
</Accordion>

### Apex

<Accordion title="Expand Apex code sample">
  By passing an `LDClient.EvaluationDetail` object to a variation call you can programmatically inspect the reason for a particular evaluation.

  Here is an example:

  <CodeGroup>
    ```java title="Apex" theme={null}
          LDClient.EvaluationDetail details = new LDClient.EvaluationDetail();

          Boolean value = client.boolVariation(user, 'your.feature.key', false, details);

          /* inspect details here */
          if (details.getReason().getKind() == EvaluationReason.Kind.OFF) {
              /* ... */
          }
    ```
  </CodeGroup>
</Accordion>

### C++ (server-side)

<Accordion title="Expand C++ (server-side) code sample">
  You can request and then programmatically inspect the reason for a particular feature flag evaluation.

  The `detail.Reason()` response is described in [Evaluation reasons](/sdk/concepts/evaluation-reasons).

  Here is an example:

  <CodeGroup>
    ```cpp title="C++ SDK v3.0 (native)" theme={null}
          auto detail = client.BoolVariationDetail(context, "example-flag-key", false);
          if (detail.Value()) {
            std::cout << "Value was true!" << std::endl;
          } else {
            // it was false, let's find out why
            if (auto reason = detail.Reason(); reason.has_value()) {
              // reason might not be present, so we have to check
              std::cout << "Value was false because of " << reason.value() << std::endl;
            } else {
              std::cout << "No reason provided to explain why flag was false!" << std::endl;
            }
          }
    ```

    ```c title="C++ SDK v3.0 (C binding)" theme={null}
          LDEvalDetail detail;
          if (LDServerSDK_BoolVariationDetail(client, context, "example-flag-key", false, &detail)) {
              printf("Value was true!\n");
          } else {
              LDEvalReason reason;
              if (LDEvalDetail_Reason(detail, &reason)) {
                 printf("Value was false because of %d\n", LDEvalReason_Kind(reason));
              } else {
                 printf("No reason provided to explain why flag was false!\n");
              }
          }
    ```

    ```c title="C SDK v2.x (native)" theme={null}
          struct LDDetails details;
          LDBoolean value;

          value = LDBoolVariation(client, user, "example-flag-key", LDBooleanFalse, &details);

          /* inspect details here */
          if (details.reason == LD_RULE_MATCH) {
              /* ... */
          }

          LDDetailsClear(&details);
    ```

    ```cpp title="C SDK v2.x (C++ binding)" theme={null}
          LDDetails details;

          bool value = LDBoolVariation(client, user, "example-flag-key", false, &details);

          /* inspect details here */
          if (details.reason == LD_RULE_MATCH) {
              /* ... */
          }

          LDDetailsClear(&details);
    ```
  </CodeGroup>

  To learn more, read [`EvaluationDetail`](https://launchdarkly.github.io/cpp-sdks/libs/server-sdk/docs/html/classlaunchdarkly_1_1EvaluationDetail.html).
</Accordion>

### Erlang

<Accordion title="Expand Erlang code sample">
  The `variation_detail` function is similar to the variation function, but also returns an explanation of the evaluation that you can inspect programmatically.

  Here is an example:

  <CodeGroup>
    ```title="Erlang SDK v2.0+" theme={null}
          Flag = ldclient:variation_detail(<<"example-flag-key">>, #{key => <<"example-context-key">>}, false)
    ```

    ```title="Erlang SDK v1.x" theme={null}
          Flag = ldclient:variation_detail(<<"example-flag-key">>, #{key => <<"example-user-key">>}, false)
    ```
  </CodeGroup>
</Accordion>

### Go

<Accordion title="Expand Go code sample">
  The `VariationDetail` methods, such as [`BoolVariationDetail`](https://pkg.go.dev/github.com/launchdarkly/go-server-sdk/v7#LDScopedClient.BoolVariationDetail), work the same way as `Variation`, but also provide additional "reason" information about how a flag value was calculated. For example, you can find out if the context was individually targeted by the flag or was matched by one of the flag's rules. You can examine the "reason" data programmatically, or, if you capture detailed analytics events for flags, view it with Data Export.

  Here is an example:

  <CodeGroup>
    ```go title="Go SDK v7.13.4+, using LDScopedClient" theme={null}
          value, detail, err := scopedClient.BoolVariationDetail("example-flag-key", false)
          // or StringVariationDetail for a string-valued flag, etc.
          // LDScopedClient is in beta and may change without notice.

          index := detail.VariationIndex
          reason := detail.Reason

    ```

    ```go title="Go SDK v6+, using LDClient" theme={null}
          value, detail, err := client.BoolVariationDetail("example-flag-key", context, false)
          // or StringVariationDetail for a string-valued flag, etc.

          index := detail.VariationIndex
          reason := detail.Reason

    ```
  </CodeGroup>

  To learn more, read [`EvaluationDetail`](https://pkg.go.dev/github.com/launchdarkly/go-sdk-common/v3/ldreason#EvaluationDetail) and [`BoolVariationDetail`](https://pkg.go.dev/github.com/launchdarkly/go-server-sdk/v7#LDScopedClient.BoolVariationDetail).

  Here is an example of how to access the details of a reason object:

  <CodeGroup>
    ```go title="Go SDK v6+" theme={null}
          import (
              "github.com/launchdarkly/go-sdk-common/v3/ldreason"
          )

          func PrintReason(reason ldreason.EvaluationReason) {
            switch reason.GetKind() {
            case ldreason.EvalReasonOff:
              fmt.Println("it's off")
            case ldreason.EvalReasonFallthrough:
              fmt.Println("fell through")
            case ldreason.EvalReasonTargetMatch:
              fmt.Println("targeted")
            case ldreason.EvalReasonRuleMatch:
              fmt.Printf("matched rule %d/%s\n", r.GetRuleIndex(), r.GetRuleID())
            case ldreason.EvalReasonPrerequisiteFailed:
              fmt.Printf("prereq failed: %s\n", r.GetPrerequisiteKey())
            case ldreason.EvalReasonError:
              fmt.Printf("error: %s\n", r.GetErrorKind())
            }
            // or, if all you want is a simple descriptive string:
            fmt.Println(reason)
          }

    ```
  </CodeGroup>

  To learn more, read [`EvaluationReason`](https://pkg.go.dev/github.com/launchdarkly/go-sdk-common/v3@v3.0.0/ldreason#EvaluationReason).

  If you are using OpenTelemetry, then instead of using the `VariationDetail` method for each type, you must use the `VariationDetailCtx` method for each type. For example, use `BoolVariationDetailCtx` rather than `BoolVariationDetail`. The methods are the same except that the `VariationDetailCtx` methods also require a Go context parameter. This Go context is used in the hook implementation that provides OpenTelemetry support. To learn more, read [OpenTelemetry](/sdk/features/opentelemetry-server-side#go).
</Accordion>

### Haskell

<Accordion title="Expand Haskell code sample">
  The `variationDetail` functions are similar to the `variation` functions, but they also return an explanation of the evaluation that is programmatically inspectable.

  Here is an example:

  <CodeGroup>
    ```haskell title="Haskell SDK v4.0" theme={null}
          details :: IO (EvaluationDetail Bool)
          details = boolVariationDetail client "example-flag-key" context False
    ```

    ```haskell title="Haskell SDK v3.x" theme={null}
          details :: IO (EvaluationDetail Bool)
          details = boolVariationDetail client "example-flag-key" user False
    ```
  </CodeGroup>

  To learn more, read [`EvaluationDetail`](https://launchdarkly.github.io/haskell-server-sdk/LaunchDarkly-Server-Client.html#t:EvaluationDetail) and [`boolVariationDetail`](https://launchdarkly.github.io/haskell-server-sdk/LaunchDarkly-Server-Client.html#v:boolVariationDetail).
</Accordion>

### Java

<Accordion title="Expand Java code sample">
  The `variationDetail` methods, such as [`boolVariationDetail`](https://launchdarkly.github.io/java-core/lib/sdk/server/com/launchdarkly/sdk/server/LDClient.html#boolVariationDetail-java.lang.String-com.launchdarkly.sdk.LDContext-boolean-), work the same as `variation`, but also provide additional "reason" information about how a flag value was calculated. For example, you can find out if the context was individually targeted for the flag or was matched by one of the flag's rules. You can examine the "reason" data programmatically, or, if you capture detailed analytics events for flags, view it with Data Export.

  Here is an example:

  <CodeGroup>
    ```java title="Java SDK v6.0" theme={null}
          import com.launchdarkly.sdk.*;

          EvaluationDetail<Boolean> detail =
            client.boolVariationDetail("example-flag-key", context, false);
            // or stringVariationDetail for a string-valued flag, and so on.

          boolean value = detail.getValue();
          int index = detail.getVariationIndex();       // will be < 0 if evaluation failed
          EvaluationReason reason = detail.getReason();
    ```
  </CodeGroup>

  To learn more, read [`EvaluationDetail`](https://launchdarkly.github.io/java-core/lib/sdk/server/com/launchdarkly/sdk/EvaluationDetail.html) and [`boolVariationDetail`](https://launchdarkly.github.io/java-core/lib/sdk/server/com/launchdarkly/sdk/server/LDClient.html#boolVariationDetail-java.lang.String-com.launchdarkly.sdk.LDContext-boolean-).

  Here is an example of how to access the details of a reason object:

  <CodeGroup>
    ```java title="Java" theme={null}
          void printReason(EvaluationReason reason) {
            switch (reason.getKind()) {
              case OFF:
                System.out.println("it's off");
                break;
              case FALLTHROUGH:
                System.out.println("fell through");
                break;
              case TARGET_MATCH:
                System.out.println("targeted");
                break;
              case RULE_MATCH:
                EvaluationReason.RuleMatch rm = (EvaluationReason.RuleMatch)reason;
                System.out.println("matched rule " + rm.getRuleIndex()
                  + "/" + rm.getRuleId());
                break;
              case PREREQUISITE_FAILED:
                EvaluationReason.PrerequisiteFailed pf =
                  (EvaluationReason.PrerequisiteFailed)reason;
                System.out.println("prereq failed: " + pf.getPrerequisiteKey());
                break;
              case ERROR:
                EvaluationReason.Error e = (EvaluationReason.Error)reason;
                System.out.println("error: " + e.getErrorKind());
            }
            // or, if all you want is a simple descriptive string:
            System.out.println(reason.toString());
          }
    ```
  </CodeGroup>

  To learn more, read [`EvaluationReason`](https://launchdarkly.github.io/java-core/lib/sdk/server/com/launchdarkly/sdk/EvaluationReason.html).
</Accordion>

### Lua

<Accordion title="Expand Lua code sample">
  By using the `*VariationDetail` family of variation calls you can programmatically inspect the reason for a particular evaluation:

  <CodeGroup>
    ```lua title="Lua SDK v2" theme={null}
          local details = client:boolVariationDetail(client, context, "example-flag-key", false);

          -- inspect details here
          if details.reason == "FLAG_NOT_FOUND" then
          end
    ```

    ```lua title="Lua SDK v1.x" theme={null}
          local details = client:boolVariationDetail(client, user, "example-flag-key", false);

          -- inspect details here
          if details.reason == "FLAG_NOT_FOUND" then
          end
    ```
  </CodeGroup>

  To learn more, read [`boolVariationDetail`](https://launchdarkly.github.io/lua-server-sdk/modules/launchdarkly-server-sdk.html#boolVariationDetail).
</Accordion>

### Node.js (server-side)

<Accordion title="Expand Node.js (server-side) code sample">
  The `variationDetail` method lets you evaluate a feature flag (using the same parameters as you would for `variation`) and receive more information about how the value was calculated.

  The variation detail is returned in an object that contains both the result value and a "reason" object which will tell you, for instance, if the context was individually targeted for the flag or was matched by one of the flag's rules. It will also indicate if the flag returned the default value due to an error. You can examine the "reason" data programmatically, or, if you capture detailed analytics events for flags, view it with Data Export.

  Here is an example:

  <CodeGroup>
    ```js title="Node.js SDK v7.x and later (JavaScript)" theme={null}
          var detail = client.variationDetail('example-flag-key', context, false);

          var value = detail.value;
          var index = detail.variationIndex;
          var reason = detail.reason;
    ```

    ```ts title="Node.js SDK v7.x and later (TypeScript)" theme={null}
          client.variationDetail('example-flag-key', context, false,
            (detail) => {
              const detailValue = detail.value;
              const detailIndex = detail.variationIndex;
              const detailReason = detail.reason;
          });
    ```
  </CodeGroup>

  To learn more, read [`LDEvaluationDetail`](https://launchdarkly.github.io/js-core/packages/sdk/server-node/docs/interfaces/platform-1.LDEvaluationDetail.html) and [`variationDetail`](https://launchdarkly.github.io/js-core/packages/sdk/server-node/docs/interfaces/LDClient.html#variationDetail).

  Here is an example of how to access the details of a reason object:

  <CodeGroup>
    ```js title="JavaScript" theme={null}
          function printReason(reason) {
            switch(reason.kind) {
              case "OFF":
                console.log("it's off");
                break;
              case "FALLTHROUGH":
                console.log("fell through");
                break;
              case "TARGET_MATCH":
                console.log("targeted");
                break;
              case "RULE_MATCH":
                console.log("matched rule " + reason.ruleIndex + ", "  + reason.ruleId);
                break;
              case "PREREQUISITE_FAILED":
                console.log("prereq failed: " + reason.prerequisiteKey);
                break;
              case "ERROR":
                console.log("error: " + reason.errorKind);
                break;
            }
          }
    ```
  </CodeGroup>

  To learn more, read [`LDEvaluationReason`](https://launchdarkly.github.io/js-core/packages/sdk/server-node/docs/interfaces/platform-1.LDEvaluationReason.html).
</Accordion>

### PHP

<Accordion title="Expand PHP code sample">
  The `variationDetail` method lets you evaluate a feature flag (using the same parameters as you would for `variation`) and receive more information about how the value was calculated.

  The variation detail is returned in an object that contains both the result value and a "reason" object which will tell you, for example, if the context was individually targeted for the flag or was matched by one of the flag's rules. It will also indicate if the flag returned the default value due to an error. You can examine the "reason" data programmatically, or, if you capture detailed analytics events for flags, view it with Data Export.

  Here is an example:

  <CodeGroup>
    ```php title="PHP SDK v5.0" theme={null}

          $detail = $client->variationDetail("example-flag-key", $myContext, false);

          $value = $detail->getValue();
          $index = $detail->getVariationIndex();
          $reason = $detail->getReason();
    ```
  </CodeGroup>

  To learn more, read [`EvaluationDetail`](https://launchdarkly.github.io/php-server-sdk/classes/LaunchDarkly-EvaluationDetail.html) and [`variationDetail`](https://launchdarkly.github.io/php-server-sdk/classes/LaunchDarkly-LDClient.html#method_variationDetail).

  Here is an example of how to access the details of a reason object:

  <CodeGroup>
    ```php title="PHP SDK v5.0 and earlier" theme={null}
          function printReason($reason) {
            switch ($reason->getKind()) {
              case EvaluationReason::OFF:
                echo("it's off");
                break;
              case EvaluationReason::FALLTHROUGH:
                echo("fell through");
                break;
              case EvaluationReason::TARGET_MATCH:
                echo("targeted");
                break;
              case EvaluationReason::RULE_MATCH:
                echo("matched rule " . $reason->getRuleIndex() .
                  "/" . $reason->getRuleId());
                break;
              case EvaluationReason::PREREQUISITE_FAILED:
                echo("prereq failed: " . $reason->getPrerequisiteKey());
                break;
              case EvaluationReason::ERROR:
                echo("error: " . $reason->getErrorKind());
                break;
            }
            // or, if all you want is a simple descriptive string:
            echo $reason;
          }
    ```
  </CodeGroup>

  To learn more, read [`EvaluationReason`](https://launchdarkly.github.io/php-server-sdk/classes/LaunchDarkly-EvaluationReason.html).
</Accordion>

### Python

<Accordion title="Expand Python code sample">
  The `variation_detail` method lets you evaluate a feature flag with the same parameters as you would for `variation`. You can use this method to receive more information about how the value was calculated.

  The variation detail is returned in an object that contains both the result value and a "reason" object which will tell you, for instance, if the context was individually targeted for the flag or was matched by one of the flag's rules. It will also indicate if the flag returned the default value due to an error. You can examine the "reason" data programmatically, or, if you capture detailed analytics events for flags, view it with Data Export.

  Here is an example:

  <CodeGroup>
    ```python title="Python SDK v8.0" theme={null}
          detail = client.variation_detail("example-flag-key", my_context, False)
          value = detail.value
          index = detail.variation_index
          reason = detail.reason
    ```
  </CodeGroup>

  To learn more, read [`EvaluationDetail`](https://launchdarkly-python-sdk.readthedocs.io/en/latest/api-main.html#ldclient.evaluation.EvaluationDetail) and [`variation_detail`](https://launchdarkly-python-sdk.readthedocs.io/en/latest/api-main.html#ldclient.client.LDClient.variation_detail).

  Here is an example of how to access the details of a reason object:

  <CodeGroup>
    ```python title="Python" theme={null}
          def print_reason(reason):
            kind = reason["kind"]
            if kind == "OFF":
              print "it's off"
            elif kind == "FALLTHROUGH":
              print "fell through"
            elif kind == "TARGET_MATCH":
              print "targeted"
            elif kind == "RULE_MATCH":
              print "matched rule %d/%s" % (reason["ruleIndex"], reason["ruleId"])
            elif kind == "PREREQUISITE_FAILED":
              print "prereq failed: %s" % reason["prerequisiteKey"]
            elif kind == "ERROR":
              print "error: %s" % reason["errorKind"]
    ```
  </CodeGroup>

  To learn more, read [`EvaluationDetail.reason`](https://launchdarkly-python-sdk.readthedocs.io/en/latest/api-main.html#ldclient.evaluation.EvaluationDetail.reason).
</Accordion>

### Ruby

<Accordion title="Expand Ruby code sample">
  The `variation_detail` method lets you evaluate a feature flag (using the same parameters as you would for `variation`) and receive more information about how the value was calculated.

  The variation detail is returned in an object that contains both the result value and a "reason" object which will tell you, for instance, if the context was individually targeted for the flag or was matched by one of the flag's rules. It will also indicate if the flag returned the default value due to an error. You can examine the "reason" data programmatically, or, if you capture detailed analytics events for flags, view it with Data Export.

  Here is an example:

  <CodeGroup>
    ```ruby title="Ruby SDK v7.0" theme={null}
          detail = client.variation_detail("example-flag-key", my_context, false)
          value = detail.value
          index = detail.variation_index
          reason = detail.reason
    ```
  </CodeGroup>

  To learn more, read [`EvaluationDetail`](https://launchdarkly.github.io/ruby-server-sdk/LaunchDarkly/EvaluationDetail.html) and [`variation_detail`](https://launchdarkly.github.io/ruby-server-sdk/LaunchDarkly/LDClient.html#variation_detail-instance_method).

  Here is an example of how to access the details of a reason object:

  <CodeGroup>
    ```ruby title="Ruby" theme={null}
          def print_reason(reason)
            case reason[:kind]
            when "OFF"
              puts "it's off"
            when "FALLTHROUGH"
              puts "fell through"
            when "TARGET_MATCH"
              puts "targeted"
            when "RULE_MATCH"
              puts "matched rule #{reason[:ruleIndex]}/#{reason[:ruleId]}"
            when "PREREQUISITE_FAILED"
              puts "prereq failed: #{reason[:prerequisiteKey]}"
            when "ERROR"
              puts "error: #{reason[:errorKind]}"
            end
          end
    ```
  </CodeGroup>

  To learn more, read [`EvaluationDetail.reason`](https://launchdarkly.github.io/ruby-server-sdk/LaunchDarkly/EvaluationDetail.html#reason-instance_method).
</Accordion>

### Rust

<Accordion title="Expand Rust code sample">
  The `variation_detail` methods (for example, [`bool_variation_detail`](https://docs.rs/launchdarkly-server-sdk/latest/launchdarkly_server_sdk/struct.Client.html#method.bool_variation_detail)) let you evaluate a feature flag, using the same parameters as you would for `variation`, and receive more information about how the flag value was calculated. For example, you can find out if the context was individually targeted for the flag or was matched by one of the flag's rules. You can examine the "reason" data programmatically, or, if you capture detailed analytics events for flags, view it with Data Export.

  Here is an example:

  <CodeGroup>
    ```rust title="Rust SDK v1" theme={null}
          let detail = client.bool_variation_detail(&context, "example-flag-key", false);

          let value = detail.value;
          let index = detail.variation_index;
          let reason = detail.reason;
    ```
  </CodeGroup>

  To learn more, read [`variation_detail`](https://docs.rs/launchdarkly-server-sdk/latest/launchdarkly_server_sdk/struct.Client.html#method.variation_detail) and [`bool_variation_detail`](https://docs.rs/launchdarkly-server-sdk/latest/launchdarkly_server_sdk/struct.Client.html#method.bool_variation_detail).

  Here is an example of how to access the details of a reason object:

  <CodeGroup>
    ```rust title="Rust SDK v1" theme={null}
          fn print_reason(reason: Reason) {
              match reason {
                  Reason::Off => println!("it's off"),
                  Reason::Fallthrough { .. } => println!("fell through"),
                  Reason::TargetMatch => println!("targeted"),
                  Reason::RuleMatch {
                      rule_index,
                      rule_id,
                      ..
                  } => println!("matched rule {}/{}", rule_index, rule_id),
                  Reason::PrerequisiteFailed { prerequisite_key } => {
                      println!("prereq failed: {}", prerequisite_key)
                  }
                  Reason::Error { error } => println!("error: {:?}", error),
              };
          }
    ```
  </CodeGroup>

  To learn more, read [`Reason`](https://docs.rs/launchdarkly-server-sdk/latest/launchdarkly_server_sdk/enum.Reason.html).
</Accordion>
