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
leptos-rs/leptos
https://github.com/leptos-rs/leptos/blob/dd507168fa47b5eead64339431b0bd654bd1c951/server_fn/src/middleware/mod.rs
server_fn/src/middleware/mod.rs
use crate::error::ServerFnErrorErr; use bytes::Bytes; use std::{future::Future, pin::Pin}; /// An abstraction over a middleware layer, which can be used to add additional /// middleware layer to a [`Service`]. pub trait Layer<Req, Res>: Send + Sync + 'static { /// Adds this layer to the inner service. fn layer...
rust
MIT
dd507168fa47b5eead64339431b0bd654bd1c951
2026-01-04T15:41:20.302544Z
false
leptos-rs/leptos
https://github.com/leptos-rs/leptos/blob/dd507168fa47b5eead64339431b0bd654bd1c951/server_fn/src/response/actix.rs
server_fn/src/response/actix.rs
use super::{Res, TryRes}; use crate::error::{ FromServerFnError, ServerFnErrorWrapper, SERVER_FN_ERROR_HEADER, }; use actix_web::{ http::{ header, header::{HeaderValue, CONTENT_TYPE, LOCATION}, StatusCode, }, HttpResponse, }; use bytes::Bytes; use futures::{Stream, StreamExt}; us...
rust
MIT
dd507168fa47b5eead64339431b0bd654bd1c951
2026-01-04T15:41:20.302544Z
false
leptos-rs/leptos
https://github.com/leptos-rs/leptos/blob/dd507168fa47b5eead64339431b0bd654bd1c951/server_fn/src/response/http.rs
server_fn/src/response/http.rs
use super::{Res, TryRes}; use crate::error::{ FromServerFnError, IntoAppError, ServerFnErrorErr, ServerFnErrorWrapper, SERVER_FN_ERROR_HEADER, }; use axum::body::Body; use bytes::Bytes; use futures::{Stream, TryStreamExt}; use http::{header, HeaderValue, Response, StatusCode}; impl<E> TryRes<E> for Response<Bo...
rust
MIT
dd507168fa47b5eead64339431b0bd654bd1c951
2026-01-04T15:41:20.302544Z
false
leptos-rs/leptos
https://github.com/leptos-rs/leptos/blob/dd507168fa47b5eead64339431b0bd654bd1c951/server_fn/src/response/browser.rs
server_fn/src/response/browser.rs
use super::ClientRes; use crate::{ error::{FromServerFnError, IntoAppError, ServerFnErrorErr}, redirect::REDIRECT_HEADER, }; use bytes::Bytes; use futures::{Stream, StreamExt}; pub use gloo_net::http::Response; use http::{HeaderMap, HeaderName, HeaderValue}; use js_sys::Uint8Array; use send_wrapper::SendWrapper...
rust
MIT
dd507168fa47b5eead64339431b0bd654bd1c951
2026-01-04T15:41:20.302544Z
false
leptos-rs/leptos
https://github.com/leptos-rs/leptos/blob/dd507168fa47b5eead64339431b0bd654bd1c951/server_fn/src/response/reqwest.rs
server_fn/src/response/reqwest.rs
use super::ClientRes; use crate::error::{FromServerFnError, IntoAppError, ServerFnErrorErr}; use bytes::Bytes; use futures::{Stream, TryStreamExt}; use reqwest::Response; impl<E: FromServerFnError> ClientRes<E> for Response { async fn try_into_string(self) -> Result<String, E> { self.text().await.map_err(|...
rust
MIT
dd507168fa47b5eead64339431b0bd654bd1c951
2026-01-04T15:41:20.302544Z
false
leptos-rs/leptos
https://github.com/leptos-rs/leptos/blob/dd507168fa47b5eead64339431b0bd654bd1c951/server_fn/src/response/mod.rs
server_fn/src/response/mod.rs
/// Response types for Actix. #[cfg(feature = "actix-no-default")] pub mod actix; /// Response types for the browser. #[cfg(feature = "browser")] pub mod browser; #[cfg(feature = "generic")] pub mod generic; /// Response types for Axum. #[cfg(feature = "axum-no-default")] pub mod http; /// Response types for [`reqwest`...
rust
MIT
dd507168fa47b5eead64339431b0bd654bd1c951
2026-01-04T15:41:20.302544Z
false
leptos-rs/leptos
https://github.com/leptos-rs/leptos/blob/dd507168fa47b5eead64339431b0bd654bd1c951/server_fn/src/response/generic.rs
server_fn/src/response/generic.rs
//! This module uses platform-agnostic abstractions //! allowing users to run server functions on a wide range of //! platforms. //! //! The crates in use in this crate are: //! //! * `bytes`: platform-agnostic manipulation of bytes. //! * `http`: low-dependency HTTP abstractions' *front-end*. //! //! # Users //! //! *...
rust
MIT
dd507168fa47b5eead64339431b0bd654bd1c951
2026-01-04T15:41:20.302544Z
false
leptos-rs/leptos
https://github.com/leptos-rs/leptos/blob/dd507168fa47b5eead64339431b0bd654bd1c951/server_fn/src/request/actix.rs
server_fn/src/request/actix.rs
use crate::{ error::{FromServerFnError, IntoAppError, ServerFnErrorErr}, request::Req, response::actix::ActixResponse, }; use actix_web::{web::Payload, HttpRequest}; use actix_ws::Message; use bytes::Bytes; use futures::{FutureExt, Stream, StreamExt}; use send_wrapper::SendWrapper; use std::{borrow::Cow, fu...
rust
MIT
dd507168fa47b5eead64339431b0bd654bd1c951
2026-01-04T15:41:20.302544Z
false
leptos-rs/leptos
https://github.com/leptos-rs/leptos/blob/dd507168fa47b5eead64339431b0bd654bd1c951/server_fn/src/request/axum.rs
server_fn/src/request/axum.rs
use crate::{ error::{FromServerFnError, IntoAppError, ServerFnErrorErr}, request::Req, }; use axum::{ body::{Body, Bytes}, response::Response, }; use futures::{Sink, Stream, StreamExt}; use http::{ header::{ACCEPT, CONTENT_TYPE, REFERER}, Request, }; use http_body_util::BodyExt; use std::borrow:...
rust
MIT
dd507168fa47b5eead64339431b0bd654bd1c951
2026-01-04T15:41:20.302544Z
false
leptos-rs/leptos
https://github.com/leptos-rs/leptos/blob/dd507168fa47b5eead64339431b0bd654bd1c951/server_fn/src/request/browser.rs
server_fn/src/request/browser.rs
use super::ClientReq; use crate::{ client::get_server_url, error::{FromServerFnError, ServerFnErrorErr}, }; use bytes::Bytes; use futures::{Stream, StreamExt}; pub use gloo_net::http::Request; use http::Method; use js_sys::{Reflect, Uint8Array}; use send_wrapper::SendWrapper; use std::ops::{Deref, DerefMut}; us...
rust
MIT
dd507168fa47b5eead64339431b0bd654bd1c951
2026-01-04T15:41:20.302544Z
false
leptos-rs/leptos
https://github.com/leptos-rs/leptos/blob/dd507168fa47b5eead64339431b0bd654bd1c951/server_fn/src/request/reqwest.rs
server_fn/src/request/reqwest.rs
use super::ClientReq; use crate::{ client::get_server_url, error::{FromServerFnError, IntoAppError, ServerFnErrorErr}, }; use bytes::Bytes; use futures::{Stream, StreamExt}; use reqwest::{ header::{ACCEPT, CONTENT_TYPE}, Body, }; pub use reqwest::{multipart::Form, Client, Method, Request, Url}; use std:...
rust
MIT
dd507168fa47b5eead64339431b0bd654bd1c951
2026-01-04T15:41:20.302544Z
false
leptos-rs/leptos
https://github.com/leptos-rs/leptos/blob/dd507168fa47b5eead64339431b0bd654bd1c951/server_fn/src/request/mod.rs
server_fn/src/request/mod.rs
use bytes::Bytes; use futures::{Sink, Stream}; use http::Method; use std::{borrow::Cow, future::Future}; /// Request types for Actix. #[cfg(feature = "actix-no-default")] pub mod actix; /// Request types for Axum. #[cfg(feature = "axum-no-default")] pub mod axum; /// Request types for the browser. #[cfg(feature = "bro...
rust
MIT
dd507168fa47b5eead64339431b0bd654bd1c951
2026-01-04T15:41:20.302544Z
false
leptos-rs/leptos
https://github.com/leptos-rs/leptos/blob/dd507168fa47b5eead64339431b0bd654bd1c951/server_fn/src/request/spin.rs
server_fn/src/request/spin.rs
use crate::{error::ServerFnError, request::Req}; use axum::body::{Body, Bytes}; use futures::{Stream, StreamExt}; use http::{ header::{ACCEPT, CONTENT_TYPE, REFERER}, Request, }; use http_body_util::BodyExt; use std::borrow::Cow; impl<E> Req<E> for IncomingRequest where CustErr: 'static, { fn as_query(...
rust
MIT
dd507168fa47b5eead64339431b0bd654bd1c951
2026-01-04T15:41:20.302544Z
false
leptos-rs/leptos
https://github.com/leptos-rs/leptos/blob/dd507168fa47b5eead64339431b0bd654bd1c951/server_fn/src/request/generic.rs
server_fn/src/request/generic.rs
//! This module uses platform-agnostic abstractions //! allowing users to run server functions on a wide range of //! platforms. //! //! The crates in use in this crate are: //! //! * `bytes`: platform-agnostic manipulation of bytes. //! * `http`: low-dependency HTTP abstractions' *front-end*. //! //! # Users //! //! *...
rust
MIT
dd507168fa47b5eead64339431b0bd654bd1c951
2026-01-04T15:41:20.302544Z
false
leptos-rs/leptos
https://github.com/leptos-rs/leptos/blob/dd507168fa47b5eead64339431b0bd654bd1c951/server_fn/tests/server_macro.rs
server_fn/tests/server_macro.rs
// The trybuild output has slightly different error message output for // different combinations of features. Since tests are run with `test-all-features` // multiple combinations of features are tested. This ensures this file is only // run when **only** the browser feature is enabled. #![cfg(all( rustc_nightly, ...
rust
MIT
dd507168fa47b5eead64339431b0bd654bd1c951
2026-01-04T15:41:20.302544Z
false
leptos-rs/leptos
https://github.com/leptos-rs/leptos/blob/dd507168fa47b5eead64339431b0bd654bd1c951/server_fn/tests/valid/aliased_return_full.rs
server_fn/tests/valid/aliased_return_full.rs
use server_fn_macro_default::server; use server_fn::error::ServerFnError; type FullAlias = Result<String, ServerFnError>; #[server] pub async fn full_alias_result() -> FullAlias { Ok("hello".to_string()) } fn main() {}
rust
MIT
dd507168fa47b5eead64339431b0bd654bd1c951
2026-01-04T15:41:20.302544Z
false
leptos-rs/leptos
https://github.com/leptos-rs/leptos/blob/dd507168fa47b5eead64339431b0bd654bd1c951/server_fn/tests/valid/custom_error_aliased_return_part.rs
server_fn/tests/valid/custom_error_aliased_return_part.rs
use server_fn::{ codec::JsonEncoding, error::{FromServerFnError, ServerFnErrorErr}, }; use server_fn_macro_default::server; #[derive( Debug, thiserror::Error, Clone, serde::Serialize, serde::Deserialize, )] pub enum CustomError { #[error("error a")] ErrorA, #[error("error b")] ErrorB, } im...
rust
MIT
dd507168fa47b5eead64339431b0bd654bd1c951
2026-01-04T15:41:20.302544Z
false
leptos-rs/leptos
https://github.com/leptos-rs/leptos/blob/dd507168fa47b5eead64339431b0bd654bd1c951/server_fn/tests/valid/aliased_return_part.rs
server_fn/tests/valid/aliased_return_part.rs
use server_fn_macro_default::server; use server_fn::error::ServerFnError; type PartAlias<T> = Result<T, ServerFnError>; #[server] pub async fn part_alias_result() -> PartAlias<String> { Ok("hello".to_string()) } fn main() {}
rust
MIT
dd507168fa47b5eead64339431b0bd654bd1c951
2026-01-04T15:41:20.302544Z
false
leptos-rs/leptos
https://github.com/leptos-rs/leptos/blob/dd507168fa47b5eead64339431b0bd654bd1c951/server_fn/tests/valid/aliased_return_none.rs
server_fn/tests/valid/aliased_return_none.rs
use server_fn_macro_default::server; use server_fn::error::ServerFnError; #[server] pub async fn no_alias_result() -> Result<String, ServerFnError> { Ok("hello".to_string()) } fn main() {}
rust
MIT
dd507168fa47b5eead64339431b0bd654bd1c951
2026-01-04T15:41:20.302544Z
false
leptos-rs/leptos
https://github.com/leptos-rs/leptos/blob/dd507168fa47b5eead64339431b0bd654bd1c951/server_fn/tests/valid/custom_error_aliased_return_none.rs
server_fn/tests/valid/custom_error_aliased_return_none.rs
use server_fn::{ codec::JsonEncoding, error::{FromServerFnError, ServerFnErrorErr}, }; use server_fn_macro_default::server; #[derive( Debug, thiserror::Error, Clone, serde::Serialize, serde::Deserialize, )] pub enum CustomError { #[error("error a")] ErrorA, #[error("error b")] ErrorB, } im...
rust
MIT
dd507168fa47b5eead64339431b0bd654bd1c951
2026-01-04T15:41:20.302544Z
false
leptos-rs/leptos
https://github.com/leptos-rs/leptos/blob/dd507168fa47b5eead64339431b0bd654bd1c951/server_fn/tests/valid/custom_error_aliased_return_full.rs
server_fn/tests/valid/custom_error_aliased_return_full.rs
use server_fn::{ codec::JsonEncoding, error::{FromServerFnError, ServerFnErrorErr}, }; use server_fn_macro_default::server; #[derive( Debug, thiserror::Error, Clone, serde::Serialize, serde::Deserialize, )] pub enum CustomError { #[error("error a")] ErrorA, #[error("error b")] ErrorB, } im...
rust
MIT
dd507168fa47b5eead64339431b0bd654bd1c951
2026-01-04T15:41:20.302544Z
false
leptos-rs/leptos
https://github.com/leptos-rs/leptos/blob/dd507168fa47b5eead64339431b0bd654bd1c951/server_fn/tests/invalid/aliased_return_full.rs
server_fn/tests/invalid/aliased_return_full.rs
use server_fn_macro_default::server; #[derive(Debug, thiserror::Error, Clone, serde::Serialize, serde::Deserialize)] pub enum InvalidError { #[error("error a")] A, } type FullAlias = Result<String, InvalidError>; #[server] pub async fn full_alias_result() -> FullAlias { Ok("hello".to_string()) } fn main...
rust
MIT
dd507168fa47b5eead64339431b0bd654bd1c951
2026-01-04T15:41:20.302544Z
false
leptos-rs/leptos
https://github.com/leptos-rs/leptos/blob/dd507168fa47b5eead64339431b0bd654bd1c951/server_fn/tests/invalid/no_return.rs
server_fn/tests/invalid/no_return.rs
use server_fn_macro_default::server; #[server] pub async fn no_return() {} fn main() {}
rust
MIT
dd507168fa47b5eead64339431b0bd654bd1c951
2026-01-04T15:41:20.302544Z
false
leptos-rs/leptos
https://github.com/leptos-rs/leptos/blob/dd507168fa47b5eead64339431b0bd654bd1c951/server_fn/tests/invalid/not_async.rs
server_fn/tests/invalid/not_async.rs
use server_fn_macro_default::server; use server_fn::error::ServerFnError; #[server] pub fn not_async() -> Result<String, ServerFnError> { Ok("hello".to_string()) } fn main() {}
rust
MIT
dd507168fa47b5eead64339431b0bd654bd1c951
2026-01-04T15:41:20.302544Z
false
leptos-rs/leptos
https://github.com/leptos-rs/leptos/blob/dd507168fa47b5eead64339431b0bd654bd1c951/server_fn/tests/invalid/aliased_return_part.rs
server_fn/tests/invalid/aliased_return_part.rs
use server_fn_macro_default::server; #[derive(Debug, thiserror::Error, Clone, serde::Serialize, serde::Deserialize)] pub enum InvalidError { #[error("error a")] A, } type PartAlias<T> = Result<T, InvalidError>; #[server] pub async fn part_alias_result() -> PartAlias<String> { Ok("hello".to_string()) } f...
rust
MIT
dd507168fa47b5eead64339431b0bd654bd1c951
2026-01-04T15:41:20.302544Z
false
leptos-rs/leptos
https://github.com/leptos-rs/leptos/blob/dd507168fa47b5eead64339431b0bd654bd1c951/server_fn/tests/invalid/aliased_return_none.rs
server_fn/tests/invalid/aliased_return_none.rs
use server_fn_macro_default::server; #[derive(Debug, thiserror::Error, Clone, serde::Serialize, serde::Deserialize)] pub enum InvalidError { #[error("error a")] A, } #[server] pub async fn no_alias_result() -> Result<String, InvalidError> { Ok("hello".to_string()) } fn main() {}
rust
MIT
dd507168fa47b5eead64339431b0bd654bd1c951
2026-01-04T15:41:20.302544Z
false
leptos-rs/leptos
https://github.com/leptos-rs/leptos/blob/dd507168fa47b5eead64339431b0bd654bd1c951/server_fn/tests/invalid/empty_return.rs
server_fn/tests/invalid/empty_return.rs
use server_fn_macro_default::server; #[server] pub async fn empty_return() -> () { () } fn main() {}
rust
MIT
dd507168fa47b5eead64339431b0bd654bd1c951
2026-01-04T15:41:20.302544Z
false
leptos-rs/leptos
https://github.com/leptos-rs/leptos/blob/dd507168fa47b5eead64339431b0bd654bd1c951/server_fn/tests/invalid/not_result.rs
server_fn/tests/invalid/not_result.rs
use server_fn::{ codec::JsonEncoding, error::{FromServerFnError, ServerFnErrorErr}, }; use server_fn_macro_default::server; #[derive( Debug, thiserror::Error, Clone, serde::Serialize, serde::Deserialize, )] pub enum CustomError { #[error("error a")] A, #[error("error b")] B, } impl FromSer...
rust
MIT
dd507168fa47b5eead64339431b0bd654bd1c951
2026-01-04T15:41:20.302544Z
false
leptos-rs/leptos
https://github.com/leptos-rs/leptos/blob/dd507168fa47b5eead64339431b0bd654bd1c951/server_fn/server_fn_macro_default/src/lib.rs
server_fn/server_fn_macro_default/src/lib.rs
#![forbid(unsafe_code)] #![deny(missing_docs)] //! This crate contains the default implementation of the #[macro@crate::server] macro without additional context from the server. //! See the [server_fn_macro] crate for more information. use proc_macro::TokenStream; use server_fn_macro::server_macro_impl; use syn::__pr...
rust
MIT
dd507168fa47b5eead64339431b0bd654bd1c951
2026-01-04T15:41:20.302544Z
false
leptos-rs/leptos
https://github.com/leptos-rs/leptos/blob/dd507168fa47b5eead64339431b0bd654bd1c951/leptos/build.rs
leptos/build.rs
use rustc_version::{version_meta, Channel}; fn main() { let target = std::env::var("TARGET").unwrap_or_default(); // Set cfg flags depending on release channel if matches!(version_meta().unwrap().channel, Channel::Nightly) { println!("cargo:rustc-cfg=rustc_nightly"); } // Set cfg flag for ...
rust
MIT
dd507168fa47b5eead64339431b0bd654bd1c951
2026-01-04T15:41:20.302544Z
false
leptos-rs/leptos
https://github.com/leptos-rs/leptos/blob/dd507168fa47b5eead64339431b0bd654bd1c951/leptos/src/subsecond.rs
leptos/src/subsecond.rs
use dioxus_devtools::DevserverMsg; use wasm_bindgen::{prelude::Closure, JsCast}; use web_sys::{js_sys::JsString, MessageEvent, WebSocket}; /// Sets up a websocket connect to the `dx` CLI, waiting for incoming hot-patching messages /// and patching the WASM binary appropriately. // // Note: This is a stripped-down ver...
rust
MIT
dd507168fa47b5eead64339431b0bd654bd1c951
2026-01-04T15:41:20.302544Z
false
leptos-rs/leptos
https://github.com/leptos-rs/leptos/blob/dd507168fa47b5eead64339431b0bd654bd1c951/leptos/src/animated_show.rs
leptos/src/animated_show.rs
use crate::{children::ChildrenFn, component, control_flow::Show, IntoView}; use core::time::Duration; use leptos_dom::helpers::TimeoutHandle; use leptos_macro::view; use reactive_graph::{ effect::RenderEffect, owner::{on_cleanup, StoredValue}, signal::RwSignal, traits::{Get, GetUntracked, GetValue, Set,...
rust
MIT
dd507168fa47b5eead64339431b0bd654bd1c951
2026-01-04T15:41:20.302544Z
false
leptos-rs/leptos
https://github.com/leptos-rs/leptos/blob/dd507168fa47b5eead64339431b0bd654bd1c951/leptos/src/lib.rs
leptos/src/lib.rs
#![deny(missing_docs)] //! # About Leptos //! //! Leptos is a full-stack framework for building web applications in Rust. You can use it to build //! - single-page apps (SPAs) rendered entirely in the browser, using client-side routing and loading //! or mutating data via async requests to the server. //! - multi-pa...
rust
MIT
dd507168fa47b5eead64339431b0bd654bd1c951
2026-01-04T15:41:20.302544Z
false
leptos-rs/leptos
https://github.com/leptos-rs/leptos/blob/dd507168fa47b5eead64339431b0bd654bd1c951/leptos/src/error_boundary.rs
leptos/src/error_boundary.rs
use crate::{children::TypedChildren, IntoView}; use futures::{channel::oneshot, future::join_all}; use hydration_context::{SerializedDataId, SharedContext}; use leptos_macro::component; use or_poisoned::OrPoisoned; use reactive_graph::{ computed::ArcMemo, effect::RenderEffect, owner::{provide_context, ArcSt...
rust
MIT
dd507168fa47b5eead64339431b0bd654bd1c951
2026-01-04T15:41:20.302544Z
false
leptos-rs/leptos
https://github.com/leptos-rs/leptos/blob/dd507168fa47b5eead64339431b0bd654bd1c951/leptos/src/portal.rs
leptos/src/portal.rs
use crate::{children::TypedChildrenFn, mount, IntoView}; use leptos_dom::helpers::document; use leptos_macro::component; use reactive_graph::{effect::Effect, graph::untrack, owner::Owner}; use std::sync::Arc; /// Renders components somewhere else in the DOM. /// /// Useful for inserting modals and tooltips outside of ...
rust
MIT
dd507168fa47b5eead64339431b0bd654bd1c951
2026-01-04T15:41:20.302544Z
false
leptos-rs/leptos
https://github.com/leptos-rs/leptos/blob/dd507168fa47b5eead64339431b0bd654bd1c951/leptos/src/show_let.rs
leptos/src/show_let.rs
use crate::{children::ViewFn, IntoView}; use leptos_macro::component; use reactive_graph::traits::Get; use std::{marker::PhantomData, sync::Arc}; use tachys::either::Either; /// Like `<Show>` but for `Option`. This is a shortcut for /// /// ```ignore /// value.map(|value| { /// view! { ... } /// }) /// ``` /// ///...
rust
MIT
dd507168fa47b5eead64339431b0bd654bd1c951
2026-01-04T15:41:20.302544Z
false
leptos-rs/leptos
https://github.com/leptos-rs/leptos/blob/dd507168fa47b5eead64339431b0bd654bd1c951/leptos/src/nonce.rs
leptos/src/nonce.rs
use crate::context::{provide_context, use_context}; use base64::{ alphabet, engine::{self, general_purpose}, Engine, }; use rand::{rng, RngCore}; use std::{fmt::Display, ops::Deref, sync::Arc}; use tachys::html::attribute::AttributeValue; /// A cryptographic nonce ("number used once") which can be /// used...
rust
MIT
dd507168fa47b5eead64339431b0bd654bd1c951
2026-01-04T15:41:20.302544Z
false
leptos-rs/leptos
https://github.com/leptos-rs/leptos/blob/dd507168fa47b5eead64339431b0bd654bd1c951/leptos/src/into_view.rs
leptos/src/into_view.rs
use std::borrow::Cow; use tachys::{ html::attribute::{any_attribute::AnyAttribute, Attribute}, hydration::Cursor, ssr::StreamBuilder, view::{ add_attr::AddAnyAttr, Position, PositionState, Render, RenderHtml, ToTemplate, }, }; /// A wrapper for any kind of view. #[derive(Debug, Clon...
rust
MIT
dd507168fa47b5eead64339431b0bd654bd1c951
2026-01-04T15:41:20.302544Z
false
leptos-rs/leptos
https://github.com/leptos-rs/leptos/blob/dd507168fa47b5eead64339431b0bd654bd1c951/leptos/src/form.rs
leptos/src/form.rs
use crate::{children::Children, component, prelude::*, IntoView}; use leptos_dom::helpers::window; use leptos_server::{ServerAction, ServerMultiAction}; use serde::de::DeserializeOwned; use server_fn::{ client::Client, codec::PostUrl, error::{IntoAppError, ServerFnErrorErr}, request::ClientReq, Http...
rust
MIT
dd507168fa47b5eead64339431b0bd654bd1c951
2026-01-04T15:41:20.302544Z
false
leptos-rs/leptos
https://github.com/leptos-rs/leptos/blob/dd507168fa47b5eead64339431b0bd654bd1c951/leptos/src/transition.rs
leptos/src/transition.rs
use crate::{ children::{TypedChildren, ViewFnOnce}, error::ErrorBoundarySuspendedChildren, suspense_component::SuspenseBoundary, IntoView, }; use leptos_macro::component; use reactive_graph::{ computed::{suspense::SuspenseContext, ArcMemo}, effect::Effect, owner::{provide_context, use_contex...
rust
MIT
dd507168fa47b5eead64339431b0bd654bd1c951
2026-01-04T15:41:20.302544Z
false
leptos-rs/leptos
https://github.com/leptos-rs/leptos/blob/dd507168fa47b5eead64339431b0bd654bd1c951/leptos/src/for_loop.rs
leptos/src/for_loop.rs
use crate::into_view::IntoView; use leptos_macro::component; use reactive_graph::{ owner::Owner, signal::{ArcRwSignal, ReadSignal}, traits::Set, }; use std::hash::Hash; use tachys::{ reactive_graph::OwnedView, view::keyed::{keyed, SerializableKey}, }; /// Iterates over children and displays them, k...
rust
MIT
dd507168fa47b5eead64339431b0bd654bd1c951
2026-01-04T15:41:20.302544Z
false
leptos-rs/leptos
https://github.com/leptos-rs/leptos/blob/dd507168fa47b5eead64339431b0bd654bd1c951/leptos/src/from_form_data.rs
leptos/src/from_form_data.rs
rust
MIT
dd507168fa47b5eead64339431b0bd654bd1c951
2026-01-04T15:41:20.302544Z
false
leptos-rs/leptos
https://github.com/leptos-rs/leptos/blob/dd507168fa47b5eead64339431b0bd654bd1c951/leptos/src/await_.rs
leptos/src/await_.rs
use crate::{prelude::Suspend, suspense_component::Suspense, IntoView}; use leptos_macro::{component, view}; use leptos_server::ArcOnceResource; use reactive_graph::prelude::ReadUntracked; use serde::{de::DeserializeOwned, Serialize}; #[component] /// Allows you to inline the data loading for an `async` block or /// se...
rust
MIT
dd507168fa47b5eead64339431b0bd654bd1c951
2026-01-04T15:41:20.302544Z
false
leptos-rs/leptos
https://github.com/leptos-rs/leptos/blob/dd507168fa47b5eead64339431b0bd654bd1c951/leptos/src/children.rs
leptos/src/children.rs
use crate::into_view::{IntoView, View}; use std::{ fmt::{self, Debug}, sync::Arc, }; use tachys::view::{ any_view::{AnyView, IntoAny}, fragment::{Fragment, IntoFragment}, RenderHtml, }; /// The most common type for the `children` property on components, /// which can only be called once. /// /// Th...
rust
MIT
dd507168fa47b5eead64339431b0bd654bd1c951
2026-01-04T15:41:20.302544Z
false
leptos-rs/leptos
https://github.com/leptos-rs/leptos/blob/dd507168fa47b5eead64339431b0bd654bd1c951/leptos/src/attribute_interceptor.rs
leptos/src/attribute_interceptor.rs
use crate::attr::{ any_attribute::{AnyAttribute, IntoAnyAttribute}, Attribute, NextAttribute, }; use leptos::prelude::*; /// Function stored to build/rebuild the wrapped children when attributes are added. type ChildBuilder<T> = dyn Fn(AnyAttribute) -> T + Send + Sync + 'static; /// Intercepts attributes pass...
rust
MIT
dd507168fa47b5eead64339431b0bd654bd1c951
2026-01-04T15:41:20.302544Z
false
leptos-rs/leptos
https://github.com/leptos-rs/leptos/blob/dd507168fa47b5eead64339431b0bd654bd1c951/leptos/src/show.rs
leptos/src/show.rs
use crate::{ children::{TypedChildrenFn, ViewFn}, IntoView, }; use leptos_macro::component; use reactive_graph::{computed::ArcMemo, traits::Get}; use tachys::either::Either; #[component] pub fn Show<W, C>( /// The children will be shown whenever the condition in the `when` closure returns `true`. child...
rust
MIT
dd507168fa47b5eead64339431b0bd654bd1c951
2026-01-04T15:41:20.302544Z
false
leptos-rs/leptos
https://github.com/leptos-rs/leptos/blob/dd507168fa47b5eead64339431b0bd654bd1c951/leptos/src/logging.rs
leptos/src/logging.rs
//! Utilities for simple isomorphic logging to the console or terminal. use wasm_bindgen::JsValue; /// Uses `println!()`-style formatting to log something to the console (in the browser) /// or via `println!()` (if not in the browser). #[macro_export] macro_rules! log { ($($t:tt)*) => ($crate::logging::console_lo...
rust
MIT
dd507168fa47b5eead64339431b0bd654bd1c951
2026-01-04T15:41:20.302544Z
false
leptos-rs/leptos
https://github.com/leptos-rs/leptos/blob/dd507168fa47b5eead64339431b0bd654bd1c951/leptos/src/suspense_component.rs
leptos/src/suspense_component.rs
use crate::{ children::{TypedChildren, ViewFnOnce}, error::ErrorBoundarySuspendedChildren, IntoView, }; use futures::{channel::oneshot, select, FutureExt}; use hydration_context::SerializedDataId; use leptos_macro::component; use or_poisoned::OrPoisoned; use reactive_graph::{ computed::{ suspens...
rust
MIT
dd507168fa47b5eead64339431b0bd654bd1c951
2026-01-04T15:41:20.302544Z
false
leptos-rs/leptos
https://github.com/leptos-rs/leptos/blob/dd507168fa47b5eead64339431b0bd654bd1c951/leptos/src/provider.rs
leptos/src/provider.rs
use crate::{children::TypedChildren, component, IntoView}; use reactive_graph::owner::{provide_context, Owner}; use tachys::reactive_graph::OwnedView; #[component] /// Uses the context API to [`provide_context`] to its children and descendants, /// without overwriting any contexts of the same type in its own reactive ...
rust
MIT
dd507168fa47b5eead64339431b0bd654bd1c951
2026-01-04T15:41:20.302544Z
false
leptos-rs/leptos
https://github.com/leptos-rs/leptos/blob/dd507168fa47b5eead64339431b0bd654bd1c951/leptos/src/text_prop.rs
leptos/src/text_prop.rs
use oco_ref::Oco; use std::sync::Arc; use tachys::prelude::IntoAttributeValue; /// Describes a value that is either a static or a reactive string, i.e., /// a [`String`], a [`&str`], a `Signal` or a reactive `Fn() -> String`. #[derive(Clone)] pub struct TextProp(Arc<dyn Fn() -> Oco<'static, str> + Send + Sync>); impl...
rust
MIT
dd507168fa47b5eead64339431b0bd654bd1c951
2026-01-04T15:41:20.302544Z
false
leptos-rs/leptos
https://github.com/leptos-rs/leptos/blob/dd507168fa47b5eead64339431b0bd654bd1c951/leptos/src/mount.rs
leptos/src/mount.rs
#[cfg(debug_assertions)] use crate::logging; use crate::IntoView; use any_spawner::Executor; use reactive_graph::owner::Owner; #[cfg(debug_assertions)] use std::cell::Cell; use tachys::{ dom::body, view::{Mountable, Render}, }; #[cfg(feature = "hydrate")] use tachys::{ hydration::Cursor, view::{Position...
rust
MIT
dd507168fa47b5eead64339431b0bd654bd1c951
2026-01-04T15:41:20.302544Z
false
leptos-rs/leptos
https://github.com/leptos-rs/leptos/blob/dd507168fa47b5eead64339431b0bd654bd1c951/leptos/src/component.rs
leptos/src/component.rs
//! Utility traits and functions that allow building components, //! as either functions of their props or functions with no arguments, //! without knowing the name of the props struct. pub trait Component<P> {} pub trait Props { type Builder; fn builder() -> Self::Builder; } #[doc(hidden)] pub trait PropsO...
rust
MIT
dd507168fa47b5eead64339431b0bd654bd1c951
2026-01-04T15:41:20.302544Z
false
leptos-rs/leptos
https://github.com/leptos-rs/leptos/blob/dd507168fa47b5eead64339431b0bd654bd1c951/leptos/src/hydration/mod.rs
leptos/src/hydration/mod.rs
#![allow(clippy::needless_lifetimes)] use crate::{prelude::*, WasmSplitManifest}; use leptos_config::LeptosOptions; use leptos_macro::{component, view}; use std::{path::PathBuf, sync::OnceLock}; /// Inserts auto-reloading code used in `cargo-leptos`. /// /// This should be included in the `<head>` of your application...
rust
MIT
dd507168fa47b5eead64339431b0bd654bd1c951
2026-01-04T15:41:20.302544Z
false
leptos-rs/leptos
https://github.com/leptos-rs/leptos/blob/dd507168fa47b5eead64339431b0bd654bd1c951/leptos/tests/pr_4061.rs
leptos/tests/pr_4061.rs
#[cfg(feature = "ssr")] mod imports { pub use any_spawner::Executor; pub use futures::StreamExt; pub use leptos::prelude::*; } #[cfg(feature = "ssr")] #[tokio::test] async fn chain_await_resource() { use imports::*; _ = Executor::init_tokio(); let owner = Owner::new(); owner.set(); le...
rust
MIT
dd507168fa47b5eead64339431b0bd654bd1c951
2026-01-04T15:41:20.302544Z
false
leptos-rs/leptos
https://github.com/leptos-rs/leptos/blob/dd507168fa47b5eead64339431b0bd654bd1c951/leptos/tests/ssr.rs
leptos/tests/ssr.rs
#[cfg(feature = "ssr")] use leptos::html::HtmlElement; #[cfg(feature = "ssr")] #[test] fn simple_ssr_test() { use leptos::prelude::*; let (value, set_value) = signal(0); let rendered: View<HtmlElement<_, _, _>> = view! { <div> <button on:click=move |_| set_value.update(|value| *value -...
rust
MIT
dd507168fa47b5eead64339431b0bd654bd1c951
2026-01-04T15:41:20.302544Z
false
leptos-rs/leptos
https://github.com/leptos-rs/leptos/blob/dd507168fa47b5eead64339431b0bd654bd1c951/reactive_graph/build.rs
reactive_graph/build.rs
use rustc_version::{version_meta, Channel}; fn main() { // Set cfg flags depending on release channel if matches!(version_meta().unwrap().channel, Channel::Nightly) { println!("cargo:rustc-cfg=rustc_nightly"); } }
rust
MIT
dd507168fa47b5eead64339431b0bd654bd1c951
2026-01-04T15:41:20.302544Z
false
leptos-rs/leptos
https://github.com/leptos-rs/leptos/blob/dd507168fa47b5eead64339431b0bd654bd1c951/reactive_graph/src/effect.rs
reactive_graph/src/effect.rs
//! Side effects that run in response to changes in the reactive values they read from. #[allow(clippy::module_inception)] mod effect; mod effect_function; mod immediate; mod inner; mod render_effect; pub use effect::*; pub use effect_function::*; pub use immediate::*; pub use render_effect::*; /// Creates a new ren...
rust
MIT
dd507168fa47b5eead64339431b0bd654bd1c951
2026-01-04T15:41:20.302544Z
false
leptos-rs/leptos
https://github.com/leptos-rs/leptos/blob/dd507168fa47b5eead64339431b0bd654bd1c951/reactive_graph/src/serde.rs
reactive_graph/src/serde.rs
#[allow(deprecated)] use crate::wrappers::read::{MaybeProp, MaybeSignal}; use crate::{ computed::{ArcMemo, Memo}, owner::Storage, signal::{ArcReadSignal, ArcRwSignal, ReadSignal, RwSignal}, traits::With, wrappers::read::{Signal, SignalTypes}, }; use serde::{Deserialize, Serialize}; impl<T, St> Seri...
rust
MIT
dd507168fa47b5eead64339431b0bd654bd1c951
2026-01-04T15:41:20.302544Z
false
leptos-rs/leptos
https://github.com/leptos-rs/leptos/blob/dd507168fa47b5eead64339431b0bd654bd1c951/reactive_graph/src/wrappers.rs
reactive_graph/src/wrappers.rs
//! Types to abstract over different kinds of readable or writable reactive values. /// Types that abstract over signals with values that can be read. pub mod read { use crate::{ computed::{ArcMemo, Memo}, graph::untrack, owner::{ ArcStoredValue, ArenaItem, FromLocal, LocalStora...
rust
MIT
dd507168fa47b5eead64339431b0bd654bd1c951
2026-01-04T15:41:20.302544Z
true
leptos-rs/leptos
https://github.com/leptos-rs/leptos/blob/dd507168fa47b5eead64339431b0bd654bd1c951/reactive_graph/src/diagnostics.rs
reactive_graph/src/diagnostics.rs
//! By default, attempting to [`Track`](crate::traits::Track) a signal when you are not in a //! reactive tracking context will cause a warning when you are in debug mode. //! //! In some cases, this warning is a false positive. For example, inside an event listener in a //! user interface, you never want to read from ...
rust
MIT
dd507168fa47b5eead64339431b0bd654bd1c951
2026-01-04T15:41:20.302544Z
false
leptos-rs/leptos
https://github.com/leptos-rs/leptos/blob/dd507168fa47b5eead64339431b0bd654bd1c951/reactive_graph/src/lib.rs
reactive_graph/src/lib.rs
//! An implementation of a fine-grained reactive system. //! //! Fine-grained reactivity is an approach to modeling the flow of data through an interactive //! application by composing together three categories of reactive primitives: //! 1. **Signals**: atomic units of state, which can be directly mutated. //! 2. **Co...
rust
MIT
dd507168fa47b5eead64339431b0bd654bd1c951
2026-01-04T15:41:20.302544Z
false
leptos-rs/leptos
https://github.com/leptos-rs/leptos/blob/dd507168fa47b5eead64339431b0bd654bd1c951/reactive_graph/src/trait_options.rs
reactive_graph/src/trait_options.rs
use crate::{ traits::{ DefinedAt, Get, GetUntracked, Read, ReadUntracked, Track, With, WithUntracked, }, unwrap_signal, }; use std::panic::Location; impl<T> DefinedAt for Option<T> where T: DefinedAt, { fn defined_at(&self) -> Option<&'static Location<'static>> { self.as_ref...
rust
MIT
dd507168fa47b5eead64339431b0bd654bd1c951
2026-01-04T15:41:20.302544Z
false
leptos-rs/leptos
https://github.com/leptos-rs/leptos/blob/dd507168fa47b5eead64339431b0bd654bd1c951/reactive_graph/src/signal.rs
reactive_graph/src/signal.rs
//! Reactive primitives for root values that can be changed, notifying other nodes in the reactive //! graph. mod arc_read; mod arc_rw; mod arc_trigger; mod arc_write; pub mod guards; mod mapped; mod read; mod rw; mod subscriber_traits; mod trigger; mod write; use crate::owner::LocalStorage; pub use arc_read::*; pub ...
rust
MIT
dd507168fa47b5eead64339431b0bd654bd1c951
2026-01-04T15:41:20.302544Z
false
leptos-rs/leptos
https://github.com/leptos-rs/leptos/blob/dd507168fa47b5eead64339431b0bd654bd1c951/reactive_graph/src/callback.rs
reactive_graph/src/callback.rs
//! Callbacks define a standard way to store functions and closures. They are useful //! for component properties, because they can be used to define optional callback functions, //! which generic props don’t support. //! //! The callback types implement [`Copy`], so they can easily be moved into and out of other closu...
rust
MIT
dd507168fa47b5eead64339431b0bd654bd1c951
2026-01-04T15:41:20.302544Z
false
leptos-rs/leptos
https://github.com/leptos-rs/leptos/blob/dd507168fa47b5eead64339431b0bd654bd1c951/reactive_graph/src/transition.rs
reactive_graph/src/transition.rs
//! Utilities to wait for asynchronous primitives to resolve. use futures::{channel::oneshot, future::join_all}; use or_poisoned::OrPoisoned; use std::{ future::Future, sync::{mpsc, OnceLock, RwLock}, }; static TRANSITION: OnceLock<RwLock<Option<TransitionInner>>> = OnceLock::new(); fn global_transition() ->...
rust
MIT
dd507168fa47b5eead64339431b0bd654bd1c951
2026-01-04T15:41:20.302544Z
false
leptos-rs/leptos
https://github.com/leptos-rs/leptos/blob/dd507168fa47b5eead64339431b0bd654bd1c951/reactive_graph/src/computed.rs
reactive_graph/src/computed.rs
//! Computed reactive values that derive from other reactive values. mod arc_memo; mod async_derived; mod inner; mod memo; mod selector; use crate::{ prelude::*, signal::RwSignal, wrappers::{ read::Signal, write::{IntoSignalSetter, SignalSetter}, }, }; pub use arc_memo::*; pub use async...
rust
MIT
dd507168fa47b5eead64339431b0bd654bd1c951
2026-01-04T15:41:20.302544Z
false
leptos-rs/leptos
https://github.com/leptos-rs/leptos/blob/dd507168fa47b5eead64339431b0bd654bd1c951/reactive_graph/src/into_reactive_value.rs
reactive_graph/src/into_reactive_value.rs
#[doc(hidden)] pub struct __IntoReactiveValueMarkerBaseCase; /// A helper trait that works like `Into<T>` but uses a marker generic /// to allow more `From` implementations than would be allowed with just `Into<T>`. pub trait IntoReactiveValue<T, M> { /// Converts `self` into a `T`. fn into_reactive_value(self...
rust
MIT
dd507168fa47b5eead64339431b0bd654bd1c951
2026-01-04T15:41:20.302544Z
false
leptos-rs/leptos
https://github.com/leptos-rs/leptos/blob/dd507168fa47b5eead64339431b0bd654bd1c951/reactive_graph/src/nightly.rs
reactive_graph/src/nightly.rs
#[allow(deprecated)] use crate::wrappers::read::{MaybeProp, MaybeSignal}; use crate::{ computed::{ArcMemo, Memo}, owner::Storage, signal::{ ArcReadSignal, ArcRwSignal, ArcWriteSignal, ReadSignal, RwSignal, WriteSignal, }, traits::{Get, Set}, wrappers::{ read::{ArcSignal, ...
rust
MIT
dd507168fa47b5eead64339431b0bd654bd1c951
2026-01-04T15:41:20.302544Z
false
leptos-rs/leptos
https://github.com/leptos-rs/leptos/blob/dd507168fa47b5eead64339431b0bd654bd1c951/reactive_graph/src/owner.rs
reactive_graph/src/owner.rs
//! The reactive ownership model, which manages effect cancellation, cleanups, and arena allocation. #[cfg(feature = "hydration")] use hydration_context::SharedContext; use or_poisoned::OrPoisoned; use rustc_hash::FxHashMap; use std::{ any::{Any, TypeId}, cell::RefCell, fmt::Debug, mem, sync::{Arc,...
rust
MIT
dd507168fa47b5eead64339431b0bd654bd1c951
2026-01-04T15:41:20.302544Z
false
leptos-rs/leptos
https://github.com/leptos-rs/leptos/blob/dd507168fa47b5eead64339431b0bd654bd1c951/reactive_graph/src/send_wrapper_ext.rs
reactive_graph/src/send_wrapper_ext.rs
//! Additional wrapper utilities for [`send_wrapper::SendWrapper`]. use send_wrapper::SendWrapper; use std::{ fmt::{Debug, Formatter}, hash, ops::{Deref, DerefMut}, }; /// An optional value that can always be sent between threads, even if its inner value /// in the `Some(_)` case would not be threadsafe. /...
rust
MIT
dd507168fa47b5eead64339431b0bd654bd1c951
2026-01-04T15:41:20.302544Z
false
leptos-rs/leptos
https://github.com/leptos-rs/leptos/blob/dd507168fa47b5eead64339431b0bd654bd1c951/reactive_graph/src/traits.rs
reactive_graph/src/traits.rs
//! A series of traits to implement the behavior of reactive primitive, especially signals. //! //! ## Principles //! 1. **Composition**: Most of the traits are implemented as combinations of more primitive base traits, //! and blanket implemented for all types that implement those traits. //! 2. **Fallibility**: Mo...
rust
MIT
dd507168fa47b5eead64339431b0bd654bd1c951
2026-01-04T15:41:20.302544Z
false
leptos-rs/leptos
https://github.com/leptos-rs/leptos/blob/dd507168fa47b5eead64339431b0bd654bd1c951/reactive_graph/src/channel.rs
reactive_graph/src/channel.rs
use core::sync::atomic::Ordering::Relaxed; use futures::{task::AtomicWaker, Stream}; use std::{ fmt::Debug, hash::Hash, pin::Pin, sync::{atomic::AtomicBool, Arc, Weak}, task::{Context, Poll}, }; #[derive(Debug)] pub(crate) struct Sender(Arc<Inner>); #[derive(Debug)] pub(crate) struct Receiver(Weak...
rust
MIT
dd507168fa47b5eead64339431b0bd654bd1c951
2026-01-04T15:41:20.302544Z
false
leptos-rs/leptos
https://github.com/leptos-rs/leptos/blob/dd507168fa47b5eead64339431b0bd654bd1c951/reactive_graph/src/graph.rs
reactive_graph/src/graph.rs
//! Types that define the reactive graph itself. These are mostly internal, but can be used to //! create custom reactive primitives. mod node; mod sets; mod source; mod subscriber; pub use node::*; pub(crate) use sets::*; pub use source::*; pub use subscriber::*;
rust
MIT
dd507168fa47b5eead64339431b0bd654bd1c951
2026-01-04T15:41:20.302544Z
false
leptos-rs/leptos
https://github.com/leptos-rs/leptos/blob/dd507168fa47b5eead64339431b0bd654bd1c951/reactive_graph/src/effect/effect.rs
reactive_graph/src/effect/effect.rs
use crate::{ channel::{channel, Receiver}, effect::{inner::EffectInner, EffectFunction}, graph::{ AnySubscriber, ReactiveNode, SourceSet, Subscriber, ToAnySubscriber, WithObserver, }, owner::{ArenaItem, LocalStorage, Owner, Storage, SyncStorage}, traits::Dispose, }; use any_spawn...
rust
MIT
dd507168fa47b5eead64339431b0bd654bd1c951
2026-01-04T15:41:20.302544Z
false
leptos-rs/leptos
https://github.com/leptos-rs/leptos/blob/dd507168fa47b5eead64339431b0bd654bd1c951/reactive_graph/src/effect/inner.rs
reactive_graph/src/effect/inner.rs
use crate::{ channel::Sender, graph::{ AnySource, AnySubscriber, ReactiveNode, SourceSet, Subscriber, ToAnySubscriber, }, }; use or_poisoned::OrPoisoned; use std::sync::{Arc, RwLock, Weak}; /// Handles internal subscription logic for effects. #[derive(Debug)] pub struct EffectInner { pu...
rust
MIT
dd507168fa47b5eead64339431b0bd654bd1c951
2026-01-04T15:41:20.302544Z
false
leptos-rs/leptos
https://github.com/leptos-rs/leptos/blob/dd507168fa47b5eead64339431b0bd654bd1c951/reactive_graph/src/effect/render_effect.rs
reactive_graph/src/effect/render_effect.rs
use crate::{ channel::channel, effect::inner::EffectInner, graph::{ AnySubscriber, ReactiveNode, SourceSet, Subscriber, ToAnySubscriber, WithObserver, }, owner::Owner, }; use futures::StreamExt; use or_poisoned::OrPoisoned; #[cfg(feature = "subsecond")] use std::sync::Mutex; use std:...
rust
MIT
dd507168fa47b5eead64339431b0bd654bd1c951
2026-01-04T15:41:20.302544Z
false
leptos-rs/leptos
https://github.com/leptos-rs/leptos/blob/dd507168fa47b5eead64339431b0bd654bd1c951/reactive_graph/src/effect/effect_function.rs
reactive_graph/src/effect/effect_function.rs
/// Trait to enable effect functions that have zero or one parameter pub trait EffectFunction<T, M> { /// Call this to execute the function. In case the actual function has no parameters /// the parameter `p` will simply be ignored. fn run(&mut self, p: Option<T>) -> T; } /// Marker for single parameter fu...
rust
MIT
dd507168fa47b5eead64339431b0bd654bd1c951
2026-01-04T15:41:20.302544Z
false
leptos-rs/leptos
https://github.com/leptos-rs/leptos/blob/dd507168fa47b5eead64339431b0bd654bd1c951/reactive_graph/src/effect/immediate.rs
reactive_graph/src/effect/immediate.rs
use crate::{ graph::{AnySubscriber, ReactiveNode, ToAnySubscriber}, owner::on_cleanup, traits::{DefinedAt, Dispose}, }; use or_poisoned::OrPoisoned; use std::{ panic::Location, sync::{Arc, Mutex, RwLock}, }; /// Effects run a certain chunk of code whenever the signals they depend on change. /// ///...
rust
MIT
dd507168fa47b5eead64339431b0bd654bd1c951
2026-01-04T15:41:20.302544Z
false
leptos-rs/leptos
https://github.com/leptos-rs/leptos/blob/dd507168fa47b5eead64339431b0bd654bd1c951/reactive_graph/src/graph/node.rs
reactive_graph/src/graph/node.rs
/// A node in the reactive graph. pub trait ReactiveNode { /// Notifies the source's dependencies that it has changed. fn mark_dirty(&self); /// Notifies the source's dependencies that it may have changed. fn mark_check(&self); /// Marks that all subscribers need to be checked. fn mark_subscri...
rust
MIT
dd507168fa47b5eead64339431b0bd654bd1c951
2026-01-04T15:41:20.302544Z
false
leptos-rs/leptos
https://github.com/leptos-rs/leptos/blob/dd507168fa47b5eead64339431b0bd654bd1c951/reactive_graph/src/graph/source.rs
reactive_graph/src/graph/source.rs
use super::{node::ReactiveNode, AnySubscriber}; use crate::traits::{DefinedAt, IsDisposed}; use core::{fmt::Debug, hash::Hash}; use std::{panic::Location, sync::Weak}; /// Abstracts over the type of any reactive source. pub trait ToAnySource: IsDisposed { /// Converts this type to its type-erased equivalent. f...
rust
MIT
dd507168fa47b5eead64339431b0bd654bd1c951
2026-01-04T15:41:20.302544Z
false
leptos-rs/leptos
https://github.com/leptos-rs/leptos/blob/dd507168fa47b5eead64339431b0bd654bd1c951/reactive_graph/src/graph/subscriber.rs
reactive_graph/src/graph/subscriber.rs
use super::{node::ReactiveNode, AnySource}; #[cfg(debug_assertions)] use crate::diagnostics::SpecialNonReactiveZone; use core::{fmt::Debug, hash::Hash}; use std::{cell::RefCell, mem, sync::Weak}; thread_local! { static OBSERVER: RefCell<Option<ObserverState>> = const { RefCell::new(None) }; } #[derive(Debug)] str...
rust
MIT
dd507168fa47b5eead64339431b0bd654bd1c951
2026-01-04T15:41:20.302544Z
false
leptos-rs/leptos
https://github.com/leptos-rs/leptos/blob/dd507168fa47b5eead64339431b0bd654bd1c951/reactive_graph/src/graph/sets.rs
reactive_graph/src/graph/sets.rs
//! Types that hold the set of sources or subscribers affiliated with a reactive node. //! //! At the moment, these are implemented as linear maps built on a `Vec<_>`. This is for the sake //! of minimizing binary size as much as possible, and on the assumption that the M:N relationship //! between sources and subscrib...
rust
MIT
dd507168fa47b5eead64339431b0bd654bd1c951
2026-01-04T15:41:20.302544Z
false
leptos-rs/leptos
https://github.com/leptos-rs/leptos/blob/dd507168fa47b5eead64339431b0bd654bd1c951/reactive_graph/src/actions/multi_action.rs
reactive_graph/src/actions/multi_action.rs
use crate::{ diagnostics::is_suppressing_resource_load, owner::{ArenaItem, FromLocal, LocalStorage, Storage, SyncStorage}, signal::{ArcReadSignal, ArcRwSignal, ReadSignal, RwSignal}, traits::{DefinedAt, Dispose, GetUntracked, Set, Update}, unwrap_signal, }; use std::{fmt::Debug, future::Future, pani...
rust
MIT
dd507168fa47b5eead64339431b0bd654bd1c951
2026-01-04T15:41:20.302544Z
false
leptos-rs/leptos
https://github.com/leptos-rs/leptos/blob/dd507168fa47b5eead64339431b0bd654bd1c951/reactive_graph/src/actions/mod.rs
reactive_graph/src/actions/mod.rs
//! Reactive primitives to asynchronously update some value. mod action; mod multi_action; pub use action::*; pub use multi_action::*;
rust
MIT
dd507168fa47b5eead64339431b0bd654bd1c951
2026-01-04T15:41:20.302544Z
false
leptos-rs/leptos
https://github.com/leptos-rs/leptos/blob/dd507168fa47b5eead64339431b0bd654bd1c951/reactive_graph/src/actions/action.rs
reactive_graph/src/actions/action.rs
use crate::{ computed::{ArcMemo, Memo, ScopedFuture}, diagnostics::is_suppressing_resource_load, graph::untrack, owner::{ArcStoredValue, ArenaItem, Owner}, send_wrapper_ext::SendOption, signal::{ArcMappedSignal, ArcRwSignal, MappedSignal, RwSignal}, traits::{DefinedAt, Dispose, Get, GetUntra...
rust
MIT
dd507168fa47b5eead64339431b0bd654bd1c951
2026-01-04T15:41:20.302544Z
true
leptos-rs/leptos
https://github.com/leptos-rs/leptos/blob/dd507168fa47b5eead64339431b0bd654bd1c951/reactive_graph/src/owner/arc_stored_value.rs
reactive_graph/src/owner/arc_stored_value.rs
use crate::{ signal::guards::{Plain, ReadGuard, UntrackedWriteGuard}, traits::{DefinedAt, IntoInner, IsDisposed, ReadValue, WriteValue}, }; use std::{ fmt::{Debug, Formatter}, hash::Hash, panic::Location, sync::{Arc, RwLock}, }; /// A reference-counted getter for any value non-reactively. /// /...
rust
MIT
dd507168fa47b5eead64339431b0bd654bd1c951
2026-01-04T15:41:20.302544Z
false
leptos-rs/leptos
https://github.com/leptos-rs/leptos/blob/dd507168fa47b5eead64339431b0bd654bd1c951/reactive_graph/src/owner/arena.rs
reactive_graph/src/owner/arena.rs
use or_poisoned::OrPoisoned; use slotmap::{new_key_type, SlotMap}; #[cfg(feature = "sandboxed-arenas")] use std::cell::RefCell; #[cfg(not(feature = "sandboxed-arenas"))] use std::sync::OnceLock; #[cfg(feature = "sandboxed-arenas")] use std::sync::Weak; use std::{ any::Any, hash::Hash, sync::{Arc, RwLock}, }...
rust
MIT
dd507168fa47b5eead64339431b0bd654bd1c951
2026-01-04T15:41:20.302544Z
false
leptos-rs/leptos
https://github.com/leptos-rs/leptos/blob/dd507168fa47b5eead64339431b0bd654bd1c951/reactive_graph/src/owner/storage.rs
reactive_graph/src/owner/storage.rs
use super::arena::{Arena, NodeId}; use send_wrapper::SendWrapper; /// A trait for borrowing and taking data. pub trait StorageAccess<T> { /// Borrows the value. fn as_borrowed(&self) -> &T; /// Takes the value. fn into_taken(self) -> T; } impl<T> StorageAccess<T> for T { fn as_borrowed(&self) -> ...
rust
MIT
dd507168fa47b5eead64339431b0bd654bd1c951
2026-01-04T15:41:20.302544Z
false
leptos-rs/leptos
https://github.com/leptos-rs/leptos/blob/dd507168fa47b5eead64339431b0bd654bd1c951/reactive_graph/src/owner/stored_value.rs
reactive_graph/src/owner/stored_value.rs
use super::{ arc_stored_value::ArcStoredValue, ArenaItem, LocalStorage, Storage, SyncStorage, }; use crate::{ signal::guards::{Plain, ReadGuard, UntrackedWriteGuard}, traits::{ DefinedAt, Dispose, IntoInner, IsDisposed, ReadValue, WriteValue, }, unwrap_signal, }; use std::{ fmt::{Deb...
rust
MIT
dd507168fa47b5eead64339431b0bd654bd1c951
2026-01-04T15:41:20.302544Z
false
leptos-rs/leptos
https://github.com/leptos-rs/leptos/blob/dd507168fa47b5eead64339431b0bd654bd1c951/reactive_graph/src/owner/arena_item.rs
reactive_graph/src/owner/arena_item.rs
use super::{ arena::{Arena, NodeId}, LocalStorage, Storage, SyncStorage, OWNER, }; use crate::traits::{Dispose, IntoInner, IsDisposed}; use send_wrapper::SendWrapper; use std::{any::Any, hash::Hash, marker::PhantomData}; /// A copyable, stable reference for any value, stored on the arena whose ownership is man...
rust
MIT
dd507168fa47b5eead64339431b0bd654bd1c951
2026-01-04T15:41:20.302544Z
false
leptos-rs/leptos
https://github.com/leptos-rs/leptos/blob/dd507168fa47b5eead64339431b0bd654bd1c951/reactive_graph/src/owner/context.rs
reactive_graph/src/owner/context.rs
use crate::owner::Owner; use or_poisoned::OrPoisoned; use std::{ any::{Any, TypeId}, collections::VecDeque, }; impl Owner { fn provide_context<T: Send + Sync + 'static>(&self, value: T) { self.inner .write() .or_poisoned() .contexts .insert(value.type...
rust
MIT
dd507168fa47b5eead64339431b0bd654bd1c951
2026-01-04T15:41:20.302544Z
false
leptos-rs/leptos
https://github.com/leptos-rs/leptos/blob/dd507168fa47b5eead64339431b0bd654bd1c951/reactive_graph/src/signal/subscriber_traits.rs
reactive_graph/src/signal/subscriber_traits.rs
//! Traits to reduce the boilerplate when implementing the [`ReactiveNode`], [`Source`], and //! [`ToAnySource`] traits for signal types. //! //! These traits can be automatically derived for any type that //! 1) is a root node in the reactive graph, with no sources (i.e., a signal, not a memo) //! 2) contains an `Arc<...
rust
MIT
dd507168fa47b5eead64339431b0bd654bd1c951
2026-01-04T15:41:20.302544Z
false
leptos-rs/leptos
https://github.com/leptos-rs/leptos/blob/dd507168fa47b5eead64339431b0bd654bd1c951/reactive_graph/src/signal/trigger.rs
reactive_graph/src/signal/trigger.rs
use super::{subscriber_traits::AsSubscriberSet, ArcTrigger}; use crate::{ graph::{ReactiveNode, SubscriberSet}, owner::ArenaItem, traits::{DefinedAt, Dispose, IsDisposed, Notify}, }; use std::{ fmt::{Debug, Formatter, Result}, panic::Location, sync::{Arc, RwLock}, }; /// A trigger is a data-les...
rust
MIT
dd507168fa47b5eead64339431b0bd654bd1c951
2026-01-04T15:41:20.302544Z
false
leptos-rs/leptos
https://github.com/leptos-rs/leptos/blob/dd507168fa47b5eead64339431b0bd654bd1c951/reactive_graph/src/signal/guards.rs
reactive_graph/src/signal/guards.rs
//! Guards that integrate with the reactive system, wrapping references to the values of signals. use crate::{ computed::BlockingLock, traits::{Notify, UntrackableGuard}, }; use core::fmt::Debug; use guardian::{ArcRwLockReadGuardian, ArcRwLockWriteGuardian}; use std::{ borrow::Borrow, fmt::Display, ...
rust
MIT
dd507168fa47b5eead64339431b0bd654bd1c951
2026-01-04T15:41:20.302544Z
false
leptos-rs/leptos
https://github.com/leptos-rs/leptos/blob/dd507168fa47b5eead64339431b0bd654bd1c951/reactive_graph/src/signal/write.rs
reactive_graph/src/signal/write.rs
use super::{guards::WriteGuard, ArcWriteSignal}; use crate::{ owner::{ArenaItem, FromLocal, LocalStorage, Storage, SyncStorage}, traits::{ DefinedAt, Dispose, IntoInner, IsDisposed, Notify, UntrackableGuard, Write, }, }; use core::fmt::Debug; use guardian::ArcRwLockWriteGuardian; use std::{h...
rust
MIT
dd507168fa47b5eead64339431b0bd654bd1c951
2026-01-04T15:41:20.302544Z
false
leptos-rs/leptos
https://github.com/leptos-rs/leptos/blob/dd507168fa47b5eead64339431b0bd654bd1c951/reactive_graph/src/signal/mapped.rs
reactive_graph/src/signal/mapped.rs
use super::{ guards::{Mapped, MappedMutArc}, ArcRwSignal, RwSignal, }; use crate::{ owner::{StoredValue, SyncStorage}, signal::guards::WriteGuard, traits::{ DefinedAt, GetValue, IsDisposed, Notify, ReadUntracked, Track, UntrackableGuard, Write, }, }; use guardian::ArcRwLockWriteG...
rust
MIT
dd507168fa47b5eead64339431b0bd654bd1c951
2026-01-04T15:41:20.302544Z
false
leptos-rs/leptos
https://github.com/leptos-rs/leptos/blob/dd507168fa47b5eead64339431b0bd654bd1c951/reactive_graph/src/signal/arc_rw.rs
reactive_graph/src/signal/arc_rw.rs
use super::{ guards::{Plain, ReadGuard, UntrackedWriteGuard, WriteGuard}, subscriber_traits::AsSubscriberSet, ArcReadSignal, ArcWriteSignal, }; use crate::{ graph::{ReactiveNode, SubscriberSet}, prelude::{IsDisposed, Notify}, traits::{DefinedAt, IntoInner, ReadUntracked, UntrackableGuard, Write}...
rust
MIT
dd507168fa47b5eead64339431b0bd654bd1c951
2026-01-04T15:41:20.302544Z
false
leptos-rs/leptos
https://github.com/leptos-rs/leptos/blob/dd507168fa47b5eead64339431b0bd654bd1c951/reactive_graph/src/signal/arc_write.rs
reactive_graph/src/signal/arc_write.rs
use super::guards::{UntrackedWriteGuard, WriteGuard}; use crate::{ graph::{ReactiveNode, SubscriberSet}, prelude::{IsDisposed, Notify}, traits::{DefinedAt, IntoInner, UntrackableGuard, Write}, }; use core::fmt::{Debug, Formatter, Result}; use std::{ hash::Hash, panic::Location, sync::{Arc, RwLoc...
rust
MIT
dd507168fa47b5eead64339431b0bd654bd1c951
2026-01-04T15:41:20.302544Z
false
leptos-rs/leptos
https://github.com/leptos-rs/leptos/blob/dd507168fa47b5eead64339431b0bd654bd1c951/reactive_graph/src/signal/arc_read.rs
reactive_graph/src/signal/arc_read.rs
use super::{ guards::{Plain, ReadGuard}, subscriber_traits::AsSubscriberSet, }; use crate::{ graph::SubscriberSet, traits::{DefinedAt, IntoInner, IsDisposed, ReadUntracked}, }; use core::fmt::{Debug, Formatter, Result}; use std::{ hash::Hash, panic::Location, sync::{Arc, RwLock}, }; /// A r...
rust
MIT
dd507168fa47b5eead64339431b0bd654bd1c951
2026-01-04T15:41:20.302544Z
false
leptos-rs/leptos
https://github.com/leptos-rs/leptos/blob/dd507168fa47b5eead64339431b0bd654bd1c951/reactive_graph/src/signal/read.rs
reactive_graph/src/signal/read.rs
use super::{ guards::{Plain, ReadGuard}, subscriber_traits::AsSubscriberSet, ArcReadSignal, }; use crate::{ graph::SubscriberSet, owner::{ArenaItem, FromLocal, LocalStorage, Storage, SyncStorage}, traits::{DefinedAt, Dispose, IntoInner, IsDisposed, ReadUntracked}, unwrap_signal, }; use core:...
rust
MIT
dd507168fa47b5eead64339431b0bd654bd1c951
2026-01-04T15:41:20.302544Z
false