#[non_exhaustive]pub struct TextButton {
pub text: String,
pub on_click: Option<OnClick>,
/* private fields */
}Expand description
A button with text and onclick action.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.text: StringThe text of the button.
on_click: Option<OnClick>The onclick action of the button.
Implementations§
Source§impl TextButton
impl TextButton
Sourcepub fn set_on_click<T>(self, v: T) -> Self
pub fn set_on_click<T>(self, v: T) -> Self
Sourcepub fn set_or_clear_on_click<T>(self, v: Option<T>) -> Self
pub fn set_or_clear_on_click<T>(self, v: Option<T>) -> Self
Trait Implementations§
Source§impl Clone for TextButton
impl Clone for TextButton
Source§fn clone(&self) -> TextButton
fn clone(&self) -> TextButton
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for TextButton
impl Debug for TextButton
Source§impl Default for TextButton
impl Default for TextButton
Source§fn default() -> TextButton
fn default() -> TextButton
Returns the “default value” for a type. Read more
Source§impl PartialEq for TextButton
impl PartialEq for TextButton
impl StructuralPartialEq for TextButton
Auto Trait Implementations§
impl Freeze for TextButton
impl RefUnwindSafe for TextButton
impl Send for TextButton
impl Sync for TextButton
impl Unpin for TextButton
impl UnsafeUnpin for TextButton
impl UnwindSafe for TextButton
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