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: String
The 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: bool
Unbounded 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: u64
An 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.
Trait Implementations
sourceimpl<'de> Deserialize<'de> for Segment
impl<'de> Deserialize<'de> for Segment
sourcefn deserialize<__D>(
__deserializer: __D
) -> Result<Segment, <__D as Deserializer<'de>>::Error> where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D
) -> Result<Segment, <__D as Deserializer<'de>>::Error> where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
sourceimpl Serialize for Segment
impl Serialize for Segment
sourcefn serialize<__S>(
&self,
__serializer: __S
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error> where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error> where
__S: Serializer,
Serialize this value into the given Serde serializer. Read more
Auto Trait Implementations
impl RefUnwindSafe for Segment
impl Send for Segment
impl Sync for Segment
impl Unpin for Segment
impl UnwindSafe for Segment
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> Instrument for T
impl<T> Instrument for T
sourcefn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
sourcefn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcefn clone_into(&self, target: &mut T)
fn clone_into(&self, target: &mut T)
toowned_clone_into
)Uses borrowed data to replace owned data, usually by cloning. Read more
sourceimpl<T> WithSubscriber for T
impl<T> WithSubscriber for T
sourcefn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
Attaches the provided Subscriber
to this type, returning a
WithDispatch
wrapper. Read more
sourcefn with_current_subscriber(self) -> WithDispatch<Self>
fn with_current_subscriber(self) -> WithDispatch<Self>
Attaches the current default Subscriber
to this type, returning a
WithDispatch
wrapper. Read more