Skip to main content

UiNode

Enum UiNode 

Source
pub enum UiNode {
    Column {
        id: String,
        children: Vec<UiNode>,
        gap: Option<f32>,
        no_padding: bool,
        intrinsic_height: bool,
        fill_remaining_height: bool,
    },
    Row {
        id: String,
        children: Vec<UiNode>,
        no_wrap: bool,
        fill_remaining_height: bool,
    },
    Container {
        id: String,
        child: Box<UiNode>,
        background: bool,
        no_padding: bool,
        fill_height: bool,
        width: Option<f32>,
        height: Option<f32>,
    },
    Text {
        id: String,
        text: UiTextSource,
        role: UiTextRole,
    },
    Button {
        id: String,
        label: String,
        accessible_name: Option<String>,
        tooltip: Option<String>,
        on_click_path: Option<String>,
        click_value: Option<String>,
        navigate: Option<UiNavigation>,
        enabled: bool,
        role: UiButtonRole,
    },
    TextInput {
        id: String,
        label: Option<String>,
        accessible_name: String,
        placeholder: String,
        value_path: Option<String>,
        initial_value: String,
        multiline: bool,
        disabled: bool,
    },
    Checkbox {
        id: String,
        label: Option<String>,
        accessible_name: String,
        value_path: String,
        enabled: bool,
    },
    Toggle {
        id: String,
        label: Option<String>,
        accessible_name: String,
        value_path: String,
        enabled: bool,
    },
    Component {
        id: String,
        name: String,
        props: Map<String, Value>,
    },
    Spacer {
        id: String,
    },
}

Variants§

§

Column

Fields

§children: Vec<UiNode>
§no_padding: bool
§intrinsic_height: bool
§fill_remaining_height: bool
§

Row

Fields

§children: Vec<UiNode>
§no_wrap: bool
§fill_remaining_height: bool
§

Container

Fields

§child: Box<UiNode>
§background: bool
§no_padding: bool
§fill_height: bool
§width: Option<f32>
§height: Option<f32>
§

Text

§

Button

Fields

§label: String
§accessible_name: Option<String>
§tooltip: Option<String>
§on_click_path: Option<String>

Where a click is reported to the app: the app takes it from the graph’s UiValues by this path and acts on it. The button never writes the document.

§click_value: Option<String>

What a click reports at on_click_path; "true" when absent.

§enabled: bool
§

TextInput

Fields

§label: Option<String>

Optional visible Fluent label. When present it is also the control’s accessible name, so serialized forms have one source of truth for both presentations.

§accessible_name: String
§placeholder: String
§value_path: Option<String>
§initial_value: String
§multiline: bool
§disabled: bool
§

Checkbox

Fields

§accessible_name: String
§value_path: String
§enabled: bool
§

Toggle

Fields

§accessible_name: String
§value_path: String
§enabled: bool
§

Component

App-owned retained widget built by a process-local component factory.

Fields

§name: String

Stable kebab-case factory name registered by the app.

§props: Map<String, Value>

Serializable app-defined input passed unchanged to the factory.

§

Spacer

Fields

Implementations§

Source§

impl UiNode

Source

pub fn id(&self) -> &str

Source

pub fn children(&self) -> Vec<&UiNode>

Trait Implementations§

Source§

impl Clone for UiNode

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 Debug for UiNode

Source§

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

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

impl<'de> Deserialize<'de> for UiNode

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 PartialEq for UiNode

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 Serialize for UiNode

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

impl StructuralPartialEq for UiNode

Auto Trait Implementations§

§

impl Forget for UiNode

§

impl Freeze for UiNode
where *const u8 is !null: Freeze, PhantomData<u8>: Freeze, PhantomData<UiNode>: Freeze, *const UiNode is !null: Freeze, *const LeafNode<String, Value> is !null: Freeze, PhantomData<(Owned, LeafOrInternal)>: Freeze, PhantomData<Box<(String, Value)>>: Freeze,

§

impl Move for UiNode

§

impl RefUnwindSafe for UiNode

§

impl Send for UiNode
where RawVecInner: Send, BoxRaw<UiNode>: Send, NodeRef<Owned, String, Value, LeafOrInternal>: Send, BoxRaw<(String, Value)>: Send,

§

impl Sync for UiNode
where RawVecInner: Sync, BoxRaw<UiNode>: Sync, NodeRef<Owned, String, Value, LeafOrInternal>: Sync, BoxRaw<(String, Value)>: Sync,

§

impl Unpin for UiNode
where *const u8 is !null: Unpin, Box<UiNode>: Unpin, *const LeafNode<String, Value> is !null: Unpin, Box<(String, Value)>: Unpin,

§

impl UnsafeUnpin for UiNode

§

impl UnwindSafe for UiNode
where RawVecInner: UnwindSafe, BoxRaw<UiNode>: UnwindSafe, BTreeMap<String, Value>: UnwindSafe,

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> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,

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.