pub struct StreamRuleEngine { /* private fields */ }Expand description
Main streaming rule engine
Implementations§
Source§impl StreamRuleEngine
impl StreamRuleEngine
Sourcepub fn with_config(config: StreamConfig) -> Self
pub fn with_config(config: StreamConfig) -> Self
Create with custom configuration
Sourcepub async fn add_rule(&mut self, grl_rule: &str) -> Result<()>
pub async fn add_rule(&mut self, grl_rule: &str) -> Result<()>
Add streaming rule from GRL string
Sourcepub async fn add_rule_file<P: AsRef<Path>>(&mut self, path: P) -> Result<()>
pub async fn add_rule_file<P: AsRef<Path>>(&mut self, path: P) -> Result<()>
Add streaming rule from file
Sourcepub async fn register_action_handler<F>(&self, action_type: &str, handler: F)
pub async fn register_action_handler<F>(&self, action_type: &str, handler: F)
Register action handler
Sourcepub async fn send_event(&self, event: StreamEvent) -> Result<()>
pub async fn send_event(&self, event: StreamEvent) -> Result<()>
Send event to stream for processing
Sourcepub async fn execute_rules(&self) -> Result<StreamExecutionResult>
pub async fn execute_rules(&self) -> Result<StreamExecutionResult>
Execute rules against current window state
Sourcepub async fn get_window_statistics(&self) -> WindowStatistics
pub async fn get_window_statistics(&self) -> WindowStatistics
Get current window statistics
Sourcepub async fn get_field_analytics(&self, field: &str) -> HashMap<String, Value>
pub async fn get_field_analytics(&self, field: &str) -> HashMap<String, Value>
Get analytics for a specific field
Sourcepub async fn is_running(&self) -> bool
pub async fn is_running(&self) -> bool
Check if engine is running
Trait Implementations§
Auto Trait Implementations§
impl Freeze for StreamRuleEngine
impl !RefUnwindSafe for StreamRuleEngine
impl Send for StreamRuleEngine
impl Sync for StreamRuleEngine
impl Unpin for StreamRuleEngine
impl !UnwindSafe for StreamRuleEngine
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more