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.

§height: Option<Height>

Specifies the height of the element.

§id: Option<String>

A unique identifier associated with the item.

§separator: Option<bool>

When true, draw a separating line at the top of the element.

§spacing: Option<Spacing>

Controls the amount of spacing between this element and the preceding element.

Containers group items together.

§

ColumnSet

Fields

§columns: Vec<Column>

The array of Columns to divide the region into.

§select_action: Option<Action>

An Action that will be invoked when the ColumnSet is tapped or selected.

§id: Option<String>

A unique identifier associated with the item.

§separator: Option<bool>

When true, draw a separating line at the top of the element.

§spacing: Option<Spacing>

Controls the amount of spacing between this element and the preceding element.

ColumnSet divides a region into Columns, allowing elements to sit side-by-side.

§

FactSet

Fields

§facts: Vec<Fact>

The array of Fact‘s.

§height: Option<Height>

Specifies the height of the element.

§id: Option<String>

A unique identifier associated with the item.

§separator: Option<bool>

When true, draw a separating line at the top of the element.

§spacing: Option<Spacing>

Controls the amount of spacing between this element and the preceding element.

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.

§image_size: Option<ImageSize>

Controls the approximate size of each image. The physical dimensions will vary per host.

§height: Option<Height>

Specifies the height of the element.

§id: Option<String>

A unique identifier associated with the item.

§separator: Option<bool>

When true, draw a separating line at the top of the element.

§spacing: Option<Spacing>

Controls the amount of spacing between this element and the preceding element.

The ImageSet displays a collection of Images similar to a gallery.

§

TextBlock

Fields

§text: String

Text to display

§wrap: Option<bool>

If true, allow text to wrap. Otherwise, text is clipped.

§color: Option<Color>

Controls the color of TextBlock elements.

§horizontal_alignment: Option<HorizontalAlignment>

Controls the horizontal text alignment.

§is_subtle: Option<bool>

If true, displays text slightly toned down to appear less prominent.

§max_lines: Option<u64>

Specifies the maximum number of lines to display.

§font_type: Option<FontType>

Specifies the font type

§size: Option<Size>

Controls size of text.

§weight: Option<Weight>

Controls the weight of TextBlock elements.

§height: Option<Height>

Specifies the height of the element.

§id: Option<String>

A unique identifier associated with the item.

§separator: Option<bool>

When true, draw a separating line at the top of the element.

§spacing: Option<Spacing>

Controls the amount of spacing between this element and the preceding element.

Displays text, allowing control over font sizes, weight, and color.

§

Image

Fields

§url: String

The URL to the image.

§alt_text: Option<String>

Alternate text describing the image.

§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.

§id: Option<String>

A unique identifier associated with the item.

§separator: Option<bool>

When true, draw a separating line at the top of the element.

§spacing: Option<Spacing>

Controls the amount of spacing between this element and the preceding element.

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.

§is_multiline: Option<bool>

If true, allow multiple lines of input.

§max_length: Option<u64>

Hint of maximum length characters to collect (may be ignored by some clients).

§style: Option<TextInputStyle>

Text Input Style

§inline_action: Option<Action>

The inline action for the input. Typically displayed to the right of the input.

§value: Option<String>

The initial value for this field.

§height: Option<Height>

Specifies the height of the element.

§separator: Option<bool>

When true, draw a separating line at the top of the element.

§spacing: Option<Spacing>

Controls the amount of spacing between this element and the preceding element.

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.

§placeholder: Option<String>

Description of the input desired. Displayed when no selection has been made.

§max: Option<f64>

Hint of maximum value (may be ignored by some clients).

§min: Option<f64>

Hint of minimum value (may be ignored by some clients).

§value: Option<f64>

Initial value for this field.

§height: Option<Height>

Specifies the height of the element.

§separator: Option<bool>

When true, draw a separating line at the top of the element.

§spacing: Option<Spacing>

Controls the amount of spacing between this element and the preceding element.

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.

§placeholder: Option<String>

Description of the input desired. Displayed when no selection has been made.

§max: Option<String>

Hint of maximum value expressed in YYYY-MM-DD(may be ignored by some clients).

§min: Option<String>

Hint of minimum value expressed in YYYY-MM-DD(may be ignored by some clients).

§value: Option<String>

The initial value for this field expressed in YYYY-MM-DD.

§height: Option<Height>

Specifies the height of the element.

§separator: Option<bool>

When true, draw a separating line at the top of the element.

§spacing: Option<Spacing>

Controls the amount of spacing between this element and the preceding element.

Lets a user choose a date.

§

InputTime

Fields

§id: String

Unique identifier for the value. Used to identify collected input when the Submit action is performed.

§max: Option<String>

Hint of maximum value expressed in HH:MM (may be ignored by some clients).

§min: Option<String>

Hint of minimum value expressed in HH:MM (may be ignored by some clients).

§value: Option<String>

The initial value for this field expressed in HH:MM.

§height: Option<Height>

Specifies the height of the element.

§separator: Option<bool>

When true, draw a separating line at the top of the element.

§spacing: Option<Spacing>

Controls the amount of spacing between this element and the preceding element.

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.

§value_off: Option<String>

The value when toggle is off

§value_on: Option<String>

The value when toggle is on

§height: Option<Height>

Specifies the height of the element.

§separator: Option<bool>

When true, draw a separating line at the top of the element.

§spacing: Option<Spacing>

Controls the amount of spacing between this element and the preceding element.

§title: Option<String>

Controls the amount of spacing between this element and the preceding element.

Lets a user choose between two options.

§

InputChoiceSet

Fields

§choices: Vec<Choice>

Choice options.

§id: String

Unique identifier for the value. Used to identify collected input when the Submit action is performed.

§is_multi_select: Option<bool>

Allow multiple choices to be selected.

§style: Option<ChoiceInputStyle>

Input Choice Style

§value: Option<String>

The initial choice (or set of choices) that should be selected. For multi-select, specify a comma-separated string of values.

§height: Option<Height>

Specifies the height of the element.

§separator: Option<bool>

When true, draw a separating line at the top of the element.

§spacing: Option<Spacing>

Controls the amount of spacing between this element and the preceding element.

Allows a user to input a Choice.

§

ActionSet

Fields

§actions: Vec<Action>

The array of Action elements to show.

§height: Option<Height>

Specifies the height of the element.

Displays a set of actions.

Implementations§

source§

impl CardElement

Functions for Card Element

source

pub const fn container() -> Self

Create container

source

pub fn add_element<T: Into<Self>>(&mut self, element: T) -> Self

Add element to Container

source

pub fn set_container_style(&mut self, s: ContainerStyle) -> Self

Set Container Style

source

pub fn set_vertical_alignment( &mut self, align: VerticalContentAlignment ) -> Self

Set container contents vertical alignment

source

pub fn input_text<T: Into<String>, S: Into<String>>( id: T, value: Option<S> ) -> Self

Create input.Text

source

pub fn set_multiline(&mut self, s: bool) -> Self

Set Text Input Multiline

source

pub fn input_choice_set<T: Into<String>, S: Into<String>>( id: T, value: Option<S> ) -> Self

Create input.ChoiceSet

source

pub fn input_toggle<T: Into<String>>(id: T, value: bool) -> Self

Create input.Toggle

source

pub fn set_style(&mut self, s: ChoiceInputStyle) -> Self

Set choiceSet Style

source

pub fn set_title(&mut self, s: String) -> Self

Set title Style

source

pub fn set_multiselect(&mut self, b: bool) -> Self

Set choiceSet Style

source

pub fn text_block<T: Into<String>>(text: T) -> Self

Create textBlock

Arguments
  • text - Text to set to the new text block (Must implement Into<String>)
source

pub fn set_weight(&mut self, w: Weight) -> Self

Set Text Weight

source

pub fn set_font(&mut self, f: FontType) -> Self

Set Text Font Type

source

pub fn set_size(&mut self, s: Size) -> Self

Set Text Size

source

pub fn set_color(&mut self, c: Color) -> Self

Set Text Color

source

pub fn set_wrap(&mut self, w: bool) -> Self

Set Text wrap

source

pub fn set_subtle(&mut self, s: bool) -> Self

Set Text subtle

source

pub const fn fact_set() -> Self

Create factSet

source

pub fn image<T: Into<String>>(url: T) -> Self

Create image

source

pub fn add_key_value<T: Into<String>, S: Into<String>>( &mut self, title: T, value: S ) -> Self

Add fact to factSet

source

pub const fn column_set() -> Self

Create columnSet

source

pub fn add_column(&mut self, column: Column) -> Self

Add column to columnSet

source

pub fn set_separator(&mut self, s: bool) -> Self

Set Separator

source

pub fn set_placeholder(&mut self, s: Option<String>) -> Self

Set Placeholder

source

pub fn set_spacing(&mut self, s: Spacing) -> Self

Set Spacing

source

pub const fn action_set() -> Self

Create actionSet

source

pub fn add_action_to_set(&mut self, action: Action) -> Self

Add action to actionSet

Trait Implementations§

source§

impl Clone for CardElement

source§

fn clone(&self) -> CardElement

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for CardElement

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl<'de> Deserialize<'de> for CardElement

source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
source§

impl From<&CardElement> for CardElement

source§

fn from(item: &Self) -> Self

Converts to this type from the input type.
source§

impl From<&mut CardElement> for CardElement

source§

fn from(item: &mut Self) -> Self

Converts to this type from the input type.
source§

impl Serialize for CardElement

source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided [Span], returning an Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for T
where T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a [WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a [WithDispatch] wrapper. Read more
source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,