pub struct OperationResultProps<T: Clone + PartialEq + 'static, E: Clone + PartialEq + 'static> {
pub class: Class,
pub close_class: Class,
pub future: Option<Result<T, E>>,
pub on_close: Option<EventHandler<bool>>,
pub visible: bool,
pub title: SharedString,
pub loading: SharedString,
pub success: SharedString,
pub error: SharedString,
pub on_loading: Option<EventHandler>,
pub on_success: Option<EventHandler<T>>,
pub on_error: Option<EventHandler<E>>,
}
Expand description
The OperationResult
properties struct for the configuration of the component.
Fields§
§class: Class
The class attribute for the component.
close_class: Class
A class to apply to the close
button element.
future: Option<Result<T, E>>
A future value which represents the result of user operations.
on_close: Option<EventHandler<bool>>
An event handler to be called when the close
button is clicked.
visible: bool
A flag to determine whether the message is visible or not.
title: SharedString
The title in the message header.
loading: SharedString
A message to render when the future value is not ready.
success: SharedString
A message to render when the future value is resolved.
error: SharedString
A message to render when the future value is rejected.
on_loading: Option<EventHandler>
An event handler to be called when the future value is not ready.
on_success: Option<EventHandler<T>>
An event handler to be called when the future value is resolved.
on_error: Option<EventHandler<E>>
An event handler to be called when the future value is rejected.
Implementations§
Source§impl<T: Clone + PartialEq + 'static, E: Clone + PartialEq + 'static> OperationResultProps<T, E>
impl<T: Clone + PartialEq + 'static, E: Clone + PartialEq + 'static> OperationResultProps<T, E>
Sourcepub fn builder() -> OperationResultPropsBuilder<((), (), (), (), (), (), (), (), (), (), (), ()), T, E>
pub fn builder() -> OperationResultPropsBuilder<((), (), (), (), (), (), (), (), (), (), (), ()), T, E>
Create a builder for building OperationResultProps
.
On the builder, call .class(...)
(optional), .close_class(...)
(optional), .future(...)
(optional), .on_close(...)
(optional), .visible(...)
(optional), .title(...)
(optional), .loading(...)
(optional), .success(...)
(optional), .error(...)
(optional), .on_loading(...)
(optional), .on_success(...)
(optional), .on_error(...)
(optional) to set the values of the fields.
Finally, call .build()
to create the instance of OperationResultProps
.
Trait Implementations§
Source§impl<T: Clone + Clone + PartialEq + 'static, E: Clone + Clone + PartialEq + 'static> Clone for OperationResultProps<T, E>
impl<T: Clone + Clone + PartialEq + 'static, E: Clone + Clone + PartialEq + 'static> Clone for OperationResultProps<T, E>
Source§fn clone(&self) -> OperationResultProps<T, E>
fn clone(&self) -> OperationResultProps<T, E>
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read more