#[non_exhaustive]pub struct Node {
pub element: Element,
pub style: Option<String>,
pub if: Option<String>,
pub unless: Option<String>,
pub if_stale: Option<bool>,
pub if_fullscreen: Option<bool>,
pub accessibility: Option<Accessibility>,
pub transition: Option<Transition>,
pub privacy: Option<Privacy>,
}Expand description
One node of a layout tree: an element and the members every node may carry.
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.element: Element§style: Option<String>A token of the request’s style table.
if: Option<String>Key of a value; the node is rendered only while it is truthy.
unless: Option<String>Key of a value; the node is rendered only while it is not truthy.
if_stale: Option<bool>true: the node is rendered only while the content is stale; false: only while it is not.
if_fullscreen: Option<bool>true: the node is rendered only while the Lock Screen presentation fills the screen, in StandBy; false:
only while it does not.
accessibility: Option<Accessibility>What assistive technologies read of the node.
transition: Option<Transition>How the node comes and goes when if or unless shows or hides it.
privacy: Option<Privacy>Whether the system hides what the node shows on a locked device.
Implementations§
Source§impl Node
Modifiers. Each one that belongs to certain nodes says which, and leaves every other node as it is.
impl Node
Modifiers. Each one that belongs to certain nodes says which, and leaves every other node as it is.
Sourcepub fn style(self, token: impl Into<String>) -> Node
pub fn style(self, token: impl Into<String>) -> Node
Draws the node with the style token of the layout’s style table.
Sourcepub fn when(self, key: impl Into<String>) -> Node
pub fn when(self, key: impl Into<String>) -> Node
Draws the node only while the value key is truthy: true, a number other than 0 or non-empty text.
The wire member is if. A node takes when or unless, not both.
Sourcepub fn unless(self, key: impl Into<String>) -> Node
pub fn unless(self, key: impl Into<String>) -> Node
Draws the node only while the value key is not truthy.
Sourcepub fn when_stale(self) -> Node
pub fn when_stale(self) -> Node
Draws the node only while the content is stale: its stale date (Start::stale_at,
Update::stale_at) has passed and no update has come since. The system says so
when it draws the activity, so the node appears without the app running. The wire member is ifStale; beside
when or unless the node is drawn while both hold.
Sourcepub fn unless_stale(self) -> Node
pub fn unless_stale(self) -> Node
Draws the node only while the content is not stale: see when_stale.
Sourcepub fn when_fullscreen(self) -> Node
pub fn when_fullscreen(self) -> Node
Draws the node only while the Lock Screen presentation fills the screen: in StandBy, where an iPhone that
charges on its side shows it scaled up, with room for more. The system says so when it draws the activity. The
wire member is ifFullscreen; beside the other conditions the node is drawn while all hold. The island’s parts
and the small family are never full screen.
Sourcepub fn unless_fullscreen(self) -> Node
pub fn unless_fullscreen(self) -> Node
Draws the node only while the Lock Screen presentation does not fill the screen: see
when_fullscreen.
Sourcepub fn accessibility(self, accessibility: Accessibility) -> Node
pub fn accessibility(self, accessibility: Accessibility) -> Node
What assistive technologies read of the node: see Accessibility.
Sourcepub fn transition(self, transition: Transition) -> Node
pub fn transition(self, transition: Transition) -> Node
Sourcepub fn sensitive(self) -> Node
pub fn sensitive(self) -> Node
Marks what the node shows as private: see Privacy::Sensitive.
Sourcepub fn alignment(self, alignment: impl StackAlignment) -> Node
pub fn alignment(self, alignment: impl StackAlignment) -> Node
The alignment of a stack’s children; see StackAlignment.
Sourcepub fn min_length(self, points: f64) -> Node
pub fn min_length(self, points: f64) -> Node
The least length of a spacer, 0 to 256 points.
Sourcepub fn rendering(self, mode: SymbolRendering) -> Node
pub fn rendering(self, mode: SymbolRendering) -> Node
How a symbol is colored.
Sourcepub fn variable(self, key: impl Into<String>) -> Node
pub fn variable(self, key: impl Into<String>) -> Node
The variable value of a symbol: the number value key, 0 to 1.
Sourcepub fn content_mode(self, mode: ContentMode) -> Node
pub fn content_mode(self, mode: ContentMode) -> Node
How a resizable image fills its frame.