Trait sycamore_router::Integration
source · [−]pub trait Integration {
fn current_pathname(&self) -> String;
fn on_popstate(&self, f: Box<dyn FnMut()>);
fn click_handler(&self) -> Box<dyn Fn(Event)>;
}
Expand description
A router integration provides the methods for adapting a router to a certain environment (e.g. history API).
Required methods
fn current_pathname(&self) -> String
fn current_pathname(&self) -> String
Get the current pathname.
fn on_popstate(&self, f: Box<dyn FnMut()>)
fn on_popstate(&self, f: Box<dyn FnMut()>)
Add a callback for listening to the popstate
event.
fn click_handler(&self) -> Box<dyn Fn(Event)>
fn click_handler(&self) -> Box<dyn Fn(Event)>
Get the click handler that is run when links are clicked.