#[non_exhaustive]pub struct OnClick {
pub data: Option<Data>,
/* private fields */
}Expand description
An onclick action (for example, open a link).
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.data: Option<Data>Implementations§
Source§impl OnClick
impl OnClick
Sourcepub fn action(&self) -> Option<&Box<FormAction>>
pub fn action(&self) -> Option<&Box<FormAction>>
The value of data
if it holds a Action, None if the field is not set or
holds a different branch.
Sourcepub fn set_action<T: Into<Box<FormAction>>>(self, v: T) -> Self
pub fn set_action<T: Into<Box<FormAction>>>(self, v: T) -> Self
Sets the value of data
to hold a Action.
Note that all the setters affecting data are
mutually exclusive.
§Example
ⓘ
use google_chat_v1::model::widget_markup::FormAction;
let x = OnClick::new().set_action(FormAction::default()/* use setters */);
assert!(x.action().is_some());
assert!(x.open_link().is_none());Sourcepub fn open_link(&self) -> Option<&Box<OpenLink>>
pub fn open_link(&self) -> Option<&Box<OpenLink>>
The value of data
if it holds a OpenLink, None if the field is not set or
holds a different branch.
Sourcepub fn set_open_link<T: Into<Box<OpenLink>>>(self, v: T) -> Self
pub fn set_open_link<T: Into<Box<OpenLink>>>(self, v: T) -> Self
Sets the value of data
to hold a OpenLink.
Note that all the setters affecting data are
mutually exclusive.
§Example
ⓘ
use google_chat_v1::model::widget_markup::OpenLink;
let x = OnClick::new().set_open_link(OpenLink::default()/* use setters */);
assert!(x.open_link().is_some());
assert!(x.action().is_none());Trait Implementations§
impl StructuralPartialEq for OnClick
Auto Trait Implementations§
impl Freeze for OnClick
impl RefUnwindSafe for OnClick
impl Send for OnClick
impl Sync for OnClick
impl Unpin for OnClick
impl UnsafeUnpin for OnClick
impl UnwindSafe for OnClick
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