Skip to main content

NavigationRail

Struct NavigationRail 

Source
pub struct NavigationRail<Msg = Callback> { /* private fields */ }
Expand description

A vertical navigation rail (tablet / desktop).

Implementations§

Source§

impl<Msg: Clone + 'static> NavigationRail<Msg>

Source

pub fn new(selected: usize, on_select: impl Fn(usize) -> Msg + 'static) -> Self

Creates a rail: selected = the active index, on_select(i) on click.

Source

pub fn labels(self, labels: RailLabels) -> Self

When the destinations say what they are. RailLabels::None by default, as the reference’s rail does.

Silent on an extended rail, which labels every destination. The two are different label layouts rather than modes of one another, and the reference forbids the combination outright (navigation_rail.dart:121).

Source

pub fn extended(self, extended: bool) -> Self

The wide form: 256 across instead of 80, with every label beside its glyph instead of under it (navigation_rail.dart:131).

The glyphs keep the 80-pixel column they had, so extending a rail widens it and moves nothing: the destinations stay on the line they were on and the label opens out to the side of them. A rail with room for words is what a desktop window has and a tablet in portrait does not, which is why this is a property and not a size class — the caller knows which it is building.

Source

pub fn group_alignment(self, alignment: f32) -> Self

Where the destinations sit between the rail’s top and bottom: -1.0 against the top (the default), 0.0 centred, 1.0 against the bottom — and every value in between (navigation_rail.dart:205).

Continuous rather than three names, as the reference’s is: a rail whose destinations sit a third of the way down is a thing an application asks for, and a three-valued enum would have to be replaced the first time one did.

It moves the group, which is the destinations plus whichever slot is not pinned. See Self::leading_at_top.

Source

pub fn leading(self, widget: impl Widget<Msg> + 'static) -> Self

The slot above the destinations, where an application puts a floating action button or a menu button (navigation_rail.dart:145).

Source

pub fn leading_boxed(self, widget: Box<dyn Widget<Msg>>) -> Self

Self::leading, for a slot that is already boxed.

Source

pub fn trailing(self, widget: impl Widget<Msg> + 'static) -> Self

The slot below the destinations (navigation_rail.dart:156) — an account switcher, a settings button, the end of the list rather than chrome above it.

Source

pub fn trailing_boxed(self, widget: Box<dyn Widget<Msg>>) -> Self

Self::trailing, for a slot that is already boxed.

Source

pub fn main_axis_alignment(self, alignment: Justify) -> Self

How the destinations are placed along the rail, when there is room to spare (navigation_rail.dart:371).

It is the flexbox question — start, centre, end, or one of the three ways of spreading the spare room between them — asked of the group rather than of the rail around it, so SpaceEvenly puts equal room between every destination and at both ends.

Saying this overrides Self::group_alignment, and not by a rule: the group fills the rail to distribute the room, so there is no room left outside it for an alignment to work in. The reference reaches the same place the same way (navigation_rail.dart:501).

Source

pub fn scrollable(self) -> Self

A rail too short for its destinations scrolls them (navigation_rail.dart:353) rather than running them off the bottom of the screen.

The pinned slots stay put — that is what pinning them is for — and what scrolls is the group: the destinations, plus whichever of Self::leading and Self::trailing was left in it.

Like Self::main_axis_alignment, this leaves Self::group_alignment with nothing to do: a viewport that fills the rail has no spare room to place a group in. A rail scrolls because it has less room than it needs, which is the case where an alignment had no room to work in either.

Source

pub fn use_indicator(self, use_indicator: bool) -> Self

Whether the selected destination gets an indicator behind its glyph (navigation_rail.dart:310). On unless said otherwise, as it is over there.

Turning it off is not just removing a shape. With nothing behind it the glyph stands on the rail’s own surface, so the indicator’s content colour would be a colour for a ground that is not there — the selected destination takes the accent instead, glyph and label both, which is the arrangement the reference keeps for exactly this case (navigation_rail.dart:1221, :1211).

Source

pub fn elevation(self, elevation: f32) -> Self

How far off the page the rail sits (navigation_rail.dart:192). Flat by default, as the reference’s is (:1236).

A raised rail drops its hairline: a shadow and a rule are two ways of saying the same thing, and a widget that draws both says it twice — the lesson Card already carries.

Source

pub fn leading_at_top(self, pinned: bool) -> Self

Whether the leading slot is pinned to the top instead of travelling with the destinations. true by default (navigation_rail.dart:112), which is why Self::group_alignment leaves it where it is.

Source

pub fn trailing_at_bottom(self, pinned: bool) -> Self

Whether the trailing slot is pinned to the bottom. false by default (navigation_rail.dart:113), the other half of the reference’s asymmetry: a leading slot is chrome at the top of the rail, a trailing one is the tail of the list of destinations and moves when the list does.

Source

pub fn item( self, icon: impl Into<DestinationIcon>, label: impl Into<String>, ) -> Self

Adds a destination (glyph + label).

Source

pub fn destinations( self, destinations: impl IntoIterator<Item = NavigationDestination>, ) -> Self

Adds a whole list of destinations declared elsewhere — one navigation, handed to whichever chrome the width called for.

This is the reason NavigationDestination is a value. An application that shows a bar when narrow and a rail when wide used to declare its destinations twice, and the two drifted; now it declares them once.

use frus_widgets::{Icons, NavigationDestination, NavigationRail};

let places = vec![
    NavigationDestination::new(Icons::FAVORITE_BORDER, "Saved")
        .selected_icon(Icons::FAVORITE),
    NavigationDestination::new(Icons::MAIL_OUTLINE, "Inbox").badge(3),
];
let _rail = NavigationRail::new(0, |i| i).destinations(places);
Source

pub fn badge(self, count: u32) -> Self

Adds a notification count to the last destination.

Source

pub fn badge_dot(self) -> Self

Adds a dot to the last destination’s glyph (milestone 707).

Source

pub fn tooltip(self, message: impl Into<String>) -> Self

What a pointer resting on the last destination is told (navigation_rail.dart:1155).

The case this exists for is a rail: it shows glyphs without labels by default, so the mark is all a destination says about itself, and a mark is not always enough.

Source

pub fn selected_icon(self, icon: impl Into<DestinationIcon>) -> Self

The glyph the last destination shows while it is selected, where that differs from its resting one (navigation_rail.dart:1132).

The reference pairs a stroked icon with its filled version, which is how a selected destination reads as selected without leaning on colour alone.

Source

pub fn disabled(self) -> Self

Marks the last destination inaccessible (navigation_rail.dart:1161): its glyph and its label take the disabled ink, nothing lights under the pointer, it emits no message, and the keyboard steps over it.

Source

pub fn indicator_color(self, color: Color) -> Self

The last destination’s own indicator colour, over the theme’s (navigation_rail.dart:1144) — how one entry marks itself out from the rest.

Source

pub fn indicator_shape(self, shape: ShapeBorder) -> Self

The last destination’s own indicator shape, over the theme’s (navigation_rail.dart:1148).

A pill unless something says otherwise, which is what the reference’s default StadiumBorder is — and what this painted, as a radius worked out from the height, until it could say the word.

Source

pub fn overlay_color(self, overlay: WidgetStateProperty<Color>) -> Self

The last destination’s own highlight, per state (navigation_bar.dart:232): the colour that marks it as focused, hovered or pressed, instead of the framework’s own state layer.

The resolved colour is an overlay as the reference means it: its alpha is how far the ground moves towards it, and its colour is where the ground moves to. A state the property says nothing about falls back to the state layer, so naming one state does not silence the rest.

Source

pub fn label_text_style(self, style: TextStyle) -> Self

The destinations’ labels, over the theme’s and the reference’s.

Source

pub fn badge_text_style(self, style: TextStyle) -> Self

The notification counts, over the theme’s and the reference’s.

Source

pub fn background(self, color: Color) -> Self

The rail’s surface. Unset, the theme’s, then the scheme’s surface — where the reference puts a rail (navigation_rail.dart:1202), a rung below the bottom bar.

Trait Implementations§

Source§

impl<Msg: Clone + 'static> Widget<Msg> for NavigationRail<Msg>

Source§

fn style(&self) -> Style

The rail’s box: its column of destinations, plus the intrusions it was told about.

The rail consumes them; its parent does not (milestone 420). The reference keeps its safe area inside the Material (navigation_rail.dart:553) and takes the leading side, the top and the bottom — never the trailing one, which is where the body is. So the rail’s surface, and the rule down its edge, run the full height of the screen while the destinations stay clear of the notch and the gesture bar.

Source§

fn children(&self) -> &[Box<dyn Widget<Msg>>]

The widget’s children (possibly empty).
Source§

fn paint(&self, bounds: Rect, status: Status, theme: &Theme, scene: &mut Scene)

Paints the widget’s own decoration, according to its status (hover / focus / cursor / selection) and the current theme.
Source§

fn on_click(&self) -> Option<Msg>

Message to emit on click (None = not clickable).
Source§

fn opaque(&self) -> bool

Whether a press that lands on this widget and on nothing inside it stops here. Read more
Source§

fn key(&self) -> Option<u64>

Stable identity key (independent of the position among siblings). None = positional identity. See crate::Keyed.
Source§

fn debug_name(&self) -> &'static str

Short name of the widget — for the inspector and diagnostic dumps. Defaults to the name of the concrete type, without module path or generics (each implementation gets its own monomorphised copy of this default body). Transparent wrappers (Box, crate::Keyed…) delegate to their content.
Source§

fn semantics(&self) -> Option<SemanticsProperties>

The widget’s accessibility annotation (role, label, value, state), exposed to assistive technologies through the AccessKit tree. None = no semantics of its own (a layout container — its children, though, may have some). See frus_core::SemanticsProperties.
Source§

fn describes(&self) -> Option<Description>

What this widget says about its child’s subtree, when it knows something the child cannot know about itself — the crate::Semantics wrapper, and nothing else so far. Read more
Source§

fn on_edit(&self, _edit: &mut Edit, _key: &Key) -> Option<Msg>

Applies a key to the focused widget: mutates the edit state (cursor/selection) and returns a message if the value changes.
Source§

fn positional_click( &self, _local_x: f32, _local_y: f32, _width: f32, _height: f32, ) -> Option<Msg>

Positional click: a message emitted according to where the click landed (local coordinates from the widget’s top-left corner, within the width × height box), taking priority over on_click. For clickable sub-regions — e.g. the suffix icon of a crate::TextField (clear / reveal) or a chart point (milestone 221). None (the default) = no sub-region; the shell falls back to on_click.
Source§

fn cursor_icon( &self, _local_x: f32, _local_y: f32, _width: f32, _height: f32, ) -> Option<Cursor>

Shape of the system cursor wanted at the local position (local_x, local_y) inside the widget’s width × height box (milestone 205): Some(Cursor::Pointer) over a clickable sub-region (a suffix icon…), None (the default) = no opinion, the shell keeps the default cursor. Does not affect clicking; this is purely the pointer’s appearance on hover.
Source§

fn cursor_at( &self, _local_x: f32, _local_y: f32, _width: f32, _scroll_cursor: usize, ) -> Option<usize>

Cursor index matching a local position (px from the widget’s top-left corner) — for placing the caret on click. local_y picks the line in a multi-line field (ignored on a single line). Read more
Source§

fn text_metrics( &self, _width: f32, _cursor: usize, ) -> Option<(f32, f32, f32, f32)>

SingleChildScrollView metrics of a multi-line field, for a widget width and a cursor: (content height, visible box height, caret top, caret height), in content space (px). The shell uses them to register the scrollable region and to keep the caret in view. None otherwise.
Source§

fn text_viewport(&self, _rect: Rect) -> Option<Rect>

Frame (input box) of a multi-line field within its rect — the area where the text scrolls, below the label. Used to place the scrollbar and the scrollable region exactly on the box. None otherwise.
Source§

fn caret_vertical( &self, _width: f32, _cursor: usize, _down: bool, _page: bool, _goal_x: Option<f32>, ) -> Option<(usize, f32)>

Moves the caret vertically in a multi-line field and returns (new index, visual column used). Read more
Source§

fn selected_text(&self, _edit: &Edit) -> Option<String>

The currently selected text (for copy/cut).
Source§

fn text_value(&self) -> Option<&str>

The field’s whole value, if this widget is a text field — to give the IME its input context (suggestions). None otherwise.
Source§

fn selection_text(&self) -> Option<&str>

The words this widget shows, if it takes part in a SelectionArea: a Text, and nothing that is not made of words. The walk registers such a widget as a text stop when it is inside an area, so that a selection can begin, end and pass through it.
Source§

fn selection_hit( &self, _local_x: f32, _local_y: f32, _width: f32, ) -> Option<usize>

The character boundary of selection_text nearest a local position (px from the widget’s top-left corner) in a box width wide — the layout the widget was drawn with, which is what a press is hit against.
Source§

fn selection_grip( &self, _width: f32, _index: usize, _start: bool, ) -> Option<SelectionHandle>

The handle that hangs from character boundary index of this widget’s words — the start handle when start, the end handle otherwise — in local coordinates, for a widget width wide: where it is painted, and so where a finger takes it. None for anything that is not a text.
Source§

fn area_toolbar( &self, _context: ToolbarContext, ) -> Option<Option<&dyn Widget<Msg>>>

The bar a SelectionArea offers over its selection, for context, when the application has said what it holds (SelectionArea::selection_toolbar): Some of the bar, or Some(None) for no bar at all. None for anything else — and for an area that was told nothing — whose texts then offer Copy and Select all.
Source§

fn region_toolbar( &self, _context: ToolbarContext, _width: f32, _range: (usize, usize), ) -> Option<(Rect, &dyn Widget<Msg>)>

The bar over the part of a selection area’s selection that lies in this widget — range, in characters — for context, and the box it is placed against in local coordinates, for a widget width wide. None for anything that is not a text, or when the list for context is empty.
Source§

fn takes_typing(&self) -> bool

Whether this widget takes typing: a field that can be changed, which is what the software keyboard is for. A text field that may only be read and selected — a read_only one, a Text made selectable — answers false: it has a caret and a selection, and no use for a keyboard sliding up over the words being read. Read more
Source§

fn replace_value(&self, _value: String) -> Option<Msg>

The message that puts value in this field: the one typing would have produced, for a value the framework restores rather than the user typing it. Read more
Source§

fn word_at(&self, _index: usize) -> Option<(usize, usize)>

Range (start, end) of the word around the given index (for double-click).
Source§

fn selection_handles( &self, _width: f32, _edit: &Edit, _scroll_y: f32, ) -> Option<[SelectionHandle; 2]>

The two handles of the selection in edit, start then end, for a field width wide whose content is scrolled down by scroll_y — where they are painted, and so where a finger takes them. None when there is no selection, or this is not a text field.
Source§

fn selection_toolbar( &self, _context: ToolbarContext, ) -> Option<&dyn Widget<Msg>>

The bar this field shows over its selection (Cut, Copy, Paste, Select all — see crate::ToolbarItem) for context, or None when there is none to show: this is not a text field, or the application’s list for that context is empty. Read more
Source§

fn selection_anchor( &self, _width: f32, _edit: &Edit, _scroll_y: f32, ) -> Option<Rect>

The box the bar is placed against, in the field’s local coordinates: the selection’s, or the caret’s when nothing is selected. Like selection_handles it is the paint’s own geometry.
Source§

fn edit_action(&self) -> Option<EditAction>

The editing action pressing this widget performs on the focused field, for a button of the bar that carries no message (see crate::EditAction).
Source§

fn shortcut_bindings(&self) -> &[(KeyStroke, Intent)]

Keystrokes this subtree binds to intents — see crate::Shortcuts.
Source§

fn shortcut_callbacks(&self) -> &[(KeyStroke, Msg)]

Keystrokes this subtree binds straight to messages — see crate::CallbackShortcuts.
Source§

fn action_bindings(&self) -> &[(Intent, Msg)]

Intents this subtree answers — see crate::Actions.
Source§

fn action_listeners(&self) -> &[(Intent, Msg)]

Intents this subtree watches without answering — see crate::ActionListener.
Source§

fn on_keystroke(&self) -> Option<Rc<dyn Fn(KeyStroke) -> Option<Msg>>>

Every keystroke reaching this subtree, handed to a closure — see crate::KeyboardListener. None (the default) is not a listener.
Source§

fn focusable(&self) -> bool

If true, the widget can take keyboard focus (click or Tab).
Source§

fn on_focus_change(&self, _focused: bool) -> Option<Msg>

Message for the focus arriving in or leaving this widget’s subtree (milestone 660) — the reference’s onFocusChange: true when the focused widget is now this one or inside it and was not, false the other way. The shell asks once a frame, after the focus has moved, every widget on the two paths from the root that the move changed, the one that lost it first.
Source§

fn on_tap_outside(&self) -> Option<Msg>

Message for a press outside this widget while it holds the focus (milestone 660) — the reference’s onTapOutside: sent before the press moves the focus.
Source§

fn autofocus(&self) -> bool

If true, a focusable widget takes the focus when it appears: a menu’s first row when the menu opens, a field on a screen made to type into (milestone 605). Where the focus came from is remembered, and it goes back there when this one goes.
Source§

fn descendants_focusable(&self) -> bool

If false, nothing inside this subtree can take focus — the reference’s ExcludeFocus. A dimmed panel behind a sheet is still drawn and still measured; it simply stops being somewhere Tab can land.
Source§

fn focus_skip_traversal(&self) -> bool

If true, this subtree’s focus stops are skipped by Tab while remaining focusable by a click — the reference’s ExcludeFocusTraversal. The two are separate questions: a toolbar button may be reachable with the pointer and still not belong in the keyboard’s order.
Source§

fn focus_order(&self) -> Option<f32>

A traversal order for this subtree’s focus stops, smallest first — the reference’s NumericFocusOrder. None leaves them in tree order, which is where everything sits until someone says otherwise.
Source§

fn focus_group(&self) -> bool

If true, this subtree is a traversal group: an order set inside it is resolved among its own members and nowhere else, so a reordered dialog does not reshuffle the page behind it.
Source§

fn autofill_hints(&self) -> &[AutofillHint]

What this field is for, so the platform can fill it in — see AutofillHint. Empty (the default) is a field that takes no part in autofill at all. Read more
Source§

fn autofill_group(&self) -> bool

If true, this subtree’s fields are one form — the reference’s AutofillGroup. A service shown a password with no username beside it has nothing to save the pair under.
Source§

fn draws_own_focus(&self) -> bool

If true, the widget draws its focus indicator itself (the driver then does not stroke the generic ring). E.g. TextField.
Source§

fn draggable(&self) -> bool

If true, the widget responds to pointer dragging (sliders, handles).
Source§

fn drag_track(&self) -> DragTrack

Where along a draggable widget its drag lands (milestone 648): how far in from each end the travel starts, and whether it runs from the right in a right-to-left reading direction. The fraction on_drag and its edges are given is measured along that travel. The default is the whole width, left to right.
Source§

fn on_thumb_drag( &self, _thumb: usize, _moment: ThumbDrag, _fraction: f32, ) -> Option<Msg>

Message for a moment of a drag on one of this widget’s thumbs (milestone 651), on a DragMode::Thumbs track: thumb is the one the press picked, 0 for the start, and fraction the pointer’s place along the travel. A press that has picked none yet sends nothing.
Source§

fn on_drag(&self, _fraction: f32) -> Option<Msg>

Message produced while dragging, fraction being the relative horizontal position (0.0..=1.0) within the widget’s bounds.
Source§

fn on_drag_start(&self, _fraction: f32) -> Option<Msg>

Message produced when a value drag begins — on the press, before the first on_drag. Read more
Source§

fn on_drag_end(&self, _fraction: f32) -> Option<Msg>

Message produced when a value drag ends — on the release, with the fraction the pointer finished on. Read more
Source§

fn on_drag_delta(&self, _dx: f32) -> Option<Msg>

Message produced by a horizontal drag expressed as a delta: dx is the movement (logical px) since the last event. For handles that accumulate (column resizing), unlike on_drag (an absolute fraction, e.g. a slider). The shell tries it before on_drag; a widget implements only one of the two.
Source§

fn hero_tag(&self) -> Option<u64>

If this widget is a shared element, its tag. Two heroes with the same tag on the two sides of a route transition are one thing in two places. See crate::Hero.
Source§

fn drag_payload(&self) -> Option<u64>

If this widget can be picked up and dropped elsewhere, what it carries. See crate::Draggable.
Source§

fn drag_needs_long_press(&self) -> bool

Does this item lift on a long press rather than on the first movement? The answer inside a scrollable, where a plain drag belongs to the scroll. Read more
Source§

fn drag_ghost_opacity(&self) -> f32

How solid the item left behind looks while a copy of it is being dragged.
Source§

fn on_dropped(&self, _accepted: bool) -> Option<Msg>

Message sent when a drag of this item ends, true if a target took it.
Source§

fn drop_zone(&self) -> bool

Is this widget a drop target? See crate::DragTarget.
Source§

fn accepts_drag(&self, _payload: u64) -> bool

Would this target take payload? Only asked of a drop target.
Source§

fn on_drop(&self, _payload: u64) -> Option<Msg>

Message sent when an accepted item is dropped on this target.
Source§

fn accepts_files(&self, _paths: &[PathBuf]) -> bool

Would this target take these files, dragged onto the window from outside the application? Only asked of a drop target; none takes files unless it says so. See crate::DragTarget::on_files.
Source§

fn on_files_dropped(&self, _paths: Vec<PathBuf>) -> Option<Msg>

Message sent when accepted files are dropped on this target.
Source§

fn reorder_index(&self) -> Option<usize>

If this widget is a reorderable header, its column index. The shell uses it to identify the source column (on press) and the target column (under the pointer on release) of a reordering drag.
Source§

fn on_reorder(&self, _to: usize) -> Option<Msg>

Message emitted when this header (the source) is dropped on column to. The widget knows its own index and the on_reorder(from, to) callback.
Source§

fn reorder_axis(&self) -> ReorderAxis

Movement axis of this reorderable (default ReorderAxis::Horizontal): the shell orients the drag preview (ghost + insertion indicator) accordingly. Kanban cards return ReorderAxis::Vertical.
Source§

fn reorder_inserts(&self) -> bool

Is a horizontal reorderable dropped between its neighbours, like a list’s row, rather than into the place of the one under the pointer, like a table’s column? false by default, which is the table. Read more
Source§

fn reorder_draggable(&self) -> bool

Can this reorderable be picked up as a drag source? true by default for every reorderable. A target-only slot — the drop zone at the end of a Kanban column — returns false: a card can be dropped there, not lifted from it (otherwise the drag would raise an empty ghost that moves nothing).
Source§

fn reorder_droppable(&self) -> bool

Can this reorderable be dropped onto? true by default, and the mirror image of reorder_draggable: a source-only grip — a list row’s drag handle — returns false. Read more
Source§

fn reorder_announcement(&self, _to: usize) -> Option<String>

What to say to a screen reader once this reorderable has been moved to to — the spoken counterpart of the ghost, for someone who cannot see it land. Read more
Source§

fn announce(&self) -> Option<String>

Text to announce to the screen reader when this widget is activated (mouse click or Enter/Space) — a live region reads it out loud. Describes the effect the activation produced (“Sorted by Name ascending”, “All rows selected”), for the blind user who cannot perceive the visual change. None = nothing to announce (the default).
Source§

fn stack(&self) -> bool

If true, the widget is a stack: its children are superimposed layers (the same box), rendered in order (the last one on top).
Source§

fn sticky_header(&self) -> bool

If true, the widget is a section with a sticky header (crate::StickyHeader): its first child is painted, and takes taps, at the top of what is visible of the section, over the second (milestone 602).
Source§

fn custom_layout(&self) -> Option<CustomLayout<'_>>

If the widget places its children with a function — a crate::CustomMultiChildLayout — the function and one key per child. The children are then laid out and placed in the walk, by the function, and not in this node’s layout (milestone 601).
Source§

fn continuous(&self) -> bool

If true, the widget animates continuously (driven by time, not by a target): the framework keeps redrawing. E.g. CircularProgressIndicator.
Source§

fn repaint_boundary(&self) -> bool

If true, this widget is a repaint boundary: its subtree is cached (primitives + interaction maps) and reused as is as long as its geometry and the interaction state of its descendants do not change — a widget animating elsewhere no longer forces it to repaint. See crate::Container::repaint_boundary and paintcache.rs.
Source§

fn scroll_content(&self) -> Option<&dyn Widget<Msg>>

If the widget is a scrollable container, returns its content.
Source§

fn virtual_list(&self, _viewport: Size) -> Option<VirtualList<'_, Msg>>

If the widget is a virtualised list, returns its description (item count, height, factory). Only the visible items are built.
Source§

fn page_view(&self) -> Option<PagedView<'_, Msg>>

If the widget is a paged view, returns its description (page count, axis, factory). Like a virtualised list, only the visible pages are built.
Source§

fn on_page_changed(&self, _page: usize) -> Option<Msg>

Message sent by a paged view when the page on screen changes.
Source§

fn on_scroll(&self, _position: ScrollPosition) -> Option<Msg>

Message sent by a scroll region when its offset changes — the reading half of crate::ScrollPosition. Read more
Source§

fn scroll_grain(&self) -> f32

How far this region must move before it says so again, in pixels; 0 — the default — reports every change. Read more
Source§

fn intrinsic(&self) -> Option<(IntrinsicAxis, Option<f32>)>

If the widget takes one axis from its content’s preferred size, returns that axis and the step its measurement is rounded up to. See crate::Intrinsic.
Source§

fn overflow_box(&self) -> Option<Overflow>

If the widget lays its child out to constraints of its own, which the child may exceed, returns them. See crate::OverflowBox.
Source§

fn constraints_transform(&self) -> Option<ConstraintsTransform>

The box this widget gives its child as a function of the box it was offered, with the child laid out in it separately and the box then sized to what came back. None — the default — means the child shares this node’s layout, as everything ordinary does. See crate::ConstraintsTransformBox.
Source§

fn animated_size(&self) -> Option<SizeAnimation>

If the box this widget’s constraints_transform makes follows its child’s size over time rather than at once, how (milestone 594). See crate::AnimatedSize.
Source§

fn size_factor(&self) -> Option<(f32, f32)>

If the box this widget’s constraints_transform makes is a multiple of its child’s size — (across, down), 1 for as big as the child — the multiples (milestones 596 and 597). See crate::SizeTransition and crate::Aligned::width_factor.
Source§

fn clips_to_box(&self) -> bool

Whether the box this widget’s constraints_transform makes cuts its child to itself. A reveal does; an anchor with a factor lets its child spill (milestone 597).
Source§

fn layout_builder(&self) -> Option<&dyn Fn(Size) -> Box<dyn Widget<Msg>>>

If the widget builds its content from its actual box, returns the size → widget factory. The content is built on the fly: no retained state and no overlay (like a virtualised list item).
Source§

fn scroll_overlay(&self) -> Option<&OverlayBuilder<Msg>>

If the widget draws something over its scroll region, returns the offset → overlay factory. See crate::ScrollOverlay. Read more
Source§

fn scroll_axis(&self) -> Axis

SingleChildScrollView axis (or axes), for a scrollable container.
Source§

fn scroll_physics(&self) -> Option<ScrollPhysics>

The edge and fling behaviour of a scrollable container, when this widget wants one in particular. None — the usual answer — leaves the choice to the application, which defaults to what the platform does.
Source§

fn scrollbars(&self) -> Option<Scrollbars>

Whether this area draws a scrollbar, when it wants its own answer rather than the application’s. None — the default — follows the application, which follows the platform. See crate::Scrollbars.
Source§

fn thumb_visibility(&self) -> Option<bool>

Keep this area’s scrollbar on screen, instead of letting it fade away when the area stops moving (scrollbar.dart:214). Read more
Source§

fn ime(&self) -> Ime

What the software keyboard should be, when this widget is the focused editable one. Read more
Source§

fn overlay(&self) -> Option<(&dyn Widget<Msg>, Placement)>

If the widget is a portal, returns its floating content and its placement.
Source§

fn overlay_dismiss(&self) -> Option<Msg>

Message emitted when the scrim of a modal is clicked (dismissal), if any.
Source§

fn overlay_scrim(&self, _theme: &Theme) -> Option<Color>

The colour of the scrim behind this widget’s modal overlay, when it wants one in particular. None — the usual answer — leaves it to the scheme’s scrim role at the framework’s own opacity. Read more
Source§

fn overlay_traps_focus(&self) -> bool

If true, this widget’s anchored overlay (a menu…) traps focus: Tab and the arrow keys cycle within its focusables while it is open (the keyboard pattern of menus). Modal (scrimmed) overlays already trap by default; a tooltip or an autocomplete list (focus stays on the field) do not. Default: false.
Source§

fn anim_target(&self) -> Option<f32>

Target of the widget’s own animated value (e.g. 1.0 for a switch that is on, 0.0 for off). The runtime drives the retained value towards this target and hands it back through Status::value. None = no animated value.
Source§

fn anim_transform(&self) -> Option<TransformValues>

Target transform of an animated one (Transform::animated): the runtime tweens the scales and the turn through anim_duration/anim_curve and hands the interpolated value back through Runtime::anim_transform, which the paint walk reads in place of the static transform_scale/transform_rotate. None = the transform does not move. Read more
Source§

fn anim_duration(&self) -> f32

Duration (seconds) of the animated value’s transition (anim_target). Default: the framework’s standard duration.
Source§

fn anim_curve(&self) -> Curve

Easing curve of the animated value’s transition (anim_target). Default: linear.
Source§

fn anim_initial(&self) -> Option<f32>

Where the animated value starts when the widget appears. None, the default: at its target, with no transition, so a switch shown on is simply on. A widget that plays something from its start when it appears — an animation — says Some(0.0), and the value travels to its target in anim_duration from the first frame (milestone 691).
Source§

fn opacity_group(&self) -> Option<f32>

If the widget is an opacity group, returns the (target) opacity [0,1] applied to its whole subtree as one: the paint walk wraps its primitives in a composited layer at that opacity — no double-blending where they overlap. None = not a group. Combined with anim_target, the opacity animates (a group fade).
Source§

fn anim_color(&self) -> Option<Color>

Target background colour of an animated background (Container::animated_color): the runtime tweens it (through anim_duration/anim_curve) and hands the interpolated value back in Status::anim_color. None = no animated colour.
Source§

fn anim_size(&self) -> Option<Size>

Target size of an animated size (Container::animated_size): the runtime tweens it (through anim_duration/anim_curve) and the interpolated size is injected at layout (see effective_style). None = fixed size.
Source§

fn anim_radius(&self) -> Option<BorderRadius>

Target corner radius of an animated radius (Container::animated_radius): the runtime tweens it and hands the interpolated value back in Status::anim_radius. None = fixed radius.
Source§

fn anim_padding(&self) -> Option<Insets>

Target padding of an animated padding (Container::animated_padding): the runtime tweens it and the interpolated padding is injected at layout (see effective_style). None = fixed padding.
Source§

fn anim_offset(&self) -> Option<(f32, f32)>

The pair of fractions this node’s offset rule is made of, animated: an alignment’s two fractions, or a slide’s. None — the default — leaves the rule reading the widget’s own numbers. Read more
Source§

fn anim_pins(&self) -> Option<Positioning>

Target pins of an animated stack layer (crate::AnimatedPositioned): the runtime tweens them and the interpolated pins are read where the stack lays its layers out. None — the default — leaves Widget::positioned alone. Read more
Source§

fn anim_fractions(&self) -> Option<(Option<f32>, Option<f32>)>

Target fractions of an animated share of the parent (FractionallySizedBox::animated), as (width factor, height factor): the runtime tweens them and the interpolated pair is injected at layout (see effective_style), like the size and the padding. None = fixed factors. Read more
Source§

fn anim_text_style(&self) -> Option<TextStyle>

Target text style an animated subtree is heading for (AnimatedDefaultTextStyle). None = the subtree inherits whatever it inherits. Read more
Source§

fn alignment_geometry(&self) -> Option<AlignmentGeometry>

Alignment of the single child within the box: the walk offsets the child through the free space according to the alignment’s fractions, resolved against the reading direction (physical or directional — see frus_core::AlignmentGeometry). Being continuous, a Tween<Alignment> read in view() slides the child. None = default flex placement.
Source§

fn transform_translate(&self) -> Option<(f32, f32)>

Paint offset (dx, dy) applied to the widget’s whole subtree: the render and the hit-test are offset without touching layout (siblings do not move, the child may overflow its box). Continuous → a Tween read in view() slides the subtree. None = no offset. See crate::Transform.
Source§

fn translate_fraction(&self) -> Option<(f32, f32)>

Paint offset as a fraction of the child’s own size (fx, fy): (0.5, 0.0) slides the subtree half its own width to the right. Added to Widget::transform_translate, and offsetting the render and the hit-test the same way, without touching layout. None = no offset. Read more
Source§

fn transform_scale(&self) -> Option<(f32, f32, Alignment)>

Paint scaling (sx, sy, pivot) of the whole subtree: the render and the hit-test are scaled — per axis — around the pivot (a frus_core::Alignment within the box), without touching layout. Stays axis-aligned (a scaled rect is still a rect). None = no scaling. See crate::Transform.
Source§

fn transform_rotate(&self) -> Option<(f32, Alignment)>

Paint rotation (angle, pivot) of the whole subtree: the subtree is painted rotated by angle radians (clockwise) around the pivot (a frus_core::Alignment within the box), without touching layout. The render goes through a rotated composited layer; the hit-test counter-rotates the point. None = no rotation. See crate::Transform.
Source§

fn clip_shape(&self) -> Option<ClipShape>

Shape clip of the whole subtree: the paint walk wraps its primitives in a composited layer whose frus_core::ClipShape (rounded corners, ellipse) modulates the alpha — whatever falls outside the shape is erased, edges antialiased. None = no shape clip. See crate::ClipRRect, crate::ClipOval.
Source§

fn style_themed(&self, _theme: &Theme) -> Style

The widget’s style once the theme has had its say — the layout half of the caller ?? theme ?? framework chain. Read more
Source§

fn theme_override(&self, _inherited: &Theme) -> Option<Box<Theme>>

The theme this widget imposes on itself and its subtree, given the one it inherits. None — the default — means “whatever came down from above”, which is what every widget but crate::Themed answers. Read more
Source§

fn media_override(&self, _inherited: MediaQuery) -> Option<MediaQuery>

The surface this widget imposes on itself and its subtree, given the one it inherits. None — the default — means “whatever came down from above”, which is what every widget but MediaScope answers. Read more
Source§

fn scaffold_override(&self) -> Option<ScaffoldInfo>

The shell this widget imposes on its subtree: what a Scaffold knows about itself and its slots do not. Read more
Source§

fn scroll_behavior_override(&self) -> Option<ScrollBehavior>

The ScrollBehavior this widget puts in force for its subtree, or None — the default — for whatever came down from above. Only ScrollConfiguration answers otherwise. Applied by the same four walks as Self::scaffold_override: the scrollables under it record what it decides when they are registered (milestone 616).
Source§

fn build_themed(&self, _theme: &Theme)

Builds this widget’s subtree from the ambient theme, for the widgets that defer that decision — see ThemeBuilder. Does nothing by default, which is what all but a handful of widgets want. Read more
Source§

fn build_in(&self, _id: WidgetId, _runtime: &Runtime, theme: &Theme)

Self::build_themed, for the few widgets that also need who they are and what the frame remembers to compose their subtree. An AnimatedSwitcher keeps what it is letting go of in the runtime, under its own identity, and that is reachable nowhere else before its children are read. Read more
Source§

fn expand(&self, _id: WidgetId, _runtime: &Runtime, _theme: &Theme)

Builds what this node stands for, before anything else is asked of it. Read more
Source§

fn switches(&self) -> bool

Whether this node is an AnimatedSwitcher. An identity is a position, so a switcher and the widget that comes to stand where it stood have the same one: this is how the runtime tells the switcher still being there from its having gone, and forgets what it kept for it.
Source§

fn system_ui_style(&self) -> Option<SystemUiOverlayStyle>

What the system bars over this widget should look like — see AnnotatedRegion. None for every widget but that one; a transparent wrapper forwards it, or a keyed region would say nothing.
Source§

fn ink(&self, _theme: &Theme) -> Option<InkStyle>

If the widget takes ink — the splash a tap leaves on a material surface — the shape and colour to splash in. None = no ink, which is the default: a widget has to ask. Read more
Source§

fn foreground(&self, _theme: &Theme) -> Option<BoxDecoration>

A decoration painted over this widget’s children rather than behind them: the reference’s foregroundDecoration. Read more
Source§

fn paints_over(&self) -> bool

Whether this widget paints over its own children too, with paint_over (milestone 652). false by default, which spares the walk the status it would compute for it.
Source§

fn paint_over( &self, _bounds: Rect, _status: Status, _theme: &Theme, _scene: &mut Scene, )

Paints over this widget’s children, after its subtree, in the box and with the status Widget::paint is given — the reference’s foregroundPainter, for what a widget draws that its children must not cover. A range slider’s thumbs are one: each thumb’s focus stop is a child, and the halo it paints belongs under the thumb. Read more
Source§

fn layer_filter(&self, _cx: FilterContext) -> Option<LayerFilter>

The pixel effects this widget applies to its whole subtree: a blur, a colour transform, a mask, or a filter over what is painted underneath. The paint walk drains the subtree into a composited layer and hands the filter to the renderer, exactly as it does for an opacity group or a shape clip. Read more
Source§

fn backdrop_group(&self) -> bool

true when this widget is a backdrop group: the backdrops below it that ask to be shared are filtered once between them. See crate::BackdropGroup.
Source§

fn text_baseline(&self, _theme: &Theme) -> Option<f32>

The widget’s own text baseline: the distance from the top of its box down to the line its letters sit on. None — the default — means this widget has no text of its own, and whatever is inside it answers instead. Read more
Source§

fn ignores_baseline(&self) -> bool

true when this subtree should be left out of a parent’s baseline alignment: it has a baseline, and the parent is to pretend it does not. An icon beside a label, where the label is what the row should line up on. See crate::IgnoreBaseline.
Source§

fn fill_axes(&self, _theme: &Theme) -> FillAxes

The axes this widget asks to fill: on each, it takes the room the parent leaves it rather than shrink-wrapping its children. FillAxes::NONE means shrink-wrap on both. Read more
Source§

fn soft_extent(&self) -> FillAxes

The axes on which this widget’s size is only a default (milestone 590): the room on offer replaces it wherever the widget is asked to fill that axis and the layout can grant it — alone in a box, or across a row or a column. Where it cannot, along a line shared with other children, the default stands. Read more
Source§

fn main_axis_floor(&self, _theme: &Theme) -> Option<f32>

The width below which this widget must not be squeezed when its parent runs horizontally — a line of text that would rather run past the end of a row than be folded into a column of single words. None means squeeze freely. Read more
Source§

fn tile_shape(&self) -> Option<f32>

If this container gives all of its children the shape of a tile, the width / height ratio to impose on each of them. None = each child keeps its own shape. Read more
Source§

fn positioned(&self) -> Option<Positioning>

If this is a layer pinned against its crate::Stack’s edges (crate::Positioned), what it pins. None = an ordinary layer, sized and placed by the stack’s own fit and alignment. Read more
Source§

fn stack_fit(&self) -> StackFit

How this stack sizes its unpinned layers (crate::StackFit). Unset, Passthrough: each is handed the stack’s box, and one with a size of its own keeps it. Meaningless unless Widget::stack is true.
Source§

fn stack_measured(&self) -> bool

Whether this stack is as big as its largest unpinned layer (milestone 639), as crate::Stack is, rather than the size its own style says. Meaningless unless Widget::stack is true.
Source§

fn stack_clips(&self) -> bool

Whether this stack cuts its layers at its edges. Unset, it does.
Source§

fn stack_direction(&self) -> Option<TextDirection>

The reading direction this stack resolves its alignment and its layers’ start and end pins in, when it names one. Unset, the theme’s.
Source§

fn stack_visible(&self) -> Option<usize>

Which layer of this stack is shown: the one at that index paints and takes input, and every other one is laid out and then silenced — not drawn, not clickable, not read out. None, the default, shows all of them. Read more
Source§

fn keep_visible(&self, _size: Size, _theme: &Theme) -> Option<KeepVisible>

The box this widget asks the scroll region around it to keep in view, in its own coordinates, with a key naming which box it is. Read more
Source§

fn scroll_reverse(&self) -> bool

Whether this scrollable runs from the far end (crate::SingleChildScrollView::reverse): the content is anchored to the end of the viewport and offsets are counted from there. Meaningless unless Widget::scroll_content is Some.
Source§

fn scroll_padding(&self) -> Insets

The insets a scrollable area puts around its content, inside the viewport. Read more
Source§

fn baseline_target(&self) -> Option<f32>

If the widget positions its child by the child’s baseline (crate::Baseline), the distance from the top of this box at which that baseline should land. None = not a baseline box.
Source§

fn clip_path(&self) -> Option<&Path>

If the widget clips its child to an arbitrary path (ClipPath), returns the path in local coordinates (origin at the box’s top-left corner). The walk offsets it to the screen and wraps it in a layer whose mask (the path) erases the outside. Takes priority over Widget::clip_shape. None = no path clip. See crate::ClipPath.
Source§

fn dismissible(&self) -> Option<DismissSpec>

If the widget is a dismissible item (crate::Dismissible), its configuration for this frame. The shell gives a mostly-sideways drag on it to the dismissal and a mostly-up-and-down one to the enclosing scrollable. None = not dismissible.
Source§

fn on_dismissed(&self, _direction: DismissDirection) -> Option<Msg>

The message a dismissed item dispatches, once it has flown out and its gap has closed. None = the swipe is shown but removes nothing.
Source§

fn sheet(&self) -> Option<&SheetSpec>

If the widget is the moving panel of a crate::DraggableScrollableSheet, its configuration for this frame. The layout makes it as tall as the retained height, and the shell shares a finger on it between the sheet and the scroll areas inside. None = not a sheet.
Source§

fn on_sheet_dismissed(&self) -> Option<Msg>

The message a sheet dispatches once it has been lowered to nothing. None = it cannot be dismissed, or says nothing when it is.
Source§

fn refresh(&self) -> Option<RefreshSpec>

If the widget is a refresh area (crate::RefreshIndicator), its configuration for this frame. Any scrollable inside it routes the movement its physics refuses at the top edge into the pull, instead of into the overscroll glow. None = not a refresh area.
Source§

fn on_refresh(&self) -> Option<Msg>

The message a refresh area dispatches when an armed pull is released. None = the pull is shown but asks for nothing, which is what an area still waiting for its on_refresh looks like.
Source§

fn barrier(&self) -> Option<ModalBarrier>

What the widget withholds from the frame on behalf of its whole subtree: input targets, primitives, accessibility nodes. The walk visits the subtree normally and then discards whatever it added to the selected registries, so a target registered deep inside is caught just as surely as one at the top. None = nothing withheld (the default). See crate::ModalBarrier, crate::IgnorePointer, crate::AbsorbPointer, crate::Visibility, crate::ExcludeSemantics.
Source§

fn interactive(&self) -> Option<(f32, f32)>

If the widget is an interactive viewport (InteractiveViewer), returns its scale bounds (min, max). The paint walk renders its child in a transformed layer (retained scale + translation, clipped to the viewport); the shell routes drag → pan and wheel/pinch → zoom. None = not an interactive viewport. See crate::InteractiveViewer.
Source§

fn fitted(&self) -> Option<BoxFit>

If the widget fits its child to its box (FittedBox), returns the frus_core::BoxFit: the walk measures the child at its natural size, scales it according to the fit and centres it (composited layer, hit-test through M⁻¹). None = not a fitter. See crate::FittedBox.
Source§

fn rotated_quarter_turns(&self) -> Option<i32>

If the widget rotates its child by quarter turns (RotatedBox), returns the number of quarters. Unlike Transform, this affects layout: the box swaps its dimensions for an odd number. None = not a RotatedBox. See crate::RotatedBox.
Source§

fn navigator(&self) -> Option<(f32, bool)>

If the widget is a screen navigator, returns (progress, push?). Its children ([screen] or [outgoing, incoming]) are rendered full-window with a sliding transition.
Source§

fn navigator_gesture(&self) -> bool

Whether a finger drives the navigator’s transition — a back gesture — so that it follows the finger linearly (milestone 620).
Source§

fn navigator_clips(&self) -> bool

Whether a navigator clips its pages to its own box. true, which is the reference’s default (Clip.hardEdge) and the only sane one: a screen sliding in comes from outside the box and has to stop at its edge. Read more
Source§

fn navigator_retained(&self) -> usize

How many of a navigator’s first children are kept but not shown: the pages under the one on show. They are built, so what their components hold survives, and they are not laid out, drawn or given input. 0, the default, is a navigator that shows every page it holds.
Source§

fn on_long_press(&self) -> Option<Msg>

Message emitted by a long press (a press held ~500 ms without movement). The long press pre-empts the click: the release that follows does not emit on_click.
Source§

fn on_double_tap(&self) -> Option<Msg>

Message emitted by a double tap: two taps on this widget in quick succession (within 300 ms and 100 px of each other, the reference’s numbers). While one is possible, a first tap’s on_click waits out those 300 ms, so that the second tap of a double tap is not also a tap.
Source§

fn on_secondary_tap(&self) -> Option<Msg>

Message emitted by a secondary tap: a click of the secondary mouse button, usually the right one.
Source§

fn pointer_listener(&self) -> bool

Whether this widget hears the pointer’s raw events (milestone 586): a press inside it, and then that pointer wherever it goes until it lifts; and a mouse’s hover.
Source§

fn on_pointer_event(&self, _event: ListenerEvent) -> Vec<Msg>

The messages for one raw event of the pointer, on a widget that is a pointer_listener. Several, when listeners wrap each other at the same place.
Source§

fn hover_region(&self) -> Option<HoverRegion>

Whether this widget is a region the mouse enters and leaves (milestone 583), and how: the cursor it asks for while the pointer is over it, and whether it hides the regions behind it. None for anything that is not one.
Source§

fn on_hover_event(&self, _event: HoverEvent) -> Option<Msg>

Message for the pointer entering, moving over or leaving this region — one whose hover_region is set.
Source§

fn pan_axis(&self) -> Option<PanAxis>

Which way this widget takes a drag, if it takes one at all (milestone 582): the shell then reports it through on_pan. Inside a scroll, a drag along the scroll’s axis stays the scroll’s unless this axis claims it.
Source§

fn on_pan(&self, _event: PanEvent) -> Option<Msg>

Message for one moment of a drag — its start, a movement, its end — on a widget whose pan_axis is set.
Source§

fn wants_title_bar(&self) -> bool

Whether this widget wants the title bar’s line for itself (milestone 640): a WindowMenuBar’s row. The shell gives it the line where the system allows it.
Source§

fn title_bar_role(&self) -> Option<TitleBarRole>

What this widget is to the system on the title bar’s line, which acts on it: the window’s icon or its three buttons (milestone 640).
Source§

fn pan_value(&self, _event: PanEvent, _value: f32, _rtl: bool) -> Option<f32>

A drag that moves this widget’s own animated value (anim_target) — a switch’s thumb following the finger (milestone 638). Given a moment of the drag, the value now and whether the text runs right to left, the value to hold it at; None leaves it alone. The shell holds the value there while the finger is down, and when it lifts lets it settle from there, asking on_value_release what that means.
Source§

fn on_value_release(&self, _value: f32) -> Option<Msg>

Message for a drag that moved this widget’s value letting go at value — a switch flips when its thumb was let go past half way (milestone 638).
Source§

fn on_key(&self, _key: &Key) -> KeyResponse<Msg>

Key received while bubbling leaf→root: the focused widget gets it first, then each ancestor as long as the response is Ignored. (E.g. an OverlayPortal consumes Escape to close itself.)
Source§

fn measure(&self, _theme: &Theme) -> Option<MeasureFn<'_>>

Measure under constraints: for a widget whose size depends on the space offered (a paragraph that wraps…), returns the closure wired into taffy. None = size fixed by style(). Contract: must be Some if and only if Widget::measure_key is. Read more
Source§

fn measure_key(&self, _theme: &Theme) -> Option<u64>

Fingerprint of the content Widget::measure depends on (text, style…), mixed into the relayout fingerprint: without it, two different contents with the same style would be conflated by the cache and would keep a stale geometry. Contract: Some if and only if measure() is. Read more

Auto Trait Implementations§

§

impl<Msg = Callback> !Freeze for NavigationRail<Msg>

§

impl<Msg = Callback> !RefUnwindSafe for NavigationRail<Msg>

§

impl<Msg = Callback> !Send for NavigationRail<Msg>

§

impl<Msg = Callback> !Sync for NavigationRail<Msg>

§

impl<Msg = Callback> !UnwindSafe for NavigationRail<Msg>

§

impl<Msg> Unpin for NavigationRail<Msg>
where Box<dyn Fn(usize) -> Msg>: Unpin, RefCell<Option<Box<dyn Widget<Msg>>>>: Unpin, OnceCell<Vec<Box<dyn Widget<Msg>>>>: Unpin,

§

impl<Msg> UnsafeUnpin for NavigationRail<Msg>
where Box<dyn Fn(usize) -> Msg>: UnsafeUnpin, RefCell<Option<Box<dyn Widget<Msg>>>>: UnsafeUnpin, OnceCell<Vec<Box<dyn Widget<Msg>>>>: UnsafeUnpin,

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.

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<Msg> IntoMsg<Msg> for Msg

Source§

fn defer(work: impl Fn() -> Msg + 'static) -> Msg

The message that stands for work’s result.
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.