pub struct Alert { /* private fields */ }Expand description
A persistent alert/notification widget
Displays important messages that require user attention. Unlike Toast, Alert stays visible until explicitly dismissed.
Implementations§
Source§impl Alert
impl Alert
Sourcepub fn level(self, level: AlertLevel) -> Self
pub fn level(self, level: AlertLevel) -> Self
Set the severity level
Sourcepub fn variant(self, variant: AlertVariant) -> Self
pub fn variant(self, variant: AlertVariant) -> Self
Set the visual variant
Sourcepub fn custom_icon(self, icon: char) -> Self
pub fn custom_icon(self, icon: char) -> Self
Set a custom icon
Sourcepub fn dismissible(self, dismissible: bool) -> Self
pub fn dismissible(self, dismissible: bool) -> Self
Make the alert dismissible
Sourcepub fn is_dismissed(&self) -> bool
pub fn is_dismissed(&self) -> bool
Check if alert is dismissed
Sourcepub fn handle_key(&mut self, key: &Key) -> bool
pub fn handle_key(&mut self, key: &Key) -> bool
Handle keyboard input
Returns true if the key was handled.
Source§impl Alert
impl Alert
Sourcepub fn is_focused(&self) -> bool
pub fn is_focused(&self) -> bool
Check if widget is focused
Sourcepub fn is_disabled(&self) -> bool
pub fn is_disabled(&self) -> bool
Check if widget is disabled
Sourcepub fn set_focused(&mut self, focused: bool)
pub fn set_focused(&mut self, focused: bool)
Set focused state (mutable)
Trait Implementations§
Source§impl StyledView for Alert
impl StyledView for Alert
Source§fn remove_class(&mut self, class: &str)
fn remove_class(&mut self, class: &str)
Remove a CSS class
Source§fn toggle_class(&mut self, class: &str)
fn toggle_class(&mut self, class: &str)
Toggle a CSS class
Auto Trait Implementations§
impl Freeze for Alert
impl RefUnwindSafe for Alert
impl Send for Alert
impl Sync for Alert
impl Unpin 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
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<R, P> ReadPrimitive<R> for P
impl<R, P> ReadPrimitive<R> for P
Source§fn read_from_little_endian(read: &mut R) -> Result<Self, Error>
fn read_from_little_endian(read: &mut R) -> Result<Self, Error>
Read this value from the supplied reader. Same as
ReadEndian::read_from_little_endian().