Enum webex::adaptive_card::CardElement
source · pub enum CardElement {
Show 13 variants
Container {
items: Vec<CardElement>,
select_action: Option<Action>,
style: Option<ContainerStyle>,
vertical_content_alignment: Option<VerticalContentAlignment>,
height: Option<Height>,
id: Option<String>,
separator: Option<bool>,
spacing: Option<Spacing>,
},
ColumnSet {
columns: Vec<Column>,
select_action: Option<Action>,
id: Option<String>,
separator: Option<bool>,
spacing: Option<Spacing>,
},
FactSet {
facts: Vec<Fact>,
height: Option<Height>,
id: Option<String>,
separator: Option<bool>,
spacing: Option<Spacing>,
},
ImageSet {
images: Vec<CardElement>,
image_size: Option<ImageSize>,
height: Option<Height>,
id: Option<String>,
separator: Option<bool>,
spacing: Option<Spacing>,
},
TextBlock {Show 13 fields
text: String,
wrap: Option<bool>,
color: Option<Color>,
horizontal_alignment: Option<HorizontalAlignment>,
is_subtle: Option<bool>,
max_lines: Option<u64>,
font_type: Option<FontType>,
size: Option<Size>,
weight: Option<Weight>,
height: Option<Height>,
id: Option<String>,
separator: Option<bool>,
spacing: Option<Spacing>,
},
Image {
url: String,
alt_text: Option<String>,
background_color: Option<String>,
width: Option<String>,
height: Option<String>,
horizontal_alignment: Option<HorizontalAlignment>,
select_action: Option<Action>,
size: Option<ImageSize>,
style: Option<ImageStyle>,
id: Option<String>,
separator: Option<bool>,
spacing: Option<Spacing>,
},
InputText {
id: String,
placeholder: Option<String>,
is_multiline: Option<bool>,
max_length: Option<u64>,
style: Option<TextInputStyle>,
inline_action: Option<Action>,
value: Option<String>,
height: Option<Height>,
separator: Option<bool>,
spacing: Option<Spacing>,
},
InputNumber {
id: String,
placeholder: Option<String>,
max: Option<f64>,
min: Option<f64>,
value: Option<f64>,
height: Option<Height>,
separator: Option<bool>,
spacing: Option<Spacing>,
},
InputDate {
id: String,
placeholder: Option<String>,
max: Option<String>,
min: Option<String>,
value: Option<String>,
height: Option<Height>,
separator: Option<bool>,
spacing: Option<Spacing>,
},
InputTime {
id: String,
max: Option<String>,
min: Option<String>,
value: Option<String>,
height: Option<Height>,
separator: Option<bool>,
spacing: Option<Spacing>,
},
InputToggle {
id: String,
value: Option<String>,
value_off: Option<String>,
value_on: Option<String>,
height: Option<Height>,
separator: Option<bool>,
spacing: Option<Spacing>,
title: Option<String>,
},
InputChoiceSet {
choices: Vec<Choice>,
id: String,
is_multi_select: Option<bool>,
style: Option<ChoiceInputStyle>,
value: Option<String>,
height: Option<Height>,
separator: Option<bool>,
spacing: Option<Spacing>,
},
ActionSet {
actions: Vec<Action>,
height: Option<Height>,
},
}
Expand description
Card element types
Variants§
Container
Fields
items: Vec<CardElement>
The card elements to render inside the Container.
select_action: Option<Action>
An Action that will be invoked when the Container is tapped or selected.
style: Option<ContainerStyle>
Style hint for Container.
vertical_content_alignment: Option<VerticalContentAlignment>
Defines how the content should be aligned vertically within the container.
Containers group items together.
ColumnSet
Fields
ColumnSet divides a region into Columns, allowing elements to sit side-by-side.
FactSet
Fields
The FactSet element displays a series of facts (i.e. name/value pairs) in a tabular form.
ImageSet
Fields
images: Vec<CardElement>
The array of Image elements to show.
The ImageSet displays a collection of Images similar to a gallery.
TextBlock
Fields
horizontal_alignment: Option<HorizontalAlignment>
Controls the horizontal text alignment.
Displays text, allowing control over font sizes, weight, and color.
Image
Fields
background_color: Option<String>
Applies a background to a transparent image. This property will respect the image style. hex value of a color (e.g. #982374)
width: Option<String>
The desired on-screen width of the image, ending in ‘px’. E.g., 50px. This overrides the size property.
height: Option<String>
The desired height of the image. If specified as a pixel value, ending in ‘px’, E.g., 50px, the image will distort to fit that exact height. This overrides the size property.
horizontal_alignment: Option<HorizontalAlignment>
Controls how this element is horizontally positioned within its parent.
select_action: Option<Action>
An Action that will be invoked when the Image is tapped or selected. Action.ShowCard is not supported.
size: Option<ImageSize>
Controls the approximate size of the image. The physical dimensions will vary per host.
style: Option<ImageStyle>
Controls how this Image is displayed.
Displays an image.
InputText
Fields
id: String
Unique identifier for the value. Used to identify collected input when the Submit action is performed.
placeholder: Option<String>
Description of the input desired. Displayed when no text has been input.
max_length: Option<u64>
Hint of maximum length characters to collect (may be ignored by some clients).
style: Option<TextInputStyle>
Text Input Style
Lets a user enter text.
InputNumber
Fields
id: String
Unique identifier for the value. Used to identify collected input when the Submit action is performed.
Allows a user to enter a number.
InputDate
Fields
id: String
Unique identifier for the value. Used to identify collected input when the Submit action is performed.
Lets a user choose a date.
InputTime
Fields
Lets a user select a time.
InputToggle
Fields
id: String
Unique identifier for the value. Used to identify collected input when the Submit action is performed.
value: Option<String>
The initial selected value. If you want the toggle to be initially on, set this to the value of valueOn‘s value.
Lets a user choose between two options.
InputChoiceSet
Fields
id: String
Unique identifier for the value. Used to identify collected input when the Submit action is performed.
style: Option<ChoiceInputStyle>
Input Choice Style
Allows a user to input a Choice.
ActionSet
Fields
Displays a set of actions.
Implementations§
source§impl CardElement
impl CardElement
Functions for Card Element
sourcepub fn add_element<T: Into<Self>>(&mut self, element: T) -> Self
pub fn add_element<T: Into<Self>>(&mut self, element: T) -> Self
Add element to Container
sourcepub fn set_container_style(&mut self, s: ContainerStyle) -> Self
pub fn set_container_style(&mut self, s: ContainerStyle) -> Self
Set Container Style
sourcepub fn set_vertical_alignment(
&mut self,
align: VerticalContentAlignment
) -> Self
pub fn set_vertical_alignment( &mut self, align: VerticalContentAlignment ) -> Self
Set container contents vertical alignment
sourcepub fn input_text<T: Into<String>, S: Into<String>>(
id: T,
value: Option<S>
) -> Self
pub fn input_text<T: Into<String>, S: Into<String>>( id: T, value: Option<S> ) -> Self
Create input.Text
sourcepub fn set_multiline(&mut self, s: bool) -> Self
pub fn set_multiline(&mut self, s: bool) -> Self
Set Text Input Multiline
sourcepub fn input_choice_set<T: Into<String>, S: Into<String>>(
id: T,
value: Option<S>
) -> Self
pub fn input_choice_set<T: Into<String>, S: Into<String>>( id: T, value: Option<S> ) -> Self
Create input.ChoiceSet
sourcepub fn input_toggle<T: Into<String>>(id: T, value: bool) -> Self
pub fn input_toggle<T: Into<String>>(id: T, value: bool) -> Self
Create input.Toggle
sourcepub fn set_style(&mut self, s: ChoiceInputStyle) -> Self
pub fn set_style(&mut self, s: ChoiceInputStyle) -> Self
Set choiceSet Style
sourcepub fn set_multiselect(&mut self, b: bool) -> Self
pub fn set_multiselect(&mut self, b: bool) -> Self
Set choiceSet Style
sourcepub fn text_block<T: Into<String>>(text: T) -> Self
pub fn text_block<T: Into<String>>(text: T) -> Self
sourcepub fn set_weight(&mut self, w: Weight) -> Self
pub fn set_weight(&mut self, w: Weight) -> Self
Set Text Weight
sourcepub fn set_subtle(&mut self, s: bool) -> Self
pub fn set_subtle(&mut self, s: bool) -> Self
Set Text subtle
sourcepub fn add_key_value<T: Into<String>, S: Into<String>>(
&mut self,
title: T,
value: S
) -> Self
pub fn add_key_value<T: Into<String>, S: Into<String>>( &mut self, title: T, value: S ) -> Self
Add fact to factSet
sourcepub const fn column_set() -> Self
pub const fn column_set() -> Self
Create columnSet
sourcepub fn add_column(&mut self, column: Column) -> Self
pub fn add_column(&mut self, column: Column) -> Self
Add column to columnSet
sourcepub fn set_separator(&mut self, s: bool) -> Self
pub fn set_separator(&mut self, s: bool) -> Self
Set Separator
sourcepub fn set_placeholder(&mut self, s: Option<String>) -> Self
pub fn set_placeholder(&mut self, s: Option<String>) -> Self
Set Placeholder
sourcepub fn set_spacing(&mut self, s: Spacing) -> Self
pub fn set_spacing(&mut self, s: Spacing) -> Self
Set Spacing
sourcepub const fn action_set() -> Self
pub const fn action_set() -> Self
Create actionSet
sourcepub fn add_action_to_set(&mut self, action: Action) -> Self
pub fn add_action_to_set(&mut self, action: Action) -> Self
Add action to actionSet
Trait Implementations§
source§impl Clone for CardElement
impl Clone for CardElement
source§fn clone(&self) -> CardElement
fn clone(&self) -> CardElement
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read more