pub struct QueryRuntimeContext {
pub instance_id: String,
pub query_id: String,
pub update_tx: ComponentUpdateSender,
}Expand description
Context provided to Query components during initialization.
Contains the DrasiLib instance ID and update channel for status reporting.
Constructed by QueryManager when a query is added via add_query().
Unlike sources and reactions, queries are internal to drasi-lib (not plugins), but still follow the same context-based initialization pattern for consistency.
§Clone
This struct implements Clone and uses Arc internally for the update channel,
making cloning cheap (just reference count increments).
Fields§
§instance_id: StringDrasiLib instance ID (for log routing isolation)
query_id: StringUnique identifier for this query instance
update_tx: ComponentUpdateSendermpsc sender for fire-and-forget component status updates.
Status changes sent here are applied to the component graph by the graph update loop, which emits broadcast events to all subscribers.
Implementations§
Source§impl QueryRuntimeContext
impl QueryRuntimeContext
Sourcepub fn new(
instance_id: impl Into<String>,
query_id: impl Into<String>,
update_tx: ComponentUpdateSender,
) -> Self
pub fn new( instance_id: impl Into<String>, query_id: impl Into<String>, update_tx: ComponentUpdateSender, ) -> Self
Create a new query runtime context.
This is typically called by QueryManager when adding a query to DrasiLib.
§Arguments
instance_id- The DrasiLib instance IDquery_id- The unique identifier for this queryupdate_tx- mpsc sender for status updates to the component graph
Sourcepub fn instance_id(&self) -> &str
pub fn instance_id(&self) -> &str
Get the DrasiLib instance ID.
Trait Implementations§
Source§impl Clone for QueryRuntimeContext
impl Clone for QueryRuntimeContext
Source§fn clone(&self) -> QueryRuntimeContext
fn clone(&self) -> QueryRuntimeContext
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more