/// This method accepts a given url and chooses the appropriate update for
/// the history depending of the `MoveStatus`.
/// It also resets the current move to Ready.
/// Mostly this method is used with the subscribe() in the init() in Seed.
/// ```rust
/// extern crate seed_routing;
/// #[macro_use]
///
/// use seed_routing::{View, *};
/// use seed::prelude::*;
/// add_router!();
/// // Empty Model for example
/// struct Model {
/// // Empty for example
/// }
///
/// fn init(url: Url, orders: &mut impl Orders<Msg>) -> Model {
///     orders.subscribe(Msg::UrlChanged);
///     router()
///     .init(url)
///     .subscribe(orders.subscribe_with_handle(
///         |subs::UrlChanged(changed_url)| router().confirm_navigation(changed_url), // <-- Confirmation called when we request a Url
///     ));
///
/// Model {
/// // Empty for example
/// }
///
/// }  
/// enum Msg {
///      UrlChanged(subs::UrlChanged),
/// }
///
/// #[derive(Debug, PartialEq, Clone,ParseUrl,WithDefaultRoute)]
///   pub enum Routes {
///     #[default_route]
///     NotFound
/// }
/// ```
This method accepts a given url and chooses the appropriate update for
the history depending of the `MoveStatus`.
It also resets the current move to Ready.
Mostly this method is used with the subscribe() in the init() in Seed.
```rust
extern crate seed_routing.
This method accepts a given url and chooses the appropriate update for the history depending of the ` MoveStatus ` . It also resets the current move to Ready . Mostly this method is used with the subscribe () in the init () in Seed . ` ` ` rust extern crate seed_routing .
pub fn confirm_navigation(&self, url: Url) {
        log!("ask route");
        match self.map_data(|data| data.current_move.clone()) {
            MoveStatus::Navigating | MoveStatus::Ready => {
                self.navigate_to_url(url);
            }
            MoveStatus::MovingBack => {
                self.back();
            }
            MoveStatus::MovingForward => {
                self.forward();
            }
        }
        self.update_data(|data| data.current_move = MoveStatus::Ready);
    }
pub fn confirm_navigation ( & self , url : Url ) { log ! ( " " ) ; match self . map_data ( | data | data . current_move . clone ( ) ) { MoveStatus :: Navigating | MoveStatus :: Ready => { self . navigate_to_url ( url ) ; } MoveStatus :: MovingBack => { self . back ( ) ; } MoveStatus :: MovingForward => { self . forward ( ) ; } } self . update_data ( | data | data . current_move = MoveStatus :: Ready ) ; }
This method accepts a given url and chooses the appropriate update for
the history depending of the `MoveStatus`.
This method accepts a given url and chooses the appropriate update for the history depending of the ` MoveStatus ` .
&self
url
Url
[macro_use]
use seed_routing::{View, *};
use seed::prelude::*;
add_router!();
Empty Model for example
struct Model {
Empty for example
}

fn init(url: Url, orders: &mut impl Orders) -> Model {
orders.subscribe(Msg::UrlChanged);
router()
.init(url)
.subscribe(orders.subscribe_with_handle(
|subs::UrlChanged(changed_url)| router().confirm_navigation(changed_url), // <-- Confirmation called when we request a Url
)).

Model {
Empty for example
}

}
enum Msg {
UrlChanged(subs::UrlChanged),
}
use seed_routing :: { View * } ; use seed :: prelude :: * ; add_router! () ; Empty Model for example struct Model { Empty for example } fn init ( url : Url orders : &mut impl Orders ) - > Model { orders . subscribe ( Msg :: UrlChanged ) ; router () . init ( url ) . subscribe ( orders . subscribe_with_handle ( |subs :: UrlChanged ( changed_url ) | router () . confirm_navigation ( changed_url ) // < -- Confirmation called when we request a Url )) . Model { Empty for example } } enum Msg { UrlChanged ( subs :: UrlChanged ) }
[derive(debug, partialeq, clone,parseurl,withdefaultroute)]
pub enum Routes {
[default_route]
NotFound
}
```
pub enum Routes { [ default_route ] NotFound } ` ` `