optimizely 0.5.0

An unofficial Rust SDK for Optimizely Feature Experimentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
use std::any::Any;

// Imports from super
use crate::{client::UserContext, Conversion, Decision};

/// Trait for sending events to Optimizely Event API
///
/// It is possible to make a custom event dispatcher by implementing this trait
/// TODO: add example again
pub trait EventDispatcher: Send + Sync + Any {
    /// Send conversion event to destination
    fn send_conversion_event(&self, user_context: &UserContext, conversion: Conversion);

    /// Send event to destination
    fn send_decision_event(&self, user_context: &UserContext, decision: Decision);
}