pub struct Mixpanel {
pub token: String,
pub config: Config,
pub people: MixpanelPeople,
pub groups: MixpanelGroups,
/* private fields */
}
Fields§
§token: String
§config: Config
§people: MixpanelPeople
§groups: MixpanelGroups
Implementations§
Source§impl Mixpanel
impl Mixpanel
Sourcepub fn init(token: &str, config: Option<Config>) -> Self
pub fn init(token: &str, config: Option<Config>) -> Self
Initialize a new Mixpanel client with the given token and optional config
Sourcepub async fn track<S: Into<String>>(
&self,
event: S,
properties: Option<HashMap<String, Value>>,
) -> Result<()>
pub async fn track<S: Into<String>>( &self, event: S, properties: Option<HashMap<String, Value>>, ) -> Result<()>
Track an event with optional properties
Sourcepub async fn track_batch(&self, events: Vec<Event>) -> Result<()>
pub async fn track_batch(&self, events: Vec<Event>) -> Result<()>
Track multiple events in a single request (batch)
Sourcepub async fn alias<S: Into<String>>(
&self,
distinct_id: S,
alias: S,
) -> Result<()>
pub async fn alias<S: Into<String>>( &self, distinct_id: S, alias: S, ) -> Result<()>
Create an alias for a distinct_id
Sourcepub async fn send_request<T: Serialize + ?Sized>(
&self,
method: &str,
endpoint: &str,
data: &T,
) -> Result<()>
pub async fn send_request<T: Serialize + ?Sized>( &self, method: &str, endpoint: &str, data: &T, ) -> Result<()>
Send a request to the Mixpanel API with automatic retries for certain error types
pub fn now() -> u64
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Mixpanel
impl !RefUnwindSafe for Mixpanel
impl Send for Mixpanel
impl Sync for Mixpanel
impl Unpin for Mixpanel
impl !UnwindSafe for Mixpanel
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