Skip to main content

Crate drasi_lib

Crate drasi_lib 

Source
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 api module for backward compatibility with tests. This allows use 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§

ComponentEvent
Component event for tracking lifecycle changes Lifecycle event emitted when a component’s status changes.
ComponentGraphBootstrapProvider
Bootstrap provider that generates data from the component graph Bootstrap provider that generates a consistent snapshot from the ComponentGraph.
DrasiLib
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.
ReactionBase
Base implementations for reaction plugins Base implementation for common reaction functionality
ReactionBaseParams
Base implementations for reaction plugins Parameters for creating a ReactionBase instance.
SourceBase
Base implementations for source plugins Base implementation for common source functionality
SourceBaseParams
Base implementations for source plugins Parameters for creating a SourceBase instance.
SubscriptionResponse
Subscription response for source subscriptions Subscription response from Source to Query

Enums§

ComponentStatus
Component status type for monitoring component states Execution status of a Drasi component
ComponentType
Component event for tracking lifecycle changes Type of Drasi component
DispatchMode
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§

BootstrapProvider
Bootstrap provider trait for implementing bootstrap plugins Trait for bootstrap providers that handle initial data delivery for newly subscribed queries
IndexBackendPlugin
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_tracingDeprecated
Deprecated tracing initialization functions — use get_or_init_global_registry() instead. Initialize the tracing subscriber with component log routing.
try_init_tracingDeprecated
Deprecated tracing initialization functions — use get_or_init_global_registry() instead. Try to initialize tracing, returning whether initialization succeeded.