Skip to content

Crates and feature flags

The workspace is split into focused crates. Most applications depend on the elura facade and enable concrete features there.

Workspace crates

CratePurposePublished application dependency?
eluraUnified facade and feature selectionYes, recommended
elura-coreProtocol, sessions, routing, tickets, realtime primitivesFor low-level integrations
elura-runtimeGateway, World, transport, launchers, observabilityUsually through elura
elura-adaptersRedis, SQL, DNS, Kubernetes, outbox adaptersUsually through elura
elura-providersIdentity, OTP, SMS, payment providersUsually through elura
elura-cliProject scaffolding binaryInstall as a tool
elura-loadConnection/request load generatorDevelopment only
elura-perfReproducible performance scenariosWorkspace/internal

Facade features

The elura crate enables runtime by default; runtime includes core.

FeatureEnables
coreelura-core
runtimecore, elura-runtime
adaptersruntime, base elura-adapters
redisadapters, Redis adapter implementations
sqladapters, SQL adapter implementations
kubernetesadapters, Kubernetes adapter implementations
adminadapters, adapter-backed admin capabilities
providerscore, base elura-providers
identityidentity provider set
notification-alismsAliyun SMS notification provider
otpOTP service and store integration
payment-alipayAlipay
payment-appleApple purchase verification
payment-douyinDouyin payment
payment-quicksdkQuickSDK payment
payment-wechat-miniWeChat Mini Program payment
payment-wechat-payWeChat Pay
fullAll adapters and providers above

Facade imports

The facade keeps its crate root intentionally small: elura::Error and elura::Result are available there, while the rest of the API is organized by responsibility.

Use the prelude for common application contracts and runtime types:

rust
use elura::prelude::{
    GatewayLaunchConfig, GatewayLauncher, Identity, WorldBuilder, WorldContext,
};

Use domain modules when the responsibility should remain visible at the call site:

rust
use elura::world::{WorldBuilder, WorldModule};
use elura::world::middleware::LoggingMiddleware;
use elura::world::testing::WorldHarness;
use elura::gateway::GatewayInfrastructure;

Concrete infrastructure and provider implementations are never added to the prelude. Import them through their feature-gated namespaces:

rust
use elura::adapters::discovery::DnsWorldDiscoveryConfig;
use elura::adapters::redis::RedisReplayStore; // `redis`
use elura::providers::identity::GuestProvider; // `identity`
use elura::providers::payment::WechatPayPayment; // `payment-wechat-pay`

This split makes dependencies on Redis, Kubernetes, SQL, or third-party APIs easy to see during review. Feature flags still determine whether a module or item is available. Provider operations use elura::providers::ProviderResult; common provider traits are also available from the prelude when their feature is enabled.

Examples

toml
# Gateway + World runtime only (default)
elura = "0.1.1"

# DNS discovery types live in the adapter crate without a concrete optional
# backend, so the generated split project starts with this feature.
elura = { version = "0.1.1", features = ["adapters"] }

# Redis-backed distributed application
elura = { version = "0.1.1", features = ["redis"] }

# Kubernetes discovery and SQL account versions
elura = { version = "0.1.1", features = ["kubernetes", "sql"] }

During 0.x, pin a precise compatible version and review release notes before upgrading.

Rustdoc

Use docs.rs for item-level signatures and this site for architecture and operational guidance:

  • https://docs.rs/elura
  • https://docs.rs/elura-core
  • https://docs.rs/elura-runtime
  • https://docs.rs/elura-adapters
  • https://docs.rs/elura-providers

Released under the MIT License.