pub struct Subject {
pub id: String,
pub attrs: HashMap<String, Value>,
}Expand description
The entity a flag is being evaluated for. id is the only required field
and is used as the sticky-bucketing key. Arbitrary string-keyed attributes
(country, plan, email, …) are supported by the crate::Predicate DSL.
Fields§
§id: StringStable identifier for sticky bucketing. Usually a user/tenant/device id.
attrs: HashMap<String, Value>Free-form string attributes for targeting ({"country": "US", ...}).
Implementations§
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Subject
impl<'de> Deserialize<'de> for Subject
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for Subject
impl RefUnwindSafe for Subject
impl Send for Subject
impl Sync for Subject
impl Unpin for Subject
impl UnsafeUnpin for Subject
impl UnwindSafe for Subject
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more