Struct launchdarkly_server_sdk::Segment
source · pub struct Segment {
pub key: String,
pub included: Vec<String, Global>,
pub excluded: Vec<String, Global>,
pub unbounded: bool,
pub version: u64,
/* private fields */
}Expand description
Segment describes a group of users based on user keys and/or matching rules.
Fields
key: StringThe unique key of the user segment.
included: Vec<String, Global>A list of user keys that are always matched by this segment.
excluded: Vec<String, Global>A list of user keys that are never matched by this segment, unless the key is also in included.
unbounded: boolUnbounded is true if this is a segment whose included list is stored separately and is not limited in size. Currently, the server-side Rust SDK cannot access the user list for this kind of segment; it only works when flags are being evaluated within the LaunchDarkly service.
The name is historical: “unbounded segments” was an earlier name for the product feature that is currently known as “big segments”. If unbounded is true, this is a big segment.
version: u64An integer that is incremented by LaunchDarkly every time the configuration of the segment is changed.
Implementations
sourceimpl Segment
impl Segment
sourcepub fn contains(&self, user: &User) -> bool
pub fn contains(&self, user: &User) -> bool
Determines if the provided User is a part of this segment.
Inclusion can be determined by specifically listing the user key in the segment, or by matching any of the rules configured for this segment.
sourcepub fn unbounded_segment_id(&self) -> String
pub fn unbounded_segment_id(&self) -> String
Retrieve the id representing this big segment.
This id will either be the segment key if the segment isn’t a big segment, or it will be a combination of the segment key and the segment generation id.