Expand description

This crate contains the LaunchDarkly Rust SDK feature flag evaluation engine.

Normal use of the Rust SDK does not require referencing this crate directly. It is used internally by the SDK, but is published and versioned separately so it can be used in other LaunchDarkly components without making the SDK versioning dependent on these internal APIs.

Structs

Clause describes an individual clause within a FlagRule or SegmentRule.

ClientSideAvailability describes whether a flag is available to client-side SDKs.

A Detail instance is returned from evaluate, combining the result of a flag evaluation with an explanation of how it was calculated.

Flag describes an individual feature flag.

FlagRule describes a single rule within a feature flag.

Prereq describes a requirement that another feature flag return a specific variation.

A struct representing the results of an evaluation on a prerequisite flag.

Rollout describes how users will be bucketed into variations during a percentage rollout.

Segment describes a group of users based on user keys and/or matching rules.

An error type used user attribute type failures.

A User contains specific attributes of a user browsing your site. The only mandatory property is the Key, which must uniquely identify each user. For authenticated users, this may be a username or e-mail address. For anonymous users, this could be an IP address or session ID.

When sending User information to LaunchDarkly, we may want to redact select user properties.

Contains methods for configuring a user.

WeightedVariation describes a fraction of users who will receive a specific variation.

Enums

AttributeValue is an enum representing possible values that can be stored in a user attribute.

Error is returned via a Reason::Error when the client could not evaluate a flag, and provides information about why the flag could not be evaluated.

FlagValue represents any of the data types supported by JSON, all of which can be used for a LaunchDarkly feature flag variation or a custom user attribute.

Reason describes the reason that a flag evaluation produced a particular value.

RolloutKind describes whether a rollout is a simple percentage rollout or represents an experiment. Experiments have different behaviour for tracking and variation bucketing.

VariationOrRollout describes either a fixed variation or a percentage rollout.

Traits

Trait used by evaluate to record the result of prerequisite flag evaluations.

Store is an interface for a data store that holds feature flags and related data received by the SDK.

Trait indicating that the item is versioned.

Functions

Evaluate a feature flag for the specified user.

Type Definitions

A type representing the index into the crate::Flag’s variations.