pub struct Data {Show 13 fields
pub account_id: String,
pub distinct_id: String,
pub data_type: DataType,
pub time: String,
pub event_name: String,
pub event_id: String,
pub first_check_id: String,
pub ip: String,
pub uuid: String,
pub app_id: String,
pub transaction_property: String,
pub import_tool_id: String,
pub properties: Map<String, Value>,
/* private fields */
}Expand description
One data point in the ThinkingData wire format.
Fields whose name starts with # are preset properties recognized by the
receiver; they are serialized with omitempty semantics, except #type,
#time and properties which are always present.
Fields§
§account_id: StringAccount ID of the user (#account_id).
distinct_id: StringAnonymous/distinct ID of the user (#distinct_id).
data_type: DataTypeData type (#type), always serialized.
time: StringEvent time, yyyy-MM-dd HH:mm:ss.SSS (#time), always serialized.
event_name: StringEvent name (#event_name).
event_id: StringEvent ID for updatable/overridable events (#event_id).
first_check_id: StringFirst-check ID for first events (#first_check_id).
ip: StringIP address used for geolocation (#ip).
uuid: StringUnique ID that identifies this data point (#uuid).
app_id: StringApp ID override (#app_id).
transaction_property: StringTransaction properties for track_update/track_overwrite
(#transaction_property).
import_tool_id: StringIdentifier of the import tool (#import_tool_id).
properties: Map<String, Value>Custom event/user properties, always serialized.
Implementations§
Source§impl Data
impl Data
Sourcepub fn new(data_type: DataType) -> Self
pub fn new(data_type: DataType) -> Self
Create an empty Data for data_type, stamping #time with the
current local time.
Sourcepub fn check_limits(&self) -> Result<()>
pub fn check_limits(&self) -> Result<()>
Validate this snapshot against the limits documented in the TE v5.0 data rules:
#timemust beyyyy-MM-dd HH:mm:ssoryyyy-MM-dd HH:mm:ss.SSS#account_id/#distinct_idare limited to 128 characters- property values must respect the documented type limits (string ≤ 2 KB, number within ±9E15, list ≤ 500 elements with string elements ≤ 255 bytes, object ≤ 100 sub-properties)
The debug consumer runs this check in stringent mode; other consumers leave it to the receiver, which silently drops mismatched values. Call it yourself for pre-flight validation.