Struct vertigo::Driver [−][src]
pub struct Driver { /* fields omitted */ }
Expand description
Main connection to vertigo facilities - dependencies and rendering client (the browser).
This is in fact only a box for inner generic driver. This way a web developer don’t need to worry about the specific driver used, though usually it is BrowserDriver which is used to create a Driver.
Implementations
pub fn new(
dependencies: Dependencies,
driver: impl DriverTrait + 'static,
spawn_local: Box<dyn Fn(Pin<Box<dyn Future<Output = ()> + 'static>>)>
) -> Driver
Spawn a future - thus allowing to fire async functions in, for example, event handler. Handy when fetching resources from internet.
Retrieves the hash part of location URL from client (browser)
Sets the hash part of location URL from client (browser)
Set event handler upon hash location change
Make func
fire every time
seconds.
Create new RequestBuilder (more complex version of fetch)
pub fn websocket(
&self,
host: impl Into<String>,
callback: Box<dyn Fn(WebsocketMessage)>
) -> DropResource
pub fn websocket(
&self,
host: impl Into<String>,
callback: Box<dyn Fn(WebsocketMessage)>
) -> DropResource
Initiate a websocket connection. Provided callback should handle a single WebsocketMessage.
Create new reactive value in dependency graph.
Create new computed from provided value
Fire provided function in a way that all changes in graph made by this function will trigger only one run of updates, just like the changes were done all at once.
Create a value that is connected to a generator, where value
parameter is a starting value, and create
function takes care of updating it.
See game of life example.
Trait Implementations
Auto Trait Implementations
impl !RefUnwindSafe for Driver
impl !UnwindSafe for Driver
Blanket Implementations
Mutably borrows from an owned value. Read more