pub struct EuvMessageItem {
pub text: &'static str,
pub action_label: &'static str,
pub on_action: Option<Rc<dyn Fn()>>,
pub on_close: Option<Rc<dyn Fn()>>,
pub dismissible: bool,
}Expand description
One toast in the euv_message stack.
A message is a short line of text with an optional action and an optional close button. The component is purely presentational: it renders the item it is given and reports the clicks, so the caller keeps ownership of the queue and of any auto-dismiss timing.
Fields§
§text: &'static strThe message body, rendered in c_euv_message_text.
action_label: &'static strThe label of the optional action button.
An empty label renders no action button at all.
on_action: Option<Rc<dyn Fn()>>The callback fired when the action button is clicked.
on_close: Option<Rc<dyn Fn()>>The callback fired when the close button is clicked.
dismissible: boolWhether the message renders a close button.
Defaults to false, but supplying an on_close callback implies a
dismissible message, so the close button is rendered either way.
Trait Implementations§
Source§impl Clone for EuvMessageItem
impl Clone for EuvMessageItem
Source§impl Debug for EuvMessageItem
impl Debug for EuvMessageItem
Auto Trait Implementations§
impl !RefUnwindSafe for EuvMessageItem
impl !Send for EuvMessageItem
impl !Sync for EuvMessageItem
impl !UnwindSafe for EuvMessageItem
impl Freeze for EuvMessageItem
impl Unpin for EuvMessageItem
impl UnsafeUnpin for EuvMessageItem
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more