StreamRuleEngine

Struct StreamRuleEngine 

Source
pub struct StreamRuleEngine { /* private fields */ }
Expand description

Main streaming rule engine

Implementations§

Source§

impl StreamRuleEngine

Source

pub fn new() -> Self

Create a new stream rule engine

Source

pub fn with_config(config: StreamConfig) -> Self

Create with custom configuration

Source

pub async fn add_rule(&mut self, grl_rule: &str) -> Result<()>

Add streaming rule from GRL string

Source

pub async fn add_rule_file<P: AsRef<Path>>(&mut self, path: P) -> Result<()>

Add streaming rule from file

Source

pub async fn register_action_handler<F>(&self, action_type: &str, handler: F)
where F: Fn(&StreamAction) + Send + Sync + 'static,

Register action handler

Source

pub async fn start(&mut self) -> Result<()>

Start the streaming engine

Source

pub async fn stop(&self)

Stop the streaming engine

Source

pub async fn send_event(&self, event: StreamEvent) -> Result<()>

Send event to stream for processing

Source

pub async fn execute_rules(&self) -> Result<StreamExecutionResult>

Execute rules against current window state

Source

pub async fn get_window_statistics(&self) -> WindowStatistics

Get current window statistics

Source

pub async fn get_field_analytics(&self, field: &str) -> HashMap<String, Value>

Get analytics for a specific field

Source

pub async fn is_running(&self) -> bool

Check if engine is running

Trait Implementations§

Source§

impl Default for StreamRuleEngine

Source§

fn default() -> Self

Returns the “default value” for a type. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.