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/stores/src/impls/vec.rs | packages/stores/src/impls/vec.rs | use crate::store::Store;
use dioxus_signals::Writable;
impl<Lens: Writable<Target = Vec<T>> + 'static, T: 'static> Store<Vec<T>, Lens> {
/// Pushes an item to the end of the vector. This will only mark the length of the vector as dirty.
///
/// # Example
/// ```rust, no_run
/// use dioxus_stores::*... | rust | Apache-2.0 | ec8f31dece5c75371177bf080bab46dff54ffd0e | 2026-01-04T15:32:28.012891Z | false |
DioxusLabs/dioxus | https://github.com/DioxusLabs/dioxus/blob/ec8f31dece5c75371177bf080bab46dff54ffd0e/packages/stores/src/impls/index.rs | packages/stores/src/impls/index.rs | //! Additional utilities for indexing into stores.
use std::{
collections::{BTreeMap, HashMap},
hash::Hash,
ops::{self, Index, IndexMut},
};
use crate::{scope::SelectorScope, store::Store, ReadStore};
use dioxus_signals::{
AnyStorage, BorrowError, BorrowMutError, ReadSignal, Readable, UnsyncStorage, W... | rust | Apache-2.0 | ec8f31dece5c75371177bf080bab46dff54ffd0e | 2026-01-04T15:32:28.012891Z | false |
DioxusLabs/dioxus | https://github.com/DioxusLabs/dioxus/blob/ec8f31dece5c75371177bf080bab46dff54ffd0e/packages/stores/src/impls/result.rs | packages/stores/src/impls/result.rs | use std::fmt::Debug;
use crate::{store::Store, MappedStore};
use dioxus_signals::{Readable, ReadableExt, Writable};
impl<Lens, T, E> Store<Result<T, E>, Lens>
where
Lens: Readable<Target = Result<T, E>> + 'static,
T: 'static,
E: 'static,
{
/// Checks if the `Result` is `Ok`. This will only track the s... | rust | Apache-2.0 | ec8f31dece5c75371177bf080bab46dff54ffd0e | 2026-01-04T15:32:28.012891Z | false |
DioxusLabs/dioxus | https://github.com/DioxusLabs/dioxus/blob/ec8f31dece5c75371177bf080bab46dff54ffd0e/packages/stores/src/impls/btreemap.rs | packages/stores/src/impls/btreemap.rs | //! Additional utilities for `BTreeMap` stores.
use std::{
borrow::Borrow, collections::BTreeMap, hash::Hash, iter::FusedIterator, panic::Location,
};
use crate::{store::Store, ReadStore};
use dioxus_signals::{
AnyStorage, BorrowError, BorrowMutError, ReadSignal, Readable, ReadableExt, UnsyncStorage,
Writ... | rust | Apache-2.0 | ec8f31dece5c75371177bf080bab46dff54ffd0e | 2026-01-04T15:32:28.012891Z | false |
DioxusLabs/dioxus | https://github.com/DioxusLabs/dioxus/blob/ec8f31dece5c75371177bf080bab46dff54ffd0e/packages/stores/src/impls/option.rs | packages/stores/src/impls/option.rs | use std::ops::DerefMut;
use crate::{store::Store, MappedStore};
use dioxus_signals::{Readable, ReadableExt};
impl<Lens: Readable<Target = Option<T>> + 'static, T: 'static> Store<Option<T>, Lens> {
/// Checks if the `Option` is `Some`. This will only track the shallow state of the `Option`. It will
/// only ca... | rust | Apache-2.0 | ec8f31dece5c75371177bf080bab46dff54ffd0e | 2026-01-04T15:32:28.012891Z | false |
DioxusLabs/dioxus | https://github.com/DioxusLabs/dioxus/blob/ec8f31dece5c75371177bf080bab46dff54ffd0e/packages/stores/src/impls/mod.rs | packages/stores/src/impls/mod.rs | pub mod btreemap;
mod deref;
pub mod hashmap;
pub mod index;
mod option;
mod result;
mod slice;
mod vec;
| rust | Apache-2.0 | ec8f31dece5c75371177bf080bab46dff54ffd0e | 2026-01-04T15:32:28.012891Z | false |
DioxusLabs/dioxus | https://github.com/DioxusLabs/dioxus/blob/ec8f31dece5c75371177bf080bab46dff54ffd0e/packages/stores/src/impls/deref.rs | packages/stores/src/impls/deref.rs | use std::ops::DerefMut;
use crate::{store::Store, MappedStore};
use dioxus_signals::Readable;
impl<Lens, T> Store<T, Lens>
where
Lens: Readable<Target = T> + 'static,
T: DerefMut + 'static,
{
/// Returns a store that dereferences the original value. The dereferenced store shares the same
/// subscript... | rust | Apache-2.0 | ec8f31dece5c75371177bf080bab46dff54ffd0e | 2026-01-04T15:32:28.012891Z | false |
DioxusLabs/dioxus | https://github.com/DioxusLabs/dioxus/blob/ec8f31dece5c75371177bf080bab46dff54ffd0e/packages/stores/tests/marco.rs | packages/stores/tests/marco.rs | #[allow(unused)]
#[allow(clippy::disallowed_names)]
mod macro_tests {
use dioxus_signals::*;
use dioxus_stores::*;
use std::collections::HashMap;
fn derive_unit() {
#[derive(Store)]
struct TodoItem;
}
fn derive_struct() {
#[derive(Store)]
struct TodoItem {
... | rust | Apache-2.0 | ec8f31dece5c75371177bf080bab46dff54ffd0e | 2026-01-04T15:32:28.012891Z | false |
DioxusLabs/dioxus | https://github.com/DioxusLabs/dioxus/blob/ec8f31dece5c75371177bf080bab46dff54ffd0e/packages/stores/tests/coercions.rs | packages/stores/tests/coercions.rs | #![allow(unused)]
use dioxus::prelude::*;
use dioxus_stores::*;
#[derive(Store)]
struct TodoItem {
checked: bool,
contents: String,
}
fn app() -> Element {
let item = use_store(|| TodoItem {
checked: false,
contents: "Learn about stores".to_string(),
});
rsx! {
TakesReadS... | rust | Apache-2.0 | ec8f31dece5c75371177bf080bab46dff54ffd0e | 2026-01-04T15:32:28.012891Z | false |
DioxusLabs/dioxus | https://github.com/DioxusLabs/dioxus/blob/ec8f31dece5c75371177bf080bab46dff54ffd0e/packages/component-manifest/src/lib.rs | packages/component-manifest/src/lib.rs | use std::process::Command;
use schemars::{schema_for, JsonSchema, Schema};
use serde::{Deserialize, Serialize};
/// A component compatible with the dioxus components system.
/// This may be a "virtual" component which is empty except for a list of members.
#[derive(Deserialize, Serialize, JsonSchema, Clone, Debug, Pa... | rust | Apache-2.0 | ec8f31dece5c75371177bf080bab46dff54ffd0e | 2026-01-04T15:32:28.012891Z | false |
DioxusLabs/dioxus | https://github.com/DioxusLabs/dioxus/blob/ec8f31dece5c75371177bf080bab46dff54ffd0e/packages/autofmt/src/lib.rs | packages/autofmt/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 crate::writer::*;
use dioxus_rsx::{BodyNode, CallBody};
use proc_macro2::{LineColumn, Span};
use syn::parse::Parser;
mod... | rust | Apache-2.0 | ec8f31dece5c75371177bf080bab46dff54ffd0e | 2026-01-04T15:32:28.012891Z | false |
DioxusLabs/dioxus | https://github.com/DioxusLabs/dioxus/blob/ec8f31dece5c75371177bf080bab46dff54ffd0e/packages/autofmt/src/indent.rs | packages/autofmt/src/indent.rs | #[derive(Clone, Copy, PartialEq, Eq, Debug)]
pub enum IndentType {
Spaces,
Tabs,
}
#[derive(Debug, Clone)]
pub struct IndentOptions {
width: usize,
indent_string: String,
split_line_attributes: bool,
}
impl IndentOptions {
pub fn new(ty: IndentType, width: usize, split_line_attributes: bool) -... | rust | Apache-2.0 | ec8f31dece5c75371177bf080bab46dff54ffd0e | 2026-01-04T15:32:28.012891Z | false |
DioxusLabs/dioxus | https://github.com/DioxusLabs/dioxus/blob/ec8f31dece5c75371177bf080bab46dff54ffd0e/packages/autofmt/src/prettier_please.rs | packages/autofmt/src/prettier_please.rs | use dioxus_rsx::CallBody;
use syn::{parse::Parser, visit_mut::VisitMut, Expr, File, Item, MacroDelimiter};
use crate::{IndentOptions, Writer};
impl Writer<'_> {
pub fn unparse_expr(&mut self, expr: &Expr) -> String {
unparse_expr(expr, self.raw_src, &self.out.indent)
}
}
// we use weird unicode alter... | rust | Apache-2.0 | ec8f31dece5c75371177bf080bab46dff54ffd0e | 2026-01-04T15:32:28.012891Z | false |
DioxusLabs/dioxus | https://github.com/DioxusLabs/dioxus/blob/ec8f31dece5c75371177bf080bab46dff54ffd0e/packages/autofmt/src/collect_macros.rs | packages/autofmt/src/collect_macros.rs | //! Collect macros from a file
//!
//! Returns all macros that match a pattern. You can use this information to autoformat them later
use proc_macro2::LineColumn;
use syn::{visit::Visit, File, Macro, Meta};
type CollectedMacro<'a> = &'a Macro;
pub fn collect_from_file(file: &File) -> Vec<CollectedMacro<'_>> {
le... | rust | Apache-2.0 | ec8f31dece5c75371177bf080bab46dff54ffd0e | 2026-01-04T15:32:28.012891Z | false |
DioxusLabs/dioxus | https://github.com/DioxusLabs/dioxus/blob/ec8f31dece5c75371177bf080bab46dff54ffd0e/packages/autofmt/src/writer.rs | packages/autofmt/src/writer.rs | use crate::{buffer::Buffer, IndentOptions};
use dioxus_rsx::*;
use proc_macro2::{LineColumn, Span};
use quote::ToTokens;
use regex::Regex;
use std::{
borrow::Cow,
collections::{HashMap, VecDeque},
fmt::{Result, Write},
};
use syn::{spanned::Spanned, token::Brace, Expr};
#[derive(Debug)]
pub struct Writer<'... | rust | Apache-2.0 | ec8f31dece5c75371177bf080bab46dff54ffd0e | 2026-01-04T15:32:28.012891Z | true |
DioxusLabs/dioxus | https://github.com/DioxusLabs/dioxus/blob/ec8f31dece5c75371177bf080bab46dff54ffd0e/packages/autofmt/src/buffer.rs | packages/autofmt/src/buffer.rs | //! The output buffer that supports some helpful methods
//! These are separate from the input so we can lend references between the two
use std::fmt::{Result, Write};
use dioxus_rsx::IfmtInput;
use crate::indent::IndentOptions;
/// The output buffer that tracks indent and string
#[derive(Debug, Default)]
pub struc... | rust | Apache-2.0 | ec8f31dece5c75371177bf080bab46dff54ffd0e | 2026-01-04T15:32:28.012891Z | false |
DioxusLabs/dioxus | https://github.com/DioxusLabs/dioxus/blob/ec8f31dece5c75371177bf080bab46dff54ffd0e/packages/autofmt/tests/srcless.rs | packages/autofmt/tests/srcless.rs | use dioxus_rsx::CallBody;
use syn::parse_quote;
macro_rules! test_case {
(
$path:literal
) => {
works(include!($path), include_str!($path))
};
}
/// Ensure we can write RSX blocks without a source file
///
/// Useful in code generation use cases where we still want formatted code.
#[test]
... | rust | Apache-2.0 | ec8f31dece5c75371177bf080bab46dff54ffd0e | 2026-01-04T15:32:28.012891Z | false |
DioxusLabs/dioxus | https://github.com/DioxusLabs/dioxus/blob/ec8f31dece5c75371177bf080bab46dff54ffd0e/packages/autofmt/tests/wrong.rs | packages/autofmt/tests/wrong.rs | #![allow(deprecated)]
use dioxus_autofmt::{IndentOptions, IndentType};
macro_rules! twoway {
($val:literal => $name:ident ($indent:expr)) => {
#[test]
fn $name() {
let src_right = include_str!(concat!("./wrong/", $val, ".rsx"));
let src_wrong = include_str!(concat!("./wrong... | rust | Apache-2.0 | ec8f31dece5c75371177bf080bab46dff54ffd0e | 2026-01-04T15:32:28.012891Z | false |
DioxusLabs/dioxus | https://github.com/DioxusLabs/dioxus/blob/ec8f31dece5c75371177bf080bab46dff54ffd0e/packages/autofmt/tests/samples.rs | packages/autofmt/tests/samples.rs | #![allow(deprecated)]
macro_rules! twoway {
(
$(
// doc attrs
$( #[doc = $doc:expr] )*
$name:ident,
)*
) => {
$(
$( #[doc = $doc] )*
#[test]
fn $name() {
let src = include_str!(concat!("./samples/",... | rust | Apache-2.0 | ec8f31dece5c75371177bf080bab46dff54ffd0e | 2026-01-04T15:32:28.012891Z | false |
DioxusLabs/dioxus | https://github.com/DioxusLabs/dioxus/blob/ec8f31dece5c75371177bf080bab46dff54ffd0e/packages/autofmt/tests/error_handling.rs | packages/autofmt/tests/error_handling.rs | #[test]
fn no_parse() {
let src = include_str!("./partials/no_parse.rsx");
assert!(syn::parse_file(src).is_err());
}
#[test]
fn parses_but_fmt_fails() {
let src = include_str!("./partials/wrong.rsx");
let file = syn::parse_file(src).unwrap();
let formatted = dioxus_autofmt::try_fmt_file(src, &file,... | rust | Apache-2.0 | ec8f31dece5c75371177bf080bab46dff54ffd0e | 2026-01-04T15:32:28.012891Z | false |
DioxusLabs/dioxus | https://github.com/DioxusLabs/dioxus/blob/ec8f31dece5c75371177bf080bab46dff54ffd0e/packages/cli-telemetry/src/lib.rs | packages/cli-telemetry/src/lib.rs | //! # Telemetry for the Dioxus CLI
//!
//! Dioxus uses telemetry in the CLI to get insight into metrics like performance, panics, and usage
//! of various arguments. This data helps us track down bugs and improve quality of the tooling.
//!
//! Usage of telemetry in open source products can be controversial. Our goal h... | rust | Apache-2.0 | ec8f31dece5c75371177bf080bab46dff54ffd0e | 2026-01-04T15:32:28.012891Z | false |
DioxusLabs/dioxus | https://github.com/DioxusLabs/dioxus/blob/ec8f31dece5c75371177bf080bab46dff54ffd0e/packages/history/src/lib.rs | packages/history/src/lib.rs | use dioxus_core::{provide_context, provide_root_context};
use std::{rc::Rc, sync::Arc};
mod memory;
pub use memory::*;
/// Get the history provider for the current platform if the platform doesn't implement a history functionality.
pub fn history() -> Rc<dyn History> {
match dioxus_core::try_consume_context::<Rc<... | rust | Apache-2.0 | ec8f31dece5c75371177bf080bab46dff54ffd0e | 2026-01-04T15:32:28.012891Z | false |
DioxusLabs/dioxus | https://github.com/DioxusLabs/dioxus/blob/ec8f31dece5c75371177bf080bab46dff54ffd0e/packages/history/src/memory.rs | packages/history/src/memory.rs | use std::cell::RefCell;
use crate::History;
struct MemoryHistoryState {
current: String,
history: Vec<String>,
future: Vec<String>,
}
/// A [`History`] provider that stores all navigation information in memory.
pub struct MemoryHistory {
state: RefCell<MemoryHistoryState>,
base_path: Option<Strin... | rust | Apache-2.0 | ec8f31dece5c75371177bf080bab46dff54ffd0e | 2026-01-04T15:32:28.012891Z | false |
DioxusLabs/dioxus | https://github.com/DioxusLabs/dioxus/blob/ec8f31dece5c75371177bf080bab46dff54ffd0e/packages/html/src/attribute_groups.rs | packages/html/src/attribute_groups.rs | #![allow(non_upper_case_globals)]
#![allow(deprecated)]
use dioxus_core::HasAttributes;
use dioxus_core::IntoAttributeValue;
use dioxus_html_internal_macro::impl_extension_attributes;
use crate::AttributeDescription;
#[cfg(feature = "hot-reload-context")]
macro_rules! mod_method_mapping {
(
$matching:ide... | rust | Apache-2.0 | ec8f31dece5c75371177bf080bab46dff54ffd0e | 2026-01-04T15:32:28.012891Z | true |
DioxusLabs/dioxus | https://github.com/DioxusLabs/dioxus/blob/ec8f31dece5c75371177bf080bab46dff54ffd0e/packages/html/src/input_data.rs | packages/html/src/input_data.rs | //! Data structures representing user input, such as modifier keys and mouse buttons
use enumset::{EnumSet, EnumSetType};
/// A re-export of keyboard_types
pub use keyboard_types;
use keyboard_types::Location;
/// A mouse button type (such as Primary/Secondary)
// note: EnumSetType also derives Copy and Clone for som... | rust | Apache-2.0 | ec8f31dece5c75371177bf080bab46dff54ffd0e | 2026-01-04T15:32:28.012891Z | false |
DioxusLabs/dioxus | https://github.com/DioxusLabs/dioxus/blob/ec8f31dece5c75371177bf080bab46dff54ffd0e/packages/html/src/lib.rs | packages/html/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")]
#![allow(non_snake_case)]
//! # Dioxus Namespace for HTML
//!
//! This crate provides a set of compile-time correct HTML elem... | rust | Apache-2.0 | ec8f31dece5c75371177bf080bab46dff54ffd0e | 2026-01-04T15:32:28.012891Z | false |
DioxusLabs/dioxus | https://github.com/DioxusLabs/dioxus/blob/ec8f31dece5c75371177bf080bab46dff54ffd0e/packages/html/src/transit.rs | packages/html/src/transit.rs | use std::{any::Any, rc::Rc};
use crate::events::*;
use dioxus_core::ElementId;
use serde::{Deserialize, Serialize};
#[cfg(feature = "serialize")]
#[derive(Serialize, Debug, PartialEq)]
pub struct HtmlEvent {
pub element: ElementId,
pub name: String,
pub bubbles: bool,
pub data: EventData,
}
#[cfg(fea... | rust | Apache-2.0 | ec8f31dece5c75371177bf080bab46dff54ffd0e | 2026-01-04T15:32:28.012891Z | false |
DioxusLabs/dioxus | https://github.com/DioxusLabs/dioxus/blob/ec8f31dece5c75371177bf080bab46dff54ffd0e/packages/html/src/point_interaction.rs | packages/html/src/point_interaction.rs | use keyboard_types::Modifiers;
use crate::{
geometry::{ClientPoint, Coordinates, ElementPoint, PagePoint, ScreenPoint},
input_data::{MouseButton, MouseButtonSet},
};
/// A interaction that contains data about the location of the event.
pub trait InteractionLocation {
/// Gets the coordinates of the event ... | rust | Apache-2.0 | ec8f31dece5c75371177bf080bab46dff54ffd0e | 2026-01-04T15:32:28.012891Z | false |
DioxusLabs/dioxus | https://github.com/DioxusLabs/dioxus/blob/ec8f31dece5c75371177bf080bab46dff54ffd0e/packages/html/src/geometry.rs | packages/html/src/geometry.rs | //! Geometry primitives for representing e.g. mouse events
/// A re-export of euclid, which we use for geometry primitives
pub use euclid;
use euclid::*;
/// Coordinate space relative to the screen
pub struct ScreenSpace;
/// A point in ScreenSpace
pub type ScreenPoint = Point2D<f64, ScreenSpace>;
/// Coordinate sp... | rust | Apache-2.0 | ec8f31dece5c75371177bf080bab46dff54ffd0e | 2026-01-04T15:32:28.012891Z | false |
DioxusLabs/dioxus | https://github.com/DioxusLabs/dioxus/blob/ec8f31dece5c75371177bf080bab46dff54ffd0e/packages/html/src/render_template.rs | packages/html/src/render_template.rs | use dioxus_core::{Template, TemplateAttribute, TemplateNode};
use std::fmt::Write;
/// Render a template to an HTML string
///
/// Useful for sending over the wire. Can be used to with innerHtml to create templates with little work
pub fn render_template_to_html(template: &Template) -> String {
let mut out = Strin... | rust | Apache-2.0 | ec8f31dece5c75371177bf080bab46dff54ffd0e | 2026-01-04T15:32:28.012891Z | false |
DioxusLabs/dioxus | https://github.com/DioxusLabs/dioxus/blob/ec8f31dece5c75371177bf080bab46dff54ffd0e/packages/html/src/file_data.rs | packages/html/src/file_data.rs | use bytes::Bytes;
use futures_util::Stream;
use std::{path::PathBuf, pin::Pin, prelude::rust_2024::Future};
#[derive(Clone)]
pub struct FileData {
inner: std::sync::Arc<dyn NativeFileData>,
}
impl FileData {
pub fn new(inner: impl NativeFileData + 'static) -> Self {
Self {
inner: std::sync... | rust | Apache-2.0 | ec8f31dece5c75371177bf080bab46dff54ffd0e | 2026-01-04T15:32:28.012891Z | false |
DioxusLabs/dioxus | https://github.com/DioxusLabs/dioxus/blob/ec8f31dece5c75371177bf080bab46dff54ffd0e/packages/html/src/elements.rs | packages/html/src/elements.rs | #![allow(non_upper_case_globals)]
use dioxus_core::HasAttributes;
use dioxus_core::IntoAttributeValue;
#[cfg(feature = "hot-reload-context")]
use dioxus_core_types::HotReloadingContext;
use dioxus_html_internal_macro::impl_extension_attributes;
#[cfg(feature = "hot-reload-context")]
use crate::{map_global_attributes,... | rust | Apache-2.0 | ec8f31dece5c75371177bf080bab46dff54ffd0e | 2026-01-04T15:32:28.012891Z | true |
DioxusLabs/dioxus | https://github.com/DioxusLabs/dioxus/blob/ec8f31dece5c75371177bf080bab46dff54ffd0e/packages/html/src/data_transfer.rs | packages/html/src/data_transfer.rs | pub struct DataTransfer {
inner: Box<dyn NativeDataTransfer>,
}
impl DataTransfer {
pub fn new(inner: impl NativeDataTransfer + 'static) -> Self {
Self {
inner: Box::new(inner),
}
}
#[cfg(feature = "serialize")]
pub fn store(&self, item: impl Serialize) -> Result<(), St... | rust | Apache-2.0 | ec8f31dece5c75371177bf080bab46dff54ffd0e | 2026-01-04T15:32:28.012891Z | false |
DioxusLabs/dioxus | https://github.com/DioxusLabs/dioxus/blob/ec8f31dece5c75371177bf080bab46dff54ffd0e/packages/html/src/events/focus.rs | packages/html/src/events/focus.rs | use dioxus_core::Event;
pub type FocusEvent = Event<FocusData>;
pub struct FocusData {
inner: Box<dyn HasFocusData>,
}
impl<E: HasFocusData> From<E> for FocusData {
fn from(e: E) -> Self {
Self { inner: Box::new(e) }
}
}
impl std::fmt::Debug for FocusData {
fn fmt(&self, f: &mut std::fmt::Fo... | rust | Apache-2.0 | ec8f31dece5c75371177bf080bab46dff54ffd0e | 2026-01-04T15:32:28.012891Z | false |
DioxusLabs/dioxus | https://github.com/DioxusLabs/dioxus/blob/ec8f31dece5c75371177bf080bab46dff54ffd0e/packages/html/src/events/scroll.rs | packages/html/src/events/scroll.rs | use dioxus_core::Event;
pub type ScrollEvent = Event<ScrollData>;
pub struct ScrollData {
inner: Box<dyn HasScrollData>,
}
impl<E: HasScrollData> From<E> for ScrollData {
fn from(e: E) -> Self {
Self { inner: Box::new(e) }
}
}
impl ScrollData {
/// Create a new ScrollData
pub fn new(inne... | rust | Apache-2.0 | ec8f31dece5c75371177bf080bab46dff54ffd0e | 2026-01-04T15:32:28.012891Z | false |
DioxusLabs/dioxus | https://github.com/DioxusLabs/dioxus/blob/ec8f31dece5c75371177bf080bab46dff54ffd0e/packages/html/src/events/image.rs | packages/html/src/events/image.rs | use dioxus_core::Event;
pub type ImageEvent = Event<ImageData>;
pub struct ImageData {
inner: Box<dyn HasImageData>,
}
impl<E: HasImageData> From<E> for ImageData {
fn from(e: E) -> Self {
Self { inner: Box::new(e) }
}
}
impl std::fmt::Debug for ImageData {
fn fmt(&self, f: &mut std::fmt::For... | rust | Apache-2.0 | ec8f31dece5c75371177bf080bab46dff54ffd0e | 2026-01-04T15:32:28.012891Z | false |
DioxusLabs/dioxus | https://github.com/DioxusLabs/dioxus/blob/ec8f31dece5c75371177bf080bab46dff54ffd0e/packages/html/src/events/mouse.rs | packages/html/src/events/mouse.rs | use crate::geometry::{ClientPoint, Coordinates, ElementPoint, PagePoint, ScreenPoint};
use crate::input_data::{MouseButton, MouseButtonSet};
use crate::*;
use dioxus_core::Event;
use keyboard_types::Modifiers;
pub type MouseEvent = Event<MouseData>;
/// A synthetic event that wraps a web-style [`MouseEvent`](https://... | rust | Apache-2.0 | ec8f31dece5c75371177bf080bab46dff54ffd0e | 2026-01-04T15:32:28.012891Z | false |
DioxusLabs/dioxus | https://github.com/DioxusLabs/dioxus/blob/ec8f31dece5c75371177bf080bab46dff54ffd0e/packages/html/src/events/clipboard.rs | packages/html/src/events/clipboard.rs | use dioxus_core::Event;
pub type ClipboardEvent = Event<ClipboardData>;
pub struct ClipboardData {
inner: Box<dyn HasClipboardData>,
}
impl<E: HasClipboardData> From<E> for ClipboardData {
fn from(e: E) -> Self {
Self { inner: Box::new(e) }
}
}
impl std::fmt::Debug for ClipboardData {
fn fmt... | rust | Apache-2.0 | ec8f31dece5c75371177bf080bab46dff54ffd0e | 2026-01-04T15:32:28.012891Z | false |
DioxusLabs/dioxus | https://github.com/DioxusLabs/dioxus/blob/ec8f31dece5c75371177bf080bab46dff54ffd0e/packages/html/src/events/composition.rs | packages/html/src/events/composition.rs | use dioxus_core::Event;
pub type CompositionEvent = Event<CompositionData>;
pub struct CompositionData {
inner: Box<dyn HasCompositionData>,
}
impl std::fmt::Debug for CompositionData {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
f.debug_struct("CompositionData")
... | rust | Apache-2.0 | ec8f31dece5c75371177bf080bab46dff54ffd0e | 2026-01-04T15:32:28.012891Z | false |
DioxusLabs/dioxus | https://github.com/DioxusLabs/dioxus/blob/ec8f31dece5c75371177bf080bab46dff54ffd0e/packages/html/src/events/animation.rs | packages/html/src/events/animation.rs | use dioxus_core::Event;
pub type AnimationEvent = Event<AnimationData>;
pub struct AnimationData {
inner: Box<dyn HasAnimationData>,
}
impl AnimationData {
/// Create a new AnimationData
pub fn new(inner: impl HasAnimationData + 'static) -> Self {
Self {
inner: Box::new(inner),
... | rust | Apache-2.0 | ec8f31dece5c75371177bf080bab46dff54ffd0e | 2026-01-04T15:32:28.012891Z | false |
DioxusLabs/dioxus | https://github.com/DioxusLabs/dioxus/blob/ec8f31dece5c75371177bf080bab46dff54ffd0e/packages/html/src/events/form.rs | packages/html/src/events/form.rs | use crate::file_data::HasFileData;
use crate::FileData;
use std::fmt::Debug;
use dioxus_core::Event;
pub type FormEvent = Event<FormData>;
/* DOMEvent: Send + SyncTarget relatedTarget */
pub struct FormData {
inner: Box<dyn HasFormData>,
}
impl FormData {
/// Create a new form event
pub fn new(event: i... | rust | Apache-2.0 | ec8f31dece5c75371177bf080bab46dff54ffd0e | 2026-01-04T15:32:28.012891Z | false |
DioxusLabs/dioxus | https://github.com/DioxusLabs/dioxus/blob/ec8f31dece5c75371177bf080bab46dff54ffd0e/packages/html/src/events/drag.rs | packages/html/src/events/drag.rs | use crate::input_data::{MouseButton, MouseButtonSet};
use crate::*;
use crate::{
data_transfer::DataTransfer,
geometry::{ClientPoint, Coordinates, ElementPoint, PagePoint, ScreenPoint},
};
use dioxus_core::Event;
use keyboard_types::Modifiers;
use crate::HasMouseData;
pub type DragEvent = Event<DragData>;
/... | rust | Apache-2.0 | ec8f31dece5c75371177bf080bab46dff54ffd0e | 2026-01-04T15:32:28.012891Z | false |
DioxusLabs/dioxus | https://github.com/DioxusLabs/dioxus/blob/ec8f31dece5c75371177bf080bab46dff54ffd0e/packages/html/src/events/media.rs | packages/html/src/events/media.rs | use dioxus_core::Event;
pub type MediaEvent = Event<MediaData>;
pub struct MediaData {
inner: Box<dyn HasMediaData>,
}
impl<E: HasMediaData> From<E> for MediaData {
fn from(e: E) -> Self {
Self { inner: Box::new(e) }
}
}
impl std::fmt::Debug for MediaData {
fn fmt(&self, f: &mut std::fmt::For... | rust | Apache-2.0 | ec8f31dece5c75371177bf080bab46dff54ffd0e | 2026-01-04T15:32:28.012891Z | false |
DioxusLabs/dioxus | https://github.com/DioxusLabs/dioxus/blob/ec8f31dece5c75371177bf080bab46dff54ffd0e/packages/html/src/events/toggle.rs | packages/html/src/events/toggle.rs | use dioxus_core::Event;
pub type ToggleEvent = Event<ToggleData>;
pub struct ToggleData {
inner: Box<dyn HasToggleData>,
}
impl<E: HasToggleData> From<E> for ToggleData {
fn from(e: E) -> Self {
Self { inner: Box::new(e) }
}
}
impl std::fmt::Debug for ToggleData {
fn fmt(&self, f: &mut std::... | rust | Apache-2.0 | ec8f31dece5c75371177bf080bab46dff54ffd0e | 2026-01-04T15:32:28.012891Z | false |
DioxusLabs/dioxus | https://github.com/DioxusLabs/dioxus/blob/ec8f31dece5c75371177bf080bab46dff54ffd0e/packages/html/src/events/cancel.rs | packages/html/src/events/cancel.rs | use dioxus_core::Event;
pub type CancelEvent = Event<CancelData>;
pub struct CancelData {
inner: Box<dyn HasCancelData>,
}
impl<E: HasCancelData> From<E> for CancelData {
fn from(e: E) -> Self {
Self { inner: Box::new(e) }
}
}
impl std::fmt::Debug for CancelData {
fn fmt(&self, f: &mut std::... | rust | Apache-2.0 | ec8f31dece5c75371177bf080bab46dff54ffd0e | 2026-01-04T15:32:28.012891Z | false |
DioxusLabs/dioxus | https://github.com/DioxusLabs/dioxus/blob/ec8f31dece5c75371177bf080bab46dff54ffd0e/packages/html/src/events/transition.rs | packages/html/src/events/transition.rs | use dioxus_core::Event;
pub type TransitionEvent = Event<TransitionData>;
pub struct TransitionData {
inner: Box<dyn HasTransitionData>,
}
impl<E: HasTransitionData> From<E> for TransitionData {
fn from(e: E) -> Self {
Self { inner: Box::new(e) }
}
}
impl std::fmt::Debug for TransitionData {
... | rust | Apache-2.0 | ec8f31dece5c75371177bf080bab46dff54ffd0e | 2026-01-04T15:32:28.012891Z | false |
DioxusLabs/dioxus | https://github.com/DioxusLabs/dioxus/blob/ec8f31dece5c75371177bf080bab46dff54ffd0e/packages/html/src/events/wheel.rs | packages/html/src/events/wheel.rs | use dioxus_core::Event;
use keyboard_types::Modifiers;
use std::fmt::Formatter;
use crate::{geometry::*, InteractionLocation, ModifiersInteraction, PointerInteraction};
use crate::{
input_data::{MouseButton, MouseButtonSet},
InteractionElementOffset,
};
use super::HasMouseData;
/// A synthetic event that wra... | rust | Apache-2.0 | ec8f31dece5c75371177bf080bab46dff54ffd0e | 2026-01-04T15:32:28.012891Z | false |
DioxusLabs/dioxus | https://github.com/DioxusLabs/dioxus/blob/ec8f31dece5c75371177bf080bab46dff54ffd0e/packages/html/src/events/mod.rs | packages/html/src/events/mod.rs | #![doc = include_str!("../../docs/event_handlers.md")]
use std::any::Any;
use std::sync::RwLock;
macro_rules! impl_event {
(
$data:ty;
$(
$( #[$attr:meta] )*
$name:ident $(: $js_name:literal)?
)*
) => {
$(
$( #[$attr] )*
/// <deta... | rust | Apache-2.0 | ec8f31dece5c75371177bf080bab46dff54ffd0e | 2026-01-04T15:32:28.012891Z | false |
DioxusLabs/dioxus | https://github.com/DioxusLabs/dioxus/blob/ec8f31dece5c75371177bf080bab46dff54ffd0e/packages/html/src/events/selection.rs | packages/html/src/events/selection.rs | use dioxus_core::Event;
pub type SelectionEvent = Event<SelectionData>;
pub struct SelectionData {
inner: Box<dyn HasSelectionData>,
}
impl SelectionData {
/// Create a new SelectionData
pub fn new(inner: impl HasSelectionData + 'static) -> Self {
Self {
inner: Box::new(inner),
... | rust | Apache-2.0 | ec8f31dece5c75371177bf080bab46dff54ffd0e | 2026-01-04T15:32:28.012891Z | false |
DioxusLabs/dioxus | https://github.com/DioxusLabs/dioxus/blob/ec8f31dece5c75371177bf080bab46dff54ffd0e/packages/html/src/events/mounted.rs | packages/html/src/events/mounted.rs | //! Handles querying data from the renderer
use std::{
fmt::{Debug, Display, Formatter},
future::Future,
pin::Pin,
};
/// An Element that has been rendered and allows reading and modifying information about it.
///
/// Different platforms will have different implementations and different levels of support... | rust | Apache-2.0 | ec8f31dece5c75371177bf080bab46dff54ffd0e | 2026-01-04T15:32:28.012891Z | false |
DioxusLabs/dioxus | https://github.com/DioxusLabs/dioxus/blob/ec8f31dece5c75371177bf080bab46dff54ffd0e/packages/html/src/events/keyboard.rs | packages/html/src/events/keyboard.rs | use dioxus_core::Event;
use keyboard_types::{Code, Key, Location, Modifiers};
use std::fmt::Debug;
use crate::ModifiersInteraction;
#[cfg(feature = "serialize")]
fn resilient_deserialize_code<'de, D>(deserializer: D) -> Result<Code, D::Error>
where
D: serde::Deserializer<'de>,
{
use serde::Deserialize;
//... | rust | Apache-2.0 | ec8f31dece5c75371177bf080bab46dff54ffd0e | 2026-01-04T15:32:28.012891Z | false |
DioxusLabs/dioxus | https://github.com/DioxusLabs/dioxus/blob/ec8f31dece5c75371177bf080bab46dff54ffd0e/packages/html/src/events/pointer.rs | packages/html/src/events/pointer.rs | use dioxus_core::Event;
use keyboard_types::Modifiers;
use crate::{geometry::*, input_data::*, *};
/// A synthetic event that wraps a web-style [`PointerEvent`](https://developer.mozilla.org/en-US/docs/Web/API/PointerEvent)
pub type PointerEvent = Event<PointerData>;
pub struct PointerData {
inner: Box<dyn HasPo... | rust | Apache-2.0 | ec8f31dece5c75371177bf080bab46dff54ffd0e | 2026-01-04T15:32:28.012891Z | false |
DioxusLabs/dioxus | https://github.com/DioxusLabs/dioxus/blob/ec8f31dece5c75371177bf080bab46dff54ffd0e/packages/html/src/events/visible.rs | packages/html/src/events/visible.rs | use std::{
fmt::{Display, Formatter},
time::SystemTime,
};
pub struct VisibleData {
inner: Box<dyn HasVisibleData>,
}
impl<E: HasVisibleData> From<E> for VisibleData {
fn from(e: E) -> Self {
Self { inner: Box::new(e) }
}
}
impl VisibleData {
/// Create a new VisibleData
pub fn ne... | rust | Apache-2.0 | ec8f31dece5c75371177bf080bab46dff54ffd0e | 2026-01-04T15:32:28.012891Z | false |
DioxusLabs/dioxus | https://github.com/DioxusLabs/dioxus/blob/ec8f31dece5c75371177bf080bab46dff54ffd0e/packages/html/src/events/resize.rs | packages/html/src/events/resize.rs | use std::fmt::{Display, Formatter};
pub struct ResizeData {
inner: Box<dyn HasResizeData>,
}
impl<E: HasResizeData> From<E> for ResizeData {
fn from(e: E) -> Self {
Self { inner: Box::new(e) }
}
}
impl ResizeData {
/// Create a new ResizeData
pub fn new(inner: impl HasResizeData + 'static... | rust | Apache-2.0 | ec8f31dece5c75371177bf080bab46dff54ffd0e | 2026-01-04T15:32:28.012891Z | false |
DioxusLabs/dioxus | https://github.com/DioxusLabs/dioxus/blob/ec8f31dece5c75371177bf080bab46dff54ffd0e/packages/html/src/events/touch.rs | packages/html/src/events/touch.rs | use dioxus_core::Event;
use keyboard_types::Modifiers;
use crate::geometry::*;
use crate::{InteractionLocation, ModifiersInteraction};
pub type TouchEvent = Event<TouchData>;
pub struct TouchData {
inner: Box<dyn HasTouchData>,
}
impl<E: HasTouchData> From<E> for TouchData {
fn from(e: E) -> Self {
S... | rust | Apache-2.0 | ec8f31dece5c75371177bf080bab46dff54ffd0e | 2026-01-04T15:32:28.012891Z | false |
DioxusLabs/dioxus | https://github.com/DioxusLabs/dioxus/blob/ec8f31dece5c75371177bf080bab46dff54ffd0e/packages/check/src/issues.rs | packages/check/src/issues.rs | use owo_colors::{
colors::{css::LightBlue, BrightRed},
OwoColorize, Stream,
};
use std::{
fmt::Display,
path::{Path, PathBuf},
};
use crate::metadata::{
AnyLoopInfo, AsyncInfo, ClosureInfo, ConditionalInfo, ForInfo, HookInfo, IfInfo, MatchInfo,
WhileInfo,
};
/// The result of checking a Dioxus... | rust | Apache-2.0 | ec8f31dece5c75371177bf080bab46dff54ffd0e | 2026-01-04T15:32:28.012891Z | false |
DioxusLabs/dioxus | https://github.com/DioxusLabs/dioxus/blob/ec8f31dece5c75371177bf080bab46dff54ffd0e/packages/check/src/lib.rs | packages/check/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")]
mod check;
mod issues;
mod metadata;
pub use check::check_file;
pub use issues::{Issue, IssueReport};
| rust | Apache-2.0 | ec8f31dece5c75371177bf080bab46dff54ffd0e | 2026-01-04T15:32:28.012891Z | false |
DioxusLabs/dioxus | https://github.com/DioxusLabs/dioxus/blob/ec8f31dece5c75371177bf080bab46dff54ffd0e/packages/check/src/check.rs | packages/check/src/check.rs | use std::path::PathBuf;
use syn::{spanned::Spanned, visit::Visit, Pat};
use crate::{
issues::{Issue, IssueReport},
metadata::{
AnyLoopInfo, AsyncInfo, ClosureInfo, ComponentInfo, ConditionalInfo, FnInfo, ForInfo,
HookInfo, IfInfo, LoopInfo, MatchInfo, Span, WhileInfo,
},
};
struct VisitHo... | rust | Apache-2.0 | ec8f31dece5c75371177bf080bab46dff54ffd0e | 2026-01-04T15:32:28.012891Z | false |
DioxusLabs/dioxus | https://github.com/DioxusLabs/dioxus/blob/ec8f31dece5c75371177bf080bab46dff54ffd0e/packages/check/src/metadata.rs | packages/check/src/metadata.rs | #[derive(Debug, Clone, PartialEq, Eq)]
/// Information about a hook call or function.
pub struct HookInfo {
/// The name of the hook, e.g. `use_signal`.
pub name: String,
/// The span of the hook, e.g. `use_signal`.
pub span: Span,
/// The span of the name, e.g. `use_signal`.
pub name_span: Span... | rust | Apache-2.0 | ec8f31dece5c75371177bf080bab46dff54ffd0e | 2026-01-04T15:32:28.012891Z | false |
DioxusLabs/dioxus | https://github.com/DioxusLabs/dioxus/blob/ec8f31dece5c75371177bf080bab46dff54ffd0e/packages/rsx-hotreload/src/lib.rs | packages/rsx-hotreload/src/lib.rs | mod collect;
pub use collect::*;
mod diff;
pub use diff::*;
mod last_build_state;
mod extensions;
| rust | Apache-2.0 | ec8f31dece5c75371177bf080bab46dff54ffd0e | 2026-01-04T15:32:28.012891Z | false |
DioxusLabs/dioxus | https://github.com/DioxusLabs/dioxus/blob/ec8f31dece5c75371177bf080bab46dff54ffd0e/packages/rsx-hotreload/src/last_build_state.rs | packages/rsx-hotreload/src/last_build_state.rs | use dioxus_core::internal::{FmtSegment, FmtedSegments, HotReloadLiteral};
use dioxus_rsx::*;
use std::cell::Cell;
/// A pool of items we can grab from during hot reloading.
/// We have three different pools we can pull from:
/// - Dynamic text segments (eg: "{class}")
/// - Dynamic nodes (eg: {children})
/// - Dynamic... | rust | Apache-2.0 | ec8f31dece5c75371177bf080bab46dff54ffd0e | 2026-01-04T15:32:28.012891Z | false |
DioxusLabs/dioxus | https://github.com/DioxusLabs/dioxus/blob/ec8f31dece5c75371177bf080bab46dff54ffd0e/packages/rsx-hotreload/src/collect.rs | packages/rsx-hotreload/src/collect.rs | //! Compare two files and find any rsx calls that have changed
//!
//! This is used to determine if a hotreload is needed.
//! We use a special syn visitor to find all the rsx! calls in the file and then compare them to see
//! if they are the same. This visitor will actually remove the rsx! calls and replace them with... | rust | Apache-2.0 | ec8f31dece5c75371177bf080bab46dff54ffd0e | 2026-01-04T15:32:28.012891Z | false |
DioxusLabs/dioxus | https://github.com/DioxusLabs/dioxus/blob/ec8f31dece5c75371177bf080bab46dff54ffd0e/packages/rsx-hotreload/src/diff.rs | packages/rsx-hotreload/src/diff.rs | //! This module contains the diffing logic for rsx hot reloading.
//!
//! There's a few details that I wish we could've gotten right but we can revisit later:
//!
//! - Expanding an if chain is not possible - only its contents can be hot reloaded
//!
//! - Components that don't start with children can't be hot reloaded... | rust | Apache-2.0 | ec8f31dece5c75371177bf080bab46dff54ffd0e | 2026-01-04T15:32:28.012891Z | false |
DioxusLabs/dioxus | https://github.com/DioxusLabs/dioxus/blob/ec8f31dece5c75371177bf080bab46dff54ffd0e/packages/rsx-hotreload/src/extensions.rs | packages/rsx-hotreload/src/extensions.rs | use dioxus_core::TemplateNode;
use dioxus_core_types::HotReloadingContext;
use dioxus_rsx::*;
use internment::Intern;
use std::hash::Hash;
// interns a object into a static object, reusing the value if it already exists
pub(crate) fn intern<T: Eq + Hash + Send + Sync + ?Sized + 'static>(
s: impl Into<Intern<T>>,
)... | rust | Apache-2.0 | ec8f31dece5c75371177bf080bab46dff54ffd0e | 2026-01-04T15:32:28.012891Z | false |
DioxusLabs/dioxus | https://github.com/DioxusLabs/dioxus/blob/ec8f31dece5c75371177bf080bab46dff54ffd0e/packages/rsx-hotreload/tests/hotreloads.rs | packages/rsx-hotreload/tests/hotreloads.rs | use dioxus_rsx_hotreload::diff_rsx;
use syn::File;
macro_rules! assert_rsx_changed {
(
$( #[doc = $doc:expr] )*
$name:ident
) => {
$( #[doc = $doc] )*
#[test]
fn $name() {
let old = include_str!(concat!("./valid/", stringify!($name), ".old.rsx"));
... | rust | Apache-2.0 | ec8f31dece5c75371177bf080bab46dff54ffd0e | 2026-01-04T15:32:28.012891Z | false |
DioxusLabs/dioxus | https://github.com/DioxusLabs/dioxus/blob/ec8f31dece5c75371177bf080bab46dff54ffd0e/packages/rsx-hotreload/tests/hotreload_pattern.rs | packages/rsx-hotreload/tests/hotreload_pattern.rs | #![allow(unused)]
use std::collections::HashMap;
use dioxus_core::{
internal::{
FmtSegment, FmtedSegments, HotReloadAttributeValue, HotReloadDynamicAttribute,
HotReloadDynamicNode, HotReloadLiteral, HotReloadedTemplate, NamedAttribute,
},
Template, TemplateAttribute, TemplateNode, VNode,
}... | rust | Apache-2.0 | ec8f31dece5c75371177bf080bab46dff54ffd0e | 2026-01-04T15:32:28.012891Z | false |
DioxusLabs/dioxus | https://github.com/DioxusLabs/dioxus/blob/ec8f31dece5c75371177bf080bab46dff54ffd0e/packages/devtools-types/src/lib.rs | packages/devtools-types/src/lib.rs | use dioxus_core::internal::HotReloadTemplateWithLocation;
use serde::{Deserialize, Serialize};
use std::path::PathBuf;
use subsecond_types::JumpTable;
/// A message the hot reloading server sends to the client
#[non_exhaustive]
#[derive(Debug, Serialize, Deserialize, Clone, PartialEq)]
pub enum DevserverMsg {
/// ... | rust | Apache-2.0 | ec8f31dece5c75371177bf080bab46dff54ffd0e | 2026-01-04T15:32:28.012891Z | false |
DioxusLabs/dioxus | https://github.com/DioxusLabs/dioxus/blob/ec8f31dece5c75371177bf080bab46dff54ffd0e/packages/cli-opt/build.rs | packages/cli-opt/build.rs | fn main() {
built::write_built_file().expect("Failed to acquire build-time information");
}
| rust | Apache-2.0 | ec8f31dece5c75371177bf080bab46dff54ffd0e | 2026-01-04T15:32:28.012891Z | false |
DioxusLabs/dioxus | https://github.com/DioxusLabs/dioxus/blob/ec8f31dece5c75371177bf080bab46dff54ffd0e/packages/cli-opt/src/css.rs | packages/cli-opt/src/css.rs | use std::{hash::Hasher, path::Path};
use anyhow::{anyhow, Context};
use codemap::SpanLoc;
use grass::OutputStyle;
use lightningcss::{
printer::PrinterOptions,
stylesheet::{MinifyOptions, ParserOptions, StyleSheet},
targets::{Browsers, Targets},
};
use manganis_core::{create_module_hash, transform_css, CssA... | rust | Apache-2.0 | ec8f31dece5c75371177bf080bab46dff54ffd0e | 2026-01-04T15:32:28.012891Z | false |
DioxusLabs/dioxus | https://github.com/DioxusLabs/dioxus/blob/ec8f31dece5c75371177bf080bab46dff54ffd0e/packages/cli-opt/src/lib.rs | packages/cli-opt/src/lib.rs | use anyhow::Context;
use manganis::AssetOptions;
use manganis_core::BundledAsset;
use rayon::iter::{IntoParallelRefIterator, ParallelIterator};
use serde::{Deserialize, Serialize};
use std::collections::{BTreeMap, HashSet};
use std::path::{Path, PathBuf};
use std::sync::{Arc, RwLock};
mod build_info;
mod css;
mod file... | rust | Apache-2.0 | ec8f31dece5c75371177bf080bab46dff54ffd0e | 2026-01-04T15:32:28.012891Z | false |
DioxusLabs/dioxus | https://github.com/DioxusLabs/dioxus/blob/ec8f31dece5c75371177bf080bab46dff54ffd0e/packages/cli-opt/src/build_info.rs | packages/cli-opt/src/build_info.rs | // The file has been placed there by the build script.
include!(concat!(env!("OUT_DIR"), "/built.rs"));
pub(crate) fn version() -> String {
format!(
"{} ({})",
PKG_VERSION,
GIT_COMMIT_HASH_SHORT.unwrap_or("was built without git repository")
)
}
| rust | Apache-2.0 | ec8f31dece5c75371177bf080bab46dff54ffd0e | 2026-01-04T15:32:28.012891Z | false |
DioxusLabs/dioxus | https://github.com/DioxusLabs/dioxus/blob/ec8f31dece5c75371177bf080bab46dff54ffd0e/packages/cli-opt/src/json.rs | packages/cli-opt/src/json.rs | use std::{io::Read, path::Path};
use anyhow::Context;
pub(crate) fn minify_json(source: &str) -> anyhow::Result<String> {
// First try to parse the json
let json: serde_json::Value = serde_json::from_str(source)?;
// Then print it in a minified format
let json = serde_json::to_string(&json)?;
Ok(j... | rust | Apache-2.0 | ec8f31dece5c75371177bf080bab46dff54ffd0e | 2026-01-04T15:32:28.012891Z | false |
DioxusLabs/dioxus | https://github.com/DioxusLabs/dioxus/blob/ec8f31dece5c75371177bf080bab46dff54ffd0e/packages/cli-opt/src/file.rs | packages/cli-opt/src/file.rs | use anyhow::Context;
use manganis::{AssetOptions, CssModuleAssetOptions, FolderAssetOptions};
use manganis_core::{AssetVariant, CssAssetOptions, ImageAssetOptions, JsAssetOptions};
use std::path::Path;
use crate::css::{process_css_module, process_scss};
use super::{
css::process_css, folder::process_folder, image... | rust | Apache-2.0 | ec8f31dece5c75371177bf080bab46dff54ffd0e | 2026-01-04T15:32:28.012891Z | false |
DioxusLabs/dioxus | https://github.com/DioxusLabs/dioxus/blob/ec8f31dece5c75371177bf080bab46dff54ffd0e/packages/cli-opt/src/js.rs | packages/cli-opt/src/js.rs | use std::hash::Hasher;
use std::path::Path;
use std::path::PathBuf;
use anyhow::Context;
use manganis_core::JsAssetOptions;
use swc_common::errors::Emitter;
use swc_common::errors::Handler;
use swc_common::input::SourceFileInput;
use swc_ecma_minifier::option::{ExtraOptions, MinifyOptions};
use swc_ecma_parser::lexer:... | rust | Apache-2.0 | ec8f31dece5c75371177bf080bab46dff54ffd0e | 2026-01-04T15:32:28.012891Z | false |
DioxusLabs/dioxus | https://github.com/DioxusLabs/dioxus/blob/ec8f31dece5c75371177bf080bab46dff54ffd0e/packages/cli-opt/src/hash.rs | packages/cli-opt/src/hash.rs | //! Utilities for creating hashed paths to assets in Manganis. This module defines [`AssetHash`] which is used to create a hashed path to an asset in both the CLI and the macro.
use std::{
hash::{Hash, Hasher},
io::Read,
path::{Path, PathBuf},
};
use crate::{
css::hash_scss,
file::{resolve_asset_o... | rust | Apache-2.0 | ec8f31dece5c75371177bf080bab46dff54ffd0e | 2026-01-04T15:32:28.012891Z | false |
DioxusLabs/dioxus | https://github.com/DioxusLabs/dioxus/blob/ec8f31dece5c75371177bf080bab46dff54ffd0e/packages/cli-opt/src/folder.rs | packages/cli-opt/src/folder.rs | use std::path::Path;
use rayon::iter::{IntoParallelRefIterator, ParallelIterator};
use crate::file::process_file_to_with_options;
/// Process a folder, optimizing and copying all assets into the output folder
pub fn process_folder(source: &Path, output_folder: &Path) -> anyhow::Result<()> {
// Create the folder
... | rust | Apache-2.0 | ec8f31dece5c75371177bf080bab46dff54ffd0e | 2026-01-04T15:32:28.012891Z | false |
DioxusLabs/dioxus | https://github.com/DioxusLabs/dioxus/blob/ec8f31dece5c75371177bf080bab46dff54ffd0e/packages/cli-opt/src/image/png.rs | packages/cli-opt/src/image/png.rs | use std::{io::BufWriter, path::Path};
use image::DynamicImage;
pub(crate) fn compress_png(image: DynamicImage, output_location: &Path) {
// Image loading/saving is outside scope of this library
let width = image.width() as usize;
let height = image.height() as usize;
let bitmap: Vec<_> = image
... | rust | Apache-2.0 | ec8f31dece5c75371177bf080bab46dff54ffd0e | 2026-01-04T15:32:28.012891Z | false |
DioxusLabs/dioxus | https://github.com/DioxusLabs/dioxus/blob/ec8f31dece5c75371177bf080bab46dff54ffd0e/packages/cli-opt/src/image/mod.rs | packages/cli-opt/src/image/mod.rs | use std::path::Path;
use anyhow::Context;
use jpg::compress_jpg;
use manganis_core::{ImageAssetOptions, ImageFormat, ImageSize};
use png::compress_png;
mod jpg;
mod png;
pub(crate) fn process_image(
image_options: &ImageAssetOptions,
source: &Path,
output_path: &Path,
) -> anyhow::Result<()> {
let mu... | rust | Apache-2.0 | ec8f31dece5c75371177bf080bab46dff54ffd0e | 2026-01-04T15:32:28.012891Z | false |
DioxusLabs/dioxus | https://github.com/DioxusLabs/dioxus/blob/ec8f31dece5c75371177bf080bab46dff54ffd0e/packages/cli-opt/src/image/jpg.rs | packages/cli-opt/src/image/jpg.rs | use image::{DynamicImage, EncodableLayout};
use std::{
io::{BufWriter, Write},
path::Path,
};
pub(crate) fn compress_jpg(image: DynamicImage, output_location: &Path) -> anyhow::Result<()> {
let mut comp = mozjpeg::Compress::new(mozjpeg::ColorSpace::JCS_EXT_RGBX);
let width = image.width() as usize;
... | rust | Apache-2.0 | ec8f31dece5c75371177bf080bab46dff54ffd0e | 2026-01-04T15:32:28.012891Z | false |
DioxusLabs/dioxus | https://github.com/DioxusLabs/dioxus/blob/ec8f31dece5c75371177bf080bab46dff54ffd0e/packages/signals/src/lib.rs | packages/signals/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)]
#![allow(clippy::type_complexity)]
mod copy_value;
pub use copy_value::*;
pub(crate) mod signal;
pub ... | rust | Apache-2.0 | ec8f31dece5c75371177bf080bab46dff54ffd0e | 2026-01-04T15:32:28.012891Z | false |
DioxusLabs/dioxus | https://github.com/DioxusLabs/dioxus/blob/ec8f31dece5c75371177bf080bab46dff54ffd0e/packages/signals/src/set_compare.rs | packages/signals/src/set_compare.rs | use crate::{write::WritableExt, ReadableExt};
use std::hash::Hash;
use dioxus_core::ReactiveContext;
use futures_util::StreamExt;
use generational_box::{Storage, UnsyncStorage};
use crate::{CopyValue, ReadSignal, Signal, SignalData};
use rustc_hash::FxHashMap;
/// An object that can efficiently compare a value to a ... | rust | Apache-2.0 | ec8f31dece5c75371177bf080bab46dff54ffd0e | 2026-01-04T15:32:28.012891Z | false |
DioxusLabs/dioxus | https://github.com/DioxusLabs/dioxus/blob/ec8f31dece5c75371177bf080bab46dff54ffd0e/packages/signals/src/write.rs | packages/signals/src/write.rs | use std::{
collections::{HashMap, HashSet},
ops::{Deref, DerefMut, IndexMut},
};
use generational_box::{AnyStorage, UnsyncStorage};
use crate::{ext_methods, read::Readable, read::ReadableExt, MappedMutSignal, WriteSignal};
/// A reference to a value that can be written to.
#[allow(type_alias_bounds)]
pub typ... | rust | Apache-2.0 | ec8f31dece5c75371177bf080bab46dff54ffd0e | 2026-01-04T15:32:28.012891Z | false |
DioxusLabs/dioxus | https://github.com/DioxusLabs/dioxus/blob/ec8f31dece5c75371177bf080bab46dff54ffd0e/packages/signals/src/signal.rs | packages/signals/src/signal.rs | use crate::{
default_impl, fmt_impls, read::*, write::*, write_impls, CopyValue, Global, GlobalMemo,
GlobalSignal, Memo, ReadableRef, WritableRef,
};
use dioxus_core::{IntoAttributeValue, IntoDynNode, ReactiveContext, ScopeId, Subscribers};
use generational_box::{BorrowResult, Storage, SyncStorage, UnsyncStorag... | rust | Apache-2.0 | ec8f31dece5c75371177bf080bab46dff54ffd0e | 2026-01-04T15:32:28.012891Z | false |
DioxusLabs/dioxus | https://github.com/DioxusLabs/dioxus/blob/ec8f31dece5c75371177bf080bab46dff54ffd0e/packages/signals/src/copy_value.rs | packages/signals/src/copy_value.rs | #![allow(clippy::unnecessary_operation)]
#![allow(clippy::no_effect)]
use dioxus_core::{current_owner, current_scope_id, ScopeId};
use dioxus_core::{Runtime, Subscribers};
use generational_box::{
AnyStorage, BorrowResult, GenerationalBox, GenerationalBoxId, Storage, UnsyncStorage,
};
use std::ops::Deref;
use crat... | rust | Apache-2.0 | ec8f31dece5c75371177bf080bab46dff54ffd0e | 2026-01-04T15:32:28.012891Z | false |
DioxusLabs/dioxus | https://github.com/DioxusLabs/dioxus/blob/ec8f31dece5c75371177bf080bab46dff54ffd0e/packages/signals/src/map.rs | packages/signals/src/map.rs | use crate::{read::Readable, read_impls, ReadableExt, ReadableRef};
use dioxus_core::{IntoAttributeValue, Subscribers};
use generational_box::{AnyStorage, BorrowResult};
use std::ops::Deref;
/// A read only signal that has been mapped to a new type.
pub struct MappedSignal<O: ?Sized, V, F = fn(&<V as Readable>::Target)... | rust | Apache-2.0 | ec8f31dece5c75371177bf080bab46dff54ffd0e | 2026-01-04T15:32:28.012891Z | false |
DioxusLabs/dioxus | https://github.com/DioxusLabs/dioxus/blob/ec8f31dece5c75371177bf080bab46dff54ffd0e/packages/signals/src/props.rs | packages/signals/src/props.rs | use crate::{ReadSignal, Signal};
use dioxus_core::SuperFrom;
#[doc(hidden)]
pub struct ReadFromMarker<M>(std::marker::PhantomData<M>);
impl<T, O, M> SuperFrom<T, ReadFromMarker<M>> for ReadSignal<O>
where
O: SuperFrom<T, M> + 'static,
T: 'static,
{
fn super_from(input: T) -> Self {
ReadSignal::new... | rust | Apache-2.0 | ec8f31dece5c75371177bf080bab46dff54ffd0e | 2026-01-04T15:32:28.012891Z | false |
DioxusLabs/dioxus | https://github.com/DioxusLabs/dioxus/blob/ec8f31dece5c75371177bf080bab46dff54ffd0e/packages/signals/src/read.rs | packages/signals/src/read.rs | use std::collections::{HashMap, HashSet};
use std::{
mem::MaybeUninit,
ops::{Deref, Index},
};
use crate::{ext_methods, MappedSignal, ReadSignal};
use dioxus_core::Subscribers;
use generational_box::{AnyStorage, UnsyncStorage};
/// A reference to a value that can be read from.
#[allow(type_alias_bounds)]
pub ... | rust | Apache-2.0 | ec8f31dece5c75371177bf080bab46dff54ffd0e | 2026-01-04T15:32:28.012891Z | false |
DioxusLabs/dioxus | https://github.com/DioxusLabs/dioxus/blob/ec8f31dece5c75371177bf080bab46dff54ffd0e/packages/signals/src/boxed.rs | packages/signals/src/boxed.rs | use std::{any::Any, ops::Deref};
use dioxus_core::{IntoAttributeValue, IntoDynNode, Subscribers};
use generational_box::{BorrowResult, Storage, SyncStorage, UnsyncStorage};
use crate::{
read_impls, write_impls, CopyValue, Global, InitializeFromFunction, MappedMutSignal,
MappedSignal, Memo, Readable, ReadableE... | rust | Apache-2.0 | ec8f31dece5c75371177bf080bab46dff54ffd0e | 2026-01-04T15:32:28.012891Z | false |
DioxusLabs/dioxus | https://github.com/DioxusLabs/dioxus/blob/ec8f31dece5c75371177bf080bab46dff54ffd0e/packages/signals/src/impls.rs | packages/signals/src/impls.rs | /// This macro is used to generate a `impl Default` block for any type with the function new_maybe_sync that takes a generic `T`
///
/// # Example
/// ```rust
/// use generational_box::*;
/// use dioxus::prelude::*;
/// use dioxus_core::Subscribers;
///
/// struct MyCopyValue<T, S: 'static> {
/// value: CopyValue<T... | rust | Apache-2.0 | ec8f31dece5c75371177bf080bab46dff54ffd0e | 2026-01-04T15:32:28.012891Z | false |
DioxusLabs/dioxus | https://github.com/DioxusLabs/dioxus/blob/ec8f31dece5c75371177bf080bab46dff54ffd0e/packages/signals/src/memo.rs | packages/signals/src/memo.rs | use crate::{read::Readable, write_impls, ReadableRef, Signal};
use crate::{read_impls, GlobalMemo, ReadableExt, WritableExt};
use crate::{CopyValue, Writable};
use std::{
cell::RefCell,
ops::Deref,
sync::{atomic::AtomicBool, Arc},
};
use dioxus_core::{
current_scope_id, spawn_isomorphic, IntoAttributeV... | rust | Apache-2.0 | ec8f31dece5c75371177bf080bab46dff54ffd0e | 2026-01-04T15:32:28.012891Z | false |
DioxusLabs/dioxus | https://github.com/DioxusLabs/dioxus/blob/ec8f31dece5c75371177bf080bab46dff54ffd0e/packages/signals/src/warnings.rs | packages/signals/src/warnings.rs | //! Warnings that can be triggered by suspicious usage of signals
use warnings::warning;
/// A warning that is triggered when a copy value is used in a higher scope that it is owned by
#[warning]
pub fn copy_value_hoisted<T: 'static, S: generational_box::Storage<T> + 'static>(
value: &crate::CopyValue<T, S>,
... | rust | Apache-2.0 | ec8f31dece5c75371177bf080bab46dff54ffd0e | 2026-01-04T15:32:28.012891Z | false |
DioxusLabs/dioxus | https://github.com/DioxusLabs/dioxus/blob/ec8f31dece5c75371177bf080bab46dff54ffd0e/packages/signals/src/map_mut.rs | packages/signals/src/map_mut.rs | use std::ops::Deref;
use crate::{
read_impls, write_impls, Readable, ReadableExt, ReadableRef, Writable, WritableExt,
WritableRef, WriteLock,
};
use dioxus_core::{IntoAttributeValue, Subscribers};
use generational_box::{AnyStorage, BorrowResult};
/// A read only signal that has been mapped to a new type.
pub ... | rust | Apache-2.0 | ec8f31dece5c75371177bf080bab46dff54ffd0e | 2026-01-04T15:32:28.012891Z | false |
DioxusLabs/dioxus | https://github.com/DioxusLabs/dioxus/blob/ec8f31dece5c75371177bf080bab46dff54ffd0e/packages/signals/src/global/signal.rs | packages/signals/src/global/signal.rs | use super::{Global, InitializeFromFunction};
use crate::read::ReadableExt;
use crate::read_impls;
use crate::Signal;
impl<T: 'static> InitializeFromFunction<T> for Signal<T> {
fn initialize_from_function(f: fn() -> T) -> Self {
Signal::new(f())
}
}
/// A signal that can be accessed from anywhere in th... | rust | Apache-2.0 | ec8f31dece5c75371177bf080bab46dff54ffd0e | 2026-01-04T15:32:28.012891Z | false |
DioxusLabs/dioxus | https://github.com/DioxusLabs/dioxus/blob/ec8f31dece5c75371177bf080bab46dff54ffd0e/packages/signals/src/global/mod.rs | packages/signals/src/global/mod.rs | use dioxus_core::{Runtime, ScopeId, Subscribers};
use generational_box::BorrowResult;
use std::{any::Any, cell::RefCell, collections::HashMap, ops::Deref, panic::Location, rc::Rc};
mod memo;
pub use memo::*;
mod signal;
pub use signal::*;
use crate::{Readable, ReadableExt, ReadableRef, Signal, Writable, WritableExt,... | rust | Apache-2.0 | ec8f31dece5c75371177bf080bab46dff54ffd0e | 2026-01-04T15:32:28.012891Z | false |
DioxusLabs/dioxus | https://github.com/DioxusLabs/dioxus/blob/ec8f31dece5c75371177bf080bab46dff54ffd0e/packages/signals/src/global/memo.rs | packages/signals/src/global/memo.rs | use super::{Global, InitializeFromFunction};
use crate::read::ReadableExt;
use crate::read_impls;
use crate::Memo;
impl<T: PartialEq + 'static> InitializeFromFunction<T> for Memo<T> {
fn initialize_from_function(f: fn() -> T) -> Self {
Memo::new(f)
}
}
/// A memo that can be accessed from anywhere in ... | rust | Apache-2.0 | ec8f31dece5c75371177bf080bab46dff54ffd0e | 2026-01-04T15:32:28.012891Z | false |
DioxusLabs/dioxus | https://github.com/DioxusLabs/dioxus/blob/ec8f31dece5c75371177bf080bab46dff54ffd0e/packages/signals/tests/subscribe.rs | packages/signals/tests/subscribe.rs | #![allow(unused, non_upper_case_globals, non_snake_case)]
use dioxus_core::{current_scope_id, generation, NoOpMutations};
use std::collections::HashMap;
use std::rc::Rc;
use dioxus::prelude::*;
use dioxus_core::ElementId;
use dioxus_signals::*;
use std::cell::RefCell;
#[test]
fn reading_subscribes() {
tracing_su... | rust | Apache-2.0 | ec8f31dece5c75371177bf080bab46dff54ffd0e | 2026-01-04T15:32:28.012891Z | false |
DioxusLabs/dioxus | https://github.com/DioxusLabs/dioxus/blob/ec8f31dece5c75371177bf080bab46dff54ffd0e/packages/signals/tests/memo.rs | packages/signals/tests/memo.rs | #![allow(unused, non_upper_case_globals, non_snake_case)]
use dioxus::html::p;
use dioxus::prelude::*;
use dioxus_core::NoOpMutations;
use dioxus_core::{generation, ElementId};
use dioxus_signals::*;
use std::cell::RefCell;
use std::collections::HashMap;
use std::rc::Rc;
use std::sync::atomic::{AtomicBool, Ordering};
... | rust | Apache-2.0 | ec8f31dece5c75371177bf080bab46dff54ffd0e | 2026-01-04T15:32:28.012891Z | false |
DioxusLabs/dioxus | https://github.com/DioxusLabs/dioxus/blob/ec8f31dece5c75371177bf080bab46dff54ffd0e/packages/signals/tests/create.rs | packages/signals/tests/create.rs | #![allow(unused, non_upper_case_globals, non_snake_case)]
use dioxus::prelude::*;
use dioxus_core::{generation, ElementId, NoOpMutations};
use dioxus_signals::*;
#[test]
fn create_signals_global() {
let mut dom = VirtualDom::new(|| {
rsx! {
for _ in 0..10 {
Child {}
... | rust | Apache-2.0 | ec8f31dece5c75371177bf080bab46dff54ffd0e | 2026-01-04T15:32:28.012891Z | false |
DioxusLabs/dioxus | https://github.com/DioxusLabs/dioxus/blob/ec8f31dece5c75371177bf080bab46dff54ffd0e/packages/signals/docs/hoist/error.rs | packages/signals/docs/hoist/error.rs | #[component]
fn Counters() -> Element {
let counts = use_signal(Vec::new);
let mut children = use_signal(|| 0);
rsx! {
button { onclick: move |_| children += 1, "Add child" }
button { onclick: move |_| children -= 1, "Remove child" }
// A signal from a child is read or written to in... | rust | Apache-2.0 | ec8f31dece5c75371177bf080bab46dff54ffd0e | 2026-01-04T15:32:28.012891Z | false |
DioxusLabs/dioxus | https://github.com/DioxusLabs/dioxus/blob/ec8f31dece5c75371177bf080bab46dff54ffd0e/packages/signals/docs/hoist/fixed_list.rs | packages/signals/docs/hoist/fixed_list.rs | #[component]
fn Counters() -> Element {
let mut counts = use_signal(Vec::new);
rsx! {
button { onclick: move |_| counts.write().push(0), "Add child" }
button {
onclick: move |_| {
counts.write().pop();
},
"Remove child"
}
"{cou... | 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.