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 |
|---|---|---|---|---|---|---|---|---|
DioxusLabs/dioxus | https://github.com/DioxusLabs/dioxus/blob/ec8f31dece5c75371177bf080bab46dff54ffd0e/packages/extension/src/lib.rs | packages/extension/src/lib.rs | //! This file exports functions into the vscode extension
use dioxus_autofmt::{FormattedBlock, IndentOptions, IndentType};
use wasm_bindgen::prelude::*;
#[wasm_bindgen]
pub fn format_rsx(raw: String, use_tabs: bool, indent_size: usize) -> String {
let block = dioxus_autofmt::fmt_block(
&raw,
0,
... | rust | Apache-2.0 | ec8f31dece5c75371177bf080bab46dff54ffd0e | 2026-01-04T15:32:28.012891Z | false |
DioxusLabs/dioxus | https://github.com/DioxusLabs/dioxus/blob/ec8f31dece5c75371177bf080bab46dff54ffd0e/packages/native/src/prelude.rs | packages/native/src/prelude.rs | // RSX and component definition
pub use dioxus_core;
pub use dioxus_core::{
consume_context, provide_context, spawn, suspend, try_consume_context, use_drop, use_hook,
AnyhowContext, Attribute, Callback, Component, Element, ErrorBoundary, ErrorContext, Event,
EventHandler, Fragment, HasAttributes, IntoDynNod... | rust | Apache-2.0 | ec8f31dece5c75371177bf080bab46dff54ffd0e | 2026-01-04T15:32:28.012891Z | false |
DioxusLabs/dioxus | https://github.com/DioxusLabs/dioxus/blob/ec8f31dece5c75371177bf080bab46dff54ffd0e/packages/native/src/lib.rs | packages/native/src/lib.rs | #![cfg_attr(docsrs, feature(doc_cfg))]
//! A native renderer for Dioxus.
//!
//! ## Feature flags
//! - `default`: Enables the features listed below.
//! - `accessibility`: Enables [`accesskit`](https://docs.rs/accesskit/latest/accesskit/) accessibility support.
//! - `hot-reload`: Enables hot-reloading of Dioxus R... | rust | Apache-2.0 | ec8f31dece5c75371177bf080bab46dff54ffd0e | 2026-01-04T15:32:28.012891Z | false |
DioxusLabs/dioxus | https://github.com/DioxusLabs/dioxus/blob/ec8f31dece5c75371177bf080bab46dff54ffd0e/packages/native/src/link_handler.rs | packages/native/src/link_handler.rs | use blitz_traits::{
navigation::{NavigationOptions, NavigationProvider},
net::Method,
};
pub(crate) struct DioxusNativeNavigationProvider;
impl NavigationProvider for DioxusNativeNavigationProvider {
fn navigate_to(&self, options: NavigationOptions) {
if options.method == Method::GET
&... | rust | Apache-2.0 | ec8f31dece5c75371177bf080bab46dff54ffd0e | 2026-01-04T15:32:28.012891Z | false |
DioxusLabs/dioxus | https://github.com/DioxusLabs/dioxus/blob/ec8f31dece5c75371177bf080bab46dff54ffd0e/packages/native/src/contexts.rs | packages/native/src/contexts.rs | use blitz_shell::BlitzShellEvent;
use dioxus_document::{Document, NoOpDocument};
use winit::{event_loop::EventLoopProxy, window::WindowId};
use crate::DioxusNativeEvent;
pub struct DioxusNativeDocument {
pub(crate) proxy: EventLoopProxy<BlitzShellEvent>,
pub(crate) window: WindowId,
}
impl DioxusNativeDocume... | rust | Apache-2.0 | ec8f31dece5c75371177bf080bab46dff54ffd0e | 2026-01-04T15:32:28.012891Z | false |
DioxusLabs/dioxus | https://github.com/DioxusLabs/dioxus/blob/ec8f31dece5c75371177bf080bab46dff54ffd0e/packages/native/src/assets.rs | packages/native/src/assets.rs | use blitz_shell::BlitzShellNetCallback;
use std::sync::Arc;
use blitz_dom::net::Resource;
use blitz_shell::BlitzShellEvent;
use blitz_traits::net::{NetCallback, NetProvider};
use winit::event_loop::EventLoopProxy;
pub struct DioxusNativeNetProvider {
callback: Arc<dyn NetCallback<Resource> + 'static>,
#[cfg(f... | rust | Apache-2.0 | ec8f31dece5c75371177bf080bab46dff54ffd0e | 2026-01-04T15:32:28.012891Z | false |
DioxusLabs/dioxus | https://github.com/DioxusLabs/dioxus/blob/ec8f31dece5c75371177bf080bab46dff54ffd0e/packages/native/src/dioxus_application.rs | packages/native/src/dioxus_application.rs | use blitz_shell::{BlitzApplication, View};
use dioxus_core::{provide_context, ScopeId};
use dioxus_history::{History, MemoryHistory};
use std::rc::Rc;
use winit::application::ApplicationHandler;
use winit::event::{StartCause, WindowEvent};
use winit::event_loop::{ActiveEventLoop, EventLoopProxy};
use winit::window::Win... | rust | Apache-2.0 | ec8f31dece5c75371177bf080bab46dff54ffd0e | 2026-01-04T15:32:28.012891Z | false |
DioxusLabs/dioxus | https://github.com/DioxusLabs/dioxus/blob/ec8f31dece5c75371177bf080bab46dff54ffd0e/packages/native/src/dioxus_renderer.rs | packages/native/src/dioxus_renderer.rs | use std::cell::RefCell;
use std::rc::Rc;
use std::sync::Arc;
use anyrender::WindowRenderer;
pub use anyrender_vello::{
wgpu::{Features, Limits},
CustomPaintSource, VelloRendererOptions,
};
#[cfg(not(all(target_os = "ios", target_abi = "sim")))]
pub use anyrender_vello::VelloWindowRenderer as InnerRenderer;
... | rust | Apache-2.0 | ec8f31dece5c75371177bf080bab46dff54ffd0e | 2026-01-04T15:32:28.012891Z | false |
DioxusLabs/dioxus | https://github.com/DioxusLabs/dioxus/blob/ec8f31dece5c75371177bf080bab46dff54ffd0e/packages/native-dom/src/lib.rs | packages/native-dom/src/lib.rs | #![cfg_attr(docsrs, feature(doc_cfg))]
//! Core headless native renderer for Dioxus.
//!
//! ## Feature flags
//! - `default`: Enables the features listed below.
//! - `accessibility`: Enables [`accesskit`](https://docs.rs/accesskit/latest/accesskit/) accessibility support.
//! - `hot-reload`: Enables hot-reloading... | rust | Apache-2.0 | ec8f31dece5c75371177bf080bab46dff54ffd0e | 2026-01-04T15:32:28.012891Z | false |
DioxusLabs/dioxus | https://github.com/DioxusLabs/dioxus/blob/ec8f31dece5c75371177bf080bab46dff54ffd0e/packages/native-dom/src/mutation_writer.rs | packages/native-dom/src/mutation_writer.rs | //! Integration between Dioxus and Blitz
use crate::{qual_name, trace, NodeId};
use blitz_dom::{BaseDocument, DocumentMutator};
use blitz_traits::events::DomEventKind;
use dioxus_core::{
AttributeValue, ElementId, Template, TemplateAttribute, TemplateNode, WriteMutations,
};
use rustc_hash::FxHashMap;
use std::str:... | rust | Apache-2.0 | ec8f31dece5c75371177bf080bab46dff54ffd0e | 2026-01-04T15:32:28.012891Z | false |
DioxusLabs/dioxus | https://github.com/DioxusLabs/dioxus/blob/ec8f31dece5c75371177bf080bab46dff54ffd0e/packages/native-dom/src/dioxus_document.rs | packages/native-dom/src/dioxus_document.rs | //! Integration between Dioxus and Blitz
use crate::events::{BlitzKeyboardData, NativeClickData, NativeConverter, NativeFormData};
use crate::mutation_writer::{DioxusState, MutationWriter};
use crate::qual_name;
use crate::NodeId;
use blitz_dom::{
Attribute, BaseDocument, Document, DocumentConfig, EventDriver, Even... | rust | Apache-2.0 | ec8f31dece5c75371177bf080bab46dff54ffd0e | 2026-01-04T15:32:28.012891Z | false |
DioxusLabs/dioxus | https://github.com/DioxusLabs/dioxus/blob/ec8f31dece5c75371177bf080bab46dff54ffd0e/packages/native-dom/src/events.rs | packages/native-dom/src/events.rs | use blitz_traits::events::{BlitzKeyEvent, BlitzMouseButtonEvent, MouseEventButton};
use dioxus_html::{
geometry::{ClientPoint, ElementPoint, PagePoint, ScreenPoint},
input_data::{MouseButton, MouseButtonSet},
point_interaction::{
InteractionElementOffset, InteractionLocation, ModifiersInteraction, P... | rust | Apache-2.0 | ec8f31dece5c75371177bf080bab46dff54ffd0e | 2026-01-04T15:32:28.012891Z | false |
DioxusLabs/dioxus | https://github.com/DioxusLabs/dioxus/blob/ec8f31dece5c75371177bf080bab46dff54ffd0e/packages/logger/src/lib.rs | packages/logger/src/lib.rs | use tracing::{
subscriber::{set_global_default, SetGlobalDefaultError},
Level,
};
pub use tracing;
/// Attempt to initialize the subscriber if it doesn't already exist, with default settings.
///
/// See [`crate::init`] for more info.
///
/// If you're doing setup before your `dioxus::launch` function that re... | rust | Apache-2.0 | ec8f31dece5c75371177bf080bab46dff54ffd0e | 2026-01-04T15:32:28.012891Z | false |
DioxusLabs/dioxus | https://github.com/DioxusLabs/dioxus/blob/ec8f31dece5c75371177bf080bab46dff54ffd0e/packages/devtools/src/lib.rs | packages/devtools/src/lib.rs | use dioxus_core::internal::HotReloadedTemplate;
use dioxus_core::{ScopeId, VirtualDom};
use dioxus_signals::{GlobalKey, Signal, WritableExt};
pub use dioxus_devtools_types::*;
pub use subsecond;
use subsecond::PatchError;
/// Applies template and literal changes to the VirtualDom
///
/// Assets need to be handled by ... | rust | Apache-2.0 | ec8f31dece5c75371177bf080bab46dff54ffd0e | 2026-01-04T15:32:28.012891Z | false |
DioxusLabs/dioxus | https://github.com/DioxusLabs/dioxus/blob/ec8f31dece5c75371177bf080bab46dff54ffd0e/packages/dioxus/src/launch.rs | packages/dioxus/src/launch.rs | #![allow(clippy::new_without_default)]
#![allow(unused)]
use dioxus_config_macro::*;
use dioxus_core::{Element, LaunchConfig};
use std::any::Any;
use crate::prelude::*;
/// Launch your Dioxus application with the given root component, context and config.
/// The platform will be determined from cargo features.
///
//... | rust | Apache-2.0 | ec8f31dece5c75371177bf080bab46dff54ffd0e | 2026-01-04T15:32:28.012891Z | false |
DioxusLabs/dioxus | https://github.com/DioxusLabs/dioxus/blob/ec8f31dece5c75371177bf080bab46dff54ffd0e/packages/dioxus/src/lib.rs | packages/dioxus/src/lib.rs | #![doc = include_str!("../README.md")]
//!
//! ## Dioxus Crate Features
//!
//! This crate has several features that can be enabled to change the active renderer and enable various integrations:
//!
//! - `signals`: (default) re-exports `dioxus-signals`
//! - `macro`: (default) re-exports `dioxus-macro`
//! - `html`: (... | rust | Apache-2.0 | ec8f31dece5c75371177bf080bab46dff54ffd0e | 2026-01-04T15:32:28.012891Z | false |
DioxusLabs/dioxus | https://github.com/DioxusLabs/dioxus/blob/ec8f31dece5c75371177bf080bab46dff54ffd0e/packages/dioxus/benches/jsframework.rs | packages/dioxus/benches/jsframework.rs | #![allow(non_snake_case, non_upper_case_globals)]
//! This benchmark tests just the overhead of Dioxus itself.
//!
//! For the JS Framework Benchmark, both the framework and the browser is benchmarked together. Dioxus prepares changes
//! to be made, but the change application phase will be just as performant as the va... | rust | Apache-2.0 | ec8f31dece5c75371177bf080bab46dff54ffd0e | 2026-01-04T15:32:28.012891Z | false |
DioxusLabs/dioxus | https://github.com/DioxusLabs/dioxus/blob/ec8f31dece5c75371177bf080bab46dff54ffd0e/packages/cli-config/src/lib.rs | packages/cli-config/src/lib.rs | //! <div align="center">
//! <img
//! src="https://github.com/user-attachments/assets/6c7e227e-44ff-4e53-824a-67949051149c"
//! alt="Build web, desktop, and mobile apps with a single codebase."
//! width="100%"
//! class="darkmode-image"
//! >
//! </div>
//!
//! # Dioxus CLI conf... | rust | Apache-2.0 | ec8f31dece5c75371177bf080bab46dff54ffd0e | 2026-01-04T15:32:28.012891Z | false |
DioxusLabs/dioxus | https://github.com/DioxusLabs/dioxus/blob/ec8f31dece5c75371177bf080bab46dff54ffd0e/packages/cli-harnesses/harness-renderer-swap/src/main.rs | packages/cli-harnesses/harness-renderer-swap/src/main.rs | use dioxus::prelude::*;
fn main() {
dioxus::launch(|| rsx! { "hello world!" })
}
| rust | Apache-2.0 | ec8f31dece5c75371177bf080bab46dff54ffd0e | 2026-01-04T15:32:28.012891Z | false |
DioxusLabs/dioxus | https://github.com/DioxusLabs/dioxus/blob/ec8f31dece5c75371177bf080bab46dff54ffd0e/packages/cli-harnesses/harness-simple-web/src/main.rs | packages/cli-harnesses/harness-simple-web/src/main.rs | fn main() {
println!("Hello, world!");
}
| rust | Apache-2.0 | ec8f31dece5c75371177bf080bab46dff54ffd0e | 2026-01-04T15:32:28.012891Z | false |
DioxusLabs/dioxus | https://github.com/DioxusLabs/dioxus/blob/ec8f31dece5c75371177bf080bab46dff54ffd0e/packages/cli-harnesses/harness-fullstack-desktop-with-default/src/main.rs | packages/cli-harnesses/harness-fullstack-desktop-with-default/src/main.rs | use dioxus::prelude::*;
fn main() {
dioxus::launch(|| rsx! { "hello world!" })
}
| rust | Apache-2.0 | ec8f31dece5c75371177bf080bab46dff54ffd0e | 2026-01-04T15:32:28.012891Z | false |
DioxusLabs/dioxus | https://github.com/DioxusLabs/dioxus/blob/ec8f31dece5c75371177bf080bab46dff54ffd0e/packages/cli-harnesses/harness-simple-dedicated-server/src/main.rs | packages/cli-harnesses/harness-simple-dedicated-server/src/main.rs | fn main() {
println!("Hello, world!");
}
| rust | Apache-2.0 | ec8f31dece5c75371177bf080bab46dff54ffd0e | 2026-01-04T15:32:28.012891Z | false |
DioxusLabs/dioxus | https://github.com/DioxusLabs/dioxus/blob/ec8f31dece5c75371177bf080bab46dff54ffd0e/packages/cli-harnesses/harness-fullstack-multi-target/src/main.rs | packages/cli-harnesses/harness-fullstack-multi-target/src/main.rs | use dioxus::prelude::*;
fn main() {
dioxus::launch(|| rsx! { "hello world!" })
}
| rust | Apache-2.0 | ec8f31dece5c75371177bf080bab46dff54ffd0e | 2026-01-04T15:32:28.012891Z | false |
DioxusLabs/dioxus | https://github.com/DioxusLabs/dioxus/blob/ec8f31dece5c75371177bf080bab46dff54ffd0e/packages/cli-harnesses/harness-fullstack-desktop-with-features/src/main.rs | packages/cli-harnesses/harness-fullstack-desktop-with-features/src/main.rs | use dioxus::prelude::*;
fn main() {
dioxus::launch(|| rsx! { "hello world!" })
}
| rust | Apache-2.0 | ec8f31dece5c75371177bf080bab46dff54ffd0e | 2026-01-04T15:32:28.012891Z | false |
DioxusLabs/dioxus | https://github.com/DioxusLabs/dioxus/blob/ec8f31dece5c75371177bf080bab46dff54ffd0e/packages/cli-harnesses/harness-simple-desktop/src/main.rs | packages/cli-harnesses/harness-simple-desktop/src/main.rs | fn main() {
println!("Hello, world!");
}
| rust | Apache-2.0 | ec8f31dece5c75371177bf080bab46dff54ffd0e | 2026-01-04T15:32:28.012891Z | false |
DioxusLabs/dioxus | https://github.com/DioxusLabs/dioxus/blob/ec8f31dece5c75371177bf080bab46dff54ffd0e/packages/cli-harnesses/harness-default-to-non-default/src/main.rs | packages/cli-harnesses/harness-default-to-non-default/src/main.rs | use dioxus::prelude::*;
fn main() {
dioxus::launch(|| rsx! { "hello world!" })
}
| rust | Apache-2.0 | ec8f31dece5c75371177bf080bab46dff54ffd0e | 2026-01-04T15:32:28.012891Z | false |
DioxusLabs/dioxus | https://github.com/DioxusLabs/dioxus/blob/ec8f31dece5c75371177bf080bab46dff54ffd0e/packages/cli-harnesses/harness-simple-fullstack/src/main.rs | packages/cli-harnesses/harness-simple-fullstack/src/main.rs | use dioxus::prelude::*;
fn main() {
dioxus::launch(|| rsx! { "hello world!" })
}
| rust | Apache-2.0 | ec8f31dece5c75371177bf080bab46dff54ffd0e | 2026-01-04T15:32:28.012891Z | false |
DioxusLabs/dioxus | https://github.com/DioxusLabs/dioxus/blob/ec8f31dece5c75371177bf080bab46dff54ffd0e/packages/cli-harnesses/harness-simple-mobile/src/main.rs | packages/cli-harnesses/harness-simple-mobile/src/main.rs | fn main() {
println!("Hello, world!");
}
| rust | Apache-2.0 | ec8f31dece5c75371177bf080bab46dff54ffd0e | 2026-01-04T15:32:28.012891Z | false |
DioxusLabs/dioxus | https://github.com/DioxusLabs/dioxus/blob/ec8f31dece5c75371177bf080bab46dff54ffd0e/packages/cli-harnesses/harness-fullstack-desktop/src/main.rs | packages/cli-harnesses/harness-fullstack-desktop/src/main.rs | use dioxus::prelude::*;
fn main() {
dioxus::launch(|| rsx! { "hello world!" })
}
| rust | Apache-2.0 | ec8f31dece5c75371177bf080bab46dff54ffd0e | 2026-01-04T15:32:28.012891Z | false |
DioxusLabs/dioxus | https://github.com/DioxusLabs/dioxus/blob/ec8f31dece5c75371177bf080bab46dff54ffd0e/packages/cli-harnesses/harness-fullstack-with-optional-tokio/src/main.rs | packages/cli-harnesses/harness-fullstack-with-optional-tokio/src/main.rs | use dioxus::prelude::*;
fn main() {
dioxus::launch(|| rsx! { "hello world!" })
}
| rust | Apache-2.0 | ec8f31dece5c75371177bf080bab46dff54ffd0e | 2026-01-04T15:32:28.012891Z | false |
DioxusLabs/dioxus | https://github.com/DioxusLabs/dioxus/blob/ec8f31dece5c75371177bf080bab46dff54ffd0e/packages/cli-harnesses/harness-no-dioxus/src/main.rs | packages/cli-harnesses/harness-no-dioxus/src/main.rs | fn main() {
println!("Hello, world!");
}
| rust | Apache-2.0 | ec8f31dece5c75371177bf080bab46dff54ffd0e | 2026-01-04T15:32:28.012891Z | false |
DioxusLabs/dioxus | https://github.com/DioxusLabs/dioxus/blob/ec8f31dece5c75371177bf080bab46dff54ffd0e/packages/cli-harnesses/harness-simple-fullstack-with-default/src/main.rs | packages/cli-harnesses/harness-simple-fullstack-with-default/src/main.rs | use dioxus::prelude::*;
fn main() {
dioxus::launch(|| rsx! { "hello world!" })
}
| rust | Apache-2.0 | ec8f31dece5c75371177bf080bab46dff54ffd0e | 2026-01-04T15:32:28.012891Z | false |
DioxusLabs/dioxus | https://github.com/DioxusLabs/dioxus/blob/ec8f31dece5c75371177bf080bab46dff54ffd0e/packages/cli-harnesses/harness-fullstack-multi-target-no-default/src/main.rs | packages/cli-harnesses/harness-fullstack-multi-target-no-default/src/main.rs | use dioxus::prelude::*;
fn main() {
dioxus::launch(|| rsx! { "hello world!" })
}
| rust | Apache-2.0 | ec8f31dece5c75371177bf080bab46dff54ffd0e | 2026-01-04T15:32:28.012891Z | false |
DioxusLabs/dioxus | https://github.com/DioxusLabs/dioxus/blob/ec8f31dece5c75371177bf080bab46dff54ffd0e/packages/cli-harnesses/harness-simple-fullstack-native-with-default/src/main.rs | packages/cli-harnesses/harness-simple-fullstack-native-with-default/src/main.rs | use dioxus::prelude::*;
fn main() {
dioxus::launch(|| rsx! { "hello world!" })
}
| rust | Apache-2.0 | ec8f31dece5c75371177bf080bab46dff54ffd0e | 2026-01-04T15:32:28.012891Z | false |
DioxusLabs/dioxus | https://github.com/DioxusLabs/dioxus/blob/ec8f31dece5c75371177bf080bab46dff54ffd0e/packages/cli-harnesses/harness-simple-dedicated-client/src/main.rs | packages/cli-harnesses/harness-simple-dedicated-client/src/main.rs | fn main() {
println!("Hello, world!");
}
| rust | Apache-2.0 | ec8f31dece5c75371177bf080bab46dff54ffd0e | 2026-01-04T15:32:28.012891Z | false |
DioxusLabs/dioxus | https://github.com/DioxusLabs/dioxus/blob/ec8f31dece5c75371177bf080bab46dff54ffd0e/packages/const-serialize/src/struct.rs | packages/const-serialize/src/struct.rs | use crate::*;
/// Plain old data for a field. Stores the offset of the field in the struct and the layout of the field.
#[derive(Debug, Copy, Clone)]
pub struct StructFieldLayout {
name: &'static str,
offset: usize,
layout: Layout,
}
impl StructFieldLayout {
/// Create a new struct field layout
pu... | rust | Apache-2.0 | ec8f31dece5c75371177bf080bab46dff54ffd0e | 2026-01-04T15:32:28.012891Z | false |
DioxusLabs/dioxus | https://github.com/DioxusLabs/dioxus/blob/ec8f31dece5c75371177bf080bab46dff54ffd0e/packages/const-serialize/src/array.rs | packages/const-serialize/src/array.rs | use crate::*;
/// The layout for a constant sized array. The array layout is just a length and an item layout.
#[derive(Debug, Copy, Clone)]
pub struct ArrayLayout {
pub(crate) len: usize,
pub(crate) item_layout: &'static Layout,
}
impl ArrayLayout {
/// Create a new array layout
pub const fn new(len:... | rust | Apache-2.0 | ec8f31dece5c75371177bf080bab46dff54ffd0e | 2026-01-04T15:32:28.012891Z | false |
DioxusLabs/dioxus | https://github.com/DioxusLabs/dioxus/blob/ec8f31dece5c75371177bf080bab46dff54ffd0e/packages/const-serialize/src/lib.rs | packages/const-serialize/src/lib.rs | #![doc = include_str!("../README.md")]
#![warn(missing_docs)]
use std::mem::MaybeUninit;
mod const_buffers;
pub use const_buffers::ConstReadBuffer;
mod cbor;
mod const_vec;
mod r#enum;
pub use r#enum::*;
mod r#struct;
pub use r#struct::*;
mod primitive;
pub use primitive::*;
mod list;
pub use list::*;
mod array;
pub ... | rust | Apache-2.0 | ec8f31dece5c75371177bf080bab46dff54ffd0e | 2026-01-04T15:32:28.012891Z | false |
DioxusLabs/dioxus | https://github.com/DioxusLabs/dioxus/blob/ec8f31dece5c75371177bf080bab46dff54ffd0e/packages/const-serialize/src/list.rs | packages/const-serialize/src/list.rs | use crate::*;
/// The layout for a dynamically sized list. The list layout is just a length and an item layout.
#[derive(Debug, Copy, Clone)]
pub struct ListLayout {
/// The size of the struct backing the list
pub(crate) size: usize,
/// The byte offset of the length field
len_offset: usize,
/// Th... | rust | Apache-2.0 | ec8f31dece5c75371177bf080bab46dff54ffd0e | 2026-01-04T15:32:28.012891Z | false |
DioxusLabs/dioxus | https://github.com/DioxusLabs/dioxus/blob/ec8f31dece5c75371177bf080bab46dff54ffd0e/packages/const-serialize/src/cbor.rs | packages/const-serialize/src/cbor.rs | //! Const serialization utilities for the CBOR data format.
//!
//! ## Overview of the format
//!
//! Const serialize only supports a subset of the CBOR format, specifically the major types:
//! - UnsignedInteger
//! - NegativeInteger
//! - Bytes
//! - String
//! - Array
//!
//! Each item in CBOR starts with a leading ... | rust | Apache-2.0 | ec8f31dece5c75371177bf080bab46dff54ffd0e | 2026-01-04T15:32:28.012891Z | false |
DioxusLabs/dioxus | https://github.com/DioxusLabs/dioxus/blob/ec8f31dece5c75371177bf080bab46dff54ffd0e/packages/const-serialize/src/primitive.rs | packages/const-serialize/src/primitive.rs | use crate::*;
use std::mem::MaybeUninit;
/// The layout for a primitive type. The bytes will be reversed if the target is big endian.
#[derive(Debug, Copy, Clone)]
pub struct PrimitiveLayout {
pub(crate) size: usize,
}
impl PrimitiveLayout {
/// Create a new primitive layout
pub const fn new(size: usize) ... | rust | Apache-2.0 | ec8f31dece5c75371177bf080bab46dff54ffd0e | 2026-01-04T15:32:28.012891Z | false |
DioxusLabs/dioxus | https://github.com/DioxusLabs/dioxus/blob/ec8f31dece5c75371177bf080bab46dff54ffd0e/packages/const-serialize/src/const_vec.rs | packages/const-serialize/src/const_vec.rs | #![allow(dead_code)]
use std::{fmt::Debug, hash::Hash, mem::MaybeUninit};
use crate::ConstReadBuffer;
const DEFAULT_MAX_SIZE: usize = 2usize.pow(10);
/// [`ConstVec`] is a version of [`Vec`] that is usable in const contexts. It has
/// a fixed maximum size, but it can can grow and shrink within that size limit
/// a... | rust | Apache-2.0 | ec8f31dece5c75371177bf080bab46dff54ffd0e | 2026-01-04T15:32:28.012891Z | false |
DioxusLabs/dioxus | https://github.com/DioxusLabs/dioxus/blob/ec8f31dece5c75371177bf080bab46dff54ffd0e/packages/const-serialize/src/const_buffers.rs | packages/const-serialize/src/const_buffers.rs | /// A buffer that can be read from at compile time. This is very similar to [Cursor](std::io::Cursor) but is
/// designed to be used in const contexts.
#[derive(Debug, Clone, Copy, PartialEq)]
pub struct ConstReadBuffer<'a> {
location: usize,
memory: &'a [u8],
}
impl<'a> ConstReadBuffer<'a> {
/// Create a ... | rust | Apache-2.0 | ec8f31dece5c75371177bf080bab46dff54ffd0e | 2026-01-04T15:32:28.012891Z | false |
DioxusLabs/dioxus | https://github.com/DioxusLabs/dioxus/blob/ec8f31dece5c75371177bf080bab46dff54ffd0e/packages/const-serialize/src/enum.rs | packages/const-serialize/src/enum.rs | use crate::*;
/// Serialize an enum that is stored at the pointer passed in
pub(crate) const unsafe fn serialize_const_enum(
ptr: *const (),
mut to: ConstVec<u8>,
layout: &EnumLayout,
) -> ConstVec<u8> {
let byte_ptr = ptr as *const u8;
let discriminant = layout.discriminant.read(byte_ptr);
le... | rust | Apache-2.0 | ec8f31dece5c75371177bf080bab46dff54ffd0e | 2026-01-04T15:32:28.012891Z | false |
DioxusLabs/dioxus | https://github.com/DioxusLabs/dioxus/blob/ec8f31dece5c75371177bf080bab46dff54ffd0e/packages/const-serialize/src/str.rs | packages/const-serialize/src/str.rs | use crate::*;
use std::{char, fmt::Debug, hash::Hash, mem::MaybeUninit};
const MAX_STR_SIZE: usize = 256;
/// A string that is stored in a constant sized buffer that can be serialized and deserialized at compile time
#[derive(Clone, Copy)]
pub struct ConstStr {
bytes: [MaybeUninit<u8>; MAX_STR_SIZE],
len: u32... | rust | Apache-2.0 | ec8f31dece5c75371177bf080bab46dff54ffd0e | 2026-01-04T15:32:28.012891Z | false |
DioxusLabs/dioxus | https://github.com/DioxusLabs/dioxus/blob/ec8f31dece5c75371177bf080bab46dff54ffd0e/packages/const-serialize/tests/eq.rs | packages/const-serialize/tests/eq.rs | use const_serialize::{serialize_eq, SerializeConst};
#[derive(Clone, Copy, Debug, PartialEq, SerializeConst)]
struct Struct {
a: u32,
b: u8,
c: u32,
d: Enum,
}
#[derive(Clone, Copy, Debug, PartialEq, SerializeConst)]
#[repr(C, u8)]
enum Enum {
A { one: u32, two: u16 },
B { one: u8, two: u16 } ... | rust | Apache-2.0 | ec8f31dece5c75371177bf080bab46dff54ffd0e | 2026-01-04T15:32:28.012891Z | false |
DioxusLabs/dioxus | https://github.com/DioxusLabs/dioxus/blob/ec8f31dece5c75371177bf080bab46dff54ffd0e/packages/const-serialize/tests/lists.rs | packages/const-serialize/tests/lists.rs | use const_serialize::{deserialize_const, serialize_const, ConstVec};
#[test]
fn test_serialize_const_layout_list() {
let mut buf = ConstVec::new();
buf = serialize_const(&[1u8, 2, 3] as &[u8; 3], buf);
println!("{:?}", buf.as_ref());
let buf = buf.as_ref();
assert_eq!(deserialize_const!([u8; 3], bu... | rust | Apache-2.0 | ec8f31dece5c75371177bf080bab46dff54ffd0e | 2026-01-04T15:32:28.012891Z | false |
DioxusLabs/dioxus | https://github.com/DioxusLabs/dioxus/blob/ec8f31dece5c75371177bf080bab46dff54ffd0e/packages/const-serialize/tests/structs.rs | packages/const-serialize/tests/structs.rs | use const_serialize::{deserialize_const, serialize_const, ConstVec, SerializeConst};
use std::mem::MaybeUninit;
#[test]
fn test_transmute_bytes_to_struct() {
struct MyStruct {
a: u32,
b: u8,
c: u32,
d: u32,
}
const SIZE: usize = std::mem::size_of::<MyStruct>();
let mut o... | rust | Apache-2.0 | ec8f31dece5c75371177bf080bab46dff54ffd0e | 2026-01-04T15:32:28.012891Z | false |
DioxusLabs/dioxus | https://github.com/DioxusLabs/dioxus/blob/ec8f31dece5c75371177bf080bab46dff54ffd0e/packages/const-serialize/tests/primitive.rs | packages/const-serialize/tests/primitive.rs | use const_serialize::{deserialize_const, serialize_const, ConstVec};
#[test]
fn test_serialize_const_layout_primitive() {
let mut buf = ConstVec::new();
buf = serialize_const(&1234u32, buf);
let buf = buf.as_ref();
assert_eq!(deserialize_const!(u32, buf).unwrap().1, 1234u32);
let mut buf = ConstVe... | rust | Apache-2.0 | ec8f31dece5c75371177bf080bab46dff54ffd0e | 2026-01-04T15:32:28.012891Z | false |
DioxusLabs/dioxus | https://github.com/DioxusLabs/dioxus/blob/ec8f31dece5c75371177bf080bab46dff54ffd0e/packages/const-serialize/tests/tuples.rs | packages/const-serialize/tests/tuples.rs | use const_serialize::{deserialize_const, serialize_const, ConstVec};
#[test]
fn test_serialize_const_layout_tuple() {
let mut buf = ConstVec::new();
buf = serialize_const(&(1234u32, 5678u16), buf);
let buf = buf.as_ref();
assert_eq!(
deserialize_const!((u32, u16), buf).unwrap().1,
(1234... | rust | Apache-2.0 | ec8f31dece5c75371177bf080bab46dff54ffd0e | 2026-01-04T15:32:28.012891Z | false |
DioxusLabs/dioxus | https://github.com/DioxusLabs/dioxus/blob/ec8f31dece5c75371177bf080bab46dff54ffd0e/packages/const-serialize/tests/enum.rs | packages/const-serialize/tests/enum.rs | use const_serialize::{deserialize_const, serialize_const, ConstVec, SerializeConst};
use std::mem::MaybeUninit;
#[test]
fn test_transmute_bytes_to_enum() {
#[derive(Clone, Copy, Debug, PartialEq)]
#[repr(C, u8)]
enum Enum<T> {
A { one: u32, two: u16 },
B { one: u8, two: T } = 15,
}
... | rust | Apache-2.0 | ec8f31dece5c75371177bf080bab46dff54ffd0e | 2026-01-04T15:32:28.012891Z | false |
DioxusLabs/dioxus | https://github.com/DioxusLabs/dioxus/blob/ec8f31dece5c75371177bf080bab46dff54ffd0e/packages/const-serialize/tests/str.rs | packages/const-serialize/tests/str.rs | use const_serialize::{deserialize_const, serialize_const, ConstStr, ConstVec};
#[test]
fn test_serialize_const_layout_str() {
let mut buf = ConstVec::new();
let str = ConstStr::new("hello");
buf = serialize_const(&str, buf);
println!("{:?}", buf.as_ref());
let buf = buf.as_ref();
assert!(buf.le... | rust | Apache-2.0 | ec8f31dece5c75371177bf080bab46dff54ffd0e | 2026-01-04T15:32:28.012891Z | false |
DioxusLabs/dioxus | https://github.com/DioxusLabs/dioxus/blob/ec8f31dece5c75371177bf080bab46dff54ffd0e/packages/fullstack/src/lib.rs | packages/fullstack/src/lib.rs | // #![warn(missing_docs)]
#![allow(clippy::manual_async_fn)]
#![allow(clippy::needless_return)]
pub use client::{get_server_url, set_server_url};
pub use dioxus_fullstack_core::*;
#[doc(inline)]
pub use dioxus_fullstack_macro::*;
pub use axum_core;
pub use headers;
pub use http;
pub use reqwest;
pub use serde;
/// ... | rust | Apache-2.0 | ec8f31dece5c75371177bf080bab46dff54ffd0e | 2026-01-04T15:32:28.012891Z | false |
DioxusLabs/dioxus | https://github.com/DioxusLabs/dioxus/blob/ec8f31dece5c75371177bf080bab46dff54ffd0e/packages/fullstack/src/spawn.rs | packages/fullstack/src/spawn.rs | use std::future::Future;
/// Spawn a task in the background. If wasm is enabled, this will use the single threaded tokio runtime
pub(crate) fn spawn_platform<Fut>(
f: impl FnOnce() -> Fut + Send + 'static,
) -> tokio::task::JoinHandle<Fut::Output>
where
Fut: Future + 'static,
Fut::Output: Send + 'static,
{... | rust | Apache-2.0 | ec8f31dece5c75371177bf080bab46dff54ffd0e | 2026-01-04T15:32:28.012891Z | false |
DioxusLabs/dioxus | https://github.com/DioxusLabs/dioxus/blob/ec8f31dece5c75371177bf080bab46dff54ffd0e/packages/fullstack/src/magic.rs | packages/fullstack/src/magic.rs | //! ServerFn request magical 🧙 decoders and encoders.
//!
//! The Dioxus Server Function implementation brings a lot of *magic* to the types of endpoints we can handle.
//! Our ultimate goal is to handle *all* endpoints, even axum endpoints, with the macro.
//!
//! Unfortunately, some axum traits like `FromRequest` ov... | rust | Apache-2.0 | ec8f31dece5c75371177bf080bab46dff54ffd0e | 2026-01-04T15:32:28.012891Z | true |
DioxusLabs/dioxus | https://github.com/DioxusLabs/dioxus/blob/ec8f31dece5c75371177bf080bab46dff54ffd0e/packages/fullstack/src/client.rs | packages/fullstack/src/client.rs | #![allow(unreachable_code)]
use crate::{reqwest_error_to_request_error, StreamingError};
use bytes::Bytes;
use dioxus_fullstack_core::RequestError;
use futures::Stream;
use futures::{TryFutureExt, TryStreamExt};
use headers::{ContentType, Header};
use http::{response::Parts, Extensions, HeaderMap, HeaderName, HeaderVa... | rust | Apache-2.0 | ec8f31dece5c75371177bf080bab46dff54ffd0e | 2026-01-04T15:32:28.012891Z | false |
DioxusLabs/dioxus | https://github.com/DioxusLabs/dioxus/blob/ec8f31dece5c75371177bf080bab46dff54ffd0e/packages/fullstack/src/lazy.rs | packages/fullstack/src/lazy.rs | #![allow(clippy::needless_return)]
use dioxus_core::CapturedError;
use std::{hint::black_box, prelude::rust_2024::Future, sync::atomic::AtomicBool};
/// `Lazy` is a thread-safe, lazily-initialized global variable.
///
/// Unlike other async once-cell implementations, accessing the value of a `Lazy` instance is synchr... | rust | Apache-2.0 | ec8f31dece5c75371177bf080bab46dff54ffd0e | 2026-01-04T15:32:28.012891Z | false |
DioxusLabs/dioxus | https://github.com/DioxusLabs/dioxus/blob/ec8f31dece5c75371177bf080bab46dff54ffd0e/packages/fullstack/src/request.rs | packages/fullstack/src/request.rs | use dioxus_fullstack_core::{RequestError, ServerFnError};
#[cfg(feature = "server")]
use headers::Header;
use http::response::Parts;
use std::{future::Future, pin::Pin};
use crate::{ClientRequest, ClientResponse};
/// The `IntoRequest` trait allows types to be used as the body of a request to a HTTP endpoint or serve... | rust | Apache-2.0 | ec8f31dece5c75371177bf080bab46dff54ffd0e | 2026-01-04T15:32:28.012891Z | false |
DioxusLabs/dioxus | https://github.com/DioxusLabs/dioxus/blob/ec8f31dece5c75371177bf080bab46dff54ffd0e/packages/fullstack/src/encoding.rs | packages/fullstack/src/encoding.rs | use bytes::Bytes;
use serde::{de::DeserializeOwned, Serialize};
/// A trait for encoding and decoding data.
///
/// This takes an owned self to make it easier for zero-copy encodings.
pub trait Encoding: 'static {
fn content_type() -> &'static str;
fn stream_content_type() -> &'static str;
fn to_bytes(data... | rust | Apache-2.0 | ec8f31dece5c75371177bf080bab46dff54ffd0e | 2026-01-04T15:32:28.012891Z | false |
DioxusLabs/dioxus | https://github.com/DioxusLabs/dioxus/blob/ec8f31dece5c75371177bf080bab46dff54ffd0e/packages/fullstack/src/payloads/stream.rs | packages/fullstack/src/payloads/stream.rs | #![allow(clippy::type_complexity)]
use crate::{
CborEncoding, ClientRequest, ClientResponse, Encoding, FromResponse, IntoRequest, JsonEncoding,
ServerFnError,
};
use axum::extract::{FromRequest, Request};
use axum_core::response::IntoResponse;
use bytes::{Buf as _, Bytes};
use dioxus_fullstack_core::{HttpError... | rust | Apache-2.0 | ec8f31dece5c75371177bf080bab46dff54ffd0e | 2026-01-04T15:32:28.012891Z | false |
DioxusLabs/dioxus | https://github.com/DioxusLabs/dioxus/blob/ec8f31dece5c75371177bf080bab46dff54ffd0e/packages/fullstack/src/payloads/axum_types.rs | packages/fullstack/src/payloads/axum_types.rs | use super::*;
use crate::{ClientResponse, FromResponse};
pub use axum::extract::Json;
use axum::response::{Html, NoContent, Redirect};
use dioxus_fullstack_core::{RequestError, ServerFnError};
use futures::StreamExt;
use http::StatusCode;
use std::future::Future;
impl<T: From<String>> FromResponse for Html<T> {
fn... | rust | Apache-2.0 | ec8f31dece5c75371177bf080bab46dff54ffd0e | 2026-01-04T15:32:28.012891Z | false |
DioxusLabs/dioxus | https://github.com/DioxusLabs/dioxus/blob/ec8f31dece5c75371177bf080bab46dff54ffd0e/packages/fullstack/src/payloads/msgpack.rs | packages/fullstack/src/payloads/msgpack.rs | #![forbid(unsafe_code)]
use axum::{
body::{Body, Bytes},
extract::{FromRequest, Request},
http::{header::HeaderValue, StatusCode},
response::{IntoResponse, Response},
};
use axum::{extract::rejection::BytesRejection, http, BoxError};
use derive_more::{Deref, DerefMut, From};
use serde::{de::Deserialize... | rust | Apache-2.0 | ec8f31dece5c75371177bf080bab46dff54ffd0e | 2026-01-04T15:32:28.012891Z | false |
DioxusLabs/dioxus | https://github.com/DioxusLabs/dioxus/blob/ec8f31dece5c75371177bf080bab46dff54ffd0e/packages/fullstack/src/payloads/websocket.rs | packages/fullstack/src/payloads/websocket.rs | #![allow(unreachable_code)]
#![allow(unused_imports)]
//! This module implements WebSocket support for Dioxus Fullstack applications.
//!
//! WebSockets provide a full-duplex communication channel over a single, long-lived connection.
//!
//! This makes them ideal for real-time applications where the server and the cl... | rust | Apache-2.0 | ec8f31dece5c75371177bf080bab46dff54ffd0e | 2026-01-04T15:32:28.012891Z | true |
DioxusLabs/dioxus | https://github.com/DioxusLabs/dioxus/blob/ec8f31dece5c75371177bf080bab46dff54ffd0e/packages/fullstack/src/payloads/multipart.rs | packages/fullstack/src/payloads/multipart.rs | #![allow(unreachable_code)]
use crate::{ClientRequest, ClientResponse, IntoRequest};
use axum::{
extract::{FromRequest, Request},
response::{IntoResponse, Response},
};
use dioxus_fullstack_core::RequestError;
use dioxus_html::{FormData, FormEvent};
use std::{prelude::rust_2024::Future, rc::Rc};
#[cfg(feature... | rust | Apache-2.0 | ec8f31dece5c75371177bf080bab46dff54ffd0e | 2026-01-04T15:32:28.012891Z | false |
DioxusLabs/dioxus | https://github.com/DioxusLabs/dioxus/blob/ec8f31dece5c75371177bf080bab46dff54ffd0e/packages/fullstack/src/payloads/form.rs | packages/fullstack/src/payloads/form.rs | use super::*;
pub use axum::extract::Form;
impl<T> IntoRequest for Form<T>
where
T: Serialize + 'static + DeserializeOwned,
{
fn into_request(self, req: ClientRequest) -> impl Future<Output = ClientResult> + 'static {
async move { req.send_form(&self.0).await }
}
}
| rust | Apache-2.0 | ec8f31dece5c75371177bf080bab46dff54ffd0e | 2026-01-04T15:32:28.012891Z | false |
DioxusLabs/dioxus | https://github.com/DioxusLabs/dioxus/blob/ec8f31dece5c75371177bf080bab46dff54ffd0e/packages/fullstack/src/payloads/redirect.rs | packages/fullstack/src/payloads/redirect.rs | rust | Apache-2.0 | ec8f31dece5c75371177bf080bab46dff54ffd0e | 2026-01-04T15:32:28.012891Z | false | |
DioxusLabs/dioxus | https://github.com/DioxusLabs/dioxus/blob/ec8f31dece5c75371177bf080bab46dff54ffd0e/packages/fullstack/src/payloads/text.rs | packages/fullstack/src/payloads/text.rs | use crate::{ClientResponse, FromResponse};
use axum_core::response::{IntoResponse, Response};
use dioxus_fullstack_core::ServerFnError;
use send_wrapper::SendWrapper;
use std::future::Future;
/// A simple text response type.
///
/// The `T` parameter can be anything that converts to and from `String`, such as `Rc<str>... | rust | Apache-2.0 | ec8f31dece5c75371177bf080bab46dff54ffd0e | 2026-01-04T15:32:28.012891Z | false |
DioxusLabs/dioxus | https://github.com/DioxusLabs/dioxus/blob/ec8f31dece5c75371177bf080bab46dff54ffd0e/packages/fullstack/src/payloads/header.rs | packages/fullstack/src/payloads/header.rs | use super::*;
pub use headers::Cookie;
pub use headers::SetCookie;
#[derive(Clone, Debug)]
pub struct SetHeader<Data> {
data: Option<Data>,
}
impl<T: Header> SetHeader<T> {
pub fn new(
value: impl TryInto<HeaderValue, Error = InvalidHeaderValue>,
) -> Result<Self, headers::Error> {
let va... | rust | Apache-2.0 | ec8f31dece5c75371177bf080bab46dff54ffd0e | 2026-01-04T15:32:28.012891Z | false |
DioxusLabs/dioxus | https://github.com/DioxusLabs/dioxus/blob/ec8f31dece5c75371177bf080bab46dff54ffd0e/packages/fullstack/src/payloads/cbor.rs | packages/fullstack/src/payloads/cbor.rs | use axum::{
body::Bytes,
extract::{rejection::BytesRejection, FromRequest, Request},
http::{header, HeaderMap, HeaderValue, StatusCode},
response::{IntoResponse, Response},
};
use serde::{de::DeserializeOwned, Serialize};
/// CBOR Extractor / Response.
///
/// When used as an extractor, it can deserial... | rust | Apache-2.0 | ec8f31dece5c75371177bf080bab46dff54ffd0e | 2026-01-04T15:32:28.012891Z | false |
DioxusLabs/dioxus | https://github.com/DioxusLabs/dioxus/blob/ec8f31dece5c75371177bf080bab46dff54ffd0e/packages/fullstack/src/payloads/postcard.rs | packages/fullstack/src/payloads/postcard.rs | use axum::{
body::Bytes,
extract::{rejection::BytesRejection, FromRequest},
http::{header, HeaderMap, StatusCode},
response::{IntoResponse, Response},
};
use postcard::{from_bytes, to_allocvec};
use serde::{de::DeserializeOwned, Serialize};
use std::future::Future;
/// Postcard Extractor / Response.
//... | rust | Apache-2.0 | ec8f31dece5c75371177bf080bab46dff54ffd0e | 2026-01-04T15:32:28.012891Z | false |
DioxusLabs/dioxus | https://github.com/DioxusLabs/dioxus/blob/ec8f31dece5c75371177bf080bab46dff54ffd0e/packages/fullstack/src/payloads/files.rs | packages/fullstack/src/payloads/files.rs | use super::*;
use axum_core::extract::Request;
use dioxus_fullstack_core::RequestError;
use dioxus_html::FileData;
#[cfg(feature = "server")]
use std::path::Path;
use std::{
pin::Pin,
task::{Context, Poll},
};
/// A payload for uploading files using streams.
///
/// The `FileUpload` struct allows you to uploa... | rust | Apache-2.0 | ec8f31dece5c75371177bf080bab46dff54ffd0e | 2026-01-04T15:32:28.012891Z | false |
DioxusLabs/dioxus | https://github.com/DioxusLabs/dioxus/blob/ec8f31dece5c75371177bf080bab46dff54ffd0e/packages/fullstack/src/payloads/query.rs | packages/fullstack/src/payloads/query.rs | use std::ops::Deref;
use crate::ServerFnError;
use axum::extract::FromRequestParts;
use http::request::Parts;
use serde::de::DeserializeOwned;
/// An extractor that deserializes query parameters into the given type `T`.
///
/// This uses `serde_qs` under the hood to support complex query parameter structures.
#[deriv... | rust | Apache-2.0 | ec8f31dece5c75371177bf080bab46dff54ffd0e | 2026-01-04T15:32:28.012891Z | false |
DioxusLabs/dioxus | https://github.com/DioxusLabs/dioxus/blob/ec8f31dece5c75371177bf080bab46dff54ffd0e/packages/fullstack/src/payloads/sse.rs | packages/fullstack/src/payloads/sse.rs | use crate::{ClientResponse, FromResponse, RequestError, ServerFnError};
#[cfg(feature = "server")]
use axum::{
response::sse::{Event, KeepAlive},
BoxError,
};
use futures::io::AsyncBufReadExt;
use futures::Stream;
use futures::{StreamExt, TryStreamExt};
use http::{header::CONTENT_TYPE, HeaderValue, StatusCode};... | rust | Apache-2.0 | ec8f31dece5c75371177bf080bab46dff54ffd0e | 2026-01-04T15:32:28.012891Z | false |
DioxusLabs/dioxus | https://github.com/DioxusLabs/dioxus/blob/ec8f31dece5c75371177bf080bab46dff54ffd0e/packages/fullstack/tests/compile-test.rs | packages/fullstack/tests/compile-test.rs | #![allow(clippy::manual_async_fn)]
#![allow(unused_variables)]
use anyhow::Result;
use axum::extract::FromRequest;
use axum::response::IntoResponse;
use axum::{response::Html, Json};
use bytes::Bytes;
use dioxus::prelude::*;
use dioxus_fullstack::{get, FileStream, ServerFnError, Text, TextStream, Websocket};
use futur... | rust | Apache-2.0 | ec8f31dece5c75371177bf080bab46dff54ffd0e | 2026-01-04T15:32:28.012891Z | false |
DioxusLabs/dioxus | https://github.com/DioxusLabs/dioxus/blob/ec8f31dece5c75371177bf080bab46dff54ffd0e/packages/core-macro/src/lib.rs | packages/core-macro/src/lib.rs | #![doc = include_str!("../README.md")]
#![doc(html_logo_url = "https://avatars.githubusercontent.com/u/79236386")]
#![doc(html_favicon_url = "https://avatars.githubusercontent.com/u/79236386")]
use component::{ComponentBody, ComponentMacroOptions};
use proc_macro::TokenStream;
use quote::ToTokens;
use syn::parse_macro... | rust | Apache-2.0 | ec8f31dece5c75371177bf080bab46dff54ffd0e | 2026-01-04T15:32:28.012891Z | false |
DioxusLabs/dioxus | https://github.com/DioxusLabs/dioxus/blob/ec8f31dece5c75371177bf080bab46dff54ffd0e/packages/core-macro/src/utils.rs | packages/core-macro/src/utils.rs | use quote::ToTokens;
use syn::parse::{Parse, ParseStream};
use syn::spanned::Spanned;
use syn::{parse_quote, Expr, Lit, Meta, Token, Type};
/// Attempts to convert the given literal to a string.
/// Converts ints and floats to their base 10 counterparts.
///
/// Returns `None` if the literal is [`Lit::Verbatim`] or if... | rust | Apache-2.0 | ec8f31dece5c75371177bf080bab46dff54ffd0e | 2026-01-04T15:32:28.012891Z | false |
DioxusLabs/dioxus | https://github.com/DioxusLabs/dioxus/blob/ec8f31dece5c75371177bf080bab46dff54ffd0e/packages/core-macro/src/component.rs | packages/core-macro/src/component.rs | use proc_macro2::TokenStream;
use quote::{format_ident, quote, ToTokens, TokenStreamExt};
use syn::parse::{Parse, ParseStream};
use syn::punctuated::Punctuated;
use syn::spanned::Spanned;
use syn::*;
pub struct ComponentBody {
pub item_fn: ItemFn,
pub options: ComponentMacroOptions,
}
impl Parse for Component... | rust | Apache-2.0 | ec8f31dece5c75371177bf080bab46dff54ffd0e | 2026-01-04T15:32:28.012891Z | false |
DioxusLabs/dioxus | https://github.com/DioxusLabs/dioxus/blob/ec8f31dece5c75371177bf080bab46dff54ffd0e/packages/core-macro/src/props/mod.rs | packages/core-macro/src/props/mod.rs | //! This code mostly comes from idanarye/rust-typed-builder
//!
//! However, it has been adopted to fit the Dioxus Props builder pattern.
//!
//! For Dioxus, we make a few changes:
//! - [x] Automatically implement [`Into<Option>`] on the setters (IE the strip setter option)
//! - [x] Automatically implement a default ... | rust | Apache-2.0 | ec8f31dece5c75371177bf080bab46dff54ffd0e | 2026-01-04T15:32:28.012891Z | true |
DioxusLabs/dioxus | https://github.com/DioxusLabs/dioxus/blob/ec8f31dece5c75371177bf080bab46dff54ffd0e/packages/core-macro/tests/values_memoize_in_place.rs | packages/core-macro/tests/values_memoize_in_place.rs | use dioxus::{
core::{generation, needs_update},
prelude::*,
};
use dioxus_core::ElementId;
use std::{any::Any, rc::Rc};
#[tokio::test]
async fn values_memoize_in_place() {
thread_local! {
static DROP_COUNT: std::cell::RefCell<usize> = const { std::cell::RefCell::new(0) };
}
struct CountsDr... | rust | Apache-2.0 | ec8f31dece5c75371177bf080bab46dff54ffd0e | 2026-01-04T15:32:28.012891Z | false |
DioxusLabs/dioxus | https://github.com/DioxusLabs/dioxus/blob/ec8f31dece5c75371177bf080bab46dff54ffd0e/packages/core-macro/tests/generics.rs | packages/core-macro/tests/generics.rs | use std::fmt::Display;
use dioxus::prelude::*;
// This test just checks that props compile with generics
// It will not actually run any code
#[test]
#[allow(unused)]
#[allow(non_snake_case)]
fn generic_props_compile() {
fn app() -> Element {
rsx! {
TakesClone {
value: "hello w... | rust | Apache-2.0 | ec8f31dece5c75371177bf080bab46dff54ffd0e | 2026-01-04T15:32:28.012891Z | false |
DioxusLabs/dioxus | https://github.com/DioxusLabs/dioxus/blob/ec8f31dece5c75371177bf080bab46dff54ffd0e/packages/core-macro/tests/rsx.rs | packages/core-macro/tests/rsx.rs | #[test]
fn rsx() {
let t = trybuild::TestCases::new();
t.compile_fail("tests/rsx/trailing-comma-0.rs");
}
/// This test ensures that automatic `into` conversion occurs for default values.
///
/// These are compile-time tests.
/// See https://github.com/DioxusLabs/dioxus/issues/2373
#[cfg(test)]
mod test_defaul... | rust | Apache-2.0 | ec8f31dece5c75371177bf080bab46dff54ffd0e | 2026-01-04T15:32:28.012891Z | false |
DioxusLabs/dioxus | https://github.com/DioxusLabs/dioxus/blob/ec8f31dece5c75371177bf080bab46dff54ffd0e/packages/core-macro/tests/event_handler.rs | packages/core-macro/tests/event_handler.rs | use dioxus::prelude::*;
// This test just checks that event handlers compile without explicit type annotations
// It will not actually run any code
#[test]
#[allow(unused)]
fn event_handlers_compile() {
fn app() -> Element {
let mut todos = use_signal(String::new);
rsx! {
input {
... | rust | Apache-2.0 | ec8f31dece5c75371177bf080bab46dff54ffd0e | 2026-01-04T15:32:28.012891Z | false |
DioxusLabs/dioxus | https://github.com/DioxusLabs/dioxus/blob/ec8f31dece5c75371177bf080bab46dff54ffd0e/packages/core-macro/tests/rsx/trailing-comma-0.rs | packages/core-macro/tests/rsx/trailing-comma-0.rs | // Given an `rsx!` invocation with a missing trailing comma,
// ensure the stderr output has an informative span.
use dioxus::prelude::*;
fn main() {
rsx! {
p {
class: "foo bar"
"Hello world"
}
};
}
| rust | Apache-2.0 | ec8f31dece5c75371177bf080bab46dff54ffd0e | 2026-01-04T15:32:28.012891Z | false |
DioxusLabs/dioxus | https://github.com/DioxusLabs/dioxus/blob/ec8f31dece5c75371177bf080bab46dff54ffd0e/packages/fullstack-server/src/config.rs | packages/fullstack-server/src/config.rs | //! Configuration for how to serve a Dioxus application
#![allow(non_snake_case)]
use dioxus_core::LaunchConfig;
use std::any::Any;
use std::sync::Arc;
use crate::{IncrementalRendererConfig, IndexHtml};
#[allow(unused)]
pub(crate) type ContextProviders = Arc<Vec<Box<dyn Fn() -> Box<dyn Any> + Send + Sync + 'static>>... | rust | Apache-2.0 | ec8f31dece5c75371177bf080bab46dff54ffd0e | 2026-01-04T15:32:28.012891Z | false |
DioxusLabs/dioxus | https://github.com/DioxusLabs/dioxus/blob/ec8f31dece5c75371177bf080bab46dff54ffd0e/packages/fullstack-server/src/launch.rs | packages/fullstack-server/src/launch.rs | //! A launch function that creates an axum router for the LaunchBuilder
use crate::{server::DioxusRouterExt, FullstackState, ServeConfig};
use anyhow::Context;
use axum::{
body::Body,
extract::{Request, State},
routing::IntoMakeService,
Router,
};
use dioxus_cli_config::base_path;
use dioxus_core::{Com... | rust | Apache-2.0 | ec8f31dece5c75371177bf080bab46dff54ffd0e | 2026-01-04T15:32:28.012891Z | false |
DioxusLabs/dioxus | https://github.com/DioxusLabs/dioxus/blob/ec8f31dece5c75371177bf080bab46dff54ffd0e/packages/fullstack-server/src/lib.rs | packages/fullstack-server/src/lib.rs | #![doc = include_str!("../README.md")]
#![doc(html_logo_url = "https://avatars.githubusercontent.com/u/79236386")]
#![doc(html_favicon_url = "https://avatars.githubusercontent.com/u/79236386")]
// #![warn(missing_docs)]
#![cfg_attr(docsrs, feature(doc_cfg))]
#![forbid(unexpected_cfgs)]
// re-exported to make it possib... | rust | Apache-2.0 | ec8f31dece5c75371177bf080bab46dff54ffd0e | 2026-01-04T15:32:28.012891Z | false |
DioxusLabs/dioxus | https://github.com/DioxusLabs/dioxus/blob/ec8f31dece5c75371177bf080bab46dff54ffd0e/packages/fullstack-server/src/document.rs | packages/fullstack-server/src/document.rs | //! On the server, we collect any elements that should be rendered into the head in the first frame of SSR.
//! After the first frame, we have already sent down the head, so we can't modify it in place. The web client
//! will hydrate the head with the correct contents once it loads.
use std::cell::RefCell;
use dioxu... | rust | Apache-2.0 | ec8f31dece5c75371177bf080bab46dff54ffd0e | 2026-01-04T15:32:28.012891Z | false |
DioxusLabs/dioxus | https://github.com/DioxusLabs/dioxus/blob/ec8f31dece5c75371177bf080bab46dff54ffd0e/packages/fullstack-server/src/redirect.rs | packages/fullstack-server/src/redirect.rs | use std::sync::OnceLock;
/// A custom header that can be set with any value to indicate
/// that the server function client should redirect to a new route.
///
/// This is useful because it allows returning a value from the request,
/// while also indicating that a redirect should follow. This cannot be
/// done with ... | rust | Apache-2.0 | ec8f31dece5c75371177bf080bab46dff54ffd0e | 2026-01-04T15:32:28.012891Z | false |
DioxusLabs/dioxus | https://github.com/DioxusLabs/dioxus/blob/ec8f31dece5c75371177bf080bab46dff54ffd0e/packages/fullstack-server/src/serverfn.rs | packages/fullstack-server/src/serverfn.rs | use crate::FullstackState;
use axum::{
body::Body,
extract::{Request, State},
response::Response,
routing::MethodRouter,
};
use dioxus_fullstack_core::FullstackContext;
use http::{Method, StatusCode};
use std::{pin::Pin, prelude::rust_2024::Future};
/// A function endpoint that can be called from the c... | rust | Apache-2.0 | ec8f31dece5c75371177bf080bab46dff54ffd0e | 2026-01-04T15:32:28.012891Z | false |
DioxusLabs/dioxus | https://github.com/DioxusLabs/dioxus/blob/ec8f31dece5c75371177bf080bab46dff54ffd0e/packages/fullstack-server/src/server.rs | packages/fullstack-server/src/server.rs | use crate::{
ssr::{SSRError, SsrRendererPool},
ServeConfig, ServerFunction,
};
use axum::{
body::Body,
extract::State,
http::{Request, StatusCode},
response::{IntoResponse, Response},
routing::*,
};
use dioxus_core::{ComponentFunction, VirtualDom};
use http::header::*;
use std::path::{Path, ... | rust | Apache-2.0 | ec8f31dece5c75371177bf080bab46dff54ffd0e | 2026-01-04T15:32:28.012891Z | false |
DioxusLabs/dioxus | https://github.com/DioxusLabs/dioxus/blob/ec8f31dece5c75371177bf080bab46dff54ffd0e/packages/fullstack-server/src/ssr.rs | packages/fullstack-server/src/ssr.rs | //! A shared pool of renderers for efficient server side rendering.
use crate::isrg::{
CachedRender, IncrementalRenderer, IncrementalRendererConfig, IncrementalRendererError,
RenderFreshness,
};
use crate::streaming::{Mount, StreamingRenderer};
use crate::{document::ServerDocument, ServeConfig};
use dioxus_cli_... | rust | Apache-2.0 | ec8f31dece5c75371177bf080bab46dff54ffd0e | 2026-01-04T15:32:28.012891Z | false |
DioxusLabs/dioxus | https://github.com/DioxusLabs/dioxus/blob/ec8f31dece5c75371177bf080bab46dff54ffd0e/packages/fullstack-server/src/streaming.rs | packages/fullstack-server/src/streaming.rs | //! There are two common ways to render suspense:
//! 1. Stream the HTML in order - this will work even if javascript is disabled, but if there is something slow at the top of your page, and fast at the bottom, nothing will render until the slow part is done
//! 2. Render placeholders and stream the HTML out of order -... | rust | Apache-2.0 | ec8f31dece5c75371177bf080bab46dff54ffd0e | 2026-01-04T15:32:28.012891Z | false |
DioxusLabs/dioxus | https://github.com/DioxusLabs/dioxus/blob/ec8f31dece5c75371177bf080bab46dff54ffd0e/packages/fullstack-server/src/index_html.rs | packages/fullstack-server/src/index_html.rs | use anyhow::Context;
use std::path::Path;
/// An `IndexHtml` represents the contents of an `index.html` file used to serve a web application.
///
/// This defines the static portion of your web application, typically generated by a tool like `dx`
/// in conjunction with wasm-bindgen.
///
/// This structure expects a w... | rust | Apache-2.0 | ec8f31dece5c75371177bf080bab46dff54ffd0e | 2026-01-04T15:32:28.012891Z | false |
DioxusLabs/dioxus | https://github.com/DioxusLabs/dioxus/blob/ec8f31dece5c75371177bf080bab46dff54ffd0e/packages/fullstack-server/src/isrg/config.rs | packages/fullstack-server/src/isrg/config.rs | #![allow(non_snake_case)]
#[cfg(not(target_arch = "wasm32"))]
use crate::isrg::fs_cache::PathMapFn;
use crate::isrg::memory_cache::InMemoryCache;
use crate::IncrementalRenderer;
use std::{
path::{Path, PathBuf},
time::Duration,
};
/// A configuration for the incremental renderer.
#[derive(Clone)]
pub struct... | rust | Apache-2.0 | ec8f31dece5c75371177bf080bab46dff54ffd0e | 2026-01-04T15:32:28.012891Z | false |
DioxusLabs/dioxus | https://github.com/DioxusLabs/dioxus/blob/ec8f31dece5c75371177bf080bab46dff54ffd0e/packages/fullstack-server/src/isrg/freshness.rs | packages/fullstack-server/src/isrg/freshness.rs | use std::time::Duration;
use chrono::{DateTime, Utc};
/// Information about the freshness of a rendered response
#[derive(Debug, Clone, Copy)]
pub struct RenderFreshness {
/// The age of the rendered response
age: u64,
/// The maximum age of the rendered response
max_age: Option<u64>,
/// The time... | rust | Apache-2.0 | ec8f31dece5c75371177bf080bab46dff54ffd0e | 2026-01-04T15:32:28.012891Z | false |
DioxusLabs/dioxus | https://github.com/DioxusLabs/dioxus/blob/ec8f31dece5c75371177bf080bab46dff54ffd0e/packages/fullstack-server/src/isrg/mod.rs | packages/fullstack-server/src/isrg/mod.rs | //! Incremental file based incremental rendering
#![allow(non_snake_case)]
mod config;
mod freshness;
#[cfg(not(target_arch = "wasm32"))]
mod fs_cache;
mod memory_cache;
use std::time::Duration;
use chrono::Utc;
pub use config::*;
pub use freshness::*;
use self::memory_cache::InMemoryCache;
/// A render that was ... | rust | Apache-2.0 | ec8f31dece5c75371177bf080bab46dff54ffd0e | 2026-01-04T15:32:28.012891Z | false |
DioxusLabs/dioxus | https://github.com/DioxusLabs/dioxus/blob/ec8f31dece5c75371177bf080bab46dff54ffd0e/packages/fullstack-server/src/isrg/memory_cache.rs | packages/fullstack-server/src/isrg/memory_cache.rs | //! Incremental file based incremental rendering
#![allow(non_snake_case)]
use chrono::offset::Utc;
use chrono::DateTime;
use rustc_hash::FxHasher;
use std::{hash::BuildHasherDefault, num::NonZeroUsize};
use super::freshness::RenderFreshness;
pub(crate) struct InMemoryCache {
#[allow(clippy::type_complexity)]
... | rust | Apache-2.0 | ec8f31dece5c75371177bf080bab46dff54ffd0e | 2026-01-04T15:32:28.012891Z | false |
DioxusLabs/dioxus | https://github.com/DioxusLabs/dioxus/blob/ec8f31dece5c75371177bf080bab46dff54ffd0e/packages/fullstack-server/src/isrg/fs_cache.rs | packages/fullstack-server/src/isrg/fs_cache.rs | #![allow(non_snake_case)]
use chrono::{DateTime, Utc};
use super::{IncrementalRendererError, RenderFreshness};
use std::{path::PathBuf, sync::Arc, time::SystemTime};
pub(crate) type PathMapFn = Arc<dyn Fn(&str) -> PathBuf + Send + Sync>;
pub(crate) struct FileSystemCache {
static_dir: PathBuf,
map_path: Pat... | rust | Apache-2.0 | ec8f31dece5c75371177bf080bab46dff54ffd0e | 2026-01-04T15:32:28.012891Z | false |
DioxusLabs/dioxus | https://github.com/DioxusLabs/dioxus/blob/ec8f31dece5c75371177bf080bab46dff54ffd0e/packages/rsx-rosetta/src/lib.rs | packages/rsx-rosetta/src/lib.rs | #![doc = include_str!("../README.md")]
#![doc(html_logo_url = "https://avatars.githubusercontent.com/u/79236386")]
#![doc(html_favicon_url = "https://avatars.githubusercontent.com/u/79236386")]
use convert_case::{Case, Casing};
use dioxus_html::{map_html_attribute_to_rsx, map_html_element_to_rsx};
use dioxus_rsx::{
... | rust | Apache-2.0 | ec8f31dece5c75371177bf080bab46dff54ffd0e | 2026-01-04T15:32:28.012891Z | false |
DioxusLabs/dioxus | https://github.com/DioxusLabs/dioxus/blob/ec8f31dece5c75371177bf080bab46dff54ffd0e/packages/rsx-rosetta/tests/h-tags.rs | packages/rsx-rosetta/tests/h-tags.rs | use html_parser::Dom;
#[test]
fn h_tags_translate() {
let html = r#"
<div>
<h1>hello world!</h1>
<h2>hello world!</h2>
<h3>hello world!</h3>
<h4>hello world!</h4>
<h5>hello world!</h5>
<h6>hello world!</h6>
</div>
"#
.trim();
let dom = Dom::parse... | rust | Apache-2.0 | ec8f31dece5c75371177bf080bab46dff54ffd0e | 2026-01-04T15:32:28.012891Z | false |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.