pub trait ConfirmPluginInterface<T, U>where
    T: Debug + Clone + RespoAction,
    U: Fn(DispatchFn<T>) -> Result<(), String>,{
    // Required methods
    fn render(&self) -> Result<RespoNode<T>, String>
       where T: Clone + Debug;
    fn show<V>(
        &self,
        dispatch: DispatchFn<T>,
        next_task: V
    ) -> Result<(), String>
       where V: Fn() -> Result<(), String> + 'static;
    fn close(&self, dispatch: DispatchFn<T>) -> Result<(), String>;
    fn new(
        states: StatesTree,
        options: ConfirmOptions,
        on_confirm: U
    ) -> Result<Self, String>
       where Self: Sized;
    fn share_with_ref(&self) -> Rc<Self>;
}
Expand description

provides the interfaces to component of confirm dialog

Required Methods§

source

fn render(&self) -> Result<RespoNode<T>, String>where T: Clone + Debug,

renders UI

source

fn show<V>(&self, dispatch: DispatchFn<T>, next_task: V) -> Result<(), String>where V: Fn() -> Result<(), String> + 'static,

to show dialog, second parameter is a callback when confirmed, the callback is implemented dirty, it perform directly after confirmed

source

fn close(&self, dispatch: DispatchFn<T>) -> Result<(), String>

to close dialog

source

fn new( states: StatesTree, options: ConfirmOptions, on_confirm: U ) -> Result<Self, String>where Self: Sized,

creates a new instance of confirm plugin, second parameter is a callback when confirmed

source

fn share_with_ref(&self) -> Rc<Self>

Implementors§

source§

impl<T, U> ConfirmPluginInterface<T, U> for ConfirmPlugin<T, U>where T: Clone + Debug + RespoAction, U: Fn(DispatchFn<T>) -> Result<(), String> + 'static + Copy,