pub struct Button { /* private fields */ }
Expand description
A notification button
Implementations§
Source§impl Button
impl Button
Sourcepub fn new(label: &str, action: &str) -> Self
pub fn new(label: &str, action: &str) -> Self
Create a new notification button.
§Arguments
label
- the user visible label of the button.action
- the action name to be invoked when the user clicks on the button.
Sourcepub fn target<'a, T: Into<Value<'a>>>(
self,
target: impl Into<Option<T>>,
) -> Self
pub fn target<'a, T: Into<Value<'a>>>( self, target: impl Into<Option<T>>, ) -> Self
The value to send with the action name when the button is clicked.
Sourcepub fn purpose(self, purpose: impl Into<Option<ButtonPurpose>>) -> Self
pub fn purpose(self, purpose: impl Into<Option<ButtonPurpose>>) -> Self
Sets the button purpose.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Button
impl RefUnwindSafe for Button
impl Send for Button
impl Sync for Button
impl Unpin for Button
impl UnwindSafe for Button
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