#[non_exhaustive]pub struct Event {
pub dimensions: Vec<EventDimension>,
pub group_id: i64,
pub event_time: Option<Timestamp>,
/* private fields */
}Expand description
Represents an entry in a data source.
Each Event has:
- A timestamp at which the event occurs.
- One or multiple dimensions.
- Optionally, a group ID that allows clients to group logically related
events (for example, all events representing payments transactions done by
a user in a day have the same group ID). If a group ID is not provided, an
internal one will be generated based on the content and
eventTime.
NOTE:
- Internally, we discretize time in equal-sized chunks and we assume an event has a 0 TimeseriesPoint.value in a chunk that does not contain any occurrences of an event in the input.
- The number of Events with the same group ID should be limited.
- Group ID cannot be queried.
- Group ID does not correspond to a user ID or the like. If a user ID is of
interest to be queried, use a user ID
dimensioninstead.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.dimensions: Vec<EventDimension>Event dimensions.
group_id: i64Event group ID.
NOTE: JSON encoding should use a string to hold a 64-bit integer value, because a native JSON number holds only 53 binary bits for an integer.
event_time: Option<Timestamp>Event timestamp.
Implementations§
Source§impl Event
impl Event
pub fn new() -> Self
Sourcepub fn set_dimensions<T, V>(self, v: T) -> Self
pub fn set_dimensions<T, V>(self, v: T) -> Self
Sets the value of dimensions.
Sourcepub fn set_group_id<T: Into<i64>>(self, v: T) -> Self
pub fn set_group_id<T: Into<i64>>(self, v: T) -> Self
Sets the value of group_id.
Sourcepub fn set_event_time<T>(self, v: T) -> Self
pub fn set_event_time<T>(self, v: T) -> Self
Sets the value of event_time.
Sourcepub fn set_or_clear_event_time<T>(self, v: Option<T>) -> Self
pub fn set_or_clear_event_time<T>(self, v: Option<T>) -> Self
Sets or clears the value of event_time.
Trait Implementations§
impl StructuralPartialEq for Event
Auto Trait Implementations§
impl Freeze for Event
impl RefUnwindSafe for Event
impl Send for Event
impl Sync for Event
impl Unpin for Event
impl UnwindSafe for Event
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