#[non_exhaustive]pub struct WidgetMarkup {
pub buttons: Vec<Button>,
pub data: Option<Data>,
/* private fields */
}Expand description
A widget is a UI element that presents text and images.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.A list of buttons. Buttons is also oneof data and only one of these
fields should be set.
data: Option<Data>A WidgetMarkup can only have one of the following items. You can use
multiple WidgetMarkup fields to display more items.
Implementations§
Source§impl WidgetMarkup
impl WidgetMarkup
Sourcepub fn text_paragraph(&self) -> Option<&Box<TextParagraph>>
pub fn text_paragraph(&self) -> Option<&Box<TextParagraph>>
The value of data
if it holds a TextParagraph, None if the field is not set or
holds a different branch.
Sourcepub fn set_text_paragraph<T: Into<Box<TextParagraph>>>(self, v: T) -> Self
pub fn set_text_paragraph<T: Into<Box<TextParagraph>>>(self, v: T) -> Self
Sets the value of data
to hold a TextParagraph.
Note that all the setters affecting data are
mutually exclusive.
§Example
use google_chat_v1::model::widget_markup::TextParagraph;
let x = WidgetMarkup::new().set_text_paragraph(TextParagraph::default()/* use setters */);
assert!(x.text_paragraph().is_some());
assert!(x.image().is_none());
assert!(x.key_value().is_none());Sourcepub fn image(&self) -> Option<&Box<Image>>
pub fn image(&self) -> Option<&Box<Image>>
The value of data
if it holds a Image, None if the field is not set or
holds a different branch.
Sourcepub fn set_image<T: Into<Box<Image>>>(self, v: T) -> Self
pub fn set_image<T: Into<Box<Image>>>(self, v: T) -> Self
Sets the value of data
to hold a Image.
Note that all the setters affecting data are
mutually exclusive.
§Example
use google_chat_v1::model::widget_markup::Image;
let x = WidgetMarkup::new().set_image(Image::default()/* use setters */);
assert!(x.image().is_some());
assert!(x.text_paragraph().is_none());
assert!(x.key_value().is_none());Sourcepub fn key_value(&self) -> Option<&Box<KeyValue>>
pub fn key_value(&self) -> Option<&Box<KeyValue>>
The value of data
if it holds a KeyValue, None if the field is not set or
holds a different branch.
Sourcepub fn set_key_value<T: Into<Box<KeyValue>>>(self, v: T) -> Self
pub fn set_key_value<T: Into<Box<KeyValue>>>(self, v: T) -> Self
Sets the value of data
to hold a KeyValue.
Note that all the setters affecting data are
mutually exclusive.
§Example
use google_chat_v1::model::widget_markup::KeyValue;
let x = WidgetMarkup::new().set_key_value(KeyValue::default()/* use setters */);
assert!(x.key_value().is_some());
assert!(x.text_paragraph().is_none());
assert!(x.image().is_none());Trait Implementations§
Source§impl Clone for WidgetMarkup
impl Clone for WidgetMarkup
Source§fn clone(&self) -> WidgetMarkup
fn clone(&self) -> WidgetMarkup
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more