pub struct User {
pub user_id: Option<String>,
pub email: Option<String>,
pub ip: Option<String>,
pub user_agent: Option<String>,
pub country: Option<String>,
pub locale: Option<String>,
pub app_version: Option<String>,
pub custom: Option<HashMap<String, Value>>,
pub private_attributes: Option<HashMap<String, Value>>,
pub custom_ids: Option<HashMap<String, String>>,
pub statsig_environment: Option<StatsigEnvironment>,
}Fields§
§user_id: Option<String>§email: Option<String>§ip: Option<String>§user_agent: Option<String>§country: Option<String>§locale: Option<String>§app_version: Option<String>§custom: Option<HashMap<String, Value>>§private_attributes: Option<HashMap<String, Value>>§custom_ids: Option<HashMap<String, String>>§statsig_environment: Option<StatsigEnvironment>Implementations§
Source§impl User
impl User
pub fn validate_user(&self) -> Result<()>
Sourcepub fn with_user_id(user_id: impl Into<String>) -> UserBuilder<SetUserId>
pub fn with_user_id(user_id: impl Into<String>) -> UserBuilder<SetUserId>
Creates a new user with just a user ID
This is a convenience method for the most common use case
pub fn get_primary_id(&self) -> Option<&str>
Sourcepub fn hash_for_cache(&self) -> String
pub fn hash_for_cache(&self) -> String
Generates a consistent hash for the user used in cache keys and batch grouping
This hash includes all user identifiers to ensure consistent cache behavior across different user representations with the same logical identity.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for User
impl<'de> Deserialize<'de> for User
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
Source§impl<'v_a> ValidateArgs<'v_a> for User
impl<'v_a> ValidateArgs<'v_a> for User
Auto Trait Implementations§
impl Freeze for User
impl RefUnwindSafe for User
impl Send for User
impl Sync for User
impl Unpin for User
impl UnwindSafe for User
Blanket Implementations§
§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§unsafe fn clone_to_uninit(&self, dest: *mut u8)
unsafe fn clone_to_uninit(&self, dest: *mut u8)
🔬This is a nightly-only experimental API. (
clone_to_uninit)