pub struct Alert { /* private fields */ }Expand description
Alert component for inline messages
Built on top of the Card component with custom styling for alerts
§Example
use armas_basic::components::{Alert, AlertVariant};
fn ui(ui: &mut egui::Ui) {
// Default info alert
Alert::new("Operation completed").show(ui);
// Destructive alert
Alert::new("Something went wrong")
.variant(AlertVariant::Destructive)
.show(ui);
// Custom color alert
Alert::new("Custom alert")
.color(egui::Color32::from_rgb(100, 200, 150))
.show(ui);
}Implementations§
Source§impl Alert
impl Alert
Sourcepub const fn variant(self, variant: AlertVariant) -> Self
pub const fn variant(self, variant: AlertVariant) -> Self
Set the variant
Sourcepub const fn destructive(self) -> Self
pub const fn destructive(self) -> Self
Make this a destructive alert
Sourcepub const fn dismissible(self, dismissible: bool) -> Self
pub const fn dismissible(self, dismissible: bool) -> Self
Make the alert dismissible
Sourcepub fn show(self, ui: &mut Ui) -> AlertResponse
pub fn show(self, ui: &mut Ui) -> AlertResponse
Show the alert using Card component
Returns AlertResponse with information about user interaction
Auto Trait Implementations§
impl Freeze for Alert
impl RefUnwindSafe for Alert
impl Send for Alert
impl Sync for Alert
impl Unpin for Alert
impl UnsafeUnpin for Alert
impl UnwindSafe for Alert
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