zng_app::widget

Trait ResponseVarSubscribe

Source
pub trait ResponseVarSubscribe<T: VarValue> {
    // Required methods
    fn on_pre_rsp<H>(&self, handler: H) -> VarHandle
       where H: AppHandler<OnVarArgs<T>>;
    fn on_rsp<H>(&self, handler: H) -> VarHandle
       where H: AppHandler<OnVarArgs<T>>;
}
Expand description

Extension methods to subscribe app handlers to a response variable.

Required Methods§

Source

fn on_pre_rsp<H>(&self, handler: H) -> VarHandle
where H: AppHandler<OnVarArgs<T>>,

Add a handler that is called once when the response is received, the handler is called before all other UI updates.

The handle is not called if already is_done, in this case a dummy handle is returned.

Source

fn on_rsp<H>(&self, handler: H) -> VarHandle
where H: AppHandler<OnVarArgs<T>>,

Add a handler that is called once when the response is received, the handler is called after all other UI updates.

The handle is not called if already is_done, in this case a dummy handle is returned.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementations on Foreign Types§

Source§

impl<T: VarValue> ResponseVarSubscribe<T> for ResponseVar<T>

Source§

fn on_pre_rsp<H>(&self, handler: H) -> VarHandle
where H: AppHandler<OnVarArgs<T>>,

Source§

fn on_rsp<H>(&self, handler: H) -> VarHandle
where H: AppHandler<OnVarArgs<T>>,

Implementors§