Skip to main content

Data

Struct Data 

Source
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>,
}
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: String

Account ID of the user (#account_id).

§distinct_id: String

Anonymous/distinct ID of the user (#distinct_id).

§data_type: DataType

Data type (#type), always serialized.

§time: String

Event time, yyyy-MM-dd HH:mm:ss.SSS (#time), always serialized.

§event_name: String

Event name (#event_name).

§event_id: String

Event ID for updatable/overridable events (#event_id).

§first_check_id: String

First-check ID for first events (#first_check_id).

§ip: String

IP address used for geolocation (#ip).

§uuid: String

Unique ID that identifies this data point (#uuid).

§app_id: String

App ID override (#app_id).

§transaction_property: String

Transaction properties for track_update/track_overwrite (#transaction_property).

§import_tool_id: String

Identifier of the import tool (#import_tool_id).

§properties: Map<String, Value>

Custom event/user properties, always serialized.

Implementations§

Source§

impl Data

Source

pub fn new(data_type: DataType) -> Self

Create an empty Data for data_type, stamping #time with the current local time.

Source

pub fn check_limits(&self) -> Result<()>

Validate this snapshot against the limits documented in the TE v5.0 data rules:

  • #time must be yyyy-MM-dd HH:mm:ss or yyyy-MM-dd HH:mm:ss.SSS
  • #account_id / #distinct_id are 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.

Trait Implementations§

Source§

impl Clone for Data

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for Data

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Serialize for Data

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more

Auto Trait Implementations§

§

impl Forget for Data

§

impl Freeze for Data

§

impl Move for Data

§

impl RefUnwindSafe for Data

§

impl Send for Data

§

impl Sync for Data

§

impl Unpin for Data

§

impl UnsafeUnpin for Data

§

impl UnwindSafe for Data

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self> ⓘ

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self> ⓘ

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> PolicyExt for T
where T: ?Sized,

Source§

fn and<P, B, E>(self, other: P) -> And<T, P>
where T: Sized + Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow only if self and other return Action::Follow. Read more
Source§

fn or<P, B, E>(self, other: P) -> Or<T, P>
where T: Sized + Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow if either self or other returns Action::Follow. Read more
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> ⓘ
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self> ⓘ

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more