Struct yew_simple::RouterTask
source · pub struct RouterTask<CTX: 'static, COMP: Component<CTX>> { /* private fields */ }
Expand description
TODO: A handle which helps to cancel the router. Uses removeEventListener
Implementations
sourceimpl<'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> !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
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more