Skip to main content

Crate posthog_rs

Crate posthog_rs 

Source

Structs§

AsyncFlagPoller
Asynchronous poller for feature flag definitions.
Client
A Client facilitates interactions with the PostHog API over HTTP.
ClientOptions
Configuration options for the PostHog client.
ClientOptionsBuilder
Builder for ClientOptions.
Cohort
A cohort definition for local evaluation.
CohortDefinition
Definition of a cohort for local evaluation
EndpointManager
Manages PostHog API endpoints and host configuration
EvaluationContext
Context for evaluating properties that may depend on cohorts or other flags
Event
An Event represents an interaction a user has with your app or website. Examples include button clicks, pageviews, query completions, and signups. See the PostHog documentation for a detailed explanation of PostHog Events.
FeatureFlag
A feature flag definition from PostHog.
FeatureFlagCondition
A single condition group within a feature flag’s targeting rules.
FeatureFlagFilters
Targeting rules and configuration for a feature flag.
FlagCache
Thread-safe cache for feature flag definitions.
FlagDetail
Detailed information about a feature flag evaluation result.
FlagMetadata
Metadata about a feature flag from the PostHog server.
FlagPoller
Synchronous poller for feature flag definitions.
FlagReason
Explains why a feature flag evaluated to a particular value.
InconclusiveMatchError
Error returned when a feature flag cannot be evaluated locally.
LocalEvaluationConfig
Configuration for local flag evaluation.
LocalEvaluationResponse
Response from the PostHog local evaluation API.
LocalEvaluator
Evaluates feature flags using locally cached definitions.
MultivariateFilter
Configuration for multivariate (A/B/n) feature flags.
MultivariateVariant
A single variant in a multivariate feature flag.
Property
A property filter used in feature flag targeting.

Enums§

ClientOptionsBuilderError
Error type for ClientOptionsBuilder
Endpoint
API endpoints for different operations
Error
Errors that can occur when using the PostHog client.
FeatureFlagsResponse
Response from the PostHog feature flags API.
FlagValue
The value of a feature flag evaluation.

Constants§

DEFAULT_HOST
Default host (US by default)
EU_INGESTION_ENDPOINT
EU ingestion endpoint
US_INGESTION_ENDPOINT
US ingestion endpoint

Functions§

capture
Capture the provided event, sending it to PostHog using the global client.
client
This function constructs a new client using the options provided.
disable_global
disable prevents the global client from being initialized. NOTE: It does not prevent use of the global client once initialized.
global_is_disabled
is_disabled returns true if the global client has been disabled. NOTE: A disabled global client can still be used as long as it was initialized before it was disabled.
init_global
init_global_client will initialize a globally available client singleton. This singleton can be used when you don’t need more than one instance and have no need to regularly change the client options.
match_feature_flag
match_feature_flag_with_context
Match a feature flag with full context (cohorts, other flags) This version supports cohort membership checks and flag dependency checks
match_property_with_context
Match a property with additional context for cohorts and flag dependencies