pub struct Context { /* private fields */ }Implementations§
Source§impl Context
impl Context
pub fn new(data: ContextData) -> Self
pub fn set_event_logger(&mut self, logger: EventLogger)
pub fn is_ready(&self) -> bool
pub fn is_failed(&self) -> bool
pub fn is_finalized(&self) -> bool
pub fn is_finalizing(&self) -> bool
pub fn pending(&self) -> usize
pub fn data(&self) -> &ContextData
pub fn set_unit(&mut self, unit_type: &str, uid: &str) -> Result<(), String>
pub fn get_unit(&self, unit_type: &str) -> Option<&String>
pub fn get_units(&self) -> &HashMap<String, String>
pub fn set_attribute( &mut self, name: &str, value: impl Into<Value>, ) -> Result<(), String>
pub fn get_attribute(&self, name: &str) -> Option<&Value>
pub fn get_attributes(&self) -> HashMap<String, Value>
pub fn set_override(&mut self, experiment_name: &str, variant: i32)
pub fn set_custom_assignment( &mut self, experiment_name: &str, variant: i32, ) -> Result<(), String>
pub fn peek(&mut self, experiment_name: &str) -> i32
pub fn treatment(&mut self, experiment_name: &str) -> i32
pub fn track( &mut self, goal_name: &str, properties: impl Into<Value>, ) -> Result<(), String>
pub fn variable_value( &mut self, key: &str, default_value: impl Into<Value>, ) -> Value
pub fn peek_variable_value( &mut self, key: &str, default_value: impl Into<Value>, ) -> Value
pub fn variable_keys(&self) -> HashMap<String, Vec<String>>
pub fn custom_field_value( &self, experiment_name: &str, field_name: &str, ) -> Option<Value>
pub fn custom_field_value_type( &self, experiment_name: &str, field_name: &str, ) -> Option<String>
pub fn custom_field_keys(&self) -> Vec<String>
pub fn experiments(&self) -> Vec<String>
pub fn refresh(&mut self, new_data: ContextData)
pub fn publish(&mut self)
pub fn finalize(&mut self)
Auto Trait Implementations§
impl Freeze for Context
impl !RefUnwindSafe for Context
impl Send for Context
impl Sync for Context
impl Unpin for Context
impl !UnwindSafe for Context
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