Struct clean_insights_sdk::event::Event
source · [−]pub struct Event {
pub category: String,
pub action: String,
pub name: Option<String>,
pub value: Option<f64>,
pub campaign_id: String,
pub times: u32,
pub first: DateTime<Utc>,
pub last: DateTime<Utc>,
}
Fields
category: String
The event category. Must not be empty. (eg. Videos, Music, Games…)
action: String
The event action. Must not be empty. (eg. Play, Pause, Duration, Add Playlist, Downloaded, Clicked…)
name: Option<String>
The event name. OPTIONAL.
value: Option<f64>
The event value. OPTIONAL.
campaign_id: String
The campaign ID this data point is for.
times: u32
Number of times this data point has arisen between first
and last
. OPTIONAL, defaults to 1.
first: DateTime<Utc>
The first time this data point has arisen. OPTIONAL, defaults to now.
last: DateTime<Utc>
The last time this data point has arisen. OPTIONAL, defaults to now.
Implementations
sourceimpl Event
impl Event
sourcepub fn new(category: String, action: String, campaign_id: String) -> Event
pub fn new(category: String, action: String, campaign_id: String) -> Event
Returns a visit with the given scene_path and campaign_id and sane defaults for the other properties.
Arguments
- category: The event category. Must not be empty. (eg. Videos, Music, Games…)
- action: The event action. Must not be empty. (eg. Play, Pause, Duration, Add Playlist, Downloaded, Clicked…)
- name: The event name. OPTIONAL.
- value: The event value. OPTIONAL.
- campaign_id: The campaign ID this data point is for.
Defaults:
- times: 1.
- first: now.
- last: now.
Trait Implementations
sourceimpl<'de> Deserialize<'de> for Event
impl<'de> Deserialize<'de> for Event
sourcefn 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
impl StructuralPartialEq for Event
Auto Trait Implementations
impl RefUnwindSafe for Event
impl Send for Event
impl Sync for Event
impl Unpin for Event
impl UnwindSafe for Event
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcepub fn borrow_mut(&mut self) -> &mut T
pub fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcepub fn to_owned(&self) -> T
pub fn to_owned(&self) -> T
Creates owned data from borrowed data, usually by cloning. Read more
sourcepub fn clone_into(&self, target: &mut T)
pub fn clone_into(&self, target: &mut T)
toowned_clone_into
)Uses borrowed data to replace owned data, usually by cloning. Read more