Trait respo::dialog::AlertPluginInterface
source · pub trait AlertPluginInterface<T, U>where
T: Debug + Clone + RespoAction,
U: Fn(DispatchFn<T>) -> Result<(), String>,{
fn render(&self) -> Result<RespoNode<T>, String>
where
T: Clone + Debug;
fn show(
&self,
dispatch: DispatchFn<T>,
text: Option<String>
) -> Result<(), String>;
fn close(&self, dispatch: DispatchFn<T>) -> Result<(), String>;
fn new(
states: StatesTree,
options: AlertOptions,
on_read: U
) -> Result<Self, String>
where
Self: Sized;
fn share_with_ref(&self) -> Rc<Self>;
}
Expand description
provides the interfaces to component of alert dialog
Required Methods§
sourcefn render(&self) -> Result<RespoNode<T>, String>where
T: Clone + Debug,
fn render(&self) -> Result<RespoNode<T>, String>where
T: Clone + Debug,
renders virtual dom for alert modal
sourcefn show(
&self,
dispatch: DispatchFn<T>,
text: Option<String>
) -> Result<(), String>
fn show(
&self,
dispatch: DispatchFn<T>,
text: Option<String>
) -> Result<(), String>
to show alert, second parameter is a message that could overwrite the default message
sourcefn new(
states: StatesTree,
options: AlertOptions,
on_read: U
) -> Result<Self, String>where
Self: Sized,
fn new(
states: StatesTree,
options: AlertOptions,
on_read: U
) -> Result<Self, String>where
Self: Sized,
show alert with options, on_read
is the callback function when read button is clicked
return referencial counted alert plugin