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/examples/router/src/components/mod.rs
examples/router/src/components/mod.rs
pub mod author_card; pub mod pagination; pub mod post_card; pub mod progress_delay;
rust
Apache-2.0
2019f4577cbdcd389b34973fdec3164be3af941a
2026-01-04T15:33:05.007302Z
false
yewstack/yew
https://github.com/yewstack/yew/blob/2019f4577cbdcd389b34973fdec3164be3af941a/examples/router/src/components/pagination.rs
examples/router/src/components/pagination.rs
use serde::{Deserialize, Serialize}; use yew::prelude::*; use yew_router::prelude::*; use crate::Route; const ELLIPSIS: &str = "\u{02026}"; #[derive(Serialize, Deserialize, PartialEq, Eq, Clone, Debug)] pub struct PageQuery { pub page: u64, } #[derive(Clone, Debug, PartialEq, Eq, Properties)] pub struct Props {...
rust
Apache-2.0
2019f4577cbdcd389b34973fdec3164be3af941a
2026-01-04T15:33:05.007302Z
false
yewstack/yew
https://github.com/yewstack/yew/blob/2019f4577cbdcd389b34973fdec3164be3af941a/examples/game_of_life/src/conway.rs
examples/game_of_life/src/conway.rs
use rand::Rng; pub struct Conway { pub cellules: Vec<bool>, pub width: usize, pub height: usize, } impl Conway { pub fn new(width: usize, height: usize) -> Self { Self { cellules: vec![false; width * height], width, height, } } pub fn alive(...
rust
Apache-2.0
2019f4577cbdcd389b34973fdec3164be3af941a
2026-01-04T15:33:05.007302Z
false
yewstack/yew
https://github.com/yewstack/yew/blob/2019f4577cbdcd389b34973fdec3164be3af941a/examples/game_of_life/src/main.rs
examples/game_of_life/src/main.rs
use gloo::timers::callback::Interval; use yew::html::Scope; use yew::{classes, html, Component, Context, Html}; mod conway; pub enum Msg { Random, Start, Step, Reset, Stop, ToggleCellule((usize, usize)), Tick, } pub struct App { active: bool, conway: conway::Conway, _interval:...
rust
Apache-2.0
2019f4577cbdcd389b34973fdec3164be3af941a
2026-01-04T15:33:05.007302Z
false
yewstack/yew
https://github.com/yewstack/yew/blob/2019f4577cbdcd389b34973fdec3164be3af941a/examples/suspense/src/use_sleep.rs
examples/suspense/src/use_sleep.rs
use std::rc::Rc; use std::time::Duration; use gloo::timers::future::sleep; use yew::prelude::*; use yew::suspense::{Suspension, SuspensionResult}; #[derive(PartialEq)] pub struct SleepState { s: Suspension, } impl SleepState { fn new() -> Self { let s = Suspension::from_future(async { sle...
rust
Apache-2.0
2019f4577cbdcd389b34973fdec3164be3af941a
2026-01-04T15:33:05.007302Z
false
yewstack/yew
https://github.com/yewstack/yew/blob/2019f4577cbdcd389b34973fdec3164be3af941a/examples/suspense/src/struct_consumer.rs
examples/suspense/src/struct_consumer.rs
use web_sys::HtmlTextAreaElement; use yew::prelude::*; use crate::use_sleep; #[function_component] pub fn WithSleep<Comp>() -> HtmlResult where Comp: BaseComponent<Properties = AppContentProps>, { let sleep = use_sleep()?; let sleep = Callback::from(move |_| sleep()); Ok(yew::virtual_dom::VChild::<Com...
rust
Apache-2.0
2019f4577cbdcd389b34973fdec3164be3af941a
2026-01-04T15:33:05.007302Z
false
yewstack/yew
https://github.com/yewstack/yew/blob/2019f4577cbdcd389b34973fdec3164be3af941a/examples/suspense/src/main.rs
examples/suspense/src/main.rs
use web_sys::HtmlTextAreaElement; use yew::prelude::*; mod struct_consumer; mod use_sleep; pub use use_sleep::use_sleep; #[derive(Debug, PartialEq, Properties)] struct PleaseWaitProps { from: &'static str, } #[function_component(PleaseWait)] fn please_wait(props: &PleaseWaitProps) -> Html { html! {<div clas...
rust
Apache-2.0
2019f4577cbdcd389b34973fdec3164be3af941a
2026-01-04T15:33:05.007302Z
false
yewstack/yew
https://github.com/yewstack/yew/blob/2019f4577cbdcd389b34973fdec3164be3af941a/examples/contexts/src/producer.rs
examples/contexts/src/producer.rs
use yew::prelude::*; use super::msg_ctx::MessageContext; #[function_component] pub fn Producer() -> Html { let msg_ctx = use_context::<MessageContext>().unwrap(); html! { <button onclick={move |_| msg_ctx.dispatch("Message Received.".to_string())}> {"PRESS ME"} </button> } }
rust
Apache-2.0
2019f4577cbdcd389b34973fdec3164be3af941a
2026-01-04T15:33:05.007302Z
false
yewstack/yew
https://github.com/yewstack/yew/blob/2019f4577cbdcd389b34973fdec3164be3af941a/examples/contexts/src/struct_component_producer.rs
examples/contexts/src/struct_component_producer.rs
use yew::prelude::*; use super::msg_ctx::MessageContext; pub struct StructComponentProducer; impl Component for StructComponentProducer { type Message = (); type Properties = (); fn create(_ctx: &Context<Self>) -> Self { Self } fn view(&self, ctx: &Context<Self>) -> Html { let (...
rust
Apache-2.0
2019f4577cbdcd389b34973fdec3164be3af941a
2026-01-04T15:33:05.007302Z
false
yewstack/yew
https://github.com/yewstack/yew/blob/2019f4577cbdcd389b34973fdec3164be3af941a/examples/contexts/src/msg_ctx.rs
examples/contexts/src/msg_ctx.rs
use std::rc::Rc; use yew::prelude::*; #[derive(Debug, PartialEq, Eq, Clone)] pub struct Message { pub inner: String, } impl Reducible for Message { type Action = String; fn reduce(self: Rc<Self>, action: Self::Action) -> Rc<Self> { Message { inner: action }.into() } } pub type MessageContex...
rust
Apache-2.0
2019f4577cbdcd389b34973fdec3164be3af941a
2026-01-04T15:33:05.007302Z
false
yewstack/yew
https://github.com/yewstack/yew/blob/2019f4577cbdcd389b34973fdec3164be3af941a/examples/contexts/src/struct_component_subscriber.rs
examples/contexts/src/struct_component_subscriber.rs
use yew::prelude::*; use super::msg_ctx::MessageContext; pub enum Msg { MessageContextUpdated(MessageContext), } pub struct StructComponentSubscriber { message: MessageContext, _context_listener: ContextHandle<MessageContext>, } impl Component for StructComponentSubscriber { type Message = Msg; ...
rust
Apache-2.0
2019f4577cbdcd389b34973fdec3164be3af941a
2026-01-04T15:33:05.007302Z
false
yewstack/yew
https://github.com/yewstack/yew/blob/2019f4577cbdcd389b34973fdec3164be3af941a/examples/contexts/src/main.rs
examples/contexts/src/main.rs
mod msg_ctx; mod producer; mod struct_component_producer; mod struct_component_subscriber; mod subscriber; use msg_ctx::MessageProvider; use producer::Producer; use struct_component_producer::StructComponentProducer; use struct_component_subscriber::StructComponentSubscriber; use subscriber::Subscriber; use yew::prelu...
rust
Apache-2.0
2019f4577cbdcd389b34973fdec3164be3af941a
2026-01-04T15:33:05.007302Z
false
yewstack/yew
https://github.com/yewstack/yew/blob/2019f4577cbdcd389b34973fdec3164be3af941a/examples/contexts/src/subscriber.rs
examples/contexts/src/subscriber.rs
use yew::prelude::*; use super::msg_ctx::MessageContext; #[function_component] pub fn Subscriber() -> Html { let msg_ctx = use_context::<MessageContext>().unwrap(); let message = msg_ctx.inner.to_owned(); html! { <h1>{ message }</h1> } }
rust
Apache-2.0
2019f4577cbdcd389b34973fdec3164be3af941a
2026-01-04T15:33:05.007302Z
false
yewstack/yew
https://github.com/yewstack/yew/blob/2019f4577cbdcd389b34973fdec3164be3af941a/examples/counter_functional/src/main.rs
examples/counter_functional/src/main.rs
use yew::prelude::*; #[function_component] fn App() -> Html { let state = use_state(|| 0); let incr_counter = { let state = state.clone(); Callback::from(move |_| state.set(*state + 1)) }; let decr_counter = { let state = state.clone(); Callback::from(move |_| state.se...
rust
Apache-2.0
2019f4577cbdcd389b34973fdec3164be3af941a
2026-01-04T15:33:05.007302Z
false
yewstack/yew
https://github.com/yewstack/yew/blob/2019f4577cbdcd389b34973fdec3164be3af941a/examples/password_strength/src/app.rs
examples/password_strength/src/app.rs
extern crate zxcvbn; use yew::prelude::*; use zxcvbn::zxcvbn; use crate::password::generate_password; use crate::text_input::TextInput; pub enum Msg { SetPassword(String), RegeneratePassword, } #[derive(Debug, Default)] pub struct App { password: String, } impl App { fn get_estimate(&self) -> u8 { ...
rust
Apache-2.0
2019f4577cbdcd389b34973fdec3164be3af941a
2026-01-04T15:33:05.007302Z
false
yewstack/yew
https://github.com/yewstack/yew/blob/2019f4577cbdcd389b34973fdec3164be3af941a/examples/password_strength/src/password.rs
examples/password_strength/src/password.rs
const PASSWORD_LEN: i32 = 17; pub fn generate_password() -> String { let mut space: Vec<char> = vec![]; for c in 'a'..='z' { space.push(c); } for c in 'A'..='Z' { space.push(c); } for c in '0'..='9' { space.push(c); } space.extend( [ '_', ']',...
rust
Apache-2.0
2019f4577cbdcd389b34973fdec3164be3af941a
2026-01-04T15:33:05.007302Z
false
yewstack/yew
https://github.com/yewstack/yew/blob/2019f4577cbdcd389b34973fdec3164be3af941a/examples/password_strength/src/text_input.rs
examples/password_strength/src/text_input.rs
use wasm_bindgen::{JsCast, UnwrapThrowExt}; use web_sys::{Event, HtmlInputElement, InputEvent}; use yew::prelude::*; #[derive(Clone, PartialEq, Properties)] pub struct Props { pub value: String, pub on_change: Callback<String>, } fn get_value_from_input_event(e: InputEvent) -> String { let event: Event = ...
rust
Apache-2.0
2019f4577cbdcd389b34973fdec3164be3af941a
2026-01-04T15:33:05.007302Z
false
yewstack/yew
https://github.com/yewstack/yew/blob/2019f4577cbdcd389b34973fdec3164be3af941a/examples/password_strength/src/main.rs
examples/password_strength/src/main.rs
#![recursion_limit = "256"] mod text_input; mod app; mod password; use app::App; fn main() { yew::Renderer::<App>::new().render(); }
rust
Apache-2.0
2019f4577cbdcd389b34973fdec3164be3af941a
2026-01-04T15:33:05.007302Z
false
yewstack/yew
https://github.com/yewstack/yew/blob/2019f4577cbdcd389b34973fdec3164be3af941a/packages/yew/src/lib.rs
packages/yew/src/lib.rs
#![allow(clippy::needless_doctest_main)] #![doc(html_logo_url = "https://yew.rs/img/logo.png")] #![cfg_attr(documenting, feature(doc_cfg))] #![cfg_attr(nightly_yew, feature(fn_traits, unboxed_closures))] //! # Yew Framework - API Documentation //! //! Yew is a modern Rust framework for creating multi-threaded front-en...
rust
Apache-2.0
2019f4577cbdcd389b34973fdec3164be3af941a
2026-01-04T15:33:05.007302Z
false
yewstack/yew
https://github.com/yewstack/yew/blob/2019f4577cbdcd389b34973fdec3164be3af941a/packages/yew/src/renderer.rs
packages/yew/src/renderer.rs
use std::cell::Cell; use std::panic::PanicHookInfo as PanicInfo; use std::rc::Rc; use web_sys::Element; use crate::app_handle::AppHandle; use crate::html::BaseComponent; thread_local! { static PANIC_HOOK_IS_SET: Cell<bool> = const { Cell::new(false) }; } /// Set a custom panic hook. /// Unless a panic hook is s...
rust
Apache-2.0
2019f4577cbdcd389b34973fdec3164be3af941a
2026-01-04T15:33:05.007302Z
false
yewstack/yew
https://github.com/yewstack/yew/blob/2019f4577cbdcd389b34973fdec3164be3af941a/packages/yew/src/server_renderer.rs
packages/yew/src/server_renderer.rs
use std::fmt; use std::future::Future; use futures::pin_mut; use futures::stream::{Stream, StreamExt}; use tracing::Instrument; use crate::html::{BaseComponent, Scope}; use crate::platform::fmt::BufStream; use crate::platform::{LocalHandle, Runtime}; #[cfg(feature = "ssr")] pub(crate) mod feat_ssr { /// Passed t...
rust
Apache-2.0
2019f4577cbdcd389b34973fdec3164be3af941a
2026-01-04T15:33:05.007302Z
false
yewstack/yew
https://github.com/yewstack/yew/blob/2019f4577cbdcd389b34973fdec3164be3af941a/packages/yew/src/callback.rs
packages/yew/src/callback.rs
//! This module contains data types for interacting with `Scope`s. //! //! ## Relevant examples //! - [Counter](https://github.com/yewstack/yew/tree/master/examples/counter) //! - [Timer](https://github.com/yewstack/yew/tree/master/examples/timer) use std::fmt; use std::rc::Rc; use crate::html::ImplicitClone; macro_...
rust
Apache-2.0
2019f4577cbdcd389b34973fdec3164be3af941a
2026-01-04T15:33:05.007302Z
false
yewstack/yew
https://github.com/yewstack/yew/blob/2019f4577cbdcd389b34973fdec3164be3af941a/packages/yew/src/platform.rs
packages/yew/src/platform.rs
//! Yew's compatibility between JavaScript Runtime and Native Runtimes. //! //! This module is also published under the name [tokise] on crates.io. //! //! # Rationale //! //! When designing components and libraries that works on both WebAssembly targets backed by //! JavaScript Runtime and non-WebAssembly targets with...
rust
Apache-2.0
2019f4577cbdcd389b34973fdec3164be3af941a
2026-01-04T15:33:05.007302Z
false
yewstack/yew
https://github.com/yewstack/yew/blob/2019f4577cbdcd389b34973fdec3164be3af941a/packages/yew/src/app_handle.rs
packages/yew/src/app_handle.rs
//! [AppHandle] contains the state Yew keeps to bootstrap a component in an isolated scope. use std::ops::Deref; use std::rc::Rc; use web_sys::Element; use crate::dom_bundle::{BSubtree, DomSlot}; use crate::html::{BaseComponent, Scope, Scoped}; /// An instance of an application. #[derive(Debug)] pub struct AppHandl...
rust
Apache-2.0
2019f4577cbdcd389b34973fdec3164be3af941a
2026-01-04T15:33:05.007302Z
false
yewstack/yew
https://github.com/yewstack/yew/blob/2019f4577cbdcd389b34973fdec3164be3af941a/packages/yew/src/context.rs
packages/yew/src/context.rs
//! This module defines the `ContextProvider` component. use std::cell::RefCell; use slab::Slab; use crate::html::Scope; use crate::{Callback, Component, Context, Html, Properties}; /// Props for [`ContextProvider`] #[derive(Debug, Clone, PartialEq, Properties)] pub struct ContextProviderProps<T: Clone + PartialEq>...
rust
Apache-2.0
2019f4577cbdcd389b34973fdec3164be3af941a
2026-01-04T15:33:05.007302Z
false
yewstack/yew
https://github.com/yewstack/yew/blob/2019f4577cbdcd389b34973fdec3164be3af941a/packages/yew/src/sealed.rs
packages/yew/src/sealed.rs
/// Base traits for sealed traits. pub trait Sealed {}
rust
Apache-2.0
2019f4577cbdcd389b34973fdec3164be3af941a
2026-01-04T15:33:05.007302Z
false
yewstack/yew
https://github.com/yewstack/yew/blob/2019f4577cbdcd389b34973fdec3164be3af941a/packages/yew/src/scheduler.rs
packages/yew/src/scheduler.rs
//! This module contains a scheduler. use std::cell::RefCell; use std::collections::BTreeMap; use std::rc::Rc; /// Alias for `Rc<RefCell<T>>` pub type Shared<T> = Rc<RefCell<T>>; /// A routine which could be run. pub trait Runnable { /// Runs a routine with a context instance. fn run(self: Box<Self>); } str...
rust
Apache-2.0
2019f4577cbdcd389b34973fdec3164be3af941a
2026-01-04T15:33:05.007302Z
false
yewstack/yew
https://github.com/yewstack/yew/blob/2019f4577cbdcd389b34973fdec3164be3af941a/packages/yew/src/virtual_dom/key.rs
packages/yew/src/virtual_dom/key.rs
//! This module contains the implementation yew's virtual nodes' keys. use std::fmt::{self, Display, Formatter}; use std::ops::Deref; use std::rc::Rc; use crate::html::ImplicitClone; /// Represents the (optional) key of Yew's virtual nodes. /// /// Keys are cheap to clone. #[derive(Clone, ImplicitClone, Debug, Ord, ...
rust
Apache-2.0
2019f4577cbdcd389b34973fdec3164be3af941a
2026-01-04T15:33:05.007302Z
false
yewstack/yew
https://github.com/yewstack/yew/blob/2019f4577cbdcd389b34973fdec3164be3af941a/packages/yew/src/virtual_dom/vlist.rs
packages/yew/src/virtual_dom/vlist.rs
//! This module contains fragments implementation. use std::ops::{Deref, DerefMut}; use std::rc::Rc; use super::{Key, VNode}; #[doc(hidden)] #[derive(Clone, Copy, Debug, PartialEq)] pub enum FullyKeyedState { KnownFullyKeyed, KnownMissingKeys, Unknown, } /// This struct represents a fragment of the Virtu...
rust
Apache-2.0
2019f4577cbdcd389b34973fdec3164be3af941a
2026-01-04T15:33:05.007302Z
false
yewstack/yew
https://github.com/yewstack/yew/blob/2019f4577cbdcd389b34973fdec3164be3af941a/packages/yew/src/virtual_dom/vportal.rs
packages/yew/src/virtual_dom/vportal.rs
//! This module contains the implementation of a portal `VPortal`. use web_sys::{Element, Node}; use super::VNode; #[derive(Debug, Clone, PartialEq)] pub struct VPortal { /// The element under which the content is inserted. pub host: Element, /// The next sibling after the inserted content. Must be a chi...
rust
Apache-2.0
2019f4577cbdcd389b34973fdec3164be3af941a
2026-01-04T15:33:05.007302Z
false
yewstack/yew
https://github.com/yewstack/yew/blob/2019f4577cbdcd389b34973fdec3164be3af941a/packages/yew/src/virtual_dom/listeners.rs
packages/yew/src/virtual_dom/listeners.rs
use std::rc::Rc; use crate::html::ImplicitClone; /// The [Listener] trait is an universal implementation of an event listener /// which is used to bind Rust-listener to JS-listener (DOM). pub trait Listener { /// Returns the name of the event fn kind(&self) -> ListenerKind; /// Handles an event firing ...
rust
Apache-2.0
2019f4577cbdcd389b34973fdec3164be3af941a
2026-01-04T15:33:05.007302Z
false
yewstack/yew
https://github.com/yewstack/yew/blob/2019f4577cbdcd389b34973fdec3164be3af941a/packages/yew/src/virtual_dom/vcomp.rs
packages/yew/src/virtual_dom/vcomp.rs
//! This module contains the implementation of a virtual component (`VComp`). use std::any::{Any, TypeId}; use std::fmt; use std::rc::Rc; #[cfg(feature = "ssr")] use futures::future::{FutureExt, LocalBoxFuture}; #[cfg(feature = "csr")] use web_sys::Element; use super::Key; #[cfg(feature = "hydration")] use crate::do...
rust
Apache-2.0
2019f4577cbdcd389b34973fdec3164be3af941a
2026-01-04T15:33:05.007302Z
false
yewstack/yew
https://github.com/yewstack/yew/blob/2019f4577cbdcd389b34973fdec3164be3af941a/packages/yew/src/virtual_dom/vnode.rs
packages/yew/src/virtual_dom/vnode.rs
//! This module contains the implementation of abstract virtual node. use std::cmp::PartialEq; use std::iter::FromIterator; use std::rc::Rc; use std::{fmt, mem}; use web_sys::Node; use super::{Key, VChild, VComp, VList, VPortal, VSuspense, VTag, VText}; use crate::html::{BaseComponent, ImplicitClone}; use crate::vir...
rust
Apache-2.0
2019f4577cbdcd389b34973fdec3164be3af941a
2026-01-04T15:33:05.007302Z
false
yewstack/yew
https://github.com/yewstack/yew/blob/2019f4577cbdcd389b34973fdec3164be3af941a/packages/yew/src/virtual_dom/mod.rs
packages/yew/src/virtual_dom/mod.rs
//! This module contains Yew's implementation of a reactive virtual DOM. #[doc(hidden)] pub mod key; #[doc(hidden)] pub mod listeners; #[doc(hidden)] pub mod vcomp; #[doc(hidden)] pub mod vlist; #[doc(hidden)] pub mod vnode; #[doc(hidden)] pub mod vportal; #[doc(hidden)] pub mod vraw; #[doc(hidden)] pub mod vsuspense;...
rust
Apache-2.0
2019f4577cbdcd389b34973fdec3164be3af941a
2026-01-04T15:33:05.007302Z
false
yewstack/yew
https://github.com/yewstack/yew/blob/2019f4577cbdcd389b34973fdec3164be3af941a/packages/yew/src/virtual_dom/vsuspense.rs
packages/yew/src/virtual_dom/vsuspense.rs
use super::{Key, VNode}; use crate::html::ImplicitClone; /// This struct represents a suspendable DOM fragment. #[derive(Clone, ImplicitClone, Debug, PartialEq)] pub struct VSuspense { /// Child nodes. pub(crate) children: VNode, /// Fallback nodes when suspended. pub(crate) fallback: VNode, /// Wh...
rust
Apache-2.0
2019f4577cbdcd389b34973fdec3164be3af941a
2026-01-04T15:33:05.007302Z
false
yewstack/yew
https://github.com/yewstack/yew/blob/2019f4577cbdcd389b34973fdec3164be3af941a/packages/yew/src/virtual_dom/vraw.rs
packages/yew/src/virtual_dom/vraw.rs
use crate::html::ImplicitClone; use crate::AttrValue; /// A raw HTML string to be used in VDOM. #[derive(Clone, ImplicitClone, Debug, PartialEq, Eq)] pub struct VRaw { pub html: AttrValue, } impl From<AttrValue> for VRaw { fn from(html: AttrValue) -> Self { Self { html } } } #[cfg(feature = "ssr"...
rust
Apache-2.0
2019f4577cbdcd389b34973fdec3164be3af941a
2026-01-04T15:33:05.007302Z
false
yewstack/yew
https://github.com/yewstack/yew/blob/2019f4577cbdcd389b34973fdec3164be3af941a/packages/yew/src/virtual_dom/vtext.rs
packages/yew/src/virtual_dom/vtext.rs
//! This module contains the implementation of a virtual text node `VText`. use std::cmp::PartialEq; use super::AttrValue; use crate::html::ImplicitClone; /// A type for a virtual /// [`TextNode`](https://developer.mozilla.org/en-US/docs/Web/API/Document/createTextNode) /// representation. #[derive(Clone, ImplicitCl...
rust
Apache-2.0
2019f4577cbdcd389b34973fdec3164be3af941a
2026-01-04T15:33:05.007302Z
false
yewstack/yew
https://github.com/yewstack/yew/blob/2019f4577cbdcd389b34973fdec3164be3af941a/packages/yew/src/virtual_dom/vtag.rs
packages/yew/src/virtual_dom/vtag.rs
//! This module contains the implementation of a virtual element node [VTag]. use std::cmp::PartialEq; use std::marker::PhantomData; use std::mem; use std::ops::{Deref, DerefMut}; use std::rc::Rc; use wasm_bindgen::JsValue; use web_sys::{HtmlInputElement as InputElement, HtmlTextAreaElement as TextAreaElement}; use ...
rust
Apache-2.0
2019f4577cbdcd389b34973fdec3164be3af941a
2026-01-04T15:33:05.007302Z
false
yewstack/yew
https://github.com/yewstack/yew/blob/2019f4577cbdcd389b34973fdec3164be3af941a/packages/yew/src/tests/mod.rs
packages/yew/src/tests/mod.rs
//! Internal module for unit tests pub mod layout_tests;
rust
Apache-2.0
2019f4577cbdcd389b34973fdec3164be3af941a
2026-01-04T15:33:05.007302Z
false
yewstack/yew
https://github.com/yewstack/yew/blob/2019f4577cbdcd389b34973fdec3164be3af941a/packages/yew/src/tests/layout_tests.rs
packages/yew/src/tests/layout_tests.rs
//! Snapshot testing of Yew components //! //! This tests must be run in browser and thus require the `csr` feature to be enabled use gloo::console::log; use crate::dom_bundle::{BSubtree, Bundle, DomSlot}; use crate::html::AnyScope; use crate::virtual_dom::VNode; use crate::{scheduler, Component, Context, Html}; #[al...
rust
Apache-2.0
2019f4577cbdcd389b34973fdec3164be3af941a
2026-01-04T15:33:05.007302Z
false
yewstack/yew
https://github.com/yewstack/yew/blob/2019f4577cbdcd389b34973fdec3164be3af941a/packages/yew/src/utils/mod.rs
packages/yew/src/utils/mod.rs
//! This module contains useful utilities to get information about the current document. use std::marker::PhantomData; use std::rc::Rc; use implicit_clone::unsync::IArray; use implicit_clone::ImplicitClone; use yew::html::ChildrenRenderer; /// Map `IntoIterator<Item = Into<T>>` to `Iterator<Item = T>` pub fn into_no...
rust
Apache-2.0
2019f4577cbdcd389b34973fdec3164be3af941a
2026-01-04T15:33:05.007302Z
false
yewstack/yew
https://github.com/yewstack/yew/blob/2019f4577cbdcd389b34973fdec3164be3af941a/packages/yew/src/html/classes.rs
packages/yew/src/html/classes.rs
use std::borrow::Cow; use std::iter::FromIterator; use std::rc::Rc; use indexmap::IndexSet; use super::IntoPropValue; use crate::html::ImplicitClone; use crate::utils::RcExt; use crate::virtual_dom::AttrValue; /// A set of classes, cheap to clone. /// /// The preferred way of creating this is using the [`classes!`][...
rust
Apache-2.0
2019f4577cbdcd389b34973fdec3164be3af941a
2026-01-04T15:33:05.007302Z
false
yewstack/yew
https://github.com/yewstack/yew/blob/2019f4577cbdcd389b34973fdec3164be3af941a/packages/yew/src/html/error.rs
packages/yew/src/html/error.rs
use thiserror::Error; use crate::suspense::Suspension; /// Render Error. #[derive(Error, Debug, Clone, PartialEq)] pub enum RenderError { /// Component Rendering Suspended #[error("component rendering is suspended.")] Suspended(#[from] Suspension), } /// Render Result. pub type RenderResult<T> = std::res...
rust
Apache-2.0
2019f4577cbdcd389b34973fdec3164be3af941a
2026-01-04T15:33:05.007302Z
false
yewstack/yew
https://github.com/yewstack/yew/blob/2019f4577cbdcd389b34973fdec3164be3af941a/packages/yew/src/html/mod.rs
packages/yew/src/html/mod.rs
//! The main html module which defines components, listeners, and class helpers. mod classes; mod component; mod conversion; mod error; mod listener; use std::cell::RefCell; use std::rc::Rc; pub use classes::*; pub use component::*; pub use conversion::*; pub use error::*; pub use listener::*; use wasm_bindgen::JsVa...
rust
Apache-2.0
2019f4577cbdcd389b34973fdec3164be3af941a
2026-01-04T15:33:05.007302Z
false
yewstack/yew
https://github.com/yewstack/yew/blob/2019f4577cbdcd389b34973fdec3164be3af941a/packages/yew/src/html/conversion/into_prop_value.rs
packages/yew/src/html/conversion/into_prop_value.rs
use std::borrow::Cow; use std::rc::Rc; use std::sync::Arc; use implicit_clone::unsync::{IArray, IMap}; pub use implicit_clone::ImplicitClone; use crate::callback::Callback; use crate::html::{BaseComponent, ChildrenRenderer, Component, Scope}; use crate::virtual_dom::{AttrValue, VChild, VList, VNode, VText}; impl<Com...
rust
Apache-2.0
2019f4577cbdcd389b34973fdec3164be3af941a
2026-01-04T15:33:05.007302Z
false
yewstack/yew
https://github.com/yewstack/yew/blob/2019f4577cbdcd389b34973fdec3164be3af941a/packages/yew/src/html/conversion/mod.rs
packages/yew/src/html/conversion/mod.rs
mod into_prop_value; pub use into_prop_value::*;
rust
Apache-2.0
2019f4577cbdcd389b34973fdec3164be3af941a
2026-01-04T15:33:05.007302Z
false
yewstack/yew
https://github.com/yewstack/yew/blob/2019f4577cbdcd389b34973fdec3164be3af941a/packages/yew/src/html/component/properties.rs
packages/yew/src/html/component/properties.rs
//! Component properties module pub use yew_macro::Properties; /// Trait for building properties for a component pub trait Properties: PartialEq { /// Builder that will be used to construct properties type Builder; /// Entrypoint for building properties fn builder() -> Self::Builder; } #[doc(hidden)...
rust
Apache-2.0
2019f4577cbdcd389b34973fdec3164be3af941a
2026-01-04T15:33:05.007302Z
false
yewstack/yew
https://github.com/yewstack/yew/blob/2019f4577cbdcd389b34973fdec3164be3af941a/packages/yew/src/html/component/lifecycle.rs
packages/yew/src/html/component/lifecycle.rs
//! Component lifecycle module use std::any::Any; use std::rc::Rc; #[cfg(feature = "csr")] use web_sys::Element; use super::scope::{AnyScope, Scope}; use super::BaseComponent; #[cfg(feature = "hydration")] use crate::dom_bundle::Fragment; #[cfg(feature = "csr")] use crate::dom_bundle::{BSubtree, Bundle, DomSlot, Dyn...
rust
Apache-2.0
2019f4577cbdcd389b34973fdec3164be3af941a
2026-01-04T15:33:05.007302Z
false
yewstack/yew
https://github.com/yewstack/yew/blob/2019f4577cbdcd389b34973fdec3164be3af941a/packages/yew/src/html/component/scope.rs
packages/yew/src/html/component/scope.rs
//! Component scope module use std::any::{Any, TypeId}; use std::future::Future; use std::marker::PhantomData; use std::ops::Deref; use std::rc::Rc; use std::{fmt, iter}; use futures::{Stream, StreamExt}; #[cfg(any(feature = "csr", feature = "ssr"))] use super::lifecycle::ComponentState; use super::BaseComponent; us...
rust
Apache-2.0
2019f4577cbdcd389b34973fdec3164be3af941a
2026-01-04T15:33:05.007302Z
false
yewstack/yew
https://github.com/yewstack/yew/blob/2019f4577cbdcd389b34973fdec3164be3af941a/packages/yew/src/html/component/mod.rs
packages/yew/src/html/component/mod.rs
//! Components wrapped with context including properties, state, and link mod children; #[cfg(any(feature = "csr", feature = "ssr"))] mod lifecycle; mod marker; mod properties; mod scope; use std::rc::Rc; pub use children::*; pub use marker::*; pub use properties::*; #[cfg(feature = "csr")] pub(crate) use scope::Sco...
rust
Apache-2.0
2019f4577cbdcd389b34973fdec3164be3af941a
2026-01-04T15:33:05.007302Z
false
yewstack/yew
https://github.com/yewstack/yew/blob/2019f4577cbdcd389b34973fdec3164be3af941a/packages/yew/src/html/component/children.rs
packages/yew/src/html/component/children.rs
//! Component children module use std::fmt; use std::rc::Rc; use crate::html::{Html, ImplicitClone}; use crate::utils::RcExt; use crate::virtual_dom::{VChild, VComp, VList, VNode}; use crate::{BaseComponent, Properties}; /// A type used for accepting children elements in Component::Properties. /// /// # Example /// ...
rust
Apache-2.0
2019f4577cbdcd389b34973fdec3164be3af941a
2026-01-04T15:33:05.007302Z
false
yewstack/yew
https://github.com/yewstack/yew/blob/2019f4577cbdcd389b34973fdec3164be3af941a/packages/yew/src/html/component/marker.rs
packages/yew/src/html/component/marker.rs
//! Primitive Components & Properties Types use crate::component; use crate::html::{BaseComponent, ChildrenProps, Html}; /// A Component to represent a component that does not exist in current implementation. /// /// During Hydration, Yew expected the Virtual DOM hierarchy to match the layout used in /// server-side ...
rust
Apache-2.0
2019f4577cbdcd389b34973fdec3164be3af941a
2026-01-04T15:33:05.007302Z
false
yewstack/yew
https://github.com/yewstack/yew/blob/2019f4577cbdcd389b34973fdec3164be3af941a/packages/yew/src/html/listener/mod.rs
packages/yew/src/html/listener/mod.rs
#[macro_use] mod events; pub use events::*; use wasm_bindgen::JsCast; use web_sys::{Event, EventTarget}; use crate::Callback; /// Cast [Event] `e` into it's target `T`. /// /// This function mainly exists to provide type inference in the [impl_action] macro to the compiler /// and avoid some verbosity by not having ...
rust
Apache-2.0
2019f4577cbdcd389b34973fdec3164be3af941a
2026-01-04T15:33:05.007302Z
false
yewstack/yew
https://github.com/yewstack/yew/blob/2019f4577cbdcd389b34973fdec3164be3af941a/packages/yew/src/html/listener/events.rs
packages/yew/src/html/listener/events.rs
// Inspired by: http://package.elm-lang.org/packages/elm-lang/html/2.0.0/Html-Events macro_rules! impl_action { ($($action:ident($type:ident) -> $ret:path => $convert:path)*) => {$( impl_action!($action($type, false) -> $ret => $convert); )*}; ($($action:ident($type:ident, $passive:literal) -> $ret...
rust
Apache-2.0
2019f4577cbdcd389b34973fdec3164be3af941a
2026-01-04T15:33:05.007302Z
false
yewstack/yew
https://github.com/yewstack/yew/blob/2019f4577cbdcd389b34973fdec3164be3af941a/packages/yew/src/dom_bundle/bsuspense.rs
packages/yew/src/dom_bundle/bsuspense.rs
//! This module contains the bundle version of a supsense [BSuspense] use gloo::utils::document; use web_sys::Element; #[cfg(feature = "hydration")] use super::Fragment; use super::{BNode, BSubtree, DomSlot, Reconcilable, ReconcileTarget}; use crate::html::AnyScope; use crate::virtual_dom::{Key, VSuspense}; #[derive...
rust
Apache-2.0
2019f4577cbdcd389b34973fdec3164be3af941a
2026-01-04T15:33:05.007302Z
false
yewstack/yew
https://github.com/yewstack/yew/blob/2019f4577cbdcd389b34973fdec3164be3af941a/packages/yew/src/dom_bundle/fragment.rs
packages/yew/src/dom_bundle/fragment.rs
use std::collections::VecDeque; use std::ops::{Deref, DerefMut}; use wasm_bindgen::JsCast; use web_sys::{Element, Node}; use super::{BSubtree, DomSlot}; use crate::virtual_dom::Collectable; /// A Hydration Fragment #[derive(Default, Debug, Clone, PartialEq, Eq)] pub(crate) struct Fragment(VecDeque<Node>, Option<Node...
rust
Apache-2.0
2019f4577cbdcd389b34973fdec3164be3af941a
2026-01-04T15:33:05.007302Z
false
yewstack/yew
https://github.com/yewstack/yew/blob/2019f4577cbdcd389b34973fdec3164be3af941a/packages/yew/src/dom_bundle/subtree_root.rs
packages/yew/src/dom_bundle/subtree_root.rs
//! Per-subtree state of apps use std::borrow::Cow; use std::cell::RefCell; use std::collections::HashSet; use std::hash::{Hash, Hasher}; use std::rc::{Rc, Weak}; use std::sync::atomic::{AtomicBool, AtomicU32, Ordering}; use wasm_bindgen::prelude::{wasm_bindgen, Closure}; use wasm_bindgen::{intern, JsCast, UnwrapThro...
rust
Apache-2.0
2019f4577cbdcd389b34973fdec3164be3af941a
2026-01-04T15:33:05.007302Z
false
yewstack/yew
https://github.com/yewstack/yew/blob/2019f4577cbdcd389b34973fdec3164be3af941a/packages/yew/src/dom_bundle/bcomp.rs
packages/yew/src/dom_bundle/bcomp.rs
//! This module contains the bundle implementation of a virtual component [BComp]. use std::any::TypeId; use std::borrow::Borrow; use std::fmt; use web_sys::Element; use super::{BNode, BSubtree, DomSlot, DynamicDomSlot, Reconcilable, ReconcileTarget}; use crate::html::{AnyScope, Scoped}; use crate::virtual_dom::{Key...
rust
Apache-2.0
2019f4577cbdcd389b34973fdec3164be3af941a
2026-01-04T15:33:05.007302Z
false
yewstack/yew
https://github.com/yewstack/yew/blob/2019f4577cbdcd389b34973fdec3164be3af941a/packages/yew/src/dom_bundle/utils.rs
packages/yew/src/dom_bundle/utils.rs
#[cfg(all(test, target_arch = "wasm32", verbose_tests))] macro_rules! test_log { ($fmt:literal, $($arg:expr),* $(,)?) => { ::wasm_bindgen_test::console_log!(concat!("\t ", $fmt), $($arg),*); }; } #[cfg(not(all(test, target_arch = "wasm32", verbose_tests)))] macro_rules! test_log { ($fmt:literal, $(...
rust
Apache-2.0
2019f4577cbdcd389b34973fdec3164be3af941a
2026-01-04T15:33:05.007302Z
false
yewstack/yew
https://github.com/yewstack/yew/blob/2019f4577cbdcd389b34973fdec3164be3af941a/packages/yew/src/dom_bundle/mod.rs
packages/yew/src/dom_bundle/mod.rs
//! Realizing a virtual dom on the actual DOM //! //! A bundle, borrowed from the mathematical meaning, is any structure over some base space. //! In our case, the base space is the virtual dom we're trying to render. //! In order to efficiently implement updates, and diffing, additional information has to be //! kept ...
rust
Apache-2.0
2019f4577cbdcd389b34973fdec3164be3af941a
2026-01-04T15:33:05.007302Z
false
yewstack/yew
https://github.com/yewstack/yew/blob/2019f4577cbdcd389b34973fdec3164be3af941a/packages/yew/src/dom_bundle/bnode.rs
packages/yew/src/dom_bundle/bnode.rs
//! This module contains the bundle version of an abstract node [BNode] use std::fmt; use web_sys::{Element, Node}; use super::{BComp, BList, BPortal, BRaw, BSubtree, BSuspense, BTag, BText, DomSlot}; use crate::dom_bundle::{Reconcilable, ReconcileTarget}; use crate::html::AnyScope; use crate::utils::RcExt; use crat...
rust
Apache-2.0
2019f4577cbdcd389b34973fdec3164be3af941a
2026-01-04T15:33:05.007302Z
false
yewstack/yew
https://github.com/yewstack/yew/blob/2019f4577cbdcd389b34973fdec3164be3af941a/packages/yew/src/dom_bundle/position.rs
packages/yew/src/dom_bundle/position.rs
//! Structs for keeping track where in the DOM a node belongs use std::cell::RefCell; use std::rc::Rc; use web_sys::{Element, Node}; /// A position in the list of children of an implicit parent [`Element`]. /// /// This can either be in front of a `DomSlot::at(next_sibling)`, at the end of the list with /// `DomSlot...
rust
Apache-2.0
2019f4577cbdcd389b34973fdec3164be3af941a
2026-01-04T15:33:05.007302Z
false
yewstack/yew
https://github.com/yewstack/yew/blob/2019f4577cbdcd389b34973fdec3164be3af941a/packages/yew/src/dom_bundle/traits.rs
packages/yew/src/dom_bundle/traits.rs
use web_sys::Element; use super::{BNode, BSubtree, DomSlot}; use crate::html::AnyScope; /// A Reconcile Target. /// /// When a [Reconcilable] is attached, a reconcile target is created to store additional /// information. pub(super) trait ReconcileTarget { /// Remove self from parent. /// /// Parent to de...
rust
Apache-2.0
2019f4577cbdcd389b34973fdec3164be3af941a
2026-01-04T15:33:05.007302Z
false
yewstack/yew
https://github.com/yewstack/yew/blob/2019f4577cbdcd389b34973fdec3164be3af941a/packages/yew/src/dom_bundle/braw.rs
packages/yew/src/dom_bundle/braw.rs
use wasm_bindgen::JsCast; use web_sys::{Element, Node}; use super::{BNode, BSubtree, DomSlot, Reconcilable, ReconcileTarget}; use crate::html::AnyScope; use crate::virtual_dom::vtag::{MATHML_NAMESPACE, SVG_NAMESPACE}; use crate::virtual_dom::VRaw; use crate::AttrValue; #[derive(Debug)] pub struct BRaw { reference...
rust
Apache-2.0
2019f4577cbdcd389b34973fdec3164be3af941a
2026-01-04T15:33:05.007302Z
false
yewstack/yew
https://github.com/yewstack/yew/blob/2019f4577cbdcd389b34973fdec3164be3af941a/packages/yew/src/dom_bundle/blist.rs
packages/yew/src/dom_bundle/blist.rs
//! This module contains fragments bundles, a [BList] use std::borrow::Borrow; use std::cmp::Ordering; use std::collections::HashSet; use std::hash::Hash; use std::ops::Deref; use web_sys::Element; use super::{test_log, BNode, BSubtree, DomSlot}; use crate::dom_bundle::{Reconcilable, ReconcileTarget}; use crate::html...
rust
Apache-2.0
2019f4577cbdcd389b34973fdec3164be3af941a
2026-01-04T15:33:05.007302Z
true
yewstack/yew
https://github.com/yewstack/yew/blob/2019f4577cbdcd389b34973fdec3164be3af941a/packages/yew/src/dom_bundle/bportal.rs
packages/yew/src/dom_bundle/bportal.rs
//! This module contains the bundle implementation of a portal [BPortal]. use web_sys::{Element, Node}; use super::{test_log, BNode, BSubtree, DomSlot}; use crate::dom_bundle::{Reconcilable, ReconcileTarget}; use crate::html::AnyScope; use crate::virtual_dom::{Key, VPortal}; /// The bundle implementation to [VPortal...
rust
Apache-2.0
2019f4577cbdcd389b34973fdec3164be3af941a
2026-01-04T15:33:05.007302Z
false
yewstack/yew
https://github.com/yewstack/yew/blob/2019f4577cbdcd389b34973fdec3164be3af941a/packages/yew/src/dom_bundle/btext.rs
packages/yew/src/dom_bundle/btext.rs
//! This module contains the bundle implementation of text [BText]. use gloo::utils::document; use web_sys::{Element, Text as TextNode}; use super::{BNode, BSubtree, DomSlot, Reconcilable, ReconcileTarget}; use crate::html::AnyScope; use crate::virtual_dom::{AttrValue, VText}; /// The bundle implementation to [VText...
rust
Apache-2.0
2019f4577cbdcd389b34973fdec3164be3af941a
2026-01-04T15:33:05.007302Z
false
yewstack/yew
https://github.com/yewstack/yew/blob/2019f4577cbdcd389b34973fdec3164be3af941a/packages/yew/src/dom_bundle/btag/listeners.rs
packages/yew/src/dom_bundle/btag/listeners.rs
use std::cell::RefCell; use std::collections::HashMap; use std::ops::Deref; use std::rc::Rc; use wasm_bindgen::prelude::wasm_bindgen; use wasm_bindgen::JsCast; use web_sys::{Element, Event, EventTarget as HtmlEventTarget}; use super::Apply; use crate::dom_bundle::{test_log, BSubtree, EventDescriptor}; use crate::virt...
rust
Apache-2.0
2019f4577cbdcd389b34973fdec3164be3af941a
2026-01-04T15:33:05.007302Z
false
yewstack/yew
https://github.com/yewstack/yew/blob/2019f4577cbdcd389b34973fdec3164be3af941a/packages/yew/src/dom_bundle/btag/mod.rs
packages/yew/src/dom_bundle/btag/mod.rs
//! This module contains the bundle implementation of a tag [BTag] mod attributes; mod listeners; use std::cell::RefCell; use std::collections::HashMap; use std::hint::unreachable_unchecked; use std::ops::DerefMut; use gloo::utils::document; use listeners::ListenerRegistration; pub use listeners::Registry; use wasm_...
rust
Apache-2.0
2019f4577cbdcd389b34973fdec3164be3af941a
2026-01-04T15:33:05.007302Z
true
yewstack/yew
https://github.com/yewstack/yew/blob/2019f4577cbdcd389b34973fdec3164be3af941a/packages/yew/src/dom_bundle/btag/attributes.rs
packages/yew/src/dom_bundle/btag/attributes.rs
use std::collections::HashMap; use std::ops::Deref; use indexmap::IndexMap; use wasm_bindgen::{intern, JsValue}; use web_sys::{Element, HtmlInputElement as InputElement, HtmlTextAreaElement as TextAreaElement}; use yew::AttrValue; use super::Apply; use crate::dom_bundle::BSubtree; use crate::virtual_dom::vtag::{Input...
rust
Apache-2.0
2019f4577cbdcd389b34973fdec3164be3af941a
2026-01-04T15:33:05.007302Z
false
yewstack/yew
https://github.com/yewstack/yew/blob/2019f4577cbdcd389b34973fdec3164be3af941a/packages/yew/src/suspense/suspension.rs
packages/yew/src/suspense/suspension.rs
use std::cell::RefCell; use std::future::Future; use std::pin::Pin; use std::rc::Rc; use std::sync::atomic::{AtomicBool, Ordering}; use std::task::{Context, Poll}; use thiserror::Error; use crate::platform::spawn_local; use crate::Callback; thread_local! { static SUSPENSION_ID: RefCell<usize> = RefCell::default(...
rust
Apache-2.0
2019f4577cbdcd389b34973fdec3164be3af941a
2026-01-04T15:33:05.007302Z
false
yewstack/yew
https://github.com/yewstack/yew/blob/2019f4577cbdcd389b34973fdec3164be3af941a/packages/yew/src/suspense/hooks.rs
packages/yew/src/suspense/hooks.rs
use std::cell::Cell; use std::fmt; use std::future::Future; use std::ops::Deref; use std::rc::Rc; use yew::prelude::*; use yew::suspense::{Suspension, SuspensionResult}; /// This hook is used to await a future in a suspending context. /// /// A [Suspension] is created from the passed future and the result of the futu...
rust
Apache-2.0
2019f4577cbdcd389b34973fdec3164be3af941a
2026-01-04T15:33:05.007302Z
false
yewstack/yew
https://github.com/yewstack/yew/blob/2019f4577cbdcd389b34973fdec3164be3af941a/packages/yew/src/suspense/mod.rs
packages/yew/src/suspense/mod.rs
//! This module provides suspense support. mod component; mod hooks; mod suspension; #[cfg(any(feature = "csr", feature = "ssr"))] pub(crate) use component::BaseSuspense; pub use component::{Suspense, SuspenseProps}; pub use hooks::*; pub use suspension::{Suspension, SuspensionHandle, SuspensionResult};
rust
Apache-2.0
2019f4577cbdcd389b34973fdec3164be3af941a
2026-01-04T15:33:05.007302Z
false
yewstack/yew
https://github.com/yewstack/yew/blob/2019f4577cbdcd389b34973fdec3164be3af941a/packages/yew/src/suspense/component.rs
packages/yew/src/suspense/component.rs
use crate::html::{Html, Properties}; /// Properties for [Suspense]. #[derive(Properties, PartialEq, Debug, Clone)] pub struct SuspenseProps { /// The Children of the current Suspense Component. #[prop_or_default] pub children: Html, /// The Fallback UI of the current Suspense Component. #[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/src/functional/mod.rs
packages/yew/src/functional/mod.rs
//! Function components are a simplified version of normal components. //! They consist of a single function annotated with the attribute `#[component]` //! that receives props and determines what should be rendered by returning [`Html`](crate::Html). //! //! Functions with the attribute have to return `Html` and may t...
rust
Apache-2.0
2019f4577cbdcd389b34973fdec3164be3af941a
2026-01-04T15:33:05.007302Z
false
yewstack/yew
https://github.com/yewstack/yew/blob/2019f4577cbdcd389b34973fdec3164be3af941a/packages/yew/src/functional/hooks/use_effect.rs
packages/yew/src/functional/hooks/use_effect.rs
use std::cell::RefCell; use crate::functional::{hook, Effect, Hook, HookContext}; /// Trait describing the destructor of [`use_effect`] hook. pub trait TearDown: Sized + 'static { /// The function that is executed when destructor is called fn tear_down(self); } impl TearDown for () { fn tear_down(self) {...
rust
Apache-2.0
2019f4577cbdcd389b34973fdec3164be3af941a
2026-01-04T15:33:05.007302Z
false
yewstack/yew
https://github.com/yewstack/yew/blob/2019f4577cbdcd389b34973fdec3164be3af941a/packages/yew/src/functional/hooks/use_state.rs
packages/yew/src/functional/hooks/use_state.rs
use std::fmt; use std::ops::Deref; use std::rc::Rc; use implicit_clone::ImplicitClone; use super::{use_reducer, use_reducer_eq, Reducible, UseReducerDispatcher, UseReducerHandle}; use crate::functional::hook; use crate::html::IntoPropValue; use crate::Callback; struct UseStateReducer<T> { value: T, } impl<T> Re...
rust
Apache-2.0
2019f4577cbdcd389b34973fdec3164be3af941a
2026-01-04T15:33:05.007302Z
false
yewstack/yew
https://github.com/yewstack/yew/blob/2019f4577cbdcd389b34973fdec3164be3af941a/packages/yew/src/functional/hooks/use_callback.rs
packages/yew/src/functional/hooks/use_callback.rs
use std::rc::Rc; use crate::callback::Callback; use crate::functional::{hook, use_memo}; /// Get a immutable reference to a memoized `Callback`. Its state persists across renders. /// It will be recreated only if any of the dependencies changes value. /// /// Memoization means it will only get recreated when provided...
rust
Apache-2.0
2019f4577cbdcd389b34973fdec3164be3af941a
2026-01-04T15:33:05.007302Z
false
yewstack/yew
https://github.com/yewstack/yew/blob/2019f4577cbdcd389b34973fdec3164be3af941a/packages/yew/src/functional/hooks/use_ref.rs
packages/yew/src/functional/hooks/use_ref.rs
use std::cell::RefCell; use std::rc::Rc; use crate::functional::{hook, use_state, Hook, HookContext}; use crate::NodeRef; struct UseRef<F> { init_fn: F, } impl<T: 'static, F: FnOnce() -> T> Hook for UseRef<F> { type Output = Rc<T>; fn run(self, ctx: &mut HookContext) -> Self::Output { ctx.next_s...
rust
Apache-2.0
2019f4577cbdcd389b34973fdec3164be3af941a
2026-01-04T15:33:05.007302Z
false
yewstack/yew
https://github.com/yewstack/yew/blob/2019f4577cbdcd389b34973fdec3164be3af941a/packages/yew/src/functional/hooks/use_reducer.rs
packages/yew/src/functional/hooks/use_reducer.rs
use std::cell::RefCell; use std::fmt; use std::marker::PhantomData; use std::ops::Deref; use std::rc::Rc; use implicit_clone::ImplicitClone; use crate::functional::{hook, Hook, HookContext}; use crate::html::IntoPropValue; use crate::Callback; type DispatchFn<T> = Rc<dyn Fn(<T as Reducible>::Action)>; /// A trait t...
rust
Apache-2.0
2019f4577cbdcd389b34973fdec3164be3af941a
2026-01-04T15:33:05.007302Z
false
yewstack/yew
https://github.com/yewstack/yew/blob/2019f4577cbdcd389b34973fdec3164be3af941a/packages/yew/src/functional/hooks/mod.rs
packages/yew/src/functional/hooks/mod.rs
mod use_callback; mod use_context; mod use_effect; mod use_force_update; mod use_memo; mod use_prepared_state; mod use_reducer; mod use_ref; mod use_state; mod use_transitive_state; pub use use_callback::*; pub use use_context::*; pub use use_effect::*; pub use use_force_update::*; pub use use_memo::*; pub use use_pr...
rust
Apache-2.0
2019f4577cbdcd389b34973fdec3164be3af941a
2026-01-04T15:33:05.007302Z
false
yewstack/yew
https://github.com/yewstack/yew/blob/2019f4577cbdcd389b34973fdec3164be3af941a/packages/yew/src/functional/hooks/use_force_update.rs
packages/yew/src/functional/hooks/use_force_update.rs
use std::fmt; use super::{Hook, HookContext}; use crate::functional::ReRender; /// A handle which can be used to force a re-render of the associated /// function component. #[derive(Clone)] pub struct UseForceUpdateHandle { trigger: ReRender, } impl fmt::Debug for UseForceUpdateHandle { fn fmt(&self, f: &mut...
rust
Apache-2.0
2019f4577cbdcd389b34973fdec3164be3af941a
2026-01-04T15:33:05.007302Z
false
yewstack/yew
https://github.com/yewstack/yew/blob/2019f4577cbdcd389b34973fdec3164be3af941a/packages/yew/src/functional/hooks/use_memo.rs
packages/yew/src/functional/hooks/use_memo.rs
use std::borrow::Borrow; use std::rc::Rc; use super::use_mut_ref; use crate::functional::hook; /// Get a immutable reference to a memoized value. /// /// This version allows for a key cache key derivation that only borrows /// like the original argument. For example, using ` K = Rc<D>`, we only /// create a shared re...
rust
Apache-2.0
2019f4577cbdcd389b34973fdec3164be3af941a
2026-01-04T15:33:05.007302Z
false
yewstack/yew
https://github.com/yewstack/yew/blob/2019f4577cbdcd389b34973fdec3164be3af941a/packages/yew/src/functional/hooks/use_context.rs
packages/yew/src/functional/hooks/use_context.rs
use std::cell::RefCell; use std::marker::PhantomData; use std::rc::Rc; use crate::callback::Callback; use crate::context::ContextHandle; use crate::functional::{Hook, HookContext}; /// Hook for consuming context values in function components. /// The context of the type passed as `T` is returned. If there is no such ...
rust
Apache-2.0
2019f4577cbdcd389b34973fdec3164be3af941a
2026-01-04T15:33:05.007302Z
false
yewstack/yew
https://github.com/yewstack/yew/blob/2019f4577cbdcd389b34973fdec3164be3af941a/packages/yew/src/functional/hooks/use_transitive_state/feat_hydration.rs
packages/yew/src/functional/hooks/use_transitive_state/feat_hydration.rs
//! The hydration variant. //! //! This is the same as the use_prepared_state. #[doc(hidden)] pub use crate::functional::hooks::use_prepared_state::feat_hydration::use_prepared_state as use_transitive_state;
rust
Apache-2.0
2019f4577cbdcd389b34973fdec3164be3af941a
2026-01-04T15:33:05.007302Z
false
yewstack/yew
https://github.com/yewstack/yew/blob/2019f4577cbdcd389b34973fdec3164be3af941a/packages/yew/src/functional/hooks/use_transitive_state/feat_hydration_ssr.rs
packages/yew/src/functional/hooks/use_transitive_state/feat_hydration_ssr.rs
//! The client-and-server-side rendering variant. use std::rc::Rc; use serde::de::DeserializeOwned; use serde::Serialize; use super::{feat_hydration, feat_ssr}; use crate::functional::{Hook, HookContext}; use crate::html::RenderMode; use crate::suspense::SuspensionResult; #[doc(hidden)] pub fn use_transitive_state<...
rust
Apache-2.0
2019f4577cbdcd389b34973fdec3164be3af941a
2026-01-04T15:33:05.007302Z
false
yewstack/yew
https://github.com/yewstack/yew/blob/2019f4577cbdcd389b34973fdec3164be3af941a/packages/yew/src/functional/hooks/use_transitive_state/mod.rs
packages/yew/src/functional/hooks/use_transitive_state/mod.rs
#[cfg(feature = "hydration")] mod feat_hydration; #[cfg(all(feature = "ssr", feature = "hydration"))] mod feat_hydration_ssr; #[cfg(not(any(feature = "hydration", feature = "ssr")))] mod feat_none; #[cfg(feature = "ssr")] mod feat_ssr; #[cfg(all(feature = "hydration", not(feature = "ssr")))] pub use feat_hydration::*;...
rust
Apache-2.0
2019f4577cbdcd389b34973fdec3164be3af941a
2026-01-04T15:33:05.007302Z
false
yewstack/yew
https://github.com/yewstack/yew/blob/2019f4577cbdcd389b34973fdec3164be3af941a/packages/yew/src/functional/hooks/use_transitive_state/feat_ssr.rs
packages/yew/src/functional/hooks/use_transitive_state/feat_ssr.rs
//! The server-side rendering variant. use std::cell::RefCell; use std::rc::Rc; use base64ct::{Base64, Encoding}; use serde::de::DeserializeOwned; use serde::Serialize; use crate::functional::{Hook, HookContext, PreparedState}; use crate::suspense::SuspensionResult; pub(super) struct TransitiveStateBase<T, D, F> wh...
rust
Apache-2.0
2019f4577cbdcd389b34973fdec3164be3af941a
2026-01-04T15:33:05.007302Z
false
yewstack/yew
https://github.com/yewstack/yew/blob/2019f4577cbdcd389b34973fdec3164be3af941a/packages/yew/src/functional/hooks/use_transitive_state/feat_none.rs
packages/yew/src/functional/hooks/use_transitive_state/feat_none.rs
//! The noop variant. This is used for client side rendering when hydration is disabled. #[doc(hidden)] pub use crate::functional::hooks::use_prepared_state::feat_none::use_prepared_state as use_transitive_state;
rust
Apache-2.0
2019f4577cbdcd389b34973fdec3164be3af941a
2026-01-04T15:33:05.007302Z
false
yewstack/yew
https://github.com/yewstack/yew/blob/2019f4577cbdcd389b34973fdec3164be3af941a/packages/yew/src/functional/hooks/use_prepared_state/feat_hydration.rs
packages/yew/src/functional/hooks/use_prepared_state/feat_hydration.rs
//! The client-side rendering variant. This is used for client side rendering. use std::marker::PhantomData; use std::rc::Rc; use serde::de::DeserializeOwned; use serde::Serialize; use wasm_bindgen::JsValue; use super::PreparedStateBase; use crate::functional::{use_state, Hook, HookContext}; use crate::platform::spa...
rust
Apache-2.0
2019f4577cbdcd389b34973fdec3164be3af941a
2026-01-04T15:33:05.007302Z
false
yewstack/yew
https://github.com/yewstack/yew/blob/2019f4577cbdcd389b34973fdec3164be3af941a/packages/yew/src/functional/hooks/use_prepared_state/feat_hydration_ssr.rs
packages/yew/src/functional/hooks/use_prepared_state/feat_hydration_ssr.rs
//! The client-and-server-side rendering variant. use std::future::Future; use std::rc::Rc; use serde::de::DeserializeOwned; use serde::Serialize; use super::{feat_hydration, feat_ssr}; use crate::functional::{Hook, HookContext}; use crate::html::RenderMode; use crate::suspense::SuspensionResult; #[doc(hidden)] pub...
rust
Apache-2.0
2019f4577cbdcd389b34973fdec3164be3af941a
2026-01-04T15:33:05.007302Z
false
yewstack/yew
https://github.com/yewstack/yew/blob/2019f4577cbdcd389b34973fdec3164be3af941a/packages/yew/src/functional/hooks/use_prepared_state/mod.rs
packages/yew/src/functional/hooks/use_prepared_state/mod.rs
#[cfg(feature = "hydration")] pub(super) mod feat_hydration; #[cfg(all(feature = "hydration", feature = "ssr"))] mod feat_hydration_ssr; #[cfg(not(any(feature = "hydration", feature = "ssr")))] pub(super) mod feat_none; #[cfg(feature = "ssr")] mod feat_ssr; #[cfg(all(feature = "hydration", not(feature = "ssr")))] pub ...
rust
Apache-2.0
2019f4577cbdcd389b34973fdec3164be3af941a
2026-01-04T15:33:05.007302Z
false
yewstack/yew
https://github.com/yewstack/yew/blob/2019f4577cbdcd389b34973fdec3164be3af941a/packages/yew/src/functional/hooks/use_prepared_state/feat_ssr.rs
packages/yew/src/functional/hooks/use_prepared_state/feat_ssr.rs
//! The server-side rendering variant. This is used for server side rendering. use std::future::Future; use std::marker::PhantomData; use std::rc::Rc; use serde::de::DeserializeOwned; use serde::Serialize; use super::PreparedStateBase; use crate::functional::{use_memo, use_state, Hook, HookContext}; use crate::platf...
rust
Apache-2.0
2019f4577cbdcd389b34973fdec3164be3af941a
2026-01-04T15:33:05.007302Z
false
yewstack/yew
https://github.com/yewstack/yew/blob/2019f4577cbdcd389b34973fdec3164be3af941a/packages/yew/src/functional/hooks/use_prepared_state/feat_none.rs
packages/yew/src/functional/hooks/use_prepared_state/feat_none.rs
//! The noop variant. This is used for client side rendering when hydration is disabled. use std::rc::Rc; use serde::de::DeserializeOwned; use serde::Serialize; use crate::hook; use crate::suspense::SuspensionResult; #[doc(hidden)] #[hook] pub fn use_prepared_state<T, D>(_deps: D) -> SuspensionResult<Option<Rc<T>>>...
rust
Apache-2.0
2019f4577cbdcd389b34973fdec3164be3af941a
2026-01-04T15:33:05.007302Z
false
yewstack/yew
https://github.com/yewstack/yew/blob/2019f4577cbdcd389b34973fdec3164be3af941a/packages/yew/tests/use_effect.rs
packages/yew/tests/use_effect.rs
#![cfg(all(target_arch = "wasm32", not(target_os = "wasi")))] mod common; use std::ops::{Deref, DerefMut}; use std::rc::Rc; use std::time::Duration; use common::obtain_result; use wasm_bindgen_test::*; use yew::platform::time::sleep; use yew::prelude::*; wasm_bindgen_test::wasm_bindgen_test_configure!(run_in_browse...
rust
Apache-2.0
2019f4577cbdcd389b34973fdec3164be3af941a
2026-01-04T15:33:05.007302Z
false
yewstack/yew
https://github.com/yewstack/yew/blob/2019f4577cbdcd389b34973fdec3164be3af941a/packages/yew/tests/suspense.rs
packages/yew/tests/suspense.rs
#![cfg(all(target_arch = "wasm32", not(target_os = "wasi")))] mod common; use std::cell::RefCell; use std::rc::Rc; use std::time::Duration; use common::obtain_result; use wasm_bindgen::JsCast; use wasm_bindgen_test::*; use web_sys::{HtmlElement, HtmlTextAreaElement}; use yew::platform::spawn_local; use yew::platform...
rust
Apache-2.0
2019f4577cbdcd389b34973fdec3164be3af941a
2026-01-04T15:33:05.007302Z
false
yewstack/yew
https://github.com/yewstack/yew/blob/2019f4577cbdcd389b34973fdec3164be3af941a/packages/yew/tests/use_state.rs
packages/yew/tests/use_state.rs
#![cfg(all(target_arch = "wasm32", not(target_os = "wasi")))] mod common; use std::time::Duration; use common::obtain_result; use wasm_bindgen_test::*; use yew::platform::time::sleep; use yew::prelude::*; wasm_bindgen_test::wasm_bindgen_test_configure!(run_in_browser); #[wasm_bindgen_test] async fn use_state_works...
rust
Apache-2.0
2019f4577cbdcd389b34973fdec3164be3af941a
2026-01-04T15:33:05.007302Z
false
yewstack/yew
https://github.com/yewstack/yew/blob/2019f4577cbdcd389b34973fdec3164be3af941a/packages/yew/tests/use_callback.rs
packages/yew/tests/use_callback.rs
#![cfg(all(target_arch = "wasm32", not(target_os = "wasi")))] use std::sync::atomic::{AtomicBool, Ordering}; mod common; use std::time::Duration; use common::obtain_result; use wasm_bindgen_test::*; use yew::platform::time::sleep; use yew::prelude::*; wasm_bindgen_test::wasm_bindgen_test_configure!(run_in_browser)...
rust
Apache-2.0
2019f4577cbdcd389b34973fdec3164be3af941a
2026-01-04T15:33:05.007302Z
false
yewstack/yew
https://github.com/yewstack/yew/blob/2019f4577cbdcd389b34973fdec3164be3af941a/packages/yew/tests/use_transitive_state.rs
packages/yew/tests/use_transitive_state.rs
#![cfg(feature = "hydration")] #![cfg(target_arch = "wasm32")] use std::time::Duration; mod common; use common::obtain_result_by_id; use wasm_bindgen_test::*; use yew::platform::time::sleep; use yew::prelude::*; use yew::{Renderer, ServerRenderer}; wasm_bindgen_test::wasm_bindgen_test_configure!(run_in_browser); #...
rust
Apache-2.0
2019f4577cbdcd389b34973fdec3164be3af941a
2026-01-04T15:33:05.007302Z
false
yewstack/yew
https://github.com/yewstack/yew/blob/2019f4577cbdcd389b34973fdec3164be3af941a/packages/yew/tests/use_ref.rs
packages/yew/tests/use_ref.rs
#![cfg(all(target_arch = "wasm32", not(target_os = "wasi")))] mod common; use std::ops::DerefMut; use std::time::Duration; use common::obtain_result; use wasm_bindgen_test::*; use yew::platform::time::sleep; use yew::prelude::*; wasm_bindgen_test::wasm_bindgen_test_configure!(run_in_browser); #[wasm_bindgen_test] ...
rust
Apache-2.0
2019f4577cbdcd389b34973fdec3164be3af941a
2026-01-04T15:33:05.007302Z
false