Add get_current_state & get_pending_state to ElementExtManual

Convenient API to simply get the current or pending state of the
element.
This commit is contained in:
Zeeshan Ali 2021-01-10 08:52:28 +00:00 committed by Sebastian Dröge
parent a3f6f710a9
commit 4a92966ed5

View file

@ -138,6 +138,14 @@ pub trait ElementExtManual: 'static {
) -> (Result<StateChangeSuccess, StateChangeError>, State, State); ) -> (Result<StateChangeSuccess, StateChangeError>, State, State);
fn set_state(&self, state: State) -> Result<StateChangeSuccess, StateChangeError>; fn set_state(&self, state: State) -> Result<StateChangeSuccess, StateChangeError>;
fn get_current_state(&self) -> State {
self.get_state(ClockTime::from(0)).1
}
fn get_pending_state(&self) -> State {
self.get_state(ClockTime::from(0)).2
}
fn query(&self, query: &mut QueryRef) -> bool; fn query(&self, query: &mut QueryRef) -> bool;
fn send_event(&self, event: Event) -> bool; fn send_event(&self, event: Event) -> bool;