Feat: first work for rsx vscode ext
This commit is contained in:
1 parent
65d0d611ea
commit
2e626aea51
27 files changed
+4701
-31
No files matched your search
@@ -46,7 +46,5 @@ pub mod logger {
|
||||
.chain(std::io::stdout())
|
||||
.apply()
|
||||
.unwrap();
|
||||
|
||||
debug!("finished setting up logging! yay!");
|
||||
}
|
||||
}
|
||||
@@ -17,7 +17,6 @@ fn main() {
|
||||
|
||||
<head>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
</body>
|
||||
|
||||
|
||||
@@ -1,9 +1,6 @@
|
||||
fn main() {
|
||||
println!("Hello world!");
|
||||
println!("Hello world!");
|
||||
println!("Hello world!");
|
||||
println!("Hello world!");
|
||||
println!("Hello world!");
|
||||
println!("Hello world!");
|
||||
println!("Hello world!");
|
||||
}
|
||||
//! Example: Hello-web
|
||||
//! -----------------
|
||||
//!
|
||||
//! This example showcases Dioxus-websys to build interactive single-page-applications, much like React.
|
||||
|
||||
fn main() {}
|
||||
+7
-5
@@ -1,9 +1,11 @@
|
||||
//! Dioxus Router
|
||||
//! -------------
|
||||
//!
|
||||
//! This exmaple showcases the Dioxus Router hook. This hook makes it possible to using the browser's navigation API to
|
||||
//! display different content based on the Page's URL. The hook provides a configuration object that calls various
|
||||
//! specified callbacks whenever the page URL changes. Using this hook should feel like building a "URL directory", similar
|
||||
//! to how Tide handles paths.
|
||||
|
||||
use dioxus::prelude::*;
|
||||
|
||||
fn main() {
|
||||
// let mut app = App::new();
|
||||
|
||||
// app.at(c)
|
||||
}
|
||||
fn main() {}
|
||||
+21
-14
@@ -1,3 +1,6 @@
|
||||
//! Example: Tide Server-Side-Rendering
|
||||
//! -----------------------------------
|
||||
//!
|
||||
//! This demo shows how to use the to_string utility on VNodes to convert them into valid HTML.
|
||||
//! You can use the html! macro to craft webpages generated by the server on-the-fly.
|
||||
//!
|
||||
@@ -5,6 +8,7 @@
|
||||
//! thousands of simultaneous clients on minimal hardware.
|
||||
|
||||
use dioxus::prelude::*;
|
||||
use rand::Rng;
|
||||
use tide::{Request, Response};
|
||||
|
||||
#[async_std::main]
|
||||
@@ -18,35 +22,38 @@ async fn main() -> Result<(), std::io::Error> {
|
||||
// Launch the server
|
||||
let addr = "127.0.0.1:8080";
|
||||
log::info!("App is ready at {}", addr);
|
||||
log::info!("Navigate to an fibonacci number, like so http://localhost:8080/fib/21");
|
||||
log::info!("Navigate to a fibonacci number: http://{}/fib/21", addr);
|
||||
app.listen(addr).await?;
|
||||
|
||||
Ok(())
|
||||
}
|
||||
|
||||
fn fib(n: usize) -> usize {
|
||||
if n == 0 || n == 1 {
|
||||
n
|
||||
} else {
|
||||
fib(n - 1) + fib(n - 2)
|
||||
}
|
||||
}
|
||||
|
||||
/// Calculate the fibonacci number for a given request input
|
||||
async fn fibsum(req: Request<()>) -> tide::Result<tide::Response> {
|
||||
use std::time::Instant;
|
||||
let n: usize = req.param("n")?.parse().unwrap_or(0);
|
||||
|
||||
fn fib(n: usize) -> usize {
|
||||
if n == 0 || n == 1 {
|
||||
n
|
||||
} else {
|
||||
fib(n - 1) + fib(n - 2)
|
||||
}
|
||||
}
|
||||
|
||||
// Start a stopwatch
|
||||
// Compute the nth number in the fibonacci sequence
|
||||
// Stop the stopwatch
|
||||
let start = Instant::now();
|
||||
let start = std::time::Instant::now();
|
||||
let fib_n = fib(n);
|
||||
let duration = start.elapsed().as_nanos();
|
||||
|
||||
let mut rng = rand::thread_rng();
|
||||
use rand::Rng;
|
||||
let other_fib_to_try = rng.gen_range(1..42);
|
||||
// Generate another random number to try
|
||||
let other_fib_to_try = rand::thread_rng().gen_range(1..42);
|
||||
|
||||
let g = html! {
|
||||
<div>
|
||||
</div>
|
||||
};
|
||||
|
||||
let nodes = html! {
|
||||
<html>
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
//! Example: Webview Renderer
|
||||
//! -------------------------
|
||||
//!
|
||||
//! This example shows how to use the dioxus_webview crate to build a basic desktop application.
|
||||
//!
|
||||
|
||||
Reference in new issue
Block a user