pub trait EventCallback<E: SEEvent>: Clone + Send + Sync + 'static {
    // Required method
    fn event_update<'life0, 'life1, 'async_trait>(
        &'life0 self,
        event: &'life1 EventInstance<E>
    ) -> Pin<Box<dyn Future<Output = ResponseStatus> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
}
Available on crate feature event only.
Expand description

A Trait specifying a callback for a Schedule

Required Methods§

source

fn event_update<'life0, 'life1, 'async_trait>( &'life0 self, event: &'life1 EventInstance<E> ) -> Pin<Box<dyn Future<Output = ResponseStatus> + Send + 'async_trait>>where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Called whenever the state of an event is updated such that a response cannot be automatically determined, and the client device must be made aware.

Allows the client to apply the event at the device-level, and determine the correct response code.

In some cases, the correct response code can be determined by the scheduler, in which case the return value of this function will be ignored. The specific cases depend on the function set.

The event’s EventInstance::status is guaranteed to NOT be EIStatus::Scheduled

When determining the ResponseStatus to return, refer to Table 27 of IEEE 2030.5-2018

If the returned ResponseStatus for a newly Active event is one of:

ResponseStatus::EventOptOut || ResponseStatus::EventNotApplicable || ResponseStatus::EventInvalid

The event will internally be marked as cancelled, and the client will no longer receive updates on it.

Currently, calling this function acquires a global lock on the scheduler, stopping it from making progress. This may be changed in the future.

Implementors§

source§

impl<F, R, E: SEEvent> EventCallback<E> for Fwhere F: Fn(&EventInstance<E>) -> R + Clone + Send + Sync + 'static, R: Future<Output = ResponseStatus> + Send + 'static,

Currently useless.