Trait PointHandler

Source
pub trait PointHandler {
    // Required method
    fn on_point(
        &mut self,
        point: &dyn Point,
        watch: Option<&WatchIDRef>,
    ) -> ControlFlow<()>;

    // Provided method
    fn on_close(
        &mut self,
        _: &LkQuery,
        _: StopReason,
        _total_calls: u64,
        _watch_calls: u64,
    ) { ... }
}
Expand description

Callbacks stored in a [LkSystem] instance. Is implemented for |p:&dyn Point, watch:Option<&WatchIDRef>, lks: &LkSystem| -> ControlFlow<()> {}

Required Methods§

Source

fn on_point( &mut self, point: &dyn Point, watch: Option<&WatchIDRef>, ) -> ControlFlow<()>

Handles matching points.

Provided Methods§

Source

fn on_close( &mut self, _: &LkQuery, _: StopReason, _total_calls: u64, _watch_calls: u64, )

Called when break, finished, or replaced

Trait Implementations§

Source§

impl PointHandler for Box<dyn PointHandler>

Source§

fn on_point( &mut self, point: &dyn Point, watch: Option<&WatchIDRef>, ) -> ControlFlow<()>

Handles matching points.
Source§

fn on_close( &mut self, query: &LkQuery, reason: StopReason, total: u64, watch_matches: u64, )

Called when break, finished, or replaced

Implementations on Foreign Types§

Source§

impl PointHandler for Box<dyn PointHandler>

Source§

fn on_point( &mut self, point: &dyn Point, watch: Option<&WatchIDRef>, ) -> ControlFlow<()>

Source§

fn on_close( &mut self, query: &LkQuery, reason: StopReason, total: u64, watch_matches: u64, )

Source§

impl<F, S, R: Try<Output = (), Residual = E>, E> PointHandler for (F, S)
where F: FnMut(&dyn Point, Option<&WatchIDRef>) -> R + 'static, S: FnMut(&LkQuery, StopReason, u64, u64) + 'static,

Source§

fn on_point( &mut self, point: &dyn Point, watch: Option<&WatchIDRef>, ) -> ControlFlow<()>

Source§

fn on_close( &mut self, query: &LkQuery, reason: StopReason, total: u64, writen: u64, )

Source§

impl<T: PointHandler> PointHandler for Rc<RefCell<T>>

Source§

fn on_point( &mut self, point: &dyn Point, watch: Option<&WatchIDRef>, ) -> ControlFlow<()>

Source§

fn on_close( &mut self, q: &LkQuery, stop_reason: StopReason, total_calls: u64, watch_calls: u64, )

Implementors§

Source§

impl<F, R: Try<Output = (), Residual = E>, E: Debug> PointHandler for F
where F: FnMut(&dyn Point, Option<&WatchIDRef>) -> R + 'static,

Source§

impl<H, S> PointHandler for Handle<H, S>
where H: FnMut(&dyn Point, Option<&WatchIDRef>) -> ControlFlow<()>, S: FnMut(&LkQuery, StopReason, u64, u64),