Skip to main content

PropKind

Enum PropKind 

Source
pub enum PropKind {
Show 44 variants Id, Keyword(&'static [&'static str]), DisplayText, LocalizedText, Icon, ImageResource, SvgResource, Number, Shortcut, Length, FileKinds, FileField, PositionField, Flag, NumberValue, Bool, TextValue, TextField, BoolField, NumberField, PickerField, SelectionField, SelectionValue, Items, KeyField, PathField, KeysField, Route, WindowId, TypeName, SlotName, StyleVariant, Transition, MotionToken, HeroName, KeyValue, Watched, ColorRole, NumberList, PatternName, MediaSource, Player, Query, Feature,
}
Expand description

How a property value is written and checked.

Variants§

§

Id

Stable control identity: an identifier or a text literal.

§

Keyword(&'static [&'static str])

One of a fixed set of keywords.

§

DisplayText

tr! text or a displayable binding (text, int, float, labelled enum).

§

LocalizedText

Only tr! text; used where data would make no sense (window titles).

§

Icon

Icon name literal from the Bern icon set (SF Symbols naming).

§

ImageResource

Name literal of a declared image resource (PNG or JPEG), such as "images/cover.png".

§

SvgResource

A bundled SVG document, with CSS/SMIL and document-local scripts.

§

Number

Numeric literal in logical units.

§

Shortcut

A keyboard shortcut: a literal such as "cmd+k", "space" or "cmd+shift+p", checked when the application is built (see parse_shortcut), or a text the shortcut follows while the application runs, such as app.keys.open, read by the same rules; a text that is empty or no shortcut gives none.

§

Length

A length in logical units: a literal, or a numeric expression the length follows, such as if window.idle { 0 } else { 24 }.

§

FileKinds

The kinds of file a control accepts, a literal such as "video .ass .srt"; see parse_file_kinds.

§

FileField

Writable session field holding a MediaSource (or an optional one): the file the user chose or dropped.

§

PositionField

Writable session i64 or String field holding the key of the item a scroll view stands at.

§

Flag

A literal true or false, fixed when the application is built.

§

NumberValue

Numeric restricted expression (int or float), read only.

§

Bool

Boolean restricted expression.

§

TextValue

Text restricted expression, read only, such as app.name.

§

TextField

Writable session text field.

§

BoolField

Writable session bool field.

§

NumberField

Writable session float field.

§

PickerField

Writable session enum field whose variants all carry labels.

§

SelectionField

Writable session enum field selecting among child items.

§

SelectionValue

Value matching the enclosing selection field’s enum.

§

Items

List binding of records feeding a row template.

§

KeyField

Field name of the row record used as stable key.

§

PathField

Writable session list of a route enum.

§

KeysField

Writable session list of String or i64 keys: the rows of a Table that are chosen.

§

Route

Route value for the enclosing navigation path.

§

WindowId

Window kind identifier.

§

TypeName

Name of the generated window handle type.

§

SlotName

Name of a slot that modules contribute to.

§

StyleVariant

Name of a style variant the application declares in style!.

§

Transition

Name of a transition from style!, such as pop or fade.

§

MotionToken

Name of a motion token, such as smooth.

§

HeroName

Name pairing two elements as one shared element.

§

KeyValue

A text, number or enum value identifying something, read only.

§

Watched

A value an element follows, read only: a bool, number, text or enum, or an optional or a list of them, such as draft.selected.

§

ColorRole

A semantic color role, such as accent or fill.subtle.

§

NumberList

A list of numbers, read only, such as the values a Series draws.

§

PatternName

Name of a pattern from style!.

§

MediaSource

Binding of a MediaSource, optional or not, followed by the player the declaration creates.

§

Player

An application player from the #[bern::players] catalog.

§

Query

A typed query call such as app.search(draft.text), whose result feeds the element’s template.

§

Feature

A feature of the enclosing contract, such as MediaFeature::Clip.

Trait Implementations§

Source§

impl Clone for PropKind

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

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

Performs copy-assignment from source. Read more
Source§

impl Copy for PropKind

Source§

impl Debug for PropKind

Source§

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

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

impl Eq for PropKind

Source§

impl PartialEq for PropKind

Source§

fn eq(&self, other: &Self) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl StructuralPartialEq for PropKind

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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

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> ToOwned for T
where T: Clone,

Source§

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>,

Source§

type Error = !

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

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

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

Source§

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.