Skip to main content

NodeSpec

Struct NodeSpec 

Source
pub struct NodeSpec {
Show 16 fields pub layout: LayoutSpec, pub style: VisualStyle, pub hoverable: bool, pub animate: bool, pub accent: bool, pub window: Option<WindowRole>, pub transition: Option<Transition>, pub slide: bool, pub focusable: bool, pub initial_focus: bool, pub disabled: bool, pub cursor: Option<CursorShape>, pub events: Option<Box<EventSpec>>, pub anim: Option<Box<AnimSpec>>, pub access: Option<Box<AccessSpec>>, pub interact: Option<Box<InteractSpec>>,
}
Expand description

Everything one node declares. This, not any Rust trait, is the contract every frontend (Rust builders, Lua, JSX, C) lowers into. Start from NodeSpec::row, NodeSpec::column or NodeSpec::table and chain builders; see the module docs for an example.

Fields§

§layout: LayoutSpec§style: VisualStyle§hoverable: bool

Track pointer hover for this node (Ui::is_hovered) without making it clickable — tooltips on passive badges. Nodes with on_click / on_key / window are always hover-tracked; clicks on a merely hoverable node emit nothing.

§animate: bool

Ask the driver for another frame after this one, every frame this node is declared (animate). What a fragment reading time needs; opt-in, because it takes the loop off input-driven.

§accent: bool

Paint this node’s background in the theme’s accent: the OS’s where the host reported one, the app’s where it pinned one, kui’s blue otherwise. A view says that this node is the accented one and the palette says which colour that is. The stock button also repaints its hover, pressed shade and label from the same accent.

§window: Option<WindowRole>

Window-chrome role (drag handle / window button). A chrome node’s interactions become WindowCommands for the frame driver instead of UiEvents; on_click is ignored on such nodes.

§transition: Option<Transition>

Eases this node’s sizing amounts, colors and radius toward what the view declares instead of snapping (see crate::anim). Keyed by node identity, so the node needs a stable key across frames.

§slide: bool

With transition: also ease this node’s laid-out position, moving its whole subtree — reordered siblings slide into their new slots. Opt-in because a node whose position follows an already-easing sibling (a split’s second half) would lag twice.

§focusable: bool

Reachable by Tab, and focused by a click or an assistive-technology request, without a click payload or a control role — a list row that opens on Enter, a card. Controls (editors, key sinks, on_click boxes, the control roles) are focusable already.

§initial_focus: bool

Where focus lands when the modal scope containing this node is entered: the first node in the modal’s Tab ring declaring it, instead of simply the ring’s first — a destructive confirm opening on its Cancel rather than on whichever control is declared first. Read on entry only, so a Tab press afterwards stands; a node the ring skips (disabled, decoration, not focusable) is not a candidate, and with no candidate the entry is the ring’s first node as before.

§disabled: bool

Inert: keeps its hit region (so a tooltip can say why) and loses everything else — no click, drag or key sink, no hover / pressed / focus background, no place in the Tab ring; the access tree reports it disabled.

§cursor: Option<CursorShape>

The pointer shape over this node (see crate::cursor). Unset, the pointer is the I-beam over an editor or a selection scope and the plain arrow over everything else — a clickable or draggable node included — so a hand over a button, a grab over a handle (grabbing while its drag runs), a splitter’s resize arrows and a disabled control’s notAllowed are all the view’s to declare. The stock button declares Pointer itself.

§events: Option<Box<EventSpec>>

See EventSpec. None when the node declares none of it.

§anim: Option<Box<AnimSpec>>

See AnimSpec. None when the node declares none of it.

§access: Option<Box<AccessSpec>>

See AccessSpec. None when the node declares none of it.

§interact: Option<Box<InteractSpec>>

See InteractSpec. None when the node declares none of it.

Implementations§

Source§

impl NodeSpec

Source

pub fn events(&self) -> &EventSpec

Event payloads this node declares, empty if it declares none.

Source

pub fn events_mut(&mut self) -> &mut EventSpec

Allocates the group on first write.

Source

pub fn anim(&self) -> &AnimSpec

Animation declarations, empty if this node has none.

Source

pub fn anim_mut(&mut self) -> &mut AnimSpec

Allocates the group on first write.

Source

pub fn access(&self) -> &AccessSpec

Declared accessibility properties, empty if this node declares none.

Source

pub fn access_mut(&mut self) -> &mut AccessSpec

Allocates the group on first write.

Source

pub fn interact(&self) -> &InteractSpec

Hover / pressed / focus styling, empty if this node declares none.

Source

pub fn interact_mut(&mut self) -> &mut InteractSpec

Allocates the group on first write.

Source

pub fn hover_tracked(&self) -> bool

Whether the core registers a hit region for this node (any of the interaction props, or an explicit hoverable).

Source

pub fn hover_group_id(name: &str) -> u64

The group id hover_group(name) assigns — reproducible from any binding (the same FNV mix as Key).

Source

pub fn row() -> NodeSpec

A container that lays its children out left to right.

Source

pub fn column() -> NodeSpec

A container that lays its children out top to bottom (the default).

Source

pub fn table() -> NodeSpec

A table: a column whose rows’ children line up in columns. Its in-flow Row children are the rows and each row’s in-flow children its cells; the nth cell of every row is column n, and a column is as wide as its widest cell, so a label column sits at its longest label with no width picked by hand.

A cell’s width says how its column sizes: Fit (the default) and Fixed are content the column’s fit width is the max of, Grow makes the whole column grow with the table, and a column’s min_width / max_width are the strictest its cells declared. Give the rows width: grow for the columns to grow into; a Fit row sits at the columns’ fit width. Rows keep their own gap, padding, background, click and hover, and never wrap. A bare text or image straight inside a row is a cell too. A text, a column or a table straight under the table is a child with its own width and no cells. Everything else is a column’s: gap is the space between rows, scroll_y scrolls them.

use kui_core::{NodeSpec, Sizing};
let table = NodeSpec::table().gap(4.0).rules(kui_core::Color::hex(0x80808080));
let row = NodeSpec::row().width(Sizing::GROW).gap(12.0);
assert!(table.layout.is_table() && !row.layout.is_table());
Source

pub fn width(self, s: impl Into<Sizing>) -> NodeSpec

A Sizing, or a number of px (.width(120.0)).

Source

pub fn height(self, s: impl Into<Sizing>) -> NodeSpec

A Sizing, or a number of px (.height(24.0)).

Source

pub fn size(self, w: impl Into<Sizing>, h: impl Into<Sizing>) -> NodeSpec

Both axes at once: .size(20.0, 20.0) for a fixed box, .size(Sizing::GROW, 24.0) for a strip.

Source

pub fn grow_width(self) -> NodeSpec

An equal share of the leftover width: .width(Sizing::GROW).

Source

pub fn grow_height(self) -> NodeSpec

An equal share of the leftover height: .height(Sizing::GROW).

Source

pub fn fill(self) -> NodeSpec

Grow along both axes.

Source

pub fn min_width(self, v: impl Into<Bound>) -> NodeSpec

A number of px, Min::FIT for the node’s own fit width, or a Bound::Calc.

Source

pub fn max_width(self, v: impl Into<Bound>) -> NodeSpec

A number of px, or a Bound::Calc; a max has no fit size, so Bound::Fit is no clamp. A px ceiling below zero, or NaN, is a ceiling of 0 (px_ceiling).

Source

pub fn min_height(self, v: impl Into<Bound>) -> NodeSpec

A number of px, Min::FIT for the node’s own fit height, or a Bound::Calc.

Source

pub fn with_bounds( self, min_w: Option<Bound>, max_w: Option<Bound>, min_h: Option<Bound>, max_h: Option<Bound>, ) -> NodeSpec

The four clamps where each is given, a transport’s shape (C’s *_size fields): None leaves that clamp as it is.

Source

pub fn clip(self) -> NodeSpec

Clip children to this node’s rect without scrolling. A radius on the same node rounds the clip, so children stay inside its corners (see display::Clip).

Source

pub fn scroll_y(self) -> NodeSpec

Vertical scrolling (and clipping) for overflowing content.

Source

pub fn scroll_x(self) -> NodeSpec

Horizontal scrolling (and clipping) for overflowing content.

Source

pub fn anchor(self) -> NodeSpec

Scroll anchoring on this container (see LayoutSpec::anchor): the first child in view stays where it is on screen when the content before it changes size. Needs scroll_y on a column or scroll_x on a row.

Source

pub fn float(self, cfg: FloatConfig) -> NodeSpec

Take this node out of flex flow; see FloatConfig.

Source

pub fn overflow_bits(self, bits: u32) -> NodeSpec

Apply the overflow bits (OVERFLOW_CLIP and friends). What a bit means is decided here: a binding ORs together whatever its own surface spells (clip, scrollX, overflow) and hands the number over, rather than each one re-deciding that scrolling clips too.

Source

pub fn tooltip(self, hint: &str) -> NodeSpec

A tooltip: the node tracks hover, hint is its accessible description, and the core floats the hint below it while it is hovered. On a box or a fragment the float is the node’s last child; on a leaf — an image, an editor, a cells grid, a line, a polygon, a path — which holds no children, it floats beside the leaf, anchored to it (FloatAnchor::Node), and lands below the leaf’s box all the same (backlog RG113).

Source

pub fn apply_tooltip(self, hint: &str) -> NodeSpec

The spec half of the tooltip prop: the hint is hover-gated, so the node tracks hover, and it is what assistive technology should say, so it is the accessible description too — and nothing floats. For a caller that floats the hint itself: crate::schema::PropsOut::apply_tooltip for the parsers, kui_close for C, a widget that draws its own. A Rust view wants Self::tooltip, which is all three.

Source

pub fn max_height(self, v: impl Into<Bound>) -> NodeSpec

A number of px, or a Bound::Calc; Bound::Fit is no clamp. A px ceiling below zero, or NaN, is a ceiling of 0.

Source

pub fn pad(self, v: f32) -> NodeSpec

The same padding on all four edges, logical px.

Source

pub fn pad_xy(self, x: f32, y: f32) -> NodeSpec

Padding x on the left and right, y on the top and bottom.

Source

pub fn padding(self, e: Edges) -> NodeSpec

Padding per edge.

Source

pub fn gap(self, v: f32) -> NodeSpec

Space between children along the main axis, logical px.

Source

pub fn wrap(self) -> NodeSpec

Wrap overflowing children onto more lines; see LayoutSpec::wrap.

Source

pub fn cross_gap(self, v: f32) -> NodeSpec

Space between wrap lines (across the main axis).

Source

pub fn main_align(self, a: Align) -> NodeSpec

Where children sit along the main axis; the spreads are allowed.

Source

pub fn cross_align(self, a: Align) -> NodeSpec

Where children sit across the main axis; Baseline on a row.

Source

pub fn aspect_ratio(self, ratio: f32) -> NodeSpec

Width over height (CSS’s aspect-ratio): see LayoutSpec::aspect. 16.0 / 9.0 for a video, 1.0 for a square. A ratio that is not positive and finite clears it.

Source

pub fn center(self) -> NodeSpec

Center children on both axes.

Source

pub fn bg(self, c: Color) -> NodeSpec

The background colour.

Source

pub fn radius(self, r: f32) -> NodeSpec

Rounds all four corners by r. On a node that also clips or scrolls it rounds the clip too, so its children are cut to the same corners rather than poking square out of them.

Source

pub fn radii(self, tl: f32, tr: f32, br: f32, bl: f32) -> NodeSpec

Per-corner radii, clockwise from the top-left.

Source

pub fn radius_tl(self, r: f32) -> NodeSpec

Source

pub fn radius_tr(self, r: f32) -> NodeSpec

Source

pub fn radius_br(self, r: f32) -> NodeSpec

Source

pub fn radius_bl(self, r: f32) -> NodeSpec

Source

pub fn radius_top(self, r: f32) -> NodeSpec

Rounds the two top corners (tabs, headers).

Source

pub fn radius_bottom(self, r: f32) -> NodeSpec

Rounds the two bottom corners.

Source

pub fn border(self, w: f32, c: Color) -> NodeSpec

A border w px wide in c, inside the node’s box.

Source

pub fn pixel_snap(self) -> NodeSpec

Paints this node’s background, border, shadow and fragment on whole pixels (see VisualStyle::pixel_snap).

Source

pub fn opacity(self, o: f32) -> NodeSpec

Fades this node and everything under it (see VisualStyle::opacity); clamped to 0..=1.

Source

pub fn shadow(self, shadow: Shadow) -> NodeSpec

The whole drop shadow at once: color, offset, blur, spread.

Source

pub fn shadow_color(self, c: Color) -> NodeSpec

The shadow’s color — on its own, a hard shadow exactly behind the node. Nothing else about a shadow draws without it.

Source

pub fn shadow_blur(self, blur: f32) -> NodeSpec

Source

pub fn shadow_offset(self, dx: f32, dy: f32) -> NodeSpec

Source

pub fn shadow_x(self, dx: f32) -> NodeSpec

Source

pub fn shadow_y(self, dy: f32) -> NodeSpec

Source

pub fn shadow_spread(self, spread: f32) -> NodeSpec

Source

pub fn hoverable(self) -> NodeSpec

Hover-track this node without making it clickable; see the hoverable field.

Source

pub fn animate(self) -> NodeSpec

Ask for another frame after this one, for as long as this node is declared. See the animate prop.

Source

pub fn accent(self) -> NodeSpec

Background from the OS accent colour where the host knows it; see the field.

Source

pub fn on_click(self, payload: impl Into<Value>) -> NodeSpec

Makes this node clickable: a click emits payload as a UiEvent, and the node joins the Tab ring and reads as a button to assistive technology.

Source

pub fn hover_bg(self, c: Color) -> NodeSpec

Background while hovered (see the hover_bg field).

Source

pub fn drop_bg(self, c: Color) -> NodeSpec

Background while dragged files are over this node (see the drop_bg field).

Source

pub fn gradient(self, gradient: Gradient) -> NodeSpec

Paints gradient over this node’s bg, under its border and its children (see the gradient field).

Source

pub fn backdrop_blur(self, radius: f32) -> NodeSpec

Blurs what was drawn beneath this node, inside its rounded rect, by radius logical px (see the backdrop_blur field). A translucent bg over it makes frosted glass:

let bar = NodeSpec::row().backdrop_blur(16.0).bg(Color::hex(0xffffff40));
assert_eq!(bar.interact().backdrop_blur, 16.0);
Source

pub fn rules(self, c: Color) -> NodeSpec

A table’s grid rules in c (see the rules field).

Source

pub fn rule_width(self, w: f32) -> NodeSpec

The rules’ width in logical px; 1 when unset (see rules).

Source

pub fn selectable(self) -> NodeSpec

Makes this node a selection scope (see the selectable field): the text inside it becomes one selectable run.

Source

pub fn focus_region(self) -> NodeSpec

Makes this node’s subtree a focus region (see the focus_region field): a Tab ring of its own, entered on purpose.

Source

pub fn overscroll(self, o: Overscroll) -> NodeSpec

Whether a scroll gesture starting over this scroller at its limit goes on to the one around it (see Overscroll): Overscroll::Contain keeps it here.

Source

pub fn scrollbar(self, mode: ScrollbarMode) -> NodeSpec

When this node’s scrollbars are drawn (see ScrollbarMode). Scrolling itself is unchanged whatever the mode.

Source

pub fn scrollbar_width(self, w: f32) -> NodeSpec

The thumb’s width at rest, logical px (see Scrollbar::width).

Source

pub fn scrollbar_color(self, c: Color) -> NodeSpec

The thumb’s colour at rest (see Scrollbar::color).

Source

pub fn scrollbar_active_color(self, c: Color) -> NodeSpec

The thumb’s colour under the pointer or dragged (see Scrollbar::active_color).

Source

pub fn pressed_bg(self, c: Color) -> NodeSpec

Background while pressed (see the pressed_bg field).

Source

pub fn focus_bg(self, c: Color) -> NodeSpec

Background while keyboard-visibly focused (see the focus_bg field); replaces the default focus ring.

Source

pub fn focusable(self) -> NodeSpec

Puts this node in the Tab ring (see the focusable field).

Source

pub fn on_focus(self, tag: impl Into<Value>) -> NodeSpec

Hears focus entering and leaving this subtree (see the on_focus field).

Source

pub fn keep_focus(self) -> NodeSpec

A press here leaves keyboard focus where it was (see the keep_focus field).

Source

pub fn initial_focus(self) -> NodeSpec

Makes this node the modal scope’s entry focus (see the initial_focus field).

Source

pub fn disabled(self, disabled: bool) -> NodeSpec

Makes this node inert (see the disabled field).

Source

pub fn modal(self, tag: impl Into<Value>) -> NodeSpec

Makes this node the frame’s modal surface (see the modal field).

Source

pub fn hover_group(self, name: &str) -> NodeSpec

Joins the hover group name (see the hover_group field).

Source

pub fn on_hover(self, tag: impl Into<Value>) -> NodeSpec

Emits enter/leave events for this node (see the on_hover field). Pass a tag the handler can match on; Value::Null if the node key is identification enough.

Source

pub fn on_drop(self, tag: impl Into<Value>) -> NodeSpec

Makes this node a drop zone for files dragged in from the OS (see the on_drop field).

Source

pub fn click_sound(self, sound: SoundId) -> NodeSpec

Plays a registered sound when this node is clicked (see the click_sound field).

Source

pub fn hover_sound(self, sound: SoundId) -> NodeSpec

Plays a registered sound when the pointer enters this node (see the hover_sound field).

Source

pub fn on_drag(self, tag: impl Into<Value>) -> NodeSpec

Makes this node draggable (see the on_drag field). Pass a tag the handler can match on; Value::Null if the node key is enough.

Source

pub fn on_layout(self, tag: impl Into<Value>) -> NodeSpec

Reports this node’s laid-out rect as an event whenever it changes (see the on_layout field). Pass a tag the handler can match on; Value::Null if the node key is identification enough.

Source

pub fn role(self, role: Role) -> NodeSpec

What this node is to assistive technology (see the role field).

Source

pub fn label(self, label: impl Into<Arc<str>>) -> NodeSpec

The accessible name (see the label field). Takes an Arc<str> as well as a &str, so a view can keep one and hand it out every frame without allocating.

Source

pub fn description(self, description: impl Into<Arc<str>>) -> NodeSpec

The accessible description (see the description field).

Source

pub fn checked(self, checked: bool) -> NodeSpec

The on state for a checkbox / radio / switch role.

Source

pub fn mixed(self, mixed: bool) -> NodeSpec

A checkbox that is neither on nor off (see the mixed field).

Source

pub fn selected(self, selected: bool) -> NodeSpec

The current one of a set (see the selected field).

Source

pub fn expanded(self, expanded: bool) -> NodeSpec

A disclosure’s state (see the expanded field).

Source

pub fn live(self, live: Live) -> NodeSpec

Marks this node a live region (see the live field).

Source

pub fn value_now(self, v: f32) -> NodeSpec

A slider role’s current value.

Source

pub fn value_min(self, v: f32) -> NodeSpec

Source

pub fn value_max(self, v: f32) -> NodeSpec

Source

pub fn value_step(self, v: f32) -> NodeSpec

How far one arrow key moves a slider (see the value_step field). A step that is not positive and finite clears it.

Source

pub fn on_change(self, tag: impl Into<Value>) -> NodeSpec

Asks the core for a slider’s changes (see the on_change field).

Source

pub fn value_text(self, text: impl Into<Arc<str>>) -> NodeSpec

What a slider’s position reads as (see the value_text field).

Source

pub fn caret(self, offset: u32) -> NodeSpec

On a Role::Line of a custom editor: the caret’s byte offset into this line’s text (see the caret field).

Source

pub fn selection_anchor(self, offset: u32) -> NodeSpec

On a Role::Line of a custom editor: the byte offset where the selection’s other end sits (see the selection_anchor field).

Source

pub fn caret_solid(self) -> NodeSpec

On a Role::Line declaring caret: the caret is solid, not a caret to blink (see the caret_solid field). A block caret in a modal editor’s normal mode — the one thing that otherwise asks an idle app for a frame twice a second.

Source

pub fn on_key(self, tag: impl Into<Value>) -> NodeSpec

Makes this node a key sink (see NodeSpec::on_key field). Pass a tag the handler can match on; Value::Null if the node key is identification enough.

Source

pub fn key_sink(self) -> NodeSpec

A key sink with no tag — on_key(Value::Null), for a handler that knows the node by its key.

Source

pub fn key_up(self) -> NodeSpec

Delivers releases to this key sink as well as presses (see the key_up field). Meaningless without on_key.

Source

pub fn modifier_keys(self) -> NodeSpec

Delivers the modifier and lock keys to this key sink as keys of their own (see the modifier_keys field). Meaningless without on_key.

Source

pub fn on_force_click(self, tag: impl Into<Value>) -> NodeSpec

Asks for force-click events on this node (see the on_force_click field).

Source

pub fn on_button(self, tag: impl Into<Value>) -> NodeSpec

Asks for the non-primary buttons pressed over this node as events, each captured by it until its release (see the on_button field): {kind="button", phase, button, x, y, tag}. Every such button unless NodeSpec::buttons narrows it.

Source

pub fn buttons(self, buttons: Buttons) -> NodeSpec

Which non-primary buttons on_button claims (see the buttons field): Buttons::MIDDLE, Buttons::SECONDARY | Buttons::MIDDLE. Meaningless without on_button.

Source

pub fn on_scroll(self, tag: impl Into<Value>) -> NodeSpec

Asks for the wheel over this node as events (see the on_scroll field): {kind="scroll", x, y, dx, dy, lines, tag}.

Source

pub fn scroll_axes(self, axes: ScrollAxes) -> NodeSpec

Which axes on_scroll takes (see the scroll_axes field): ScrollAxes::Y for a terminal’s history, so a sideways gesture passes it by. Meaningless without on_scroll.

Source

pub fn scroll_mods(self, mods: KeyMods) -> NodeSpec

The modifiers on_scroll is for (see the scroll_mods field): KeyMods::NONE.with_ctrl().with_super() hears a wheel turned with Ctrl or ⌘ held, ahead of every scroller under the pointer, and no other wheel. Meaningless without on_scroll.

Source

pub fn on_context_menu(self, tag: impl Into<Value>) -> NodeSpec

Asks for a context menu on this node (see the on_context_menu field). Pass a tag the handler can match on; Value::Null if the node key is identification enough.

Source

pub fn transition(self, duration_ms: f32) -> NodeSpec

Animates changes to this node’s sizing amounts, colors and radius over duration_ms (cubic ease-out); see crate::anim. Only the duration: an easing or repeat already declared survives, so the transition props compose in any order.

On a scroll container it also eases the offset a reveal or a set_scroll moves it to; the wheel, the thumb and a drag past the edge still land whole.

use kui_core::{Easing, NodeSpec, Sizing};
// Eases toward whatever width the view declares next frame.
let pane = NodeSpec::column().width(Sizing::Fixed(240.0)).transition(180.0).easing(Easing::Smooth);
assert_eq!(pane.transition.unwrap().duration_ms, 180.0);
Source

pub fn transition_with(self, t: Transition) -> NodeSpec

The whole Transition at once, replacing any declared so far.

Source

pub fn slide(self) -> NodeSpec

Also ease this node’s position (see the slide field); sets a default 200ms transition if none was declared yet.

Source

pub fn easing(self, easing: Easing) -> NodeSpec

Easing for the node’s transition (sets a default 200ms one if none was declared yet).

Source

pub fn bounce(self, bounce: f32) -> NodeSpec

How far the node’s spring overshoots, 0 (glides in) to crate::anim::MAX_BOUNCE — in place of the spring easing’s own bounce, and on a timed easing in place of the curve, making it a spring (see Transition::bounce). Sets a default 200ms transition if none was declared yet.

Source

pub fn repeat(self, repeat: Repeat) -> NodeSpec

How this node’s keyframes cycle (CSS’s animation-direction); sets a default 200ms transition if none was declared yet.

Source

pub fn delay(self, delay_ms: f32) -> NodeSpec

Holds this node’s keyframe cycle back by delay_ms (CSS’s animation-delay), so siblings given different delays run out of phase — a cascade, a chase light. Sets a default 200ms transition if none was declared yet.

Source

pub fn keyframes(self, stops: Vec<Keyframe>) -> NodeSpec

Cycles the slots these stops name (see the keyframes field); sets a default 200ms transition if none was declared yet.

Source

pub fn enter(self, enter: Enter) -> NodeSpec

Eases this node in from enter on its first sight (see the enter field); sets a default 200ms transition if none was declared yet.

Source

pub fn exit(self, exit: Enter) -> NodeSpec

Eases this node out to exit after the view stops declaring it (see the exit field); sets a default 200ms transition if none was declared yet.

Source

pub fn window_drag(self) -> NodeSpec

Pressing this node starts an OS window drag (drivers promote a quick second press to a maximize toggle).

Source

pub fn window_button(self, button: WindowButton) -> NodeSpec

Clicking this node emits the button’s WindowCommand.

Source

pub fn cursor(self, shape: CursorShape) -> NodeSpec

The pointer shape over this node (see the cursor field).

Trait Implementations§

Source§

impl Clone for NodeSpec

Source§

fn clone(&self) -> NodeSpec

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 NodeSpec

Source§

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

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

impl Default for NodeSpec

Source§

fn default() -> NodeSpec

Returns the “default value” for a type. Read more
Source§

impl PartialEq for NodeSpec

Hand-written so that a group whose box was allocated but left at its defaults — .checked(false) on a fresh spec — equals one whose box was never allocated at all. The derived version compared None against Some(EMPTY) and called them different, which is a difference the boxing introduced rather than one a caller declared.

Source§

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

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

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

Inequality operator !=. 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<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

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> Downcast for T
where T: Any,

Source§

fn into_any(self: Box<T>) -> Box<dyn Any>

Convert Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.
Source§

fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>

Convert Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be further downcast into Rc<ConcreteType> where ConcreteType implements Trait.
Source§

fn as_any(&self) -> &(dyn Any + 'static)

Convert &Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot generate &Any’s vtable from &Trait’s.
Source§

fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)

Convert &mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot generate &mut Any’s vtable from &mut Trait’s.
Source§

impl<T> Downcast<T> for T

Source§

fn downcast(&self) -> &T

Source§

impl<T> DowncastSync for T
where T: Any + Send + Sync,

Source§

fn into_any_arc(self: Arc<T>) -> Arc<dyn Any + Sync + Send> ⓘ

Convert Arc<Trait> (where Trait: Downcast) to Arc<Any>. Arc<Any> can then be further downcast into Arc<ConcreteType> where ConcreteType implements Trait.
Source§

impl<S, T> Duplex<S> for T
where T: FromSample<S> + ToSample<S>,

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<S> FromSample<S> for S

Source§

fn from_sample_(s: S) -> S

Source§

impl<T> Instrument for T

Source§

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

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

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<F, T> IntoSample<T> for F
where T: FromSample<F>,

Source§

fn into_sample(self) -> T

Source§

impl<T> NoneValue for T
where T: Default,

Source§

type NoneType = T

Source§

fn null_value() -> T

The none-equivalent value.
Source§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

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> ToSample<U> for T
where U: FromSample<T>,

Source§

fn to_sample_(self) -> U

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

impl<T> Upcast<T> for T

Source§

fn upcast(&self) -> Option<&T>

Source§

impl<T> WasmNotSend for T
where T: Send,

Source§

impl<T> WasmNotSendSync for T

Source§

impl<T> WasmNotSync for T
where T: Sync,

Source§

impl<T> WithSubscriber for T

Source§

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

fn with_current_subscriber(self) -> WithDispatch<Self> ⓘ

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