Expand description
§drasi-lib
Embedded library for running Drasi continuous queries with sources, queries, and reactions.
§Error Handling
All public API methods return error::Result<T>, which uses DrasiError —
a structured enum that supports pattern matching on failure modes.
Internal modules and plugin trait implementations use anyhow::Result for flexibility.
The DrasiError::Internal variant (with #[from] anyhow::Error) auto-converts
internal errors at the public API boundary via ?.
See the error module documentation for the full error handling architecture.
Re-exports§
pub use error::DrasiError;pub use error::Result;pub use config::snapshot::QuerySnapshot;pub use config::BootstrapSnapshot;pub use config::ConfigurationSnapshot;pub use config::DrasiLibConfig;pub use config::QueryConfig;pub use config::QueryLanguage;pub use config::QueryRuntime;pub use config::ReactionRuntime;pub use config::ReactionSnapshot;pub use config::RuntimeConfig;pub use config::SourceRuntime;pub use config::SourceSnapshot;pub use config::SourceSubscriptionSettings;pub use indexes::StorageBackendConfig;pub use indexes::StorageBackendRef;pub use indexes::StorageBackendSpec;pub use state_store::MemoryStateStoreProvider;pub use state_store::StateStoreError;pub use state_store::StateStoreProvider;pub use state_store::StateStoreResult;pub use context::QueryRuntimeContext;pub use context::ReactionRuntimeContext;pub use context::SourceRuntimeContext;pub use builder::DrasiLibBuilder;pub use builder::Query;pub use component_graph::wait_for_status;pub use component_graph::ComponentGraph;pub use component_graph::ComponentKind;pub use component_graph::ComponentNode;pub use component_graph::GraphEdge;pub use component_graph::GraphSnapshot;pub use component_graph::RelationshipKind;
Modules§
- api
- Re-export builders as
apimodule for backward compatibility with tests. This allowsuse crate::api::{Query};to work. - builder
- Fluent builders for DrasiLib and components Fluent builders for DrasiLib and its components.
- component_
graph - Component dependency graph — the single source of truth for configuration Component Dependency Graph — the single source of truth for DrasiLib configuration.
- config
- context
- Runtime context types for plugin service injection Runtime context types for plugin service injection.
- error
- Error types for drasi-lib Error types for drasi-lib operations.
- identity
- Identity providers for authentication credentials Identity providers for authentication credentials.
- indexes
- Storage Backend Configuration for DrasiLib
- state_
store - State store provider for persistent plugin state State Store Provider Module
Structs§
- Component
Event - Component event for tracking lifecycle changes Lifecycle event emitted when a component’s status changes.
- Component
Graph Bootstrap Provider - Bootstrap provider that generates data from the component graph
Bootstrap provider that generates a consistent snapshot from the
ComponentGraph. - Drasi
Lib - Main server type - use
DrasiLib::builder()to create instances - LogMessage
- Log level and log message types for component log streaming A structured log message from a component.
- Reaction
Base - Base implementations for reaction plugins Base implementation for common reaction functionality
- Reaction
Base Params - Base implementations for reaction plugins Parameters for creating a ReactionBase instance.
- Source
Base - Base implementations for source plugins Base implementation for common source functionality
- Source
Base Params - Base implementations for source plugins Parameters for creating a SourceBase instance.
- Subscription
Response - Subscription response for source subscriptions Subscription response from Source to Query
Enums§
- Component
Status - Component status type for monitoring component states Execution status of a Drasi component
- Component
Type - Component event for tracking lifecycle changes Type of Drasi component
- Dispatch
Mode - Dispatch mode for configuring event routing (Broadcast or Channel) Event routing mode for distributing changes to subscribers
- LogLevel
- Log level and log message types for component log streaming Log severity level.
Traits§
- Bootstrap
Provider - Bootstrap provider trait for implementing bootstrap plugins Trait for bootstrap providers that handle initial data delivery for newly subscribed queries
- Index
Backend Plugin - Index backend plugin trait for implementing storage backends Plugin trait for external index storage backends.
- Reaction
- Reaction traits for implementing reaction plugins Trait defining the interface for all reaction implementations.
- Source
- Source trait for implementing source plugins Trait defining the interface for all source implementations.
Functions§
- get_
or_ init_ global_ registry - Tracing initialization function - call to set up component log routing Get or initialize the shared global log registry.
- init_
tracing Deprecated - Deprecated tracing initialization functions — use
get_or_init_global_registry()instead. Initialize the tracing subscriber with component log routing. - try_
init_ tracing Deprecated - Deprecated tracing initialization functions — use
get_or_init_global_registry()instead. Try to initialize tracing, returning whether initialization succeeded.