pub struct RouterTask<CTX: 'static, COMP: Component<CTX>> { /* private fields */ }Expand description
TODO: A handle which helps to cancel the router. Uses removeEventListener
Implementations§
Source§impl<'a, CTX: 'a, COMP: Component<CTX>> RouterTask<CTX, COMP>
impl<'a, CTX: 'a, COMP: Component<CTX>> RouterTask<CTX, COMP>
Sourcepub fn new(
env: &mut Env<'a, CTX, COMP>,
route_fn: &'static dyn Fn(RouteInfo) -> COMP::Message,
) -> Self
pub fn new( env: &mut Env<'a, CTX, COMP>, route_fn: &'static dyn Fn(RouteInfo) -> COMP::Message, ) -> Self
Start the Routing Task in the environment.
Ownership of this Task should typically be put in the Model.
Routing will stop if this Task is dropped.
Sourcepub fn current_url(&self) -> Url
pub fn current_url(&self) -> Url
Retrieve the current url of the application.
Trait Implementations§
Auto Trait Implementations§
impl<CTX, COMP> Freeze for RouterTask<CTX, COMP>
impl<CTX, COMP> !RefUnwindSafe for RouterTask<CTX, COMP>
impl<CTX, COMP> !Send for RouterTask<CTX, COMP>
impl<CTX, COMP> !Sync for RouterTask<CTX, COMP>
impl<CTX, COMP> Unpin for RouterTask<CTX, COMP>
impl<CTX, COMP> !UnwindSafe for RouterTask<CTX, COMP>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more