#[non_exhaustive]pub struct ImageButton {
pub on_click: Option<OnClick>,
pub name: String,
pub icons: Option<Icons>,
/* private fields */
}Expand description
An image button with an 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.on_click: Option<OnClick>The onclick action.
name: StringThe name of this image_button that’s used for accessibility.
Default value is provided if this name isn’t specified.
icons: Option<Icons>The icon can be specified by an Icon enum or a URL.
Implementations§
Source§impl ImageButton
impl ImageButton
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
Sourcepub fn set_icons<T: Into<Option<Icons>>>(self, v: T) -> Self
pub fn set_icons<T: Into<Option<Icons>>>(self, v: T) -> Self
Sets the value of icons.
Note that all the setters affecting icons are mutually
exclusive.
§Example
ⓘ
use google_chat_v1::model::widget_markup::Icon;
let x0 = ImageButton::new().set_icons(Some(
google_chat_v1::model::widget_markup::image_button::Icons::Icon(Icon::Airplane)));
let x1 = ImageButton::new().set_icons(Some(
google_chat_v1::model::widget_markup::image_button::Icons::Icon(Icon::Bookmark)));
let x2 = ImageButton::new().set_icons(Some(
google_chat_v1::model::widget_markup::image_button::Icons::Icon(Icon::Bus)));Sourcepub fn icon(&self) -> Option<&Icon>
pub fn icon(&self) -> Option<&Icon>
The value of icons
if it holds a Icon, None if the field is not set or
holds a different branch.
Sourcepub fn set_icon<T: Into<Icon>>(self, v: T) -> Self
pub fn set_icon<T: Into<Icon>>(self, v: T) -> Self
Sets the value of icons
to hold a Icon.
Note that all the setters affecting icons are
mutually exclusive.
§Example
ⓘ
use google_chat_v1::model::widget_markup::Icon;
let x0 = ImageButton::new().set_icon(Icon::Airplane);
let x1 = ImageButton::new().set_icon(Icon::Bookmark);
let x2 = ImageButton::new().set_icon(Icon::Bus);
assert!(x0.icon().is_some());
assert!(x0.icon_url().is_none());
assert!(x1.icon().is_some());
assert!(x1.icon_url().is_none());
assert!(x2.icon().is_some());
assert!(x2.icon_url().is_none());Trait Implementations§
Source§impl Clone for ImageButton
impl Clone for ImageButton
Source§fn clone(&self) -> ImageButton
fn clone(&self) -> ImageButton
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 ImageButton
impl Debug for ImageButton
Source§impl Default for ImageButton
impl Default for ImageButton
Source§fn default() -> ImageButton
fn default() -> ImageButton
Returns the “default value” for a type. Read more
Source§impl Message for ImageButton
impl Message for ImageButton
Source§impl PartialEq for ImageButton
impl PartialEq for ImageButton
impl StructuralPartialEq for ImageButton
Auto Trait Implementations§
impl Freeze for ImageButton
impl RefUnwindSafe for ImageButton
impl Send for ImageButton
impl Sync for ImageButton
impl Unpin for ImageButton
impl UnsafeUnpin for ImageButton
impl UnwindSafe for ImageButton
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