repo stringlengths 6 65 | file_url stringlengths 81 311 | file_path stringlengths 6 227 | content stringlengths 0 32.8k | language stringclasses 1
value | license stringclasses 7
values | commit_sha stringlengths 40 40 | retrieved_at stringdate 2026-01-04 15:31:58 2026-01-04 20:25:31 | truncated bool 2
classes |
|---|---|---|---|---|---|---|---|---|
yewstack/yew | https://github.com/yewstack/yew/blob/2019f4577cbdcd389b34973fdec3164be3af941a/packages/yew-macro/tests/classes_macro/classes-fail.rs | packages/yew-macro/tests/classes_macro/classes-fail.rs | use yew::prelude::*;
fn compile_pass() {
classes!(42);
classes!(42.0);
classes!("one" "two");
classes!(vec![42]);
let some = Some(42);
let none: Option<u32> = None;
classes!(some);
classes!(none);
classes!("one", 42);
classes!("one", "two three", "four");
}
fn main() {}
| rust | Apache-2.0 | 2019f4577cbdcd389b34973fdec3164be3af941a | 2026-01-04T15:33:05.007302Z | false |
yewstack/yew | https://github.com/yewstack/yew/blob/2019f4577cbdcd389b34973fdec3164be3af941a/packages/yew-macro/tests/derive_props/fail.rs | packages/yew-macro/tests/derive_props/fail.rs | #![recursion_limit = "128"]
use yew::prelude::*;
mod t1 {
use super::*;
#[derive(Clone)]
struct Value;
#[derive(Clone, Properties, PartialEq)]
pub struct Props {
// ERROR: optional params must implement default
#[prop_or_default]
value: Value,
}
}
mod t2 {
use supe... | rust | Apache-2.0 | 2019f4577cbdcd389b34973fdec3164be3af941a | 2026-01-04T15:33:05.007302Z | false |
yewstack/yew | https://github.com/yewstack/yew/blob/2019f4577cbdcd389b34973fdec3164be3af941a/packages/yew-macro/tests/derive_props/pass.rs | packages/yew-macro/tests/derive_props/pass.rs | #![recursion_limit = "128"]
// Shadow primitives
#[allow(non_camel_case_types)]
pub struct bool;
#[allow(non_camel_case_types)]
pub struct char;
#[allow(non_camel_case_types)]
pub struct f32;
#[allow(non_camel_case_types)]
pub struct f64;
#[allow(non_camel_case_types)]
pub struct i128;
#[allow(non_camel_case_types)]
p... | rust | Apache-2.0 | 2019f4577cbdcd389b34973fdec3164be3af941a | 2026-01-04T15:33:05.007302Z | false |
yewstack/yew | https://github.com/yewstack/yew/blob/2019f4577cbdcd389b34973fdec3164be3af941a/packages/yew-macro/tests/html_lints/fail.rs | packages/yew-macro/tests/html_lints/fail.rs | use yew::prelude::*;
fn main() {
let bad_a = html! {
<a>{ "I don't have a href attribute" }</a>
};
let bad_a_2 = html! {
<a href="#">{ "I have a malformed href attribute" }</a>
};
let bad_a_3 = html! {
<a href="javascript:void(0)">{ "I have a malformed href attribute" }</a>
... | rust | Apache-2.0 | 2019f4577cbdcd389b34973fdec3164be3af941a | 2026-01-04T15:33:05.007302Z | false |
yewstack/yew | https://github.com/yewstack/yew/blob/2019f4577cbdcd389b34973fdec3164be3af941a/packages/yew-macro/tests/html_macro/generic-component-pass.rs | packages/yew-macro/tests/html_macro/generic-component-pass.rs | #![no_implicit_prelude]
// Shadow primitives
#[allow(non_camel_case_types)]
pub struct bool;
#[allow(non_camel_case_types)]
pub struct char;
#[allow(non_camel_case_types)]
pub struct f32;
#[allow(non_camel_case_types)]
pub struct f64;
#[allow(non_camel_case_types)]
pub struct i128;
#[allow(non_camel_case_types)]
pub s... | rust | Apache-2.0 | 2019f4577cbdcd389b34973fdec3164be3af941a | 2026-01-04T15:33:05.007302Z | false |
yewstack/yew | https://github.com/yewstack/yew/blob/2019f4577cbdcd389b34973fdec3164be3af941a/packages/yew-macro/tests/html_macro/component-fail.rs | packages/yew-macro/tests/html_macro/component-fail.rs | use yew::html::ChildrenRenderer;
use yew::prelude::*;
#[derive(Clone, Properties, PartialEq)]
pub struct ChildProperties {
#[prop_or_default]
pub string: String,
pub int: i32,
}
pub struct Child;
impl Component for Child {
type Message = ();
type Properties = ChildProperties;
fn create(_ctx: ... | rust | Apache-2.0 | 2019f4577cbdcd389b34973fdec3164be3af941a | 2026-01-04T15:33:05.007302Z | false |
yewstack/yew | https://github.com/yewstack/yew/blob/2019f4577cbdcd389b34973fdec3164be3af941a/packages/yew-macro/tests/html_macro/dyn-element-pass.rs | packages/yew-macro/tests/html_macro/dyn-element-pass.rs | #![no_implicit_prelude]
// Shadow primitives
#[allow(non_camel_case_types)]
pub struct bool;
#[allow(non_camel_case_types)]
pub struct char;
#[allow(non_camel_case_types)]
pub struct f32;
#[allow(non_camel_case_types)]
pub struct f64;
#[allow(non_camel_case_types)]
pub struct i128;
#[allow(non_camel_case_types)]
pub s... | rust | Apache-2.0 | 2019f4577cbdcd389b34973fdec3164be3af941a | 2026-01-04T15:33:05.007302Z | false |
yewstack/yew | https://github.com/yewstack/yew/blob/2019f4577cbdcd389b34973fdec3164be3af941a/packages/yew-macro/tests/html_macro/node-pass.rs | packages/yew-macro/tests/html_macro/node-pass.rs | #![no_implicit_prelude]
// Shadow primitives
#[allow(non_camel_case_types)]
pub struct bool;
#[allow(non_camel_case_types)]
pub struct char;
#[allow(non_camel_case_types)]
pub struct f32;
#[allow(non_camel_case_types)]
pub struct f64;
#[allow(non_camel_case_types)]
pub struct i128;
#[allow(non_camel_case_types)]
pub s... | rust | Apache-2.0 | 2019f4577cbdcd389b34973fdec3164be3af941a | 2026-01-04T15:33:05.007302Z | false |
yewstack/yew | https://github.com/yewstack/yew/blob/2019f4577cbdcd389b34973fdec3164be3af941a/packages/yew-macro/tests/html_macro/component-unimplemented-fail.rs | packages/yew-macro/tests/html_macro/component-unimplemented-fail.rs | use yew::prelude::*;
struct Unimplemented;
fn compile_fail() {
html! { <Unimplemented /> };
}
fn main() {}
| rust | Apache-2.0 | 2019f4577cbdcd389b34973fdec3164be3af941a | 2026-01-04T15:33:05.007302Z | false |
yewstack/yew | https://github.com/yewstack/yew/blob/2019f4577cbdcd389b34973fdec3164be3af941a/packages/yew-macro/tests/html_macro/for-pass.rs | packages/yew-macro/tests/html_macro/for-pass.rs | #![no_implicit_prelude]
// Shadow primitives
#[allow(non_camel_case_types)]
pub struct bool;
#[allow(non_camel_case_types)]
pub struct char;
#[allow(non_camel_case_types)]
pub struct f32;
#[allow(non_camel_case_types)]
pub struct f64;
#[allow(non_camel_case_types)]
pub struct i128;
#[allow(non_camel_case_types)]
pub s... | rust | Apache-2.0 | 2019f4577cbdcd389b34973fdec3164be3af941a | 2026-01-04T15:33:05.007302Z | false |
yewstack/yew | https://github.com/yewstack/yew/blob/2019f4577cbdcd389b34973fdec3164be3af941a/packages/yew-macro/tests/html_macro/component-any-children-pass.rs | packages/yew-macro/tests/html_macro/component-any-children-pass.rs | // Shadow primitives
#[allow(non_camel_case_types)]
pub struct bool;
#[allow(non_camel_case_types)]
pub struct char;
#[allow(non_camel_case_types)]
pub struct f32;
#[allow(non_camel_case_types)]
pub struct f64;
#[allow(non_camel_case_types)]
pub struct i128;
#[allow(non_camel_case_types)]
pub struct i16;
#[allow(non_ca... | rust | Apache-2.0 | 2019f4577cbdcd389b34973fdec3164be3af941a | 2026-01-04T15:33:05.007302Z | false |
yewstack/yew | https://github.com/yewstack/yew/blob/2019f4577cbdcd389b34973fdec3164be3af941a/packages/yew-macro/tests/html_macro/block-fail.rs | packages/yew-macro/tests/html_macro/block-fail.rs | use yew::prelude::*;
fn compile_fail() {
html! {
<>
{ () }
</>
};
let not_tree = || ();
html! {
<div>{ not_tree() }</div>
};
html! {
<>{ for (0..3).map(|_| not_tree()) }</>
};
}
fn main() {}
| rust | Apache-2.0 | 2019f4577cbdcd389b34973fdec3164be3af941a | 2026-01-04T15:33:05.007302Z | false |
yewstack/yew | https://github.com/yewstack/yew/blob/2019f4577cbdcd389b34973fdec3164be3af941a/packages/yew-macro/tests/html_macro/list-fail.rs | packages/yew-macro/tests/html_macro/list-fail.rs | use yew::prelude::*;
fn compile_fail() {
// missing closing tag
html! { <> };
html! { <><> };
html! { <><></> };
// missing starting tag
html! { </> };
html! { </></> };
// multiple root nodes
html! { <></><></> };
// invalid child content
html! { <>invalid</> };
// no... | rust | Apache-2.0 | 2019f4577cbdcd389b34973fdec3164be3af941a | 2026-01-04T15:33:05.007302Z | false |
yewstack/yew | https://github.com/yewstack/yew/blob/2019f4577cbdcd389b34973fdec3164be3af941a/packages/yew-macro/tests/html_macro/iterable-fail.rs | packages/yew-macro/tests/html_macro/iterable-fail.rs | use yew::prelude::*;
fn compile_fail() {
html! { for };
html! { for () };
html! { {for ()} };
html! { for Vec::<()>::new().into_iter() };
let empty = Vec::<()>::new().into_iter();
html! { for empty };
let empty = Vec::<()>::new();
html! { {for empty.iter()} };
html! {
<>
... | rust | Apache-2.0 | 2019f4577cbdcd389b34973fdec3164be3af941a | 2026-01-04T15:33:05.007302Z | false |
yewstack/yew | https://github.com/yewstack/yew/blob/2019f4577cbdcd389b34973fdec3164be3af941a/packages/yew-macro/tests/html_macro/html-node-pass.rs | packages/yew-macro/tests/html_macro/html-node-pass.rs | #![no_implicit_prelude]
// Shadow primitives
#[allow(non_camel_case_types)]
pub struct bool;
#[allow(non_camel_case_types)]
pub struct char;
#[allow(non_camel_case_types)]
pub struct f32;
#[allow(non_camel_case_types)]
pub struct f64;
#[allow(non_camel_case_types)]
pub struct i128;
#[allow(non_camel_case_types)]
pub s... | rust | Apache-2.0 | 2019f4577cbdcd389b34973fdec3164be3af941a | 2026-01-04T15:33:05.007302Z | false |
yewstack/yew | https://github.com/yewstack/yew/blob/2019f4577cbdcd389b34973fdec3164be3af941a/packages/yew-macro/tests/html_macro/list-pass.rs | packages/yew-macro/tests/html_macro/list-pass.rs | #![no_implicit_prelude]
// Shadow primitives
#[allow(non_camel_case_types)]
pub struct bool;
#[allow(non_camel_case_types)]
pub struct char;
#[allow(non_camel_case_types)]
pub struct f32;
#[allow(non_camel_case_types)]
pub struct f64;
#[allow(non_camel_case_types)]
pub struct i128;
#[allow(non_camel_case_types)]
pub s... | rust | Apache-2.0 | 2019f4577cbdcd389b34973fdec3164be3af941a | 2026-01-04T15:33:05.007302Z | false |
yewstack/yew | https://github.com/yewstack/yew/blob/2019f4577cbdcd389b34973fdec3164be3af941a/packages/yew-macro/tests/html_macro/svg-pass.rs | packages/yew-macro/tests/html_macro/svg-pass.rs | #![no_implicit_prelude]
// Shadow primitives
#[allow(non_camel_case_types)]
pub struct bool;
#[allow(non_camel_case_types)]
pub struct char;
#[allow(non_camel_case_types)]
pub struct f32;
#[allow(non_camel_case_types)]
pub struct f64;
#[allow(non_camel_case_types)]
pub struct i128;
#[allow(non_camel_case_types)]
pub s... | rust | Apache-2.0 | 2019f4577cbdcd389b34973fdec3164be3af941a | 2026-01-04T15:33:05.007302Z | false |
yewstack/yew | https://github.com/yewstack/yew/blob/2019f4577cbdcd389b34973fdec3164be3af941a/packages/yew-macro/tests/html_macro/html-if-fail.rs | packages/yew-macro/tests/html_macro/html-if-fail.rs | use yew::prelude::*;
fn compile_fail() {
html! { if {} };
html! { if 42 {} };
html! { if true {} else };
html! { if true {} else if {} };
html! { if true {} else if true {} else };
html! { if true {} else if true {} else };
}
fn main() {}
| rust | Apache-2.0 | 2019f4577cbdcd389b34973fdec3164be3af941a | 2026-01-04T15:33:05.007302Z | false |
yewstack/yew | https://github.com/yewstack/yew/blob/2019f4577cbdcd389b34973fdec3164be3af941a/packages/yew-macro/tests/html_macro/iterable-pass.rs | packages/yew-macro/tests/html_macro/iterable-pass.rs | #![no_implicit_prelude]
// Shadow primitives
#[allow(non_camel_case_types)]
pub struct bool;
#[allow(non_camel_case_types)]
pub struct char;
#[allow(non_camel_case_types)]
pub struct f32;
#[allow(non_camel_case_types)]
pub struct f64;
#[allow(non_camel_case_types)]
pub struct i128;
#[allow(non_camel_case_types)]
pub s... | rust | Apache-2.0 | 2019f4577cbdcd389b34973fdec3164be3af941a | 2026-01-04T15:33:05.007302Z | false |
yewstack/yew | https://github.com/yewstack/yew/blob/2019f4577cbdcd389b34973fdec3164be3af941a/packages/yew-macro/tests/html_macro/html-if-pass.rs | packages/yew-macro/tests/html_macro/html-if-pass.rs | #![no_implicit_prelude]
fn compile_pass_lit() {
_ = ::yew::html! { if true {} };
_ = ::yew::html! { if true { <div/> } };
_ = ::yew::html! { if true { <div/><div/> } };
_ = ::yew::html! { if true { <><div/><div/></> } };
_ = ::yew::html! { if true { { ::yew::html! {} } } };
_ = ::yew::html! { i... | rust | Apache-2.0 | 2019f4577cbdcd389b34973fdec3164be3af941a | 2026-01-04T15:33:05.007302Z | false |
yewstack/yew | https://github.com/yewstack/yew/blob/2019f4577cbdcd389b34973fdec3164be3af941a/packages/yew-macro/tests/html_macro/component-pass.rs | packages/yew-macro/tests/html_macro/component-pass.rs | // Shadow primitives
#[allow(non_camel_case_types)]
pub struct bool;
#[allow(non_camel_case_types)]
pub struct char;
#[allow(non_camel_case_types)]
pub struct f32;
#[allow(non_camel_case_types)]
pub struct f64;
#[allow(non_camel_case_types)]
pub struct i128;
#[allow(non_camel_case_types)]
pub struct i16;
#[allow(non_ca... | rust | Apache-2.0 | 2019f4577cbdcd389b34973fdec3164be3af941a | 2026-01-04T15:33:05.007302Z | false |
yewstack/yew | https://github.com/yewstack/yew/blob/2019f4577cbdcd389b34973fdec3164be3af941a/packages/yew-macro/tests/html_macro/html-element-pass.rs | packages/yew-macro/tests/html_macro/html-element-pass.rs | #![no_implicit_prelude]
// Shadow primitives
#[allow(non_camel_case_types)]
pub struct bool;
#[allow(non_camel_case_types)]
pub struct char;
#[allow(non_camel_case_types)]
pub struct f32;
#[allow(non_camel_case_types)]
pub struct f64;
#[allow(non_camel_case_types)]
pub struct i128;
#[allow(non_camel_case_types)]
pub s... | rust | Apache-2.0 | 2019f4577cbdcd389b34973fdec3164be3af941a | 2026-01-04T15:33:05.007302Z | false |
yewstack/yew | https://github.com/yewstack/yew/blob/2019f4577cbdcd389b34973fdec3164be3af941a/packages/yew-macro/tests/html_macro/generic-component-fail.rs | packages/yew-macro/tests/html_macro/generic-component-fail.rs | use std::marker::PhantomData;
use yew::prelude::*;
pub struct Generic<T> {
marker: PhantomData<T>,
}
impl<T> Component for Generic<T>
where
T: 'static,
{
type Message = ();
type Properties = ();
fn create(_ctx: &Context<Self>) -> Self {
unimplemented!()
}
fn view(&self, _ctx: &Con... | rust | Apache-2.0 | 2019f4577cbdcd389b34973fdec3164be3af941a | 2026-01-04T15:33:05.007302Z | false |
yewstack/yew | https://github.com/yewstack/yew/blob/2019f4577cbdcd389b34973fdec3164be3af941a/packages/yew-macro/tests/html_macro/as-return-value-pass.rs | packages/yew-macro/tests/html_macro/as-return-value-pass.rs | #![no_implicit_prelude]
// Shadow primitives
#[allow(non_camel_case_types)]
pub struct bool;
#[allow(non_camel_case_types)]
pub struct char;
#[allow(non_camel_case_types)]
pub struct f32;
#[allow(non_camel_case_types)]
pub struct f64;
#[allow(non_camel_case_types)]
pub struct i128;
#[allow(non_camel_case_types)]
pub s... | rust | Apache-2.0 | 2019f4577cbdcd389b34973fdec3164be3af941a | 2026-01-04T15:33:05.007302Z | false |
yewstack/yew | https://github.com/yewstack/yew/blob/2019f4577cbdcd389b34973fdec3164be3af941a/packages/yew-macro/tests/html_macro/missing-props-diagnostics-fail.rs | packages/yew-macro/tests/html_macro/missing-props-diagnostics-fail.rs | use yew::prelude::*;
#[component]
pub fn App() -> Html {
html! {
<Foo />
}
}
#[component]
pub fn App1() -> Html {
html! {
<Foo bar={"bar".to_string()} />
}
}
#[component]
pub fn App2() -> Html {
html! {
<Foo bar={"bar".to_string()} baz={42} />
}
}
#[derive(Properties,... | rust | Apache-2.0 | 2019f4577cbdcd389b34973fdec3164be3af941a | 2026-01-04T15:33:05.007302Z | false |
yewstack/yew | https://github.com/yewstack/yew/blob/2019f4577cbdcd389b34973fdec3164be3af941a/packages/yew-macro/tests/html_macro/element-fail.rs | packages/yew-macro/tests/html_macro/element-fail.rs | use yew::prelude::*;
struct NotToString;
fn compile_fail() {
// missing closing tag
html! { <div> };
html! { <div><div> };
html! { <div><div></div> };
// missing opening tag
html! { </div> };
html! { <div></span></div> };
html! { <img /></img> };
// tag mismatch
html! { <div>... | rust | Apache-2.0 | 2019f4577cbdcd389b34973fdec3164be3af941a | 2026-01-04T15:33:05.007302Z | false |
yewstack/yew | https://github.com/yewstack/yew/blob/2019f4577cbdcd389b34973fdec3164be3af941a/packages/yew-macro/tests/html_macro/for-fail.rs | packages/yew-macro/tests/html_macro/for-fail.rs | mod smth {
const KEY: u32 = 42;
}
fn main() {
_ = ::yew::html!{for x};
_ = ::yew::html!{for x in};
_ = ::yew::html!{for x in 0 .. 10};
_ = ::yew::html!{for (x, y) in 0 .. 10 {
<span>{x}</span>
}};
_ = ::yew::html!{for _ in 0 .. 10 {
<span>{break}</span>
}};
_ = ::y... | rust | Apache-2.0 | 2019f4577cbdcd389b34973fdec3164be3af941a | 2026-01-04T15:33:05.007302Z | false |
yewstack/yew | https://github.com/yewstack/yew/blob/2019f4577cbdcd389b34973fdec3164be3af941a/packages/yew-macro/tests/html_macro/block-pass.rs | packages/yew-macro/tests/html_macro/block-pass.rs | #![no_implicit_prelude]
// Shadow primitives
#[allow(non_camel_case_types)]
pub struct bool;
#[allow(non_camel_case_types)]
pub struct char;
#[allow(non_camel_case_types)]
pub struct f32;
#[allow(non_camel_case_types)]
pub struct f64;
#[allow(non_camel_case_types)]
pub struct i128;
#[allow(non_camel_case_types)]
pub s... | rust | Apache-2.0 | 2019f4577cbdcd389b34973fdec3164be3af941a | 2026-01-04T15:33:05.007302Z | false |
yewstack/yew | https://github.com/yewstack/yew/blob/2019f4577cbdcd389b34973fdec3164be3af941a/packages/yew-macro/tests/html_macro/node-fail.rs | packages/yew-macro/tests/html_macro/node-fail.rs | use yew::prelude::*;
fn compile_fail() {
html! { "valid" "invalid" };
html! { <span>{ "valid" "invalid" }</span> };
html! { () };
html! { invalid };
// unsupported literals
html! { b'a' };
html! { b"str" };
html! { <span>{ b'a' }</span> };
html! { <span>{ b"str" }</span> };
... | rust | Apache-2.0 | 2019f4577cbdcd389b34973fdec3164be3af941a | 2026-01-04T15:33:05.007302Z | false |
yewstack/yew | https://github.com/yewstack/yew/blob/2019f4577cbdcd389b34973fdec3164be3af941a/packages/yew-macro/tests/hook_macro/use_transitive_state-fail.rs | packages/yew-macro/tests/hook_macro/use_transitive_state-fail.rs | use yew::prelude::*;
use yew_macro::{use_transitive_state_with_closure, use_transitive_state_without_closure};
#[component]
fn Comp() -> HtmlResult {
use_transitive_state_with_closure!(123)?;
use_transitive_state_with_closure!(|_| { todo!() }, 123)?;
use_transitive_state_with_closure!(123, |_| { todo!() ... | rust | Apache-2.0 | 2019f4577cbdcd389b34973fdec3164be3af941a | 2026-01-04T15:33:05.007302Z | false |
yewstack/yew | https://github.com/yewstack/yew/blob/2019f4577cbdcd389b34973fdec3164be3af941a/packages/yew-macro/tests/hook_macro/use_prepared_state-fail.rs | packages/yew-macro/tests/hook_macro/use_prepared_state-fail.rs | use yew::prelude::*;
use yew_macro::{use_prepared_state_with_closure, use_prepared_state_without_closure};
#[component]
fn Comp() -> HtmlResult {
use_prepared_state_with_closure!(123)?;
use_prepared_state_with_closure!(123, |_| { todo!() })?;
use_prepared_state_with_closure!(|_| -> u32 { todo!() })?;
... | rust | Apache-2.0 | 2019f4577cbdcd389b34973fdec3164be3af941a | 2026-01-04T15:33:05.007302Z | false |
yewstack/yew | https://github.com/yewstack/yew/blob/2019f4577cbdcd389b34973fdec3164be3af941a/packages/yew-router/src/router.rs | packages/yew-router/src/router.rs | //! Router Component.
use std::borrow::Cow;
use std::rc::Rc;
use gloo::history::query::Raw;
use yew::prelude::*;
use yew::virtual_dom::AttrValue;
use crate::history::{AnyHistory, BrowserHistory, HashHistory, History, Location};
use crate::navigator::Navigator;
use crate::utils::{base_url, strip_slash_suffix};
/// Pr... | rust | Apache-2.0 | 2019f4577cbdcd389b34973fdec3164be3af941a | 2026-01-04T15:33:05.007302Z | false |
yewstack/yew | https://github.com/yewstack/yew/blob/2019f4577cbdcd389b34973fdec3164be3af941a/packages/yew-router/src/lib.rs | packages/yew-router/src/lib.rs | //! Provides routing faculties using the browser history API to build
//! Single Page Applications (SPAs) using [Yew web framework](https://yew.rs).
//!
//! # Usage
//!
//! ```rust
//! use yew::functional::*;
//! use yew::prelude::*;
//! use yew_router::prelude::*;
//!
//! #[derive(Debug, Clone, Copy, PartialEq, Routab... | rust | Apache-2.0 | 2019f4577cbdcd389b34973fdec3164be3af941a | 2026-01-04T15:33:05.007302Z | false |
yewstack/yew | https://github.com/yewstack/yew/blob/2019f4577cbdcd389b34973fdec3164be3af941a/packages/yew-router/src/navigator.rs | packages/yew-router/src/navigator.rs | use std::borrow::Cow;
use crate::history::{AnyHistory, History, HistoryError, HistoryResult};
use crate::query::ToQuery;
use crate::routable::Routable;
pub type NavigationError = HistoryError;
pub type NavigationResult<T> = HistoryResult<T>;
/// The kind of Navigator Provider.
#[derive(Debug, PartialEq, Eq, Clone, C... | rust | Apache-2.0 | 2019f4577cbdcd389b34973fdec3164be3af941a | 2026-01-04T15:33:05.007302Z | false |
yewstack/yew | https://github.com/yewstack/yew/blob/2019f4577cbdcd389b34973fdec3164be3af941a/packages/yew-router/src/routable.rs | packages/yew-router/src/routable.rs | use std::collections::HashMap;
pub use yew_router_macro::Routable;
/// Marks an `enum` as routable.
///
/// # Implementation
///
/// Use derive macro to implement it. Although it *is* possible to implement it manually,
/// it is discouraged.
///
/// # Usage
///
/// The functions exposed by this trait are **not** supp... | rust | Apache-2.0 | 2019f4577cbdcd389b34973fdec3164be3af941a | 2026-01-04T15:33:05.007302Z | false |
yewstack/yew | https://github.com/yewstack/yew/blob/2019f4577cbdcd389b34973fdec3164be3af941a/packages/yew-router/src/utils.rs | packages/yew-router/src/utils.rs | use std::cell::RefCell;
use wasm_bindgen::JsCast;
pub(crate) fn strip_slash_suffix(path: &str) -> &str {
path.strip_suffix('/').unwrap_or(path)
}
static BASE_URL_LOADED: std::sync::Once = std::sync::Once::new();
thread_local! {
static BASE_URL: RefCell<Option<String>> = const { RefCell::new(None) };
}
// Th... | rust | Apache-2.0 | 2019f4577cbdcd389b34973fdec3164be3af941a | 2026-01-04T15:33:05.007302Z | false |
yewstack/yew | https://github.com/yewstack/yew/blob/2019f4577cbdcd389b34973fdec3164be3af941a/packages/yew-router/src/hooks.rs | packages/yew-router/src/hooks.rs | //! Hooks to access router state and navigate between pages.
use yew::prelude::*;
use crate::history::*;
use crate::navigator::Navigator;
use crate::routable::Routable;
use crate::router::{LocationContext, NavigatorContext};
/// A hook to access the [`Navigator`].
#[hook]
pub fn use_navigator() -> Option<Navigator> ... | rust | Apache-2.0 | 2019f4577cbdcd389b34973fdec3164be3af941a | 2026-01-04T15:33:05.007302Z | false |
yewstack/yew | https://github.com/yewstack/yew/blob/2019f4577cbdcd389b34973fdec3164be3af941a/packages/yew-router/src/scope_ext.rs | packages/yew-router/src/scope_ext.rs | use yew::context::ContextHandle;
use yew::prelude::*;
use crate::history::Location;
use crate::navigator::Navigator;
use crate::routable::Routable;
use crate::router::{LocationContext, NavigatorContext};
/// A [`ContextHandle`] for [`add_location_listener`](RouterScopeExt::add_location_listener).
pub struct LocationH... | rust | Apache-2.0 | 2019f4577cbdcd389b34973fdec3164be3af941a | 2026-01-04T15:33:05.007302Z | false |
yewstack/yew | https://github.com/yewstack/yew/blob/2019f4577cbdcd389b34973fdec3164be3af941a/packages/yew-router/src/switch.rs | packages/yew-router/src/switch.rs | //! The [`Switch`] Component.
use yew::prelude::*;
use crate::prelude::*;
/// Props for [`Switch`]
#[derive(Properties, PartialEq, Clone)]
pub struct SwitchProps<R>
where
R: Routable,
{
/// Callback which returns [`Html`] to be rendered for the current route.
pub render: Callback<R, Html>,
#[prop_or_... | rust | Apache-2.0 | 2019f4577cbdcd389b34973fdec3164be3af941a | 2026-01-04T15:33:05.007302Z | false |
yewstack/yew | https://github.com/yewstack/yew/blob/2019f4577cbdcd389b34973fdec3164be3af941a/packages/yew-router/src/macro_helpers.rs | packages/yew-router/src/macro_helpers.rs | pub use urlencoding::{decode as decode_for_url, encode as encode_for_url};
use crate::utils::strip_slash_suffix;
use crate::Routable;
// re-export Router because the macro needs to access it
pub type Router = route_recognizer::Router<String>;
/// Build a `route_recognizer::Router` from a `Routable` type.
pub fn buil... | rust | Apache-2.0 | 2019f4577cbdcd389b34973fdec3164be3af941a | 2026-01-04T15:33:05.007302Z | false |
yewstack/yew | https://github.com/yewstack/yew/blob/2019f4577cbdcd389b34973fdec3164be3af941a/packages/yew-router/src/components/link.rs | packages/yew-router/src/components/link.rs | use serde::Serialize;
use wasm_bindgen::UnwrapThrowExt;
use yew::prelude::*;
use yew::virtual_dom::AttrValue;
use crate::navigator::NavigatorKind;
use crate::prelude::*;
use crate::{utils, Routable};
/// Props for [`Link`]
#[derive(Properties, Clone, PartialEq)]
pub struct LinkProps<R, Q = (), S = ()>
where
R: Ro... | rust | Apache-2.0 | 2019f4577cbdcd389b34973fdec3164be3af941a | 2026-01-04T15:33:05.007302Z | false |
yewstack/yew | https://github.com/yewstack/yew/blob/2019f4577cbdcd389b34973fdec3164be3af941a/packages/yew-router/src/components/redirect.rs | packages/yew-router/src/components/redirect.rs | use wasm_bindgen::UnwrapThrowExt;
use yew::prelude::*;
use crate::hooks::use_navigator;
use crate::Routable;
/// Props for [`Redirect`]
#[derive(Properties, Clone, PartialEq, Eq)]
pub struct RedirectProps<R: Routable> {
/// Route that will be pushed when the component is rendered.
pub to: R,
}
/// A componen... | rust | Apache-2.0 | 2019f4577cbdcd389b34973fdec3164be3af941a | 2026-01-04T15:33:05.007302Z | false |
yewstack/yew | https://github.com/yewstack/yew/blob/2019f4577cbdcd389b34973fdec3164be3af941a/packages/yew-router/src/components/mod.rs | packages/yew-router/src/components/mod.rs | //! Components to interface with [Router][crate::Router].
mod link;
mod redirect;
pub use link::*;
pub use redirect::*;
| rust | Apache-2.0 | 2019f4577cbdcd389b34973fdec3164be3af941a | 2026-01-04T15:33:05.007302Z | false |
yewstack/yew | https://github.com/yewstack/yew/blob/2019f4577cbdcd389b34973fdec3164be3af941a/packages/yew-router/tests/router_unit_tests.rs | packages/yew-router/tests/router_unit_tests.rs | // TODO: remove the cfg after wasm-bindgen-test stops emitting the function unconditionally
#![cfg(all(target_arch = "wasm32", any(target_os = "unknown", target_os = "none")))]
use wasm_bindgen_test::{wasm_bindgen_test as test, wasm_bindgen_test_configure};
use yew_router::prelude::*;
wasm_bindgen_test_configure!(run... | rust | Apache-2.0 | 2019f4577cbdcd389b34973fdec3164be3af941a | 2026-01-04T15:33:05.007302Z | false |
yewstack/yew | https://github.com/yewstack/yew/blob/2019f4577cbdcd389b34973fdec3164be3af941a/packages/yew-router/tests/url_encoded_routes.rs | packages/yew-router/tests/url_encoded_routes.rs | // TODO: remove the cfg after wasm-bindgen-test stops emitting the function unconditionally
#![cfg(all(target_arch = "wasm32", any(target_os = "unknown", target_os = "none")))]
use std::time::Duration;
use yew::platform::time::sleep;
use yew::prelude::*;
use yew_router::prelude::*;
mod utils;
use utils::*;
use wasm_... | rust | Apache-2.0 | 2019f4577cbdcd389b34973fdec3164be3af941a | 2026-01-04T15:33:05.007302Z | false |
yewstack/yew | https://github.com/yewstack/yew/blob/2019f4577cbdcd389b34973fdec3164be3af941a/packages/yew-router/tests/link.rs | packages/yew-router/tests/link.rs | // TODO: remove the cfg after wasm-bindgen-test stops emitting the function unconditionally
#![cfg(all(target_arch = "wasm32", any(target_os = "unknown", target_os = "none")))]
use std::sync::atomic::{AtomicU8, Ordering};
use std::time::Duration;
use gloo::utils::window;
use js_sys::{JsString, Object, Reflect};
use s... | rust | Apache-2.0 | 2019f4577cbdcd389b34973fdec3164be3af941a | 2026-01-04T15:33:05.007302Z | false |
yewstack/yew | https://github.com/yewstack/yew/blob/2019f4577cbdcd389b34973fdec3164be3af941a/packages/yew-router/tests/hash_router.rs | packages/yew-router/tests/hash_router.rs | // TODO: remove the cfg after wasm-bindgen-test stops emitting the function unconditionally
#![cfg(all(target_arch = "wasm32", any(target_os = "unknown", target_os = "none")))]
use std::time::Duration;
use serde::{Deserialize, Serialize};
use wasm_bindgen_test::{wasm_bindgen_test as test, wasm_bindgen_test_configure}... | rust | Apache-2.0 | 2019f4577cbdcd389b34973fdec3164be3af941a | 2026-01-04T15:33:05.007302Z | false |
yewstack/yew | https://github.com/yewstack/yew/blob/2019f4577cbdcd389b34973fdec3164be3af941a/packages/yew-router/tests/browser_router.rs | packages/yew-router/tests/browser_router.rs | // TODO: remove the cfg after wasm-bindgen-test stops emitting the function unconditionally
#![cfg(all(target_arch = "wasm32", any(target_os = "unknown", target_os = "none")))]
use std::time::Duration;
use serde::{Deserialize, Serialize};
use wasm_bindgen_test::{wasm_bindgen_test as test, wasm_bindgen_test_configure}... | rust | Apache-2.0 | 2019f4577cbdcd389b34973fdec3164be3af941a | 2026-01-04T15:33:05.007302Z | false |
yewstack/yew | https://github.com/yewstack/yew/blob/2019f4577cbdcd389b34973fdec3164be3af941a/packages/yew-router/tests/utils.rs | packages/yew-router/tests/utils.rs | use wasm_bindgen::JsCast;
#[allow(dead_code)]
pub fn obtain_result_by_id(id: &str) -> String {
gloo::utils::document()
.get_element_by_id(id)
.expect("No result found. Most likely, the application crashed and burned")
.inner_html()
}
#[allow(dead_code)]
pub fn click(selector: &str) {
g... | rust | Apache-2.0 | 2019f4577cbdcd389b34973fdec3164be3af941a | 2026-01-04T15:33:05.007302Z | false |
yewstack/yew | https://github.com/yewstack/yew/blob/2019f4577cbdcd389b34973fdec3164be3af941a/packages/yew-router/tests/basename.rs | packages/yew-router/tests/basename.rs | // TODO: remove the cfg after wasm-bindgen-test stops emitting the function unconditionally
#![cfg(all(target_arch = "wasm32", any(target_os = "unknown", target_os = "none")))]
use std::time::Duration;
use serde::{Deserialize, Serialize};
use wasm_bindgen_test::{wasm_bindgen_test as test, wasm_bindgen_test_configure}... | rust | Apache-2.0 | 2019f4577cbdcd389b34973fdec3164be3af941a | 2026-01-04T15:33:05.007302Z | false |
yewstack/yew | https://github.com/yewstack/yew/blob/2019f4577cbdcd389b34973fdec3164be3af941a/packages/yew-agent/src/lib.rs | packages/yew-agent/src/lib.rs | #![doc = include_str!("../README.md")]
#![deny(
clippy::all,
missing_docs,
missing_debug_implementations,
bare_trait_objects,
anonymous_parameters,
elided_lifetimes_in_paths
)]
extern crate self as yew_agent;
pub mod codec;
pub mod oneshot;
pub mod reactor;
pub mod worker;
pub use codec::{Binc... | rust | Apache-2.0 | 2019f4577cbdcd389b34973fdec3164be3af941a | 2026-01-04T15:33:05.007302Z | false |
yewstack/yew | https://github.com/yewstack/yew/blob/2019f4577cbdcd389b34973fdec3164be3af941a/packages/yew-agent/src/reach.rs | packages/yew-agent/src/reach.rs | /// The reachability of an agent.
#[derive(Debug, Clone, PartialEq, Eq, Hash, Copy)]
pub enum Reach {
/// Public Reachability.
Public,
/// Private Reachability.
Private,
}
| rust | Apache-2.0 | 2019f4577cbdcd389b34973fdec3164be3af941a | 2026-01-04T15:33:05.007302Z | false |
yewstack/yew | https://github.com/yewstack/yew/blob/2019f4577cbdcd389b34973fdec3164be3af941a/packages/yew-agent/src/codec.rs | packages/yew-agent/src/codec.rs | //! Submodule providing the `Codec` trait and its default implementation using `bincode`.
use js_sys::Uint8Array;
use serde::{Deserialize, Serialize};
use wasm_bindgen::JsValue;
/// Message Encoding and Decoding Format
pub trait Codec {
/// Encode an input to JsValue
fn encode<I>(input: I) -> JsValue
wher... | rust | Apache-2.0 | 2019f4577cbdcd389b34973fdec3164be3af941a | 2026-01-04T15:33:05.007302Z | false |
yewstack/yew | https://github.com/yewstack/yew/blob/2019f4577cbdcd389b34973fdec3164be3af941a/packages/yew-agent/src/utils.rs | packages/yew-agent/src/utils.rs | use std::rc::Rc;
use std::sync::atomic::{AtomicUsize, Ordering};
use wasm_bindgen::UnwrapThrowExt;
use yew::Reducible;
/// Convenience function to avoid repeating expect logic.
pub fn window() -> web_sys::Window {
web_sys::window().expect_throw("Can't find the global Window")
}
/// Gets a unique worker id
pub(cr... | rust | Apache-2.0 | 2019f4577cbdcd389b34973fdec3164be3af941a | 2026-01-04T15:33:05.007302Z | false |
yewstack/yew | https://github.com/yewstack/yew/blob/2019f4577cbdcd389b34973fdec3164be3af941a/packages/yew-agent/src/scope_ext.rs | packages/yew-agent/src/scope_ext.rs | //! This module contains extensions to the component scope for agent access.
use std::any::type_name;
use std::fmt;
use std::rc::Rc;
use futures::stream::SplitSink;
use futures::{SinkExt, StreamExt};
use wasm_bindgen::UnwrapThrowExt;
use yew::html::Scope;
use yew::platform::pinned::RwLock;
use yew::platform::spawn_lo... | rust | Apache-2.0 | 2019f4577cbdcd389b34973fdec3164be3af941a | 2026-01-04T15:33:05.007302Z | false |
yewstack/yew | https://github.com/yewstack/yew/blob/2019f4577cbdcd389b34973fdec3164be3af941a/packages/yew-agent/src/traits.rs | packages/yew-agent/src/traits.rs | //! Submodule providing the `Spawnable` and `Registrable` traits.
/// A Worker that can be spawned by a spawner.
pub trait Spawnable {
/// Spawner Type.
type Spawner;
/// Creates a spawner.
fn spawner() -> Self::Spawner;
}
/// A trait to enable public workers being registered in a web worker.
pub tra... | rust | Apache-2.0 | 2019f4577cbdcd389b34973fdec3164be3af941a | 2026-01-04T15:33:05.007302Z | false |
yewstack/yew | https://github.com/yewstack/yew/blob/2019f4577cbdcd389b34973fdec3164be3af941a/packages/yew-agent/src/worker/messages.rs | packages/yew-agent/src/worker/messages.rs | use serde::{Deserialize, Serialize};
use super::handler_id::HandlerId;
use super::traits::Worker;
/// Serializable messages to worker
#[derive(Serialize, Deserialize, Debug)]
pub(crate) enum ToWorker<W>
where
W: Worker,
{
/// Client is connected
Connected(HandlerId),
/// Incoming message to Worker
... | rust | Apache-2.0 | 2019f4577cbdcd389b34973fdec3164be3af941a | 2026-01-04T15:33:05.007302Z | false |
yewstack/yew | https://github.com/yewstack/yew/blob/2019f4577cbdcd389b34973fdec3164be3af941a/packages/yew-agent/src/worker/spawner.rs | packages/yew-agent/src/worker/spawner.rs | use std::cell::RefCell;
use std::collections::HashMap;
use std::fmt;
use std::marker::PhantomData;
use std::rc::{Rc, Weak};
use js_sys::Array;
use serde::de::Deserialize;
use serde::ser::Serialize;
use web_sys::{Blob, BlobPropertyBag, Url, WorkerOptions, WorkerType};
use super::bridge::{CallbackMap, WorkerBridge};
us... | rust | Apache-2.0 | 2019f4577cbdcd389b34973fdec3164be3af941a | 2026-01-04T15:33:05.007302Z | false |
yewstack/yew | https://github.com/yewstack/yew/blob/2019f4577cbdcd389b34973fdec3164be3af941a/packages/yew-agent/src/worker/lifecycle.rs | packages/yew-agent/src/worker/lifecycle.rs | use wasm_bindgen::prelude::*;
use super::messages::ToWorker;
use super::native_worker::{DedicatedWorker, WorkerSelf};
use super::scope::{WorkerDestroyHandle, WorkerScope};
use super::traits::Worker;
use super::Shared;
pub(crate) struct WorkerState<W>
where
W: Worker,
{
worker: Option<(W, WorkerScope<W>)>,
... | rust | Apache-2.0 | 2019f4577cbdcd389b34973fdec3164be3af941a | 2026-01-04T15:33:05.007302Z | false |
yewstack/yew | https://github.com/yewstack/yew/blob/2019f4577cbdcd389b34973fdec3164be3af941a/packages/yew-agent/src/worker/native_worker.rs | packages/yew-agent/src/worker/native_worker.rs | use serde::{Deserialize, Serialize};
use wasm_bindgen::closure::Closure;
use wasm_bindgen::prelude::*;
use wasm_bindgen::{JsCast, JsValue};
pub(crate) use web_sys::Worker as DedicatedWorker;
use web_sys::{DedicatedWorkerGlobalScope, MessageEvent};
use crate::codec::Codec;
pub(crate) trait WorkerSelf {
type Global... | rust | Apache-2.0 | 2019f4577cbdcd389b34973fdec3164be3af941a | 2026-01-04T15:33:05.007302Z | false |
yewstack/yew | https://github.com/yewstack/yew/blob/2019f4577cbdcd389b34973fdec3164be3af941a/packages/yew-agent/src/worker/bridge.rs | packages/yew-agent/src/worker/bridge.rs | use std::cell::RefCell;
use std::collections::HashMap;
use std::fmt;
use std::marker::PhantomData;
use std::rc::{Rc, Weak};
use serde::{Deserialize, Serialize};
use super::handler_id::HandlerId;
use super::messages::ToWorker;
use super::native_worker::NativeWorkerExt;
use super::traits::Worker;
use super::{Callback, ... | rust | Apache-2.0 | 2019f4577cbdcd389b34973fdec3164be3af941a | 2026-01-04T15:33:05.007302Z | false |
yewstack/yew | https://github.com/yewstack/yew/blob/2019f4577cbdcd389b34973fdec3164be3af941a/packages/yew-agent/src/worker/scope.rs | packages/yew-agent/src/worker/scope.rs | use std::cell::RefCell;
use std::fmt;
use std::future::Future;
use std::rc::Rc;
use serde::de::Deserialize;
use serde::ser::Serialize;
use wasm_bindgen_futures::spawn_local;
use super::handler_id::HandlerId;
use super::lifecycle::{WorkerLifecycleEvent, WorkerRunnable, WorkerState};
use super::messages::FromWorker;
us... | rust | Apache-2.0 | 2019f4577cbdcd389b34973fdec3164be3af941a | 2026-01-04T15:33:05.007302Z | false |
yewstack/yew | https://github.com/yewstack/yew/blob/2019f4577cbdcd389b34973fdec3164be3af941a/packages/yew-agent/src/worker/hooks.rs | packages/yew-agent/src/worker/hooks.rs | use std::any::type_name;
use std::fmt;
use std::ops::Deref;
use std::rc::Rc;
use wasm_bindgen::prelude::*;
use yew::prelude::*;
use crate::utils::{BridgeIdState, OutputsAction, OutputsState};
use crate::worker::provider::WorkerProviderState;
use crate::worker::{Worker, WorkerBridge};
/// Hook handle for the [`use_wo... | rust | Apache-2.0 | 2019f4577cbdcd389b34973fdec3164be3af941a | 2026-01-04T15:33:05.007302Z | false |
yewstack/yew | https://github.com/yewstack/yew/blob/2019f4577cbdcd389b34973fdec3164be3af941a/packages/yew-agent/src/worker/mod.rs | packages/yew-agent/src/worker/mod.rs | //! This module contains the worker agent implementation.
//!
//! This is a low-level implementation that uses an actor model.
//!
//! # Example
//!
//! ```
//! # mod example {
//! use serde::{Deserialize, Serialize};
//! use yew::prelude::*;
//! use yew_agent::worker::{use_worker_bridge, UseWorkerBridgeHandle};
//!
//... | rust | Apache-2.0 | 2019f4577cbdcd389b34973fdec3164be3af941a | 2026-01-04T15:33:05.007302Z | false |
yewstack/yew | https://github.com/yewstack/yew/blob/2019f4577cbdcd389b34973fdec3164be3af941a/packages/yew-agent/src/worker/traits.rs | packages/yew-agent/src/worker/traits.rs | use super::handler_id::HandlerId;
use super::registrar::WorkerRegistrar;
use super::scope::{WorkerDestroyHandle, WorkerScope};
use super::spawner::WorkerSpawner;
use crate::traits::{Registrable, Spawnable};
/// Declares the behaviour of a worker.
pub trait Worker: Sized {
/// Update message type.
type Message;... | rust | Apache-2.0 | 2019f4577cbdcd389b34973fdec3164be3af941a | 2026-01-04T15:33:05.007302Z | false |
yewstack/yew | https://github.com/yewstack/yew/blob/2019f4577cbdcd389b34973fdec3164be3af941a/packages/yew-agent/src/worker/provider.rs | packages/yew-agent/src/worker/provider.rs | use std::any::type_name;
use std::cell::RefCell;
use std::fmt;
use std::rc::Rc;
use serde::{Deserialize, Serialize};
use yew::prelude::*;
use super::{Worker, WorkerBridge};
use crate::reach::Reach;
use crate::utils::get_next_id;
use crate::{Bincode, Codec, Spawnable};
/// Properties for [WorkerProvider].
#[derive(De... | rust | Apache-2.0 | 2019f4577cbdcd389b34973fdec3164be3af941a | 2026-01-04T15:33:05.007302Z | false |
yewstack/yew | https://github.com/yewstack/yew/blob/2019f4577cbdcd389b34973fdec3164be3af941a/packages/yew-agent/src/worker/handler_id.rs | packages/yew-agent/src/worker/handler_id.rs | use std::sync::atomic::{AtomicUsize, Ordering};
use serde::{Deserialize, Serialize};
/// Identifier to send output to bridges.
#[derive(Debug, Serialize, Deserialize, Eq, PartialEq, Hash, Clone, Copy)]
pub struct HandlerId(usize);
impl HandlerId {
pub(crate) fn new() -> Self {
static CTR: AtomicUsize = A... | rust | Apache-2.0 | 2019f4577cbdcd389b34973fdec3164be3af941a | 2026-01-04T15:33:05.007302Z | false |
yewstack/yew | https://github.com/yewstack/yew/blob/2019f4577cbdcd389b34973fdec3164be3af941a/packages/yew-agent/src/worker/registrar.rs | packages/yew-agent/src/worker/registrar.rs | use std::fmt;
use std::marker::PhantomData;
use serde::de::Deserialize;
use serde::ser::Serialize;
use super::lifecycle::WorkerLifecycleEvent;
use super::messages::{FromWorker, ToWorker};
use super::native_worker::{DedicatedWorker, NativeWorkerExt, WorkerSelf};
use super::scope::WorkerScope;
use super::traits::Worker... | rust | Apache-2.0 | 2019f4577cbdcd389b34973fdec3164be3af941a | 2026-01-04T15:33:05.007302Z | false |
yewstack/yew | https://github.com/yewstack/yew/blob/2019f4577cbdcd389b34973fdec3164be3af941a/packages/yew-agent/src/oneshot/spawner.rs | packages/yew-agent/src/oneshot/spawner.rs | use serde::de::Deserialize;
use serde::ser::Serialize;
use super::bridge::OneshotBridge;
use super::traits::Oneshot;
use super::worker::OneshotWorker;
use crate::codec::{Bincode, Codec};
use crate::worker::WorkerSpawner;
/// A spawner to create oneshot workers.
#[derive(Debug, Default)]
pub struct OneshotSpawner<N, C... | rust | Apache-2.0 | 2019f4577cbdcd389b34973fdec3164be3af941a | 2026-01-04T15:33:05.007302Z | false |
yewstack/yew | https://github.com/yewstack/yew/blob/2019f4577cbdcd389b34973fdec3164be3af941a/packages/yew-agent/src/oneshot/bridge.rs | packages/yew-agent/src/oneshot/bridge.rs | use futures::stream::StreamExt;
use pinned::mpsc;
use pinned::mpsc::UnboundedReceiver;
use super::traits::Oneshot;
use super::worker::OneshotWorker;
use crate::codec::Codec;
use crate::worker::{WorkerBridge, WorkerSpawner};
/// A connection manager for components interaction with oneshot workers.
#[derive(Debug)]
pub... | rust | Apache-2.0 | 2019f4577cbdcd389b34973fdec3164be3af941a | 2026-01-04T15:33:05.007302Z | false |
yewstack/yew | https://github.com/yewstack/yew/blob/2019f4577cbdcd389b34973fdec3164be3af941a/packages/yew-agent/src/oneshot/worker.rs | packages/yew-agent/src/oneshot/worker.rs | use super::traits::Oneshot;
use crate::worker::{HandlerId, Worker, WorkerDestroyHandle, WorkerScope};
pub(crate) enum Message<T>
where
T: Oneshot,
{
Finished {
handler_id: HandlerId,
output: T::Output,
},
}
pub(crate) struct OneshotWorker<T>
where
T: 'static + Oneshot,
{
running_ta... | rust | Apache-2.0 | 2019f4577cbdcd389b34973fdec3164be3af941a | 2026-01-04T15:33:05.007302Z | false |
yewstack/yew | https://github.com/yewstack/yew/blob/2019f4577cbdcd389b34973fdec3164be3af941a/packages/yew-agent/src/oneshot/hooks.rs | packages/yew-agent/src/oneshot/hooks.rs | use yew::prelude::*;
use super::provider::OneshotProviderState;
use super::Oneshot;
/// Hook handle for [`use_oneshot_runner`]
#[derive(Debug)]
pub struct UseOneshotRunnerHandle<T>
where
T: Oneshot + 'static,
{
state: OneshotProviderState<T>,
}
impl<T> UseOneshotRunnerHandle<T>
where
T: Oneshot + 'static... | rust | Apache-2.0 | 2019f4577cbdcd389b34973fdec3164be3af941a | 2026-01-04T15:33:05.007302Z | false |
yewstack/yew | https://github.com/yewstack/yew/blob/2019f4577cbdcd389b34973fdec3164be3af941a/packages/yew-agent/src/oneshot/mod.rs | packages/yew-agent/src/oneshot/mod.rs | //! This module provides task agent implementation.
mod bridge;
mod hooks;
mod provider;
mod registrar;
mod spawner;
mod traits;
mod worker;
pub use bridge::OneshotBridge;
pub use hooks::{use_oneshot_runner, UseOneshotRunnerHandle};
pub use provider::OneshotProvider;
pub(crate) use provider::OneshotProviderState;
pub... | rust | Apache-2.0 | 2019f4577cbdcd389b34973fdec3164be3af941a | 2026-01-04T15:33:05.007302Z | false |
yewstack/yew | https://github.com/yewstack/yew/blob/2019f4577cbdcd389b34973fdec3164be3af941a/packages/yew-agent/src/oneshot/traits.rs | packages/yew-agent/src/oneshot/traits.rs | use std::future::Future;
/// A future-based worker that for each input, one output is produced.
pub trait Oneshot: Future {
/// Incoming message type.
type Input;
/// Creates an oneshot worker.
fn create(input: Self::Input) -> Self;
}
| rust | Apache-2.0 | 2019f4577cbdcd389b34973fdec3164be3af941a | 2026-01-04T15:33:05.007302Z | false |
yewstack/yew | https://github.com/yewstack/yew/blob/2019f4577cbdcd389b34973fdec3164be3af941a/packages/yew-agent/src/oneshot/provider.rs | packages/yew-agent/src/oneshot/provider.rs | use core::fmt;
use std::any::type_name;
use std::cell::RefCell;
use std::rc::Rc;
use serde::{Deserialize, Serialize};
use yew::prelude::*;
use super::{Oneshot, OneshotBridge, OneshotSpawner};
use crate::utils::get_next_id;
use crate::worker::WorkerProviderProps;
use crate::{Bincode, Codec, Reach};
pub(crate) struct ... | rust | Apache-2.0 | 2019f4577cbdcd389b34973fdec3164be3af941a | 2026-01-04T15:33:05.007302Z | false |
yewstack/yew | https://github.com/yewstack/yew/blob/2019f4577cbdcd389b34973fdec3164be3af941a/packages/yew-agent/src/oneshot/registrar.rs | packages/yew-agent/src/oneshot/registrar.rs | use std::fmt;
use serde::de::Deserialize;
use serde::ser::Serialize;
use super::traits::Oneshot;
use super::worker::OneshotWorker;
use crate::codec::{Bincode, Codec};
use crate::traits::Registrable;
use crate::worker::WorkerRegistrar;
/// A registrar for oneshot workers.
pub struct OneshotRegistrar<T, CODEC = Bincod... | rust | Apache-2.0 | 2019f4577cbdcd389b34973fdec3164be3af941a | 2026-01-04T15:33:05.007302Z | false |
yewstack/yew | https://github.com/yewstack/yew/blob/2019f4577cbdcd389b34973fdec3164be3af941a/packages/yew-agent/src/reactor/messages.rs | packages/yew-agent/src/reactor/messages.rs | use serde::{Deserialize, Serialize};
/// The Bridge Input.
#[derive(Debug, Serialize, Deserialize)]
pub(crate) enum ReactorInput<I> {
/// An input message.
Input(I),
}
/// The Bridge Output.
#[derive(Debug, Serialize, Deserialize)]
pub enum ReactorOutput<O> {
/// An output message has been received.
O... | rust | Apache-2.0 | 2019f4577cbdcd389b34973fdec3164be3af941a | 2026-01-04T15:33:05.007302Z | false |
yewstack/yew | https://github.com/yewstack/yew/blob/2019f4577cbdcd389b34973fdec3164be3af941a/packages/yew-agent/src/reactor/spawner.rs | packages/yew-agent/src/reactor/spawner.rs | use serde::de::Deserialize;
use serde::ser::Serialize;
use super::bridge::ReactorBridge;
use super::scope::ReactorScoped;
use super::traits::Reactor;
use super::worker::ReactorWorker;
use crate::codec::{Bincode, Codec};
use crate::worker::WorkerSpawner;
/// A spawner to create oneshot workers.
#[derive(Debug, Default... | rust | Apache-2.0 | 2019f4577cbdcd389b34973fdec3164be3af941a | 2026-01-04T15:33:05.007302Z | false |
yewstack/yew | https://github.com/yewstack/yew/blob/2019f4577cbdcd389b34973fdec3164be3af941a/packages/yew-agent/src/reactor/bridge.rs | packages/yew-agent/src/reactor/bridge.rs | use std::fmt;
use std::pin::Pin;
use std::task::{Context, Poll};
use futures::sink::Sink;
use futures::stream::{FusedStream, Stream};
use pinned::mpsc;
use pinned::mpsc::{UnboundedReceiver, UnboundedSender};
use thiserror::Error;
use super::messages::{ReactorInput, ReactorOutput};
use super::scope::ReactorScoped;
use... | rust | Apache-2.0 | 2019f4577cbdcd389b34973fdec3164be3af941a | 2026-01-04T15:33:05.007302Z | false |
yewstack/yew | https://github.com/yewstack/yew/blob/2019f4577cbdcd389b34973fdec3164be3af941a/packages/yew-agent/src/reactor/scope.rs | packages/yew-agent/src/reactor/scope.rs | use std::convert::Infallible;
use std::fmt;
use std::pin::Pin;
use futures::stream::{FusedStream, Stream};
use futures::task::{Context, Poll};
use futures::Sink;
/// A handle to communicate with bridges.
pub struct ReactorScope<I, O> {
input_stream: Pin<Box<dyn FusedStream<Item = I>>>,
output_sink: Pin<Box<dy... | rust | Apache-2.0 | 2019f4577cbdcd389b34973fdec3164be3af941a | 2026-01-04T15:33:05.007302Z | false |
yewstack/yew | https://github.com/yewstack/yew/blob/2019f4577cbdcd389b34973fdec3164be3af941a/packages/yew-agent/src/reactor/worker.rs | packages/yew-agent/src/reactor/worker.rs | use std::collections::HashMap;
use std::convert::Infallible;
use futures::sink;
use futures::stream::StreamExt;
use pinned::mpsc;
use pinned::mpsc::UnboundedSender;
use wasm_bindgen_futures::spawn_local;
use super::messages::{ReactorInput, ReactorOutput};
use super::scope::ReactorScoped;
use super::traits::Reactor;
u... | rust | Apache-2.0 | 2019f4577cbdcd389b34973fdec3164be3af941a | 2026-01-04T15:33:05.007302Z | false |
yewstack/yew | https://github.com/yewstack/yew/blob/2019f4577cbdcd389b34973fdec3164be3af941a/packages/yew-agent/src/reactor/hooks.rs | packages/yew-agent/src/reactor/hooks.rs | use std::any::type_name;
use std::fmt;
use std::ops::Deref;
use std::rc::Rc;
use futures::sink::SinkExt;
use futures::stream::{SplitSink, StreamExt};
use wasm_bindgen::UnwrapThrowExt;
use yew::platform::pinned::RwLock;
use yew::platform::spawn_local;
use yew::prelude::*;
use super::provider::ReactorProviderState;
use... | rust | Apache-2.0 | 2019f4577cbdcd389b34973fdec3164be3af941a | 2026-01-04T15:33:05.007302Z | false |
yewstack/yew | https://github.com/yewstack/yew/blob/2019f4577cbdcd389b34973fdec3164be3af941a/packages/yew-agent/src/reactor/mod.rs | packages/yew-agent/src/reactor/mod.rs | //! This module contains the reactor agent implementation.
//!
//! Reactor agents are agents that receive multiple inputs and send multiple outputs over a single
//! bridge. A reactor is defined as an async function that takes a [ReactorScope]
//! as the argument.
//!
//! The reactor scope is a stream that produces inp... | rust | Apache-2.0 | 2019f4577cbdcd389b34973fdec3164be3af941a | 2026-01-04T15:33:05.007302Z | false |
yewstack/yew | https://github.com/yewstack/yew/blob/2019f4577cbdcd389b34973fdec3164be3af941a/packages/yew-agent/src/reactor/traits.rs | packages/yew-agent/src/reactor/traits.rs | use std::future::Future;
use super::scope::ReactorScoped;
/// A reactor worker.
pub trait Reactor: Future<Output = ()> {
/// The Reactor Scope
type Scope: ReactorScoped;
/// Creates a reactor worker.
fn create(scope: Self::Scope) -> Self;
}
| rust | Apache-2.0 | 2019f4577cbdcd389b34973fdec3164be3af941a | 2026-01-04T15:33:05.007302Z | false |
yewstack/yew | https://github.com/yewstack/yew/blob/2019f4577cbdcd389b34973fdec3164be3af941a/packages/yew-agent/src/reactor/provider.rs | packages/yew-agent/src/reactor/provider.rs | use std::any::type_name;
use std::cell::RefCell;
use std::fmt;
use std::rc::Rc;
use serde::{Deserialize, Serialize};
use yew::prelude::*;
use super::{Reactor, ReactorBridge, ReactorScoped, ReactorSpawner};
use crate::utils::get_next_id;
use crate::worker::WorkerProviderProps;
use crate::{Bincode, Codec, Reach};
pub(... | rust | Apache-2.0 | 2019f4577cbdcd389b34973fdec3164be3af941a | 2026-01-04T15:33:05.007302Z | false |
yewstack/yew | https://github.com/yewstack/yew/blob/2019f4577cbdcd389b34973fdec3164be3af941a/packages/yew-agent/src/reactor/registrar.rs | packages/yew-agent/src/reactor/registrar.rs | use std::fmt;
use serde::de::Deserialize;
use serde::ser::Serialize;
use super::scope::ReactorScoped;
use super::traits::Reactor;
use super::worker::ReactorWorker;
use crate::codec::{Bincode, Codec};
use crate::traits::Registrable;
use crate::worker::WorkerRegistrar;
/// A registrar for reactor workers.
pub struct R... | rust | Apache-2.0 | 2019f4577cbdcd389b34973fdec3164be3af941a | 2026-01-04T15:33:05.007302Z | false |
lapce/lapce | https://github.com/lapce/lapce/blob/59ce6df700ce4efbe4498a719fe52195e083d2ee/lapce-app/src/db.rs | lapce-app/src/db.rs | use std::{
path::{Path, PathBuf},
rc::Rc,
sync::Arc,
};
use anyhow::{Result, anyhow};
use crossbeam_channel::{Sender, unbounded};
use floem::{peniko::kurbo::Vec2, reactive::SignalGet};
use lapce_core::directory::Directory;
use lapce_rpc::plugin::VoltID;
use sha2::{Digest, Sha256};
use crate::{
app::{A... | rust | Apache-2.0 | 59ce6df700ce4efbe4498a719fe52195e083d2ee | 2026-01-04T15:32:17.267102Z | false |
lapce/lapce | https://github.com/lapce/lapce/blob/59ce6df700ce4efbe4498a719fe52195e083d2ee/lapce-app/src/config.rs | lapce-app/src/config.rs | use std::{
collections::HashMap,
path::{Path, PathBuf},
sync::Arc,
};
use ::core::slice;
use floem::{peniko::Color, prelude::palette::css};
use itertools::Itertools;
use lapce_core::directory::Directory;
use lapce_proxy::plugin::wasi::find_all_volts;
use lapce_rpc::plugin::VoltID;
use lsp_types::{Completio... | rust | Apache-2.0 | 59ce6df700ce4efbe4498a719fe52195e083d2ee | 2026-01-04T15:32:17.267102Z | true |
lapce/lapce | https://github.com/lapce/lapce/blob/59ce6df700ce4efbe4498a719fe52195e083d2ee/lapce-app/src/app.rs | lapce-app/src/app.rs | #[cfg(target_os = "windows")]
use std::os::windows::process::CommandExt;
use std::{
io::{BufReader, IsTerminal, Read, Write},
ops::Range,
path::PathBuf,
process::Stdio,
rc::Rc,
sync::{
Arc,
atomic::AtomicU64,
mpsc::{SyncSender, channel, sync_channel},
},
};
use anyho... | rust | Apache-2.0 | 59ce6df700ce4efbe4498a719fe52195e083d2ee | 2026-01-04T15:32:17.267102Z | true |
lapce/lapce | https://github.com/lapce/lapce/blob/59ce6df700ce4efbe4498a719fe52195e083d2ee/lapce-app/src/editor_tab.rs | lapce-app/src/editor_tab.rs | use std::{
path::{Path, PathBuf},
rc::Rc,
sync::Arc,
};
use floem::{
peniko::{
Color,
kurbo::{Point, Rect},
},
reactive::{
Memo, ReadSignal, RwSignal, Scope, SignalGet, SignalUpdate, SignalWith,
create_memo, create_rw_signal,
},
views::editor::id::EditorI... | rust | Apache-2.0 | 59ce6df700ce4efbe4498a719fe52195e083d2ee | 2026-01-04T15:32:17.267102Z | false |
lapce/lapce | https://github.com/lapce/lapce/blob/59ce6df700ce4efbe4498a719fe52195e083d2ee/lapce-app/src/settings.rs | lapce-app/src/settings.rs | use std::{collections::BTreeMap, rc::Rc, sync::Arc, time::Duration};
use floem::{
IntoView, View,
action::{TimerToken, add_overlay, exec_after, remove_overlay},
event::EventListener,
keyboard::Modifiers,
peniko::kurbo::{Point, Rect, Size},
reactive::{
Memo, ReadSignal, RwSignal, Scope, ... | rust | Apache-2.0 | 59ce6df700ce4efbe4498a719fe52195e083d2ee | 2026-01-04T15:32:17.267102Z | true |
lapce/lapce | https://github.com/lapce/lapce/blob/59ce6df700ce4efbe4498a719fe52195e083d2ee/lapce-app/src/focus_text.rs | lapce-app/src/focus_text.rs | use floem::{
Renderer, View, ViewId,
peniko::{
Color,
kurbo::{Point, Rect},
},
prop_extractor,
reactive::create_effect,
style::{FontFamily, FontSize, LineHeight, Style, TextColor},
taffy::prelude::NodeId,
text::{Attrs, AttrsList, FamilyOwned, TextLayout, Weight},
};
prop... | rust | Apache-2.0 | 59ce6df700ce4efbe4498a719fe52195e083d2ee | 2026-01-04T15:32:17.267102Z | false |
lapce/lapce | https://github.com/lapce/lapce/blob/59ce6df700ce4efbe4498a719fe52195e083d2ee/lapce-app/src/workspace.rs | lapce-app/src/workspace.rs | use std::{collections::HashMap, fmt::Display, path::PathBuf};
use serde::{Deserialize, Serialize};
use crate::{debug::LapceBreakpoint, main_split::SplitInfo, panel::data::PanelInfo};
#[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize, Hash)]
pub struct SshHost {
pub user: Option<String>,
pub host: ... | rust | Apache-2.0 | 59ce6df700ce4efbe4498a719fe52195e083d2ee | 2026-01-04T15:32:17.267102Z | false |
lapce/lapce | https://github.com/lapce/lapce/blob/59ce6df700ce4efbe4498a719fe52195e083d2ee/lapce-app/src/lib.rs | lapce-app/src/lib.rs | pub mod about;
pub mod alert;
pub mod app;
pub mod code_action;
pub mod code_lens;
pub mod command;
pub mod completion;
pub mod config;
pub mod db;
pub mod debug;
pub mod doc;
pub mod editor;
pub mod editor_tab;
pub mod file_explorer;
pub mod find;
pub mod focus_text;
pub mod global_search;
pub mod history;
pub mod hov... | rust | Apache-2.0 | 59ce6df700ce4efbe4498a719fe52195e083d2ee | 2026-01-04T15:32:17.267102Z | false |
lapce/lapce | https://github.com/lapce/lapce/blob/59ce6df700ce4efbe4498a719fe52195e083d2ee/lapce-app/src/command.rs | lapce-app/src/command.rs | use std::{path::PathBuf, rc::Rc};
pub use floem::views::editor::command::CommandExecuted;
use floem::{
ViewId, keyboard::Modifiers, peniko::kurbo::Vec2,
views::editor::command::Command,
};
use indexmap::IndexMap;
use lapce_core::command::{
EditCommand, FocusCommand, MotionModeCommand, MoveCommand,
Mult... | rust | Apache-2.0 | 59ce6df700ce4efbe4498a719fe52195e083d2ee | 2026-01-04T15:32:17.267102Z | false |
lapce/lapce | https://github.com/lapce/lapce/blob/59ce6df700ce4efbe4498a719fe52195e083d2ee/lapce-app/src/source_control.rs | lapce-app/src/source_control.rs | use std::{path::PathBuf, rc::Rc};
use floem::{
keyboard::Modifiers,
reactive::{RwSignal, Scope, SignalWith},
};
use indexmap::IndexMap;
use lapce_core::mode::Mode;
use lapce_rpc::source_control::FileDiff;
use crate::{
command::{CommandExecuted, CommandKind},
editor::EditorData,
keypress::{KeyPress... | rust | Apache-2.0 | 59ce6df700ce4efbe4498a719fe52195e083d2ee | 2026-01-04T15:32:17.267102Z | false |
lapce/lapce | https://github.com/lapce/lapce/blob/59ce6df700ce4efbe4498a719fe52195e083d2ee/lapce-app/src/title.rs | lapce-app/src/title.rs | use std::{rc::Rc, sync::Arc};
use floem::{
View,
event::EventListener,
menu::{Menu, MenuItem},
peniko::Color,
reactive::{
Memo, ReadSignal, RwSignal, SignalGet, SignalUpdate, SignalWith, create_memo,
},
style::{AlignItems, CursorStyle, JustifyContent},
views::{Decorators, contai... | rust | Apache-2.0 | 59ce6df700ce4efbe4498a719fe52195e083d2ee | 2026-01-04T15:32:17.267102Z | false |
lapce/lapce | https://github.com/lapce/lapce/blob/59ce6df700ce4efbe4498a719fe52195e083d2ee/lapce-app/src/palette.rs | lapce-app/src/palette.rs | use std::{
cell::RefCell,
collections::{HashMap, HashSet},
path::PathBuf,
rc::Rc,
sync::{
Arc,
atomic::{AtomicU64, Ordering},
mpsc::{Receiver, Sender, TryRecvError, channel},
},
time::Instant,
};
use anyhow::Result;
use floem::{
ext_event::{create_ext_action, cre... | rust | Apache-2.0 | 59ce6df700ce4efbe4498a719fe52195e083d2ee | 2026-01-04T15:32:17.267102Z | true |
lapce/lapce | https://github.com/lapce/lapce/blob/59ce6df700ce4efbe4498a719fe52195e083d2ee/lapce-app/src/update.rs | lapce-app/src/update.rs | use std::path::{Path, PathBuf};
use anyhow::{Result, anyhow};
use lapce_core::{directory::Directory, meta};
use serde::Deserialize;
#[derive(Clone, Deserialize, Debug)]
pub struct ReleaseInfo {
pub tag_name: String,
pub target_commitish: String,
pub assets: Vec<ReleaseAsset>,
#[serde(skip)]
pub ve... | rust | Apache-2.0 | 59ce6df700ce4efbe4498a719fe52195e083d2ee | 2026-01-04T15:32:17.267102Z | false |
lapce/lapce | https://github.com/lapce/lapce/blob/59ce6df700ce4efbe4498a719fe52195e083d2ee/lapce-app/src/code_lens.rs | lapce-app/src/code_lens.rs | use std::rc::Rc;
use lapce_rpc::dap_types::{ConfigSource, RunDebugConfig};
use serde::{Deserialize, Serialize};
use serde_json::Value;
use crate::{command::InternalCommand, debug::RunDebugMode, window_tab::CommonData};
#[derive(Serialize, Deserialize)]
struct CargoArgs {
#[serde(rename = "cargoArgs")]
pub ca... | rust | Apache-2.0 | 59ce6df700ce4efbe4498a719fe52195e083d2ee | 2026-01-04T15:32:17.267102Z | false |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.