Skip to main content

NavigationState

Struct NavigationState 

Source
pub struct NavigationState<Id> { /* private fields */ }

Implementations§

Source§

impl<Id: Copy + Eq> NavigationState<Id>

Source

pub fn new(selected: Id) -> Self

Examples found in repository?
examples/quickstart/app.rs (line 45)
43fn boot() -> App {
44    App {
45        navigation: navigation::NavigationState::new(Page::Home),
46        count: 0,
47    }
48}
More examples
Hide additional examples
examples/showcase/app.rs (line 175)
173    fn default() -> Self {
174        Self {
175            navigation: navigation::NavigationState::new(ShowcasePage::Inputs),
176            window_size: Size::new(1080.0, 980.0),
177            count: 0,
178            note: String::new(),
179            editor_content: material::widget::text_editor::Content::with_text(
180                "Material 3 multi-line text editor",
181            ),
182            select_choice: Some("Assist"),
183            combobox_options: material::widget::combobox::State::with_selection(
184                vec!["Assist", "Suggestion", "Filter"],
185                Some(&"Suggestion"),
186            ),
187            combobox_choice: Some("Suggestion"),
188            combobox_input: String::new(),
189            search_query: String::new(),
190            date_picker: material::widget::picker::DatePickerState::new(
191                material::widget::picker::Date::new(2026, 7, 4),
192            ),
193            date_range_picker: material::widget::picker::DateRangePickerState::new(
194                material::widget::picker::Date::new(2026, 7, 4),
195                material::widget::picker::Date::new(2026, 7, 10),
196            ),
197            time_picker: material::widget::picker::TimePickerState::new(14, 30, false),
198            progress: 42.0,
199            enabled: true,
200            radio_choice: Some(RadioChoice::Standard),
201            segment_choice: SegmentChoice::List,
202            segment_state: material::widget::segmented_button::State::new(
203                SegmentChoice::List.index(),
204            ),
205            primary_tab: TabChoice::Inputs,
206            primary_tab_state: material::widget::tabs::State::new(TabChoice::Inputs.index()),
207            secondary_tab: TabChoice::Controls,
208            secondary_tab_state: material::widget::tabs::State::new(TabChoice::Controls.index()),
209            progress_animation: material::widget::progress_bar::IndeterminateState::new(
210                Instant::now(),
211            ),
212            alert_dialog: material::widget::dialog::Transition::default(),
213            snackbar: material::widget::snackbar::Transition::default(),
214            theme_controller: theme_picker::ThemeController::default(),
215        }
216    }
Source

pub fn selected(&self) -> Id

Examples found in repository?
examples/quickstart/app.rs (line 68)
64fn view(app: &App) -> material::Element<'_, Message> {
65    navigation::suite(&DESTINATIONS, &app.navigation)
66        .window_size(WINDOW_SIZE)
67        .with_menu("Quick start", Message::Menu)
68        .view(Message::Open, app.navigation.selected().view(app))
69}
More examples
Hide additional examples
examples/showcase/pages/mod.rs (line 13)
12pub(super) fn view(state: &Showcase) -> material::Element<'_, Message> {
13    let page = state.navigation.selected();
14    let content = match page {
15        ShowcasePage::Inputs => inputs::view(state),
16        ShowcasePage::Controls => controls::view(state),
17        ShowcasePage::Feedback => feedback::view(state),
18        ShowcasePage::Surfaces => surfaces::view(),
19        ShowcasePage::Navigation => navigation::view(state),
20        ShowcasePage::Structure => structure::view(state),
21    };
22
23    material::widget::page::surface(header(page), content).into()
24}
examples/showcase/app.rs (line 394)
380fn subscription(state: &Showcase) -> Subscription<Message> {
381    let mut subscriptions =
382        vec![iced::window::resize_events().map(|(_id, size)| Message::WindowResized(size))];
383
384    if state.theme_controller.is_animating()
385        || state.navigation.is_animating()
386        || state.segment_state.is_animating()
387        || state.primary_tab_state.is_animating()
388        || state.secondary_tab_state.is_animating()
389        || state.alert_dialog.is_animating()
390        || state.snackbar.is_active()
391        || state.date_picker.is_animating()
392        || state.date_range_picker.is_animating()
393        || state.time_picker.is_animating()
394        || (state.navigation.selected() == ShowcasePage::Feedback
395            && state.progress_animation.is_animating())
396    {
397        subscriptions.push(iced::window::frames().map(Message::Frame));
398    }
399
400    Subscription::batch(subscriptions)
401}
Source

pub fn selection(&self) -> Selection<Id>

Examples found in repository?
examples/showcase/app.rs (line 225)
224    fn navigation_selection(&self) -> navigation::Selection<ShowcasePage> {
225        self.navigation.selection()
226    }
Source

pub fn select(&mut self, selected: Id, now: Instant, layout: AdaptiveLayout)

Examples found in repository?
examples/showcase/app.rs (line 238)
233fn update(state: &mut Showcase, message: Message) -> Task<Message> {
234    match message {
235        Message::Navigate(page) => {
236            state
237                .navigation
238                .select(page, Instant::now(), state.adaptive_navigation_layout());
239            Task::none()
240        }
241        Message::Increment => {
242            state.count += 1;
243            Task::none()
244        }
245        Message::Decrement => {
246            state.count -= 1;
247            Task::none()
248        }
249        Message::TextChanged(note) => {
250            state.note = note;
251            Task::none()
252        }
253        Message::EditorAction(action) => {
254            state.editor_content.perform(action);
255            Task::none()
256        }
257        Message::SelectChanged(choice) => {
258            state.select_choice = Some(choice);
259            Task::none()
260        }
261        Message::ComboboxSelected(choice) => {
262            state.combobox_choice = Some(choice);
263            state.combobox_input.clear();
264            state.combobox_options.set_selection(Some(&choice));
265            Task::none()
266        }
267        Message::ComboboxInputChanged(input) => {
268            state.combobox_options.set_input(input.clone());
269            state.combobox_input = input;
270            state.combobox_choice = None;
271            Task::none()
272        }
273        Message::SearchChanged(query) => {
274            state.search_query = query;
275            Task::none()
276        }
277        Message::DatePickerChanged(action) => state.date_picker.update_and_scroll(action),
278        Message::DateRangePickerChanged(action) => {
279            state.date_range_picker.update_and_scroll(action)
280        }
281        Message::TimePickerChanged(action) => {
282            state.time_picker.update(action);
283            Task::none()
284        }
285        Message::SliderChanged(progress) => {
286            state.progress = progress;
287            Task::none()
288        }
289        Message::EnabledChanged(enabled) => {
290            state.enabled = enabled;
291            Task::none()
292        }
293        Message::ChoiceSelected(choice) => {
294            state.radio_choice = Some(choice);
295            Task::none()
296        }
297        Message::SegmentSelected(choice) => {
298            state.segment_choice = choice;
299            state.segment_state.select(choice.index(), Instant::now());
300            Task::none()
301        }
302        Message::PrimaryTabSelected(choice) => {
303            state.primary_tab = choice;
304            state.primary_tab_state.select(
305                choice.index(),
306                Instant::now(),
307                material::widget::tabs::Variant::Primary,
308            );
309            Task::none()
310        }
311        Message::SecondaryTabSelected(choice) => {
312            state.secondary_tab = choice;
313            state.secondary_tab_state.select(
314                choice.index(),
315                Instant::now(),
316                material::widget::tabs::Variant::Secondary,
317            );
318            Task::none()
319        }
320        Message::MenuPressed => {
321            state.navigation.toggle_menu_now();
322            Task::none()
323        }
324        Message::DialogOpened => {
325            state.alert_dialog.show(Instant::now());
326            Task::none()
327        }
328        Message::DialogDismissed => {
329            state.alert_dialog.dismiss(Instant::now());
330            Task::none()
331        }
332        Message::DialogConfirmed => {
333            state.alert_dialog.dismiss(Instant::now());
334            state.count += 1;
335            Task::none()
336        }
337        Message::ShowSnackbar => {
338            state.snackbar.show(Instant::now());
339            Task::none()
340        }
341        Message::SnackbarUndo => {
342            state.count -= 1;
343            state.snackbar.dismiss(Instant::now());
344            Task::none()
345        }
346        Message::WindowResized(size) => {
347            state.window_size = size;
348            Task::none()
349        }
350        Message::ThemeChanged(action) => {
351            state.theme_controller.update(
352                action,
353                state.window_size,
354                theme_picker::bottom_margin(state.adaptive_navigation_layout()),
355                Instant::now(),
356            );
357            Task::none()
358        }
359        Message::Frame(now) => {
360            let _ = state.theme_controller.advance(now);
361            let _ = state.navigation.advance(now);
362            let _ = state.segment_state.advance(now);
363            let _ = state.primary_tab_state.advance(now);
364            let _ = state.secondary_tab_state.advance(now);
365            state.progress_animation.advance(now);
366            let _ = state.alert_dialog.advance(now);
367            let _ = state.snackbar.advance(now);
368            let _ = state.date_picker.advance(now);
369            let _ = state.date_range_picker.advance(now);
370            let _ = state.time_picker.advance(now);
371            Task::none()
372        }
373    }
374}
Source

pub fn select_for_size(&mut self, selected: Id, now: Instant, size: Size)

Source

pub fn select_now_for_size(&mut self, selected: Id, size: Size)

Examples found in repository?
examples/quickstart/app.rs (line 52)
50fn update(app: &mut App, message: Message) {
51    match message {
52        Message::Open(page) => app.navigation.select_now_for_size(page, WINDOW_SIZE),
53        Message::Increment => app.count += 1,
54        Message::Decrement => app.count -= 1,
55        Message::Menu => app.navigation.toggle_menu_now(),
56        Message::Frame(now) => app.navigation.advance_frame(now),
57    }
58}
Source

pub fn toggle_menu(&mut self, now: Instant)

Source

pub fn toggle_menu_now(&mut self)

Examples found in repository?
examples/quickstart/app.rs (line 55)
50fn update(app: &mut App, message: Message) {
51    match message {
52        Message::Open(page) => app.navigation.select_now_for_size(page, WINDOW_SIZE),
53        Message::Increment => app.count += 1,
54        Message::Decrement => app.count -= 1,
55        Message::Menu => app.navigation.toggle_menu_now(),
56        Message::Frame(now) => app.navigation.advance_frame(now),
57    }
58}
More examples
Hide additional examples
examples/showcase/app.rs (line 321)
233fn update(state: &mut Showcase, message: Message) -> Task<Message> {
234    match message {
235        Message::Navigate(page) => {
236            state
237                .navigation
238                .select(page, Instant::now(), state.adaptive_navigation_layout());
239            Task::none()
240        }
241        Message::Increment => {
242            state.count += 1;
243            Task::none()
244        }
245        Message::Decrement => {
246            state.count -= 1;
247            Task::none()
248        }
249        Message::TextChanged(note) => {
250            state.note = note;
251            Task::none()
252        }
253        Message::EditorAction(action) => {
254            state.editor_content.perform(action);
255            Task::none()
256        }
257        Message::SelectChanged(choice) => {
258            state.select_choice = Some(choice);
259            Task::none()
260        }
261        Message::ComboboxSelected(choice) => {
262            state.combobox_choice = Some(choice);
263            state.combobox_input.clear();
264            state.combobox_options.set_selection(Some(&choice));
265            Task::none()
266        }
267        Message::ComboboxInputChanged(input) => {
268            state.combobox_options.set_input(input.clone());
269            state.combobox_input = input;
270            state.combobox_choice = None;
271            Task::none()
272        }
273        Message::SearchChanged(query) => {
274            state.search_query = query;
275            Task::none()
276        }
277        Message::DatePickerChanged(action) => state.date_picker.update_and_scroll(action),
278        Message::DateRangePickerChanged(action) => {
279            state.date_range_picker.update_and_scroll(action)
280        }
281        Message::TimePickerChanged(action) => {
282            state.time_picker.update(action);
283            Task::none()
284        }
285        Message::SliderChanged(progress) => {
286            state.progress = progress;
287            Task::none()
288        }
289        Message::EnabledChanged(enabled) => {
290            state.enabled = enabled;
291            Task::none()
292        }
293        Message::ChoiceSelected(choice) => {
294            state.radio_choice = Some(choice);
295            Task::none()
296        }
297        Message::SegmentSelected(choice) => {
298            state.segment_choice = choice;
299            state.segment_state.select(choice.index(), Instant::now());
300            Task::none()
301        }
302        Message::PrimaryTabSelected(choice) => {
303            state.primary_tab = choice;
304            state.primary_tab_state.select(
305                choice.index(),
306                Instant::now(),
307                material::widget::tabs::Variant::Primary,
308            );
309            Task::none()
310        }
311        Message::SecondaryTabSelected(choice) => {
312            state.secondary_tab = choice;
313            state.secondary_tab_state.select(
314                choice.index(),
315                Instant::now(),
316                material::widget::tabs::Variant::Secondary,
317            );
318            Task::none()
319        }
320        Message::MenuPressed => {
321            state.navigation.toggle_menu_now();
322            Task::none()
323        }
324        Message::DialogOpened => {
325            state.alert_dialog.show(Instant::now());
326            Task::none()
327        }
328        Message::DialogDismissed => {
329            state.alert_dialog.dismiss(Instant::now());
330            Task::none()
331        }
332        Message::DialogConfirmed => {
333            state.alert_dialog.dismiss(Instant::now());
334            state.count += 1;
335            Task::none()
336        }
337        Message::ShowSnackbar => {
338            state.snackbar.show(Instant::now());
339            Task::none()
340        }
341        Message::SnackbarUndo => {
342            state.count -= 1;
343            state.snackbar.dismiss(Instant::now());
344            Task::none()
345        }
346        Message::WindowResized(size) => {
347            state.window_size = size;
348            Task::none()
349        }
350        Message::ThemeChanged(action) => {
351            state.theme_controller.update(
352                action,
353                state.window_size,
354                theme_picker::bottom_margin(state.adaptive_navigation_layout()),
355                Instant::now(),
356            );
357            Task::none()
358        }
359        Message::Frame(now) => {
360            let _ = state.theme_controller.advance(now);
361            let _ = state.navigation.advance(now);
362            let _ = state.segment_state.advance(now);
363            let _ = state.primary_tab_state.advance(now);
364            let _ = state.secondary_tab_state.advance(now);
365            state.progress_animation.advance(now);
366            let _ = state.alert_dialog.advance(now);
367            let _ = state.snackbar.advance(now);
368            let _ = state.date_picker.advance(now);
369            let _ = state.date_range_picker.advance(now);
370            let _ = state.time_picker.advance(now);
371            Task::none()
372        }
373    }
374}
Source

pub fn is_menu_open(&self) -> bool

Source

pub fn is_menu_visible(&self) -> bool

Source

pub fn menu_progress(&self) -> f32

Source

pub fn is_animating(&self) -> bool

Examples found in repository?
examples/showcase/app.rs (line 385)
380fn subscription(state: &Showcase) -> Subscription<Message> {
381    let mut subscriptions =
382        vec![iced::window::resize_events().map(|(_id, size)| Message::WindowResized(size))];
383
384    if state.theme_controller.is_animating()
385        || state.navigation.is_animating()
386        || state.segment_state.is_animating()
387        || state.primary_tab_state.is_animating()
388        || state.secondary_tab_state.is_animating()
389        || state.alert_dialog.is_animating()
390        || state.snackbar.is_active()
391        || state.date_picker.is_animating()
392        || state.date_range_picker.is_animating()
393        || state.time_picker.is_animating()
394        || (state.navigation.selected() == ShowcasePage::Feedback
395            && state.progress_animation.is_animating())
396    {
397        subscriptions.push(iced::window::frames().map(Message::Frame));
398    }
399
400    Subscription::batch(subscriptions)
401}
Source

pub fn subscription<Message, F>(&self, on_frame: F) -> Subscription<Message>
where Message: 'static, F: Fn(Instant) -> Message + Send + Clone + 'static,

Examples found in repository?
examples/quickstart/app.rs (line 61)
60fn subscription(app: &App) -> iced::Subscription<Message> {
61    app.navigation.subscription(Message::Frame)
62}
Source

pub fn advance(&mut self, now: Instant) -> bool

Examples found in repository?
examples/showcase/app.rs (line 361)
233fn update(state: &mut Showcase, message: Message) -> Task<Message> {
234    match message {
235        Message::Navigate(page) => {
236            state
237                .navigation
238                .select(page, Instant::now(), state.adaptive_navigation_layout());
239            Task::none()
240        }
241        Message::Increment => {
242            state.count += 1;
243            Task::none()
244        }
245        Message::Decrement => {
246            state.count -= 1;
247            Task::none()
248        }
249        Message::TextChanged(note) => {
250            state.note = note;
251            Task::none()
252        }
253        Message::EditorAction(action) => {
254            state.editor_content.perform(action);
255            Task::none()
256        }
257        Message::SelectChanged(choice) => {
258            state.select_choice = Some(choice);
259            Task::none()
260        }
261        Message::ComboboxSelected(choice) => {
262            state.combobox_choice = Some(choice);
263            state.combobox_input.clear();
264            state.combobox_options.set_selection(Some(&choice));
265            Task::none()
266        }
267        Message::ComboboxInputChanged(input) => {
268            state.combobox_options.set_input(input.clone());
269            state.combobox_input = input;
270            state.combobox_choice = None;
271            Task::none()
272        }
273        Message::SearchChanged(query) => {
274            state.search_query = query;
275            Task::none()
276        }
277        Message::DatePickerChanged(action) => state.date_picker.update_and_scroll(action),
278        Message::DateRangePickerChanged(action) => {
279            state.date_range_picker.update_and_scroll(action)
280        }
281        Message::TimePickerChanged(action) => {
282            state.time_picker.update(action);
283            Task::none()
284        }
285        Message::SliderChanged(progress) => {
286            state.progress = progress;
287            Task::none()
288        }
289        Message::EnabledChanged(enabled) => {
290            state.enabled = enabled;
291            Task::none()
292        }
293        Message::ChoiceSelected(choice) => {
294            state.radio_choice = Some(choice);
295            Task::none()
296        }
297        Message::SegmentSelected(choice) => {
298            state.segment_choice = choice;
299            state.segment_state.select(choice.index(), Instant::now());
300            Task::none()
301        }
302        Message::PrimaryTabSelected(choice) => {
303            state.primary_tab = choice;
304            state.primary_tab_state.select(
305                choice.index(),
306                Instant::now(),
307                material::widget::tabs::Variant::Primary,
308            );
309            Task::none()
310        }
311        Message::SecondaryTabSelected(choice) => {
312            state.secondary_tab = choice;
313            state.secondary_tab_state.select(
314                choice.index(),
315                Instant::now(),
316                material::widget::tabs::Variant::Secondary,
317            );
318            Task::none()
319        }
320        Message::MenuPressed => {
321            state.navigation.toggle_menu_now();
322            Task::none()
323        }
324        Message::DialogOpened => {
325            state.alert_dialog.show(Instant::now());
326            Task::none()
327        }
328        Message::DialogDismissed => {
329            state.alert_dialog.dismiss(Instant::now());
330            Task::none()
331        }
332        Message::DialogConfirmed => {
333            state.alert_dialog.dismiss(Instant::now());
334            state.count += 1;
335            Task::none()
336        }
337        Message::ShowSnackbar => {
338            state.snackbar.show(Instant::now());
339            Task::none()
340        }
341        Message::SnackbarUndo => {
342            state.count -= 1;
343            state.snackbar.dismiss(Instant::now());
344            Task::none()
345        }
346        Message::WindowResized(size) => {
347            state.window_size = size;
348            Task::none()
349        }
350        Message::ThemeChanged(action) => {
351            state.theme_controller.update(
352                action,
353                state.window_size,
354                theme_picker::bottom_margin(state.adaptive_navigation_layout()),
355                Instant::now(),
356            );
357            Task::none()
358        }
359        Message::Frame(now) => {
360            let _ = state.theme_controller.advance(now);
361            let _ = state.navigation.advance(now);
362            let _ = state.segment_state.advance(now);
363            let _ = state.primary_tab_state.advance(now);
364            let _ = state.secondary_tab_state.advance(now);
365            state.progress_animation.advance(now);
366            let _ = state.alert_dialog.advance(now);
367            let _ = state.snackbar.advance(now);
368            let _ = state.date_picker.advance(now);
369            let _ = state.date_range_picker.advance(now);
370            let _ = state.time_picker.advance(now);
371            Task::none()
372        }
373    }
374}
Source

pub fn advance_frame(&mut self, now: Instant)

Examples found in repository?
examples/quickstart/app.rs (line 56)
50fn update(app: &mut App, message: Message) {
51    match message {
52        Message::Open(page) => app.navigation.select_now_for_size(page, WINDOW_SIZE),
53        Message::Increment => app.count += 1,
54        Message::Decrement => app.count -= 1,
55        Message::Menu => app.navigation.toggle_menu_now(),
56        Message::Frame(now) => app.navigation.advance_frame(now),
57    }
58}

Trait Implementations§

Source§

impl<Id: Clone> Clone for NavigationState<Id>

Source§

fn clone(&self) -> NavigationState<Id>

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<Id: Copy> Copy for NavigationState<Id>

Source§

impl<Id: Debug> Debug for NavigationState<Id>

Source§

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

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl<Id> Freeze for NavigationState<Id>
where Id: Freeze,

§

impl<Id> RefUnwindSafe for NavigationState<Id>
where Id: RefUnwindSafe,

§

impl<Id> Send for NavigationState<Id>
where Id: Send,

§

impl<Id> Sync for NavigationState<Id>
where Id: Sync,

§

impl<Id> Unpin for NavigationState<Id>
where Id: Unpin,

§

impl<Id> UnsafeUnpin for NavigationState<Id>
where Id: UnsafeUnpin,

§

impl<Id> UnwindSafe for NavigationState<Id>
where Id: UnwindSafe,

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

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

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

impl<T> 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 + Send + Sync>

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<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

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<State, Message> IntoBoot<State, Message> for State

Source§

fn into_boot(self) -> (State, Task<Message>)

Turns some type into the initial state of some Application.
Source§

impl<T> MaybeClone for T

Source§

impl<T> MaybeDebug for T

Source§

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

Source§

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

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

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

Source§

type Error = Infallible

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

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

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