Skip to main content

Crate thinkingdata

Crate thinkingdata 

Source
Expand description

Rust SDK for ThinkingData — API entry.

This crate is the API entry of the ThinkingData Rust SDK: it re-exports everything from thinkingdata_core so users depend on a single crate, and additionally ships the thinkingdata CLI binary. All functional logic lives in thinkingdata-core.

§Feature flags

  • blocking (default): synchronous API — consumer::Consumer, TDAnalytics, blocking consumer methods.
  • async: asynchronous API — [consumer::AsyncConsumer], [TDAnalyticsAsync], *_async consumer methods built on Tokio streaming pipelines.
  • full: both of the above.

§Quick start



§Command line

The same crate name doubles as the CLI binary:

thinkingdata --log-dir /tmp/ta-logs track \
    --account-id acc_1 --event-name purchase \
    --properties '{"price": 9.9, "product_name": "book"}'

thinkingdata --server-url https://receiver.thinkingdata.io --app-id YOUR_APP_ID \
    track --account-id acc_1 --event-name login

thinkingdata --server-url https://receiver.thinkingdata.io --app-id YOUR_APP_ID --debug \
    user-set --account-id acc_1 --properties '{"vip": true}'

Modules§

cli
The thinkingdata command line interface.
consumer
Delivery mechanisms: consumer::Consumer, [consumer::AsyncConsumer] and the built-in log/batch/debug consumers. Delivery mechanisms for Data: the Consumer / [AsyncConsumer] traits and the three built-in consumers ported from the Go SDK.
data
Wire-format data model and validation helpers. The wire-format data model of the ThinkingData receiver.
error
Wire-format data model and validation helpers. Error type shared by the whole SDK.
log
Diagnostics logging (TDLogLevel, custom loggers). SDK diagnostics logging.
utils
Wire-format data model and validation helpers. Time and validation helpers shared by the analytics facade and consumers.

Structs§

Data
One data point in the ThinkingData wire format.
TDAnalytics
The blocking analytics facade. Available with the blocking feature. The blocking analytics facade. Available with the blocking feature. The blocking analytics facade of the SDK, ported from the Go SDK’s TDAnalytics.

Enums§

DataType
The kind of data reported to the receiver.
TDError
Errors returned by the ThinkingData SDK.

Constants§

LIB_NAME
The name of the SDK that produced the data, reported as #lib.
SDK_VERSION
The SDK version, reported as #lib_version on every event.

Traits§

IntoPropertyMap
Conversion into the property map carried by Data.

Type Aliases§

Result
The result type used across the SDK.