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 |
|---|---|---|---|---|---|---|---|---|
iced-rs/iced | https://github.com/iced-rs/iced/blob/15c0e397a81933ca88a9a338caaac2a4689354f9/src/application/timed.rs | src/application/timed.rs | //! An [`Application`] that receives an [`Instant`] in update logic.
use crate::application::{Application, BootFn, ViewFn};
use crate::program;
use crate::theme;
use crate::time::Instant;
use crate::window;
use crate::{Element, Program, Settings, Subscription, Task};
use iced_debug as debug;
/// Creates an [`Applicat... | rust | MIT | 15c0e397a81933ca88a9a338caaac2a4689354f9 | 2026-01-04T15:34:40.545819Z | false |
iced-rs/iced | https://github.com/iced-rs/iced/blob/15c0e397a81933ca88a9a338caaac2a4689354f9/benches/wgpu.rs | benches/wgpu.rs | #![allow(missing_docs)]
use criterion::{Bencher, Criterion, criterion_group, criterion_main};
use iced::alignment;
use iced::mouse;
use iced::widget::{canvas, scrollable, stack, text};
use iced::{Color, Element, Font, Length, Pixels, Point, Rectangle, Size, Theme};
use iced_wgpu::Renderer;
use iced_wgpu::wgpu;
criter... | rust | MIT | 15c0e397a81933ca88a9a338caaac2a4689354f9 | 2026-01-04T15:34:40.545819Z | false |
iced-rs/iced | https://github.com/iced-rs/iced/blob/15c0e397a81933ca88a9a338caaac2a4689354f9/test/src/lib.rs | test/src/lib.rs | //! Test your `iced` applications in headless mode.
//!
//! # Basic Usage
//! Let's assume we want to test [the classical counter interface].
//!
//! First, we will want to create a [`Simulator`] of our interface:
//!
//! ```rust,no_run
//! # struct Counter { value: i64 }
//! # impl Counter {
//! # pub fn view(&self... | rust | MIT | 15c0e397a81933ca88a9a338caaac2a4689354f9 | 2026-01-04T15:34:40.545819Z | false |
iced-rs/iced | https://github.com/iced-rs/iced/blob/15c0e397a81933ca88a9a338caaac2a4689354f9/test/src/instruction.rs | test/src/instruction.rs | //! A step in an end-to-end test.
use crate::core::keyboard;
use crate::core::mouse;
use crate::core::{Event, Point};
use crate::simulator;
use std::fmt;
/// A step in an end-to-end test.
///
/// An [`Instruction`] can be run by an [`Emulator`](crate::Emulator).
#[derive(Debug, Clone, PartialEq)]
pub enum Instruction... | rust | MIT | 15c0e397a81933ca88a9a338caaac2a4689354f9 | 2026-01-04T15:34:40.545819Z | false |
iced-rs/iced | https://github.com/iced-rs/iced/blob/15c0e397a81933ca88a9a338caaac2a4689354f9/test/src/error.rs | test/src/error.rs | use crate::Instruction;
use crate::ice;
use std::io;
use std::path::PathBuf;
use std::sync::Arc;
/// A test error.
#[derive(Debug, Clone, thiserror::Error)]
pub enum Error {
/// No matching widget was found for the [`Selector`](crate::Selector).
#[error("no matching widget was found for the selector: {selecto... | rust | MIT | 15c0e397a81933ca88a9a338caaac2a4689354f9 | 2026-01-04T15:34:40.545819Z | false |
iced-rs/iced | https://github.com/iced-rs/iced/blob/15c0e397a81933ca88a9a338caaac2a4689354f9/test/src/simulator.rs | test/src/simulator.rs | //! Run a simulation of your application without side effects.
use crate::core;
use crate::core::clipboard;
use crate::core::event;
use crate::core::keyboard;
use crate::core::mouse;
use crate::core::theme;
use crate::core::time;
use crate::core::widget;
use crate::core::window;
use crate::core::{Element, Event, Font, ... | rust | MIT | 15c0e397a81933ca88a9a338caaac2a4689354f9 | 2026-01-04T15:34:40.545819Z | false |
iced-rs/iced | https://github.com/iced-rs/iced/blob/15c0e397a81933ca88a9a338caaac2a4689354f9/test/src/emulator.rs | test/src/emulator.rs | //! Run your application in a headless runtime.
use crate::core;
use crate::core::mouse;
use crate::core::renderer;
use crate::core::time::Instant;
use crate::core::widget;
use crate::core::window;
use crate::core::{Bytes, Element, Point, Size};
use crate::instruction;
use crate::program;
use crate::program::Program;
u... | rust | MIT | 15c0e397a81933ca88a9a338caaac2a4689354f9 | 2026-01-04T15:34:40.545819Z | false |
iced-rs/iced | https://github.com/iced-rs/iced/blob/15c0e397a81933ca88a9a338caaac2a4689354f9/test/src/ice.rs | test/src/ice.rs | //! A shareable, simple format of end-to-end tests.
use crate::Instruction;
use crate::core::Size;
use crate::emulator;
use crate::instruction;
/// An end-to-end test for iced applications.
///
/// Ice tests encode a certain configuration together with a sequence of instructions.
/// An ice test passes if all the inst... | rust | MIT | 15c0e397a81933ca88a9a338caaac2a4689354f9 | 2026-01-04T15:34:40.545819Z | false |
iced-rs/iced | https://github.com/iced-rs/iced/blob/15c0e397a81933ca88a9a338caaac2a4689354f9/runtime/src/lib.rs | runtime/src/lib.rs | //! A renderer-agnostic native GUI runtime.
//!
//! 
//!
//! `iced_runtime` takes [`iced_core`] and builds a native runtime on top of it.
//!
//! [`iced_core`]: https://github.com/iced-rs/iced/tree/maste... | rust | MIT | 15c0e397a81933ca88a9a338caaac2a4689354f9 | 2026-01-04T15:34:40.545819Z | false |
iced-rs/iced | https://github.com/iced-rs/iced/blob/15c0e397a81933ca88a9a338caaac2a4689354f9/runtime/src/widget.rs | runtime/src/widget.rs | //! Operate on widgets and query them at runtime.
pub mod operation;
#[cfg(feature = "selector")]
pub mod selector;
| rust | MIT | 15c0e397a81933ca88a9a338caaac2a4689354f9 | 2026-01-04T15:34:40.545819Z | false |
iced-rs/iced | https://github.com/iced-rs/iced/blob/15c0e397a81933ca88a9a338caaac2a4689354f9/runtime/src/image.rs | runtime/src/image.rs | //! Allocate images explicitly to control presentation.
use crate::core::image::Handle;
use crate::futures::futures::channel::oneshot;
use crate::task::{self, Task};
pub use crate::core::image::{Allocation, Error};
/// An image action.
#[derive(Debug)]
pub enum Action {
/// Allocates the given [`Handle`].
All... | rust | MIT | 15c0e397a81933ca88a9a338caaac2a4689354f9 | 2026-01-04T15:34:40.545819Z | false |
iced-rs/iced | https://github.com/iced-rs/iced/blob/15c0e397a81933ca88a9a338caaac2a4689354f9/runtime/src/clipboard.rs | runtime/src/clipboard.rs | //! Access the clipboard.
use crate::core::clipboard::Kind;
use crate::futures::futures::channel::oneshot;
use crate::task::{self, Task};
/// A clipboard action to be performed by some [`Task`].
///
/// [`Task`]: crate::Task
#[derive(Debug)]
pub enum Action {
/// Read the clipboard and produce `T` with the result.... | rust | MIT | 15c0e397a81933ca88a9a338caaac2a4689354f9 | 2026-01-04T15:34:40.545819Z | false |
iced-rs/iced | https://github.com/iced-rs/iced/blob/15c0e397a81933ca88a9a338caaac2a4689354f9/runtime/src/font.rs | runtime/src/font.rs | //! Load and use fonts.
use crate::Action;
use crate::task::{self, Task};
use std::borrow::Cow;
/// An error while loading a font.
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
pub enum Error {}
/// Load a font from its bytes.
pub fn load(bytes: impl Into<Cow<'static, [u8]>>) -> Task<Result<(), Error>> {
task::one... | rust | MIT | 15c0e397a81933ca88a9a338caaac2a4689354f9 | 2026-01-04T15:34:40.545819Z | false |
iced-rs/iced | https://github.com/iced-rs/iced/blob/15c0e397a81933ca88a9a338caaac2a4689354f9/runtime/src/user_interface.rs | runtime/src/user_interface.rs | //! Implement your own event loop to drive a user interface.
use crate::core::event::{self, Event};
use crate::core::layout;
use crate::core::mouse;
use crate::core::overlay;
use crate::core::renderer;
use crate::core::widget;
use crate::core::window;
use crate::core::{Clipboard, Element, InputMethod, Layout, Rectangle... | rust | MIT | 15c0e397a81933ca88a9a338caaac2a4689354f9 | 2026-01-04T15:34:40.545819Z | false |
iced-rs/iced | https://github.com/iced-rs/iced/blob/15c0e397a81933ca88a9a338caaac2a4689354f9/runtime/src/system.rs | runtime/src/system.rs | //! Access the native system.
use crate::core::theme;
use crate::futures::futures::channel::oneshot;
use crate::futures::subscription::{self, Subscription};
use crate::task::{self, Task};
/// An operation to be performed on the system.
#[derive(Debug)]
pub enum Action {
/// Send available system information.
G... | rust | MIT | 15c0e397a81933ca88a9a338caaac2a4689354f9 | 2026-01-04T15:34:40.545819Z | false |
iced-rs/iced | https://github.com/iced-rs/iced/blob/15c0e397a81933ca88a9a338caaac2a4689354f9/runtime/src/window.rs | runtime/src/window.rs | //! Build window-based GUI applications.
use crate::core::time::Instant;
use crate::core::window::{
Direction, Event, Icon, Id, Level, Mode, Screenshot, Settings, UserAttention,
};
use crate::core::{Point, Size};
use crate::futures::Subscription;
use crate::futures::event;
use crate::futures::futures::channel::ones... | rust | MIT | 15c0e397a81933ca88a9a338caaac2a4689354f9 | 2026-01-04T15:34:40.545819Z | false |
iced-rs/iced | https://github.com/iced-rs/iced/blob/15c0e397a81933ca88a9a338caaac2a4689354f9/runtime/src/task.rs | runtime/src/task.rs | //! Create runtime tasks.
use crate::Action;
use crate::core::widget;
use crate::futures::futures::channel::mpsc;
use crate::futures::futures::channel::oneshot;
use crate::futures::futures::future::{self, FutureExt};
use crate::futures::futures::stream::{self, Stream, StreamExt};
use crate::futures::{BoxStream, MaybeSe... | rust | MIT | 15c0e397a81933ca88a9a338caaac2a4689354f9 | 2026-01-04T15:34:40.545819Z | false |
iced-rs/iced | https://github.com/iced-rs/iced/blob/15c0e397a81933ca88a9a338caaac2a4689354f9/runtime/src/keyboard.rs | runtime/src/keyboard.rs | //! Track keyboard events.
pub use iced_core::keyboard::*;
| rust | MIT | 15c0e397a81933ca88a9a338caaac2a4689354f9 | 2026-01-04T15:34:40.545819Z | false |
iced-rs/iced | https://github.com/iced-rs/iced/blob/15c0e397a81933ca88a9a338caaac2a4689354f9/runtime/src/widget/selector.rs | runtime/src/widget/selector.rs | //! Find and query widgets in your applications.
pub use iced_selector::{Bounded, Candidate, Selector, Target, Text, id, is_focused};
use crate::Task;
use crate::task;
/// Finds a widget matching the given [`Selector`].
pub fn find<S>(selector: S) -> Task<Option<S::Output>>
where
S: Selector + Send + 'static,
... | rust | MIT | 15c0e397a81933ca88a9a338caaac2a4689354f9 | 2026-01-04T15:34:40.545819Z | false |
iced-rs/iced | https://github.com/iced-rs/iced/blob/15c0e397a81933ca88a9a338caaac2a4689354f9/runtime/src/widget/operation.rs | runtime/src/widget/operation.rs | //! Change internal widget state.
use crate::core::widget::Id;
use crate::core::widget::operation;
use crate::task;
use crate::{Action, Task};
pub use crate::core::widget::operation::scrollable::{AbsoluteOffset, RelativeOffset};
/// Snaps the scrollable with the given [`Id`] to the provided [`RelativeOffset`].
pub fn... | rust | MIT | 15c0e397a81933ca88a9a338caaac2a4689354f9 | 2026-01-04T15:34:40.545819Z | false |
iced-rs/iced | https://github.com/iced-rs/iced/blob/15c0e397a81933ca88a9a338caaac2a4689354f9/selector/src/lib.rs | selector/src/lib.rs | //! Select data from the widget tree.
use iced_core as core;
mod find;
mod target;
pub use find::{Find, FindAll};
pub use target::{Bounded, Candidate, Target, Text};
use crate::core::Point;
use crate::core::widget;
/// A type that traverses the widget tree to "select" data and produce some output.
pub trait Selecto... | rust | MIT | 15c0e397a81933ca88a9a338caaac2a4689354f9 | 2026-01-04T15:34:40.545819Z | false |
iced-rs/iced | https://github.com/iced-rs/iced/blob/15c0e397a81933ca88a9a338caaac2a4689354f9/selector/src/find.rs | selector/src/find.rs | use crate::Selector;
use crate::core::widget::operation::{Focusable, Outcome, Scrollable, TextInput};
use crate::core::widget::{Id, Operation};
use crate::core::{Rectangle, Vector};
use crate::target::Candidate;
use std::any::Any;
/// An [`Operation`] that runs the [`Selector`] and stops after
/// the first [`Output`... | rust | MIT | 15c0e397a81933ca88a9a338caaac2a4689354f9 | 2026-01-04T15:34:40.545819Z | false |
iced-rs/iced | https://github.com/iced-rs/iced/blob/15c0e397a81933ca88a9a338caaac2a4689354f9/selector/src/target.rs | selector/src/target.rs | use crate::core::widget::Id;
use crate::core::widget::operation::{Focusable, Scrollable, TextInput};
use crate::core::{Rectangle, Vector};
use std::any::Any;
/// A generic widget match produced during selection.
#[allow(missing_docs)]
#[derive(Debug, Clone, PartialEq)]
pub enum Target {
Container {
id: Op... | rust | MIT | 15c0e397a81933ca88a9a338caaac2a4689354f9 | 2026-01-04T15:34:40.545819Z | false |
iced-rs/iced | https://github.com/iced-rs/iced/blob/15c0e397a81933ca88a9a338caaac2a4689354f9/examples/slider/src/main.rs | examples/slider/src/main.rs | use iced::widget::{column, container, iced, slider, text, vertical_slider};
use iced::{Center, Element, Fill};
pub fn main() -> iced::Result {
iced::run(Slider::update, Slider::view)
}
#[derive(Debug, Clone)]
pub enum Message {
SliderChanged(u8),
}
pub struct Slider {
value: u8,
}
impl Slider {
fn n... | rust | MIT | 15c0e397a81933ca88a9a338caaac2a4689354f9 | 2026-01-04T15:34:40.545819Z | false |
iced-rs/iced | https://github.com/iced-rs/iced/blob/15c0e397a81933ca88a9a338caaac2a4689354f9/examples/combo_box/src/main.rs | examples/combo_box/src/main.rs | use iced::widget::{center, column, combo_box, scrollable, space, text};
use iced::{Center, Element, Fill};
pub fn main() -> iced::Result {
iced::run(Example::update, Example::view)
}
struct Example {
languages: combo_box::State<Language>,
selected_language: Option<Language>,
text: String,
}
#[derive(... | rust | MIT | 15c0e397a81933ca88a9a338caaac2a4689354f9 | 2026-01-04T15:34:40.545819Z | false |
iced-rs/iced | https://github.com/iced-rs/iced/blob/15c0e397a81933ca88a9a338caaac2a4689354f9/examples/qr_code/src/main.rs | examples/qr_code/src/main.rs | use iced::widget::{center, column, pick_list, qr_code, row, slider, text, text_input, toggler};
use iced::{Center, Element, Theme};
use std::ops::RangeInclusive;
pub fn main() -> iced::Result {
iced::application(QRGenerator::default, QRGenerator::update, QRGenerator::view)
.theme(QRGenerator::theme)
... | rust | MIT | 15c0e397a81933ca88a9a338caaac2a4689354f9 | 2026-01-04T15:34:40.545819Z | false |
iced-rs/iced | https://github.com/iced-rs/iced/blob/15c0e397a81933ca88a9a338caaac2a4689354f9/examples/delineate/src/main.rs | examples/delineate/src/main.rs | use iced::event::{self, Event};
use iced::mouse;
use iced::widget::{self, column, container, row, scrollable, selector, space, text};
use iced::window;
use iced::{Center, Color, Element, Fill, Font, Point, Rectangle, Subscription, Task, Theme};
pub fn main() -> iced::Result {
iced::application(Example::default, Ex... | rust | MIT | 15c0e397a81933ca88a9a338caaac2a4689354f9 | 2026-01-04T15:34:40.545819Z | false |
iced-rs/iced | https://github.com/iced-rs/iced/blob/15c0e397a81933ca88a9a338caaac2a4689354f9/examples/pick_list/src/main.rs | examples/pick_list/src/main.rs | use iced::widget::{column, pick_list, scrollable, space};
use iced::{Center, Element, Fill};
pub fn main() -> iced::Result {
iced::run(Example::update, Example::view)
}
#[derive(Default)]
struct Example {
selected_language: Option<Language>,
}
#[derive(Debug, Clone, Copy)]
enum Message {
LanguageSelected... | rust | MIT | 15c0e397a81933ca88a9a338caaac2a4689354f9 | 2026-01-04T15:34:40.545819Z | false |
iced-rs/iced | https://github.com/iced-rs/iced/blob/15c0e397a81933ca88a9a338caaac2a4689354f9/examples/multi_window/src/main.rs | examples/multi_window/src/main.rs | use iced::widget::{
button, center, center_x, column, container, operation, scrollable, space, text, text_input,
};
use iced::window;
use iced::{Center, Element, Fill, Function, Subscription, Task, Theme, Vector};
use std::collections::BTreeMap;
fn main() -> iced::Result {
iced::daemon(Example::new, Example::... | rust | MIT | 15c0e397a81933ca88a9a338caaac2a4689354f9 | 2026-01-04T15:34:40.545819Z | false |
iced-rs/iced | https://github.com/iced-rs/iced/blob/15c0e397a81933ca88a9a338caaac2a4689354f9/examples/integration/src/controls.rs | examples/integration/src/controls.rs | use iced_wgpu::Renderer;
use iced_widget::{bottom, column, row, slider, text, text_input};
use iced_winit::core::{Color, Element, Theme};
pub struct Controls {
background_color: Color,
input: String,
}
#[derive(Debug, Clone)]
pub enum Message {
BackgroundColorChanged(Color),
InputChanged(String),
}
i... | rust | MIT | 15c0e397a81933ca88a9a338caaac2a4689354f9 | 2026-01-04T15:34:40.545819Z | false |
iced-rs/iced | https://github.com/iced-rs/iced/blob/15c0e397a81933ca88a9a338caaac2a4689354f9/examples/integration/src/scene.rs | examples/integration/src/scene.rs | use iced_wgpu::wgpu;
use iced_winit::core::Color;
pub struct Scene {
pipeline: wgpu::RenderPipeline,
}
impl Scene {
pub fn new(device: &wgpu::Device, texture_format: wgpu::TextureFormat) -> Scene {
let pipeline = build_pipeline(device, texture_format);
Scene { pipeline }
}
pub fn cle... | rust | MIT | 15c0e397a81933ca88a9a338caaac2a4689354f9 | 2026-01-04T15:34:40.545819Z | false |
iced-rs/iced | https://github.com/iced-rs/iced/blob/15c0e397a81933ca88a9a338caaac2a4689354f9/examples/integration/src/main.rs | examples/integration/src/main.rs | mod controls;
mod scene;
use controls::Controls;
use scene::Scene;
use iced_wgpu::graphics::{Shell, Viewport};
use iced_wgpu::{Engine, Renderer, wgpu};
use iced_winit::Clipboard;
use iced_winit::conversion;
use iced_winit::core::mouse;
use iced_winit::core::renderer;
use iced_winit::core::time::Instant;
use iced_wini... | rust | MIT | 15c0e397a81933ca88a9a338caaac2a4689354f9 | 2026-01-04T15:34:40.545819Z | false |
iced-rs/iced | https://github.com/iced-rs/iced/blob/15c0e397a81933ca88a9a338caaac2a4689354f9/examples/loupe/src/main.rs | examples/loupe/src/main.rs | use iced::widget::{button, center, column, text};
use iced::{Center, Element};
use loupe::loupe;
pub fn main() -> iced::Result {
iced::run(Loupe::update, Loupe::view)
}
#[derive(Default)]
struct Loupe {
value: i64,
}
#[derive(Debug, Clone, Copy)]
enum Message {
Increment,
Decrement,
}
impl Loupe {
... | rust | MIT | 15c0e397a81933ca88a9a338caaac2a4689354f9 | 2026-01-04T15:34:40.545819Z | false |
iced-rs/iced | https://github.com/iced-rs/iced/blob/15c0e397a81933ca88a9a338caaac2a4689354f9/examples/tooltip/src/main.rs | examples/tooltip/src/main.rs | use iced::Element;
use iced::alignment;
use iced::time::seconds;
use iced::widget::tooltip::Position;
use iced::widget::{button, center, checkbox, column, container, tooltip};
pub fn main() -> iced::Result {
iced::run(Tooltip::update, Tooltip::view)
}
#[derive(Default)]
struct Tooltip {
position: Position,
... | rust | MIT | 15c0e397a81933ca88a9a338caaac2a4689354f9 | 2026-01-04T15:34:40.545819Z | false |
iced-rs/iced | https://github.com/iced-rs/iced/blob/15c0e397a81933ca88a9a338caaac2a4689354f9/examples/exit/src/main.rs | examples/exit/src/main.rs | use iced::widget::{button, center, column};
use iced::window;
use iced::{Center, Element, Task};
pub fn main() -> iced::Result {
iced::run(Exit::update, Exit::view)
}
#[derive(Default)]
struct Exit {
show_confirm: bool,
}
#[derive(Debug, Clone, Copy)]
enum Message {
Confirm,
Exit,
}
impl Exit {
... | rust | MIT | 15c0e397a81933ca88a9a338caaac2a4689354f9 | 2026-01-04T15:34:40.545819Z | false |
iced-rs/iced | https://github.com/iced-rs/iced/blob/15c0e397a81933ca88a9a338caaac2a4689354f9/examples/custom_widget/src/main.rs | examples/custom_widget/src/main.rs | //! This example showcases a simple native custom widget that draws a circle.
mod circle {
use iced::advanced::layout::{self, Layout};
use iced::advanced::renderer;
use iced::advanced::widget::{self, Widget};
use iced::border;
use iced::mouse;
use iced::{Color, Element, Length, Rectangle, Size};... | rust | MIT | 15c0e397a81933ca88a9a338caaac2a4689354f9 | 2026-01-04T15:34:40.545819Z | false |
iced-rs/iced | https://github.com/iced-rs/iced/blob/15c0e397a81933ca88a9a338caaac2a4689354f9/examples/tour/src/main.rs | examples/tour/src/main.rs | use iced::widget::{Button, Column, Container, Slider};
use iced::widget::{
button, center_x, center_y, checkbox, column, image, radio, rich_text, row, scrollable, slider,
space, span, text, text_input, toggler,
};
use iced::{Center, Color, Element, Fill, Font, Pixels, color};
pub fn main() -> iced::Result {
... | rust | MIT | 15c0e397a81933ca88a9a338caaac2a4689354f9 | 2026-01-04T15:34:40.545819Z | false |
iced-rs/iced | https://github.com/iced-rs/iced/blob/15c0e397a81933ca88a9a338caaac2a4689354f9/examples/gallery/src/civitai.rs | examples/gallery/src/civitai.rs | use serde::Deserialize;
use sipper::{Straw, sipper};
use tokio::task;
use std::fmt;
use std::io;
use std::sync::{Arc, LazyLock};
static CLIENT: LazyLock<reqwest::Client> = LazyLock::new(reqwest::Client::new);
#[derive(Debug, Clone, Deserialize)]
pub struct Image {
pub id: Id,
url: String,
hash: String,
}... | rust | MIT | 15c0e397a81933ca88a9a338caaac2a4689354f9 | 2026-01-04T15:34:40.545819Z | false |
iced-rs/iced | https://github.com/iced-rs/iced/blob/15c0e397a81933ca88a9a338caaac2a4689354f9/examples/gallery/src/main.rs | examples/gallery/src/main.rs | //! A simple gallery that displays the daily featured images of Civitai.
//!
//! Showcases lazy loading of images in the background, as well as
//! some smooth animations.
mod civitai;
use crate::civitai::{Bytes, Error, Id, Image, Rgba, Size};
use iced::animation;
use iced::border;
use iced::time::{Instant, milliseco... | rust | MIT | 15c0e397a81933ca88a9a338caaac2a4689354f9 | 2026-01-04T15:34:40.545819Z | false |
iced-rs/iced | https://github.com/iced-rs/iced/blob/15c0e397a81933ca88a9a338caaac2a4689354f9/examples/pane_grid/src/main.rs | examples/pane_grid/src/main.rs | use iced::keyboard;
use iced::widget::pane_grid::{self, PaneGrid};
use iced::widget::{button, center_y, column, container, responsive, row, scrollable, text};
use iced::{Center, Color, Element, Fill, Size, Subscription};
pub fn main() -> iced::Result {
iced::application(Example::default, Example::update, Example::... | rust | MIT | 15c0e397a81933ca88a9a338caaac2a4689354f9 | 2026-01-04T15:34:40.545819Z | false |
iced-rs/iced | https://github.com/iced-rs/iced/blob/15c0e397a81933ca88a9a338caaac2a4689354f9/examples/checkbox/src/main.rs | examples/checkbox/src/main.rs | use iced::widget::{center, checkbox, column, row, text};
use iced::{Element, Font};
const ICON_FONT: Font = Font::with_name("icons");
pub fn main() -> iced::Result {
iced::application(Example::default, Example::update, Example::view)
.font(include_bytes!("../fonts/icons.ttf").as_slice())
.run()
}
... | rust | MIT | 15c0e397a81933ca88a9a338caaac2a4689354f9 | 2026-01-04T15:34:40.545819Z | false |
iced-rs/iced | https://github.com/iced-rs/iced/blob/15c0e397a81933ca88a9a338caaac2a4689354f9/examples/multitouch/src/main.rs | examples/multitouch/src/main.rs | //! This example shows how to use touch events in `Canvas` to draw
//! a circle around each fingertip. This only works on touch-enabled
//! computers like Microsoft Surface.
use iced::mouse;
use iced::touch;
use iced::widget::canvas::stroke::{self, Stroke};
use iced::widget::canvas::{self, Canvas, Event, Geometry};
use... | rust | MIT | 15c0e397a81933ca88a9a338caaac2a4689354f9 | 2026-01-04T15:34:40.545819Z | false |
iced-rs/iced | https://github.com/iced-rs/iced/blob/15c0e397a81933ca88a9a338caaac2a4689354f9/examples/styling/src/main.rs | examples/styling/src/main.rs | use iced::keyboard;
use iced::widget::{
button, center_x, center_y, checkbox, column, container, pick_list, progress_bar, row, rule,
scrollable, slider, space, text, text_input, toggler,
};
use iced::{Center, Element, Fill, Shrink, Subscription, Theme};
pub fn main() -> iced::Result {
iced::application(Sty... | rust | MIT | 15c0e397a81933ca88a9a338caaac2a4689354f9 | 2026-01-04T15:34:40.545819Z | false |
iced-rs/iced | https://github.com/iced-rs/iced/blob/15c0e397a81933ca88a9a338caaac2a4689354f9/examples/lazy/src/main.rs | examples/lazy/src/main.rs | use iced::widget::{button, column, lazy, pick_list, row, scrollable, space, text, text_input};
use iced::{Element, Fill};
use std::collections::HashSet;
use std::hash::Hash;
pub fn main() -> iced::Result {
iced::run(App::update, App::view)
}
struct App {
version: u8,
items: HashSet<Item>,
input: Stri... | rust | MIT | 15c0e397a81933ca88a9a338caaac2a4689354f9 | 2026-01-04T15:34:40.545819Z | false |
iced-rs/iced | https://github.com/iced-rs/iced/blob/15c0e397a81933ca88a9a338caaac2a4689354f9/examples/geometry/src/main.rs | examples/geometry/src/main.rs | //! This example showcases a simple native custom widget that renders using
//! arbitrary low-level geometry.
mod rainbow {
use iced::advanced::graphics::color;
use iced::advanced::layout::{self, Layout};
use iced::advanced::renderer;
use iced::advanced::widget::{self, Widget};
use iced::advanced::{... | rust | MIT | 15c0e397a81933ca88a9a338caaac2a4689354f9 | 2026-01-04T15:34:40.545819Z | false |
iced-rs/iced | https://github.com/iced-rs/iced/blob/15c0e397a81933ca88a9a338caaac2a4689354f9/examples/custom_shader/src/scene.rs | examples/custom_shader/src/scene.rs | mod camera;
mod pipeline;
use camera::Camera;
use pipeline::Pipeline;
use crate::wgpu;
use pipeline::cube::{self, Cube};
use iced::mouse;
use iced::time::Duration;
use iced::widget::shader::{self, Viewport};
use iced::{Color, Rectangle};
use glam::Vec3;
use rand::Rng;
use std::cmp::Ordering;
use std::iter;
pub con... | rust | MIT | 15c0e397a81933ca88a9a338caaac2a4689354f9 | 2026-01-04T15:34:40.545819Z | false |
iced-rs/iced | https://github.com/iced-rs/iced/blob/15c0e397a81933ca88a9a338caaac2a4689354f9/examples/custom_shader/src/main.rs | examples/custom_shader/src/main.rs | mod scene;
use scene::Scene;
use iced::time::Instant;
use iced::wgpu;
use iced::widget::{center, checkbox, column, row, shader, slider, text};
use iced::window;
use iced::{Center, Color, Element, Fill, Subscription};
fn main() -> iced::Result {
iced::application(IcedCubes::default, IcedCubes::update, IcedCubes::... | rust | MIT | 15c0e397a81933ca88a9a338caaac2a4689354f9 | 2026-01-04T15:34:40.545819Z | false |
iced-rs/iced | https://github.com/iced-rs/iced/blob/15c0e397a81933ca88a9a338caaac2a4689354f9/examples/custom_shader/src/scene/pipeline.rs | examples/custom_shader/src/scene/pipeline.rs | pub mod cube;
mod buffer;
mod uniforms;
mod vertex;
pub use uniforms::Uniforms;
use buffer::Buffer;
use vertex::Vertex;
use crate::wgpu;
use crate::wgpu::util::DeviceExt;
use iced::{Rectangle, Size};
const SKY_TEXTURE_SIZE: u32 = 128;
pub struct Pipeline {
pipeline: wgpu::RenderPipeline,
vertices: wgpu::... | rust | MIT | 15c0e397a81933ca88a9a338caaac2a4689354f9 | 2026-01-04T15:34:40.545819Z | false |
iced-rs/iced | https://github.com/iced-rs/iced/blob/15c0e397a81933ca88a9a338caaac2a4689354f9/examples/custom_shader/src/scene/camera.rs | examples/custom_shader/src/scene/camera.rs | use glam::{mat4, vec3, vec4};
use iced::Rectangle;
#[derive(Copy, Clone)]
pub struct Camera {
eye: glam::Vec3,
target: glam::Vec3,
up: glam::Vec3,
fov_y: f32,
near: f32,
far: f32,
}
impl Default for Camera {
fn default() -> Self {
Self {
eye: vec3(0.0, 2.0, 3.0),
... | rust | MIT | 15c0e397a81933ca88a9a338caaac2a4689354f9 | 2026-01-04T15:34:40.545819Z | false |
iced-rs/iced | https://github.com/iced-rs/iced/blob/15c0e397a81933ca88a9a338caaac2a4689354f9/examples/custom_shader/src/scene/pipeline/uniforms.rs | examples/custom_shader/src/scene/pipeline/uniforms.rs | use crate::scene::Camera;
use iced::{Color, Rectangle};
#[derive(Copy, Clone, Debug, bytemuck::Pod, bytemuck::Zeroable)]
#[repr(C)]
pub struct Uniforms {
camera_proj: glam::Mat4,
camera_pos: glam::Vec4,
light_color: glam::Vec4,
}
impl Uniforms {
pub fn new(camera: &Camera, bounds: Rectangle, light_co... | rust | MIT | 15c0e397a81933ca88a9a338caaac2a4689354f9 | 2026-01-04T15:34:40.545819Z | false |
iced-rs/iced | https://github.com/iced-rs/iced/blob/15c0e397a81933ca88a9a338caaac2a4689354f9/examples/custom_shader/src/scene/pipeline/cube.rs | examples/custom_shader/src/scene/pipeline/cube.rs | use crate::scene::pipeline::Vertex;
use crate::wgpu;
use glam::{Vec3, vec2, vec3};
use rand::{Rng, thread_rng};
/// A single instance of a cube.
#[derive(Debug, Clone)]
pub struct Cube {
pub rotation: glam::Quat,
pub position: Vec3,
pub size: f32,
rotation_dir: f32,
rotation_axis: glam::Vec3,
}
i... | rust | MIT | 15c0e397a81933ca88a9a338caaac2a4689354f9 | 2026-01-04T15:34:40.545819Z | false |
iced-rs/iced | https://github.com/iced-rs/iced/blob/15c0e397a81933ca88a9a338caaac2a4689354f9/examples/custom_shader/src/scene/pipeline/buffer.rs | examples/custom_shader/src/scene/pipeline/buffer.rs | use crate::wgpu;
// A custom buffer container for dynamic resizing.
pub struct Buffer {
pub raw: wgpu::Buffer,
label: &'static str,
size: u64,
usage: wgpu::BufferUsages,
}
impl Buffer {
pub fn new(
device: &wgpu::Device,
label: &'static str,
size: u64,
usage: wgpu::... | rust | MIT | 15c0e397a81933ca88a9a338caaac2a4689354f9 | 2026-01-04T15:34:40.545819Z | false |
iced-rs/iced | https://github.com/iced-rs/iced/blob/15c0e397a81933ca88a9a338caaac2a4689354f9/examples/custom_shader/src/scene/pipeline/vertex.rs | examples/custom_shader/src/scene/pipeline/vertex.rs | use crate::wgpu;
#[derive(Debug, Copy, Clone, bytemuck::Pod, bytemuck::Zeroable)]
#[repr(C)]
pub struct Vertex {
pub pos: glam::Vec3,
pub normal: glam::Vec3,
pub tangent: glam::Vec3,
pub uv: glam::Vec2,
}
impl Vertex {
const ATTRIBS: [wgpu::VertexAttribute; 4] = wgpu::vertex_attr_array![
/... | rust | MIT | 15c0e397a81933ca88a9a338caaac2a4689354f9 | 2026-01-04T15:34:40.545819Z | false |
iced-rs/iced | https://github.com/iced-rs/iced/blob/15c0e397a81933ca88a9a338caaac2a4689354f9/examples/editor/src/main.rs | examples/editor/src/main.rs | use iced::highlighter;
use iced::keyboard;
use iced::widget::{
button, center_x, column, container, operation, pick_list, row, space, text, text_editor,
toggler, tooltip,
};
use iced::window;
use iced::{Center, Element, Fill, Font, Task, Theme, Window};
use std::ffi;
use std::io;
use std::path::{Path, PathBuf}... | rust | MIT | 15c0e397a81933ca88a9a338caaac2a4689354f9 | 2026-01-04T15:34:40.545819Z | false |
iced-rs/iced | https://github.com/iced-rs/iced/blob/15c0e397a81933ca88a9a338caaac2a4689354f9/examples/scrollable/src/main.rs | examples/scrollable/src/main.rs | use iced::widget::{
button, column, container, operation, progress_bar, radio, row, scrollable, slider, space, text,
};
use iced::{Border, Center, Color, Element, Fill, Task, Theme};
pub fn main() -> iced::Result {
iced::application(
ScrollableDemo::default,
ScrollableDemo::update,
Scro... | rust | MIT | 15c0e397a81933ca88a9a338caaac2a4689354f9 | 2026-01-04T15:34:40.545819Z | false |
iced-rs/iced | https://github.com/iced-rs/iced/blob/15c0e397a81933ca88a9a338caaac2a4689354f9/examples/solar_system/src/main.rs | examples/solar_system/src/main.rs | //! An animated solar system.
//!
//! This example showcases how to use a `Canvas` widget with transforms to draw
//! using different coordinate systems.
//!
//! Inspired by the example found in the MDN docs[1].
//!
//! [1]: https://developer.mozilla.org/en-US/docs/Web/API/Canvas_API/Tutorial/Basic_animations#An_animat... | rust | MIT | 15c0e397a81933ca88a9a338caaac2a4689354f9 | 2026-01-04T15:34:40.545819Z | false |
iced-rs/iced | https://github.com/iced-rs/iced/blob/15c0e397a81933ca88a9a338caaac2a4689354f9/examples/sandpiles/src/main.rs | examples/sandpiles/src/main.rs | use iced::mouse;
use iced::widget::{canvas, column, container, row, slider, text};
use iced::window;
use iced::{
Center, Element, Event, Fill, Font, Point, Rectangle, Renderer, Size, Subscription, Theme,
Vector,
};
use std::collections::{HashMap, HashSet};
pub fn main() -> iced::Result {
iced::application... | rust | MIT | 15c0e397a81933ca88a9a338caaac2a4689354f9 | 2026-01-04T15:34:40.545819Z | false |
iced-rs/iced | https://github.com/iced-rs/iced/blob/15c0e397a81933ca88a9a338caaac2a4689354f9/examples/custom_quad/src/main.rs | examples/custom_quad/src/main.rs | //! This example showcases a drawing a quad.
use iced::border;
use iced::widget::{center, column, slider, text, toggler};
use iced::{Center, Color, Element, Shadow, Vector};
pub fn main() -> iced::Result {
iced::run(Example::update, Example::view)
}
struct Example {
radius: border::Radius,
border_width: f... | rust | MIT | 15c0e397a81933ca88a9a338caaac2a4689354f9 | 2026-01-04T15:34:40.545819Z | false |
iced-rs/iced | https://github.com/iced-rs/iced/blob/15c0e397a81933ca88a9a338caaac2a4689354f9/examples/events/src/main.rs | examples/events/src/main.rs | use iced::event::{self, Event};
use iced::widget::{Column, button, center, checkbox, text};
use iced::window;
use iced::{Center, Element, Fill, Subscription, Task};
pub fn main() -> iced::Result {
iced::application(Events::default, Events::update, Events::view)
.subscription(Events::subscription)
.... | rust | MIT | 15c0e397a81933ca88a9a338caaac2a4689354f9 | 2026-01-04T15:34:40.545819Z | false |
iced-rs/iced | https://github.com/iced-rs/iced/blob/15c0e397a81933ca88a9a338caaac2a4689354f9/examples/layout/src/main.rs | examples/layout/src/main.rs | use iced::border;
use iced::keyboard;
use iced::mouse;
use iced::widget::{
button, canvas, center, center_y, checkbox, column, container, pick_list, pin, responsive, row,
rule, scrollable, space, stack, text,
};
use iced::{
Center, Element, Fill, Font, Length, Point, Rectangle, Renderer, Shrink, Subscriptio... | rust | MIT | 15c0e397a81933ca88a9a338caaac2a4689354f9 | 2026-01-04T15:34:40.545819Z | false |
iced-rs/iced | https://github.com/iced-rs/iced/blob/15c0e397a81933ca88a9a338caaac2a4689354f9/examples/system_information/src/main.rs | examples/system_information/src/main.rs | use iced::system;
use iced::widget::{button, center, column, text};
use iced::{Element, Task};
pub fn main() -> iced::Result {
iced::application(Example::new, Example::update, Example::view).run()
}
#[derive(Default)]
#[allow(clippy::large_enum_variant)]
enum Example {
#[default]
Loading,
Loaded {
... | rust | MIT | 15c0e397a81933ca88a9a338caaac2a4689354f9 | 2026-01-04T15:34:40.545819Z | false |
iced-rs/iced | https://github.com/iced-rs/iced/blob/15c0e397a81933ca88a9a338caaac2a4689354f9/examples/counter/src/main.rs | examples/counter/src/main.rs | use iced::Center;
use iced::widget::{Column, button, column, text};
pub fn main() -> iced::Result {
iced::run(Counter::update, Counter::view)
}
#[derive(Default)]
struct Counter {
value: i64,
}
#[derive(Debug, Clone, Copy)]
enum Message {
Increment,
Decrement,
}
impl Counter {
fn update(&mut sel... | rust | MIT | 15c0e397a81933ca88a9a338caaac2a4689354f9 | 2026-01-04T15:34:40.545819Z | false |
iced-rs/iced | https://github.com/iced-rs/iced/blob/15c0e397a81933ca88a9a338caaac2a4689354f9/examples/pokedex/src/main.rs | examples/pokedex/src/main.rs | use iced::futures;
use iced::widget::{self, center, column, image, row, text};
use iced::{Center, Element, Fill, Right, Task};
pub fn main() -> iced::Result {
iced::application(Pokedex::new, Pokedex::update, Pokedex::view)
.title(Pokedex::title)
.run()
}
#[derive(Debug)]
enum Pokedex {
Loading... | rust | MIT | 15c0e397a81933ca88a9a338caaac2a4689354f9 | 2026-01-04T15:34:40.545819Z | false |
iced-rs/iced | https://github.com/iced-rs/iced/blob/15c0e397a81933ca88a9a338caaac2a4689354f9/examples/ferris/src/main.rs | examples/ferris/src/main.rs | use iced::time::Instant;
use iced::widget::{center, checkbox, column, container, image, pick_list, row, slider, text};
use iced::window;
use iced::{
Bottom, Center, Color, ContentFit, Degrees, Element, Fill, Radians, Rotation, Subscription,
Theme,
};
pub fn main() -> iced::Result {
iced::application(Image:... | rust | MIT | 15c0e397a81933ca88a9a338caaac2a4689354f9 | 2026-01-04T15:34:40.545819Z | false |
iced-rs/iced | https://github.com/iced-rs/iced/blob/15c0e397a81933ca88a9a338caaac2a4689354f9/examples/color_palette/src/main.rs | examples/color_palette/src/main.rs | use iced::alignment;
use iced::mouse;
use iced::widget::canvas::{self, Canvas, Frame, Geometry, Path};
use iced::widget::{Slider, column, row, text};
use iced::{Center, Color, Element, Fill, Font, Pixels, Point, Rectangle, Renderer, Size, Vector};
use palette::{Darken, Hsl, Lighten, ShiftHue, convert::FromColor, rgb::R... | rust | MIT | 15c0e397a81933ca88a9a338caaac2a4689354f9 | 2026-01-04T15:34:40.545819Z | false |
iced-rs/iced | https://github.com/iced-rs/iced/blob/15c0e397a81933ca88a9a338caaac2a4689354f9/examples/toast/src/main.rs | examples/toast/src/main.rs | use iced::event::{self, Event};
use iced::keyboard;
use iced::keyboard::key;
use iced::widget::{button, center, column, operation, pick_list, row, slider, text, text_input};
use iced::{Center, Element, Fill, Subscription, Task};
use toast::{Status, Toast};
pub fn main() -> iced::Result {
iced::application(App::de... | rust | MIT | 15c0e397a81933ca88a9a338caaac2a4689354f9 | 2026-01-04T15:34:40.545819Z | false |
iced-rs/iced | https://github.com/iced-rs/iced/blob/15c0e397a81933ca88a9a338caaac2a4689354f9/examples/vectorial_text/src/main.rs | examples/vectorial_text/src/main.rs | use iced::alignment;
use iced::mouse;
use iced::widget::{canvas, checkbox, column, row, slider, space, text};
use iced::{Center, Element, Fill, Point, Rectangle, Renderer, Theme, Vector};
pub fn main() -> iced::Result {
iced::application(
VectorialText::default,
VectorialText::update,
Vecto... | rust | MIT | 15c0e397a81933ca88a9a338caaac2a4689354f9 | 2026-01-04T15:34:40.545819Z | false |
iced-rs/iced | https://github.com/iced-rs/iced/blob/15c0e397a81933ca88a9a338caaac2a4689354f9/examples/url_handler/src/main.rs | examples/url_handler/src/main.rs | use iced::event;
use iced::widget::{center, text};
use iced::{Element, Subscription};
pub fn main() -> iced::Result {
iced::application(App::default, App::update, App::view)
.subscription(App::subscription)
.run()
}
#[derive(Debug, Default)]
struct App {
url: Option<String>,
}
#[derive(Debug,... | rust | MIT | 15c0e397a81933ca88a9a338caaac2a4689354f9 | 2026-01-04T15:34:40.545819Z | false |
iced-rs/iced | https://github.com/iced-rs/iced/blob/15c0e397a81933ca88a9a338caaac2a4689354f9/examples/modal/src/main.rs | examples/modal/src/main.rs | use iced::event::{self, Event};
use iced::keyboard;
use iced::keyboard::key;
use iced::widget::{
button, center, column, container, mouse_area, opaque, operation, pick_list, row, space, stack,
text, text_input,
};
use iced::{Bottom, Color, Element, Fill, Subscription, Task};
use std::fmt;
pub fn main() -> ice... | rust | MIT | 15c0e397a81933ca88a9a338caaac2a4689354f9 | 2026-01-04T15:34:40.545819Z | false |
iced-rs/iced | https://github.com/iced-rs/iced/blob/15c0e397a81933ca88a9a338caaac2a4689354f9/examples/sierpinski_triangle/src/main.rs | examples/sierpinski_triangle/src/main.rs | use iced::mouse;
use iced::widget::canvas::{self, Canvas, Event, Geometry};
use iced::widget::{column, row, slider, text};
use iced::{Center, Color, Element, Fill, Point, Rectangle, Renderer, Size, Theme};
use rand::Rng;
use std::fmt::Debug;
fn main() -> iced::Result {
iced::application(
SierpinskiEmulato... | rust | MIT | 15c0e397a81933ca88a9a338caaac2a4689354f9 | 2026-01-04T15:34:40.545819Z | false |
iced-rs/iced | https://github.com/iced-rs/iced/blob/15c0e397a81933ca88a9a338caaac2a4689354f9/examples/download_progress/src/download.rs | examples/download_progress/src/download.rs | use iced::futures::StreamExt;
use iced::task::{Straw, sipper};
use std::sync::Arc;
pub fn download(url: impl AsRef<str>) -> impl Straw<(), Progress, Error> {
sipper(async move |mut progress| {
let response = reqwest::get(url.as_ref()).await?;
let total = response.content_length().ok_or(Error::NoCo... | rust | MIT | 15c0e397a81933ca88a9a338caaac2a4689354f9 | 2026-01-04T15:34:40.545819Z | false |
iced-rs/iced | https://github.com/iced-rs/iced/blob/15c0e397a81933ca88a9a338caaac2a4689354f9/examples/download_progress/src/main.rs | examples/download_progress/src/main.rs | mod download;
use download::download;
use iced::task;
use iced::widget::{Column, button, center, column, progress_bar, text};
use iced::{Center, Element, Function, Right, Task};
pub fn main() -> iced::Result {
iced::application(Example::default, Example::update, Example::view).run()
}
#[derive(Debug)]
struct Ex... | rust | MIT | 15c0e397a81933ca88a9a338caaac2a4689354f9 | 2026-01-04T15:34:40.545819Z | false |
iced-rs/iced | https://github.com/iced-rs/iced/blob/15c0e397a81933ca88a9a338caaac2a4689354f9/examples/arc/src/main.rs | examples/arc/src/main.rs | use std::{f32::consts::PI, time::Instant};
use iced::mouse;
use iced::widget::canvas::{self, Cache, Canvas, Geometry, Path, Stroke, stroke};
use iced::window;
use iced::{Element, Fill, Point, Rectangle, Renderer, Subscription, Theme};
pub fn main() -> iced::Result {
iced::application(Arc::new, Arc::update, Arc::v... | rust | MIT | 15c0e397a81933ca88a9a338caaac2a4689354f9 | 2026-01-04T15:34:40.545819Z | false |
iced-rs/iced | https://github.com/iced-rs/iced/blob/15c0e397a81933ca88a9a338caaac2a4689354f9/examples/stopwatch/src/main.rs | examples/stopwatch/src/main.rs | use iced::keyboard;
use iced::time::{self, Duration, Instant, milliseconds};
use iced::widget::{button, center, column, row, text};
use iced::{Center, Element, Subscription};
pub fn main() -> iced::Result {
iced::application(Stopwatch::default, Stopwatch::update, Stopwatch::view)
.subscription(Stopwatch::s... | rust | MIT | 15c0e397a81933ca88a9a338caaac2a4689354f9 | 2026-01-04T15:34:40.545819Z | false |
iced-rs/iced | https://github.com/iced-rs/iced/blob/15c0e397a81933ca88a9a338caaac2a4689354f9/examples/text/src/main.rs | examples/text/src/main.rs | use iced::event;
use iced::widget::{center, column, pick_list, right, stack, text};
use iced::window;
use iced::{Element, Event, Subscription, Task};
pub fn main() -> iced::Result {
iced::application(Text::new, Text::update, Text::view)
.subscription(Text::subscription)
.run()
}
struct Text {
... | rust | MIT | 15c0e397a81933ca88a9a338caaac2a4689354f9 | 2026-01-04T15:34:40.545819Z | false |
iced-rs/iced | https://github.com/iced-rs/iced/blob/15c0e397a81933ca88a9a338caaac2a4689354f9/examples/changelog/src/icon.rs | examples/changelog/src/icon.rs | use iced::widget::{text, Text};
use iced::Font;
pub const FONT_BYTES: &[u8] = include_bytes!("../fonts/changelog-icons.ttf");
const FONT: Font = Font::with_name("changelog-icons");
pub fn copy() -> Text<'static> {
text('\u{e800}').font(FONT)
}
| rust | MIT | 15c0e397a81933ca88a9a338caaac2a4689354f9 | 2026-01-04T15:34:40.545819Z | false |
iced-rs/iced | https://github.com/iced-rs/iced/blob/15c0e397a81933ca88a9a338caaac2a4689354f9/examples/changelog/src/changelog.rs | examples/changelog/src/changelog.rs | use jiff::Timestamp;
use serde::Deserialize;
use tokio::fs;
use tokio::process;
use std::collections::{BTreeMap, BTreeSet};
use std::env;
use std::fmt;
use std::io;
use std::sync::Arc;
#[derive(Debug, Clone)]
pub struct Changelog {
ids: Vec<u64>,
added: Vec<String>,
changed: Vec<String>,
fixed: Vec<St... | rust | MIT | 15c0e397a81933ca88a9a338caaac2a4689354f9 | 2026-01-04T15:34:40.545819Z | false |
iced-rs/iced | https://github.com/iced-rs/iced/blob/15c0e397a81933ca88a9a338caaac2a4689354f9/examples/changelog/src/main.rs | examples/changelog/src/main.rs | mod changelog;
use crate::changelog::Changelog;
use iced::font;
use iced::widget::{
button, center, column, container, markdown, pick_list, progress_bar, rich_text, row,
scrollable, span, stack, text, text_input,
};
use iced::{Center, Element, Fill, FillPortion, Font, Task, Theme};
pub fn main() -> iced::Res... | rust | MIT | 15c0e397a81933ca88a9a338caaac2a4689354f9 | 2026-01-04T15:34:40.545819Z | false |
iced-rs/iced | https://github.com/iced-rs/iced/blob/15c0e397a81933ca88a9a338caaac2a4689354f9/examples/bezier_tool/src/main.rs | examples/bezier_tool/src/main.rs | //! This example showcases an interactive `Canvas` for drawing Bézier curves.
use iced::widget::{button, container, hover, right, space};
use iced::{Element, Theme};
pub fn main() -> iced::Result {
iced::application(Example::default, Example::update, Example::view)
.theme(Theme::CatppuccinMocha)
.r... | rust | MIT | 15c0e397a81933ca88a9a338caaac2a4689354f9 | 2026-01-04T15:34:40.545819Z | false |
iced-rs/iced | https://github.com/iced-rs/iced/blob/15c0e397a81933ca88a9a338caaac2a4689354f9/examples/loading_spinners/src/easing.rs | examples/loading_spinners/src/easing.rs | use iced::Point;
use lyon_algorithms::measure::PathMeasurements;
use lyon_algorithms::path::{Path, builder::NoAttributes, path::BuilderImpl};
use std::sync::LazyLock;
pub static EMPHASIZED: LazyLock<Easing> = LazyLock::new(|| {
Easing::builder()
.cubic_bezier_to([0.05, 0.0], [0.133333, 0.06], [0.166666, ... | rust | MIT | 15c0e397a81933ca88a9a338caaac2a4689354f9 | 2026-01-04T15:34:40.545819Z | false |
iced-rs/iced | https://github.com/iced-rs/iced/blob/15c0e397a81933ca88a9a338caaac2a4689354f9/examples/loading_spinners/src/circular.rs | examples/loading_spinners/src/circular.rs | //! Show a circular progress indicator.
use iced::advanced::layout;
use iced::advanced::renderer;
use iced::advanced::widget::tree::{self, Tree};
use iced::advanced::{self, Clipboard, Layout, Shell, Widget};
use iced::mouse;
use iced::time::Instant;
use iced::widget::canvas;
use iced::window;
use iced::{Background, Col... | rust | MIT | 15c0e397a81933ca88a9a338caaac2a4689354f9 | 2026-01-04T15:34:40.545819Z | false |
iced-rs/iced | https://github.com/iced-rs/iced/blob/15c0e397a81933ca88a9a338caaac2a4689354f9/examples/loading_spinners/src/linear.rs | examples/loading_spinners/src/linear.rs | //! Show a linear progress indicator.
use iced::advanced::layout;
use iced::advanced::renderer::{self, Quad};
use iced::advanced::widget::tree::{self, Tree};
use iced::advanced::{self, Clipboard, Layout, Shell, Widget};
use iced::mouse;
use iced::time::Instant;
use iced::window;
use iced::{Background, Color, Element, E... | rust | MIT | 15c0e397a81933ca88a9a338caaac2a4689354f9 | 2026-01-04T15:34:40.545819Z | false |
iced-rs/iced | https://github.com/iced-rs/iced/blob/15c0e397a81933ca88a9a338caaac2a4689354f9/examples/loading_spinners/src/main.rs | examples/loading_spinners/src/main.rs | use iced::widget::{center, column, row, slider, text};
use iced::{Center, Element};
use std::time::Duration;
mod circular;
mod easing;
mod linear;
use circular::Circular;
use linear::Linear;
pub fn main() -> iced::Result {
iced::application(
LoadingSpinners::default,
LoadingSpinners::update,
... | rust | MIT | 15c0e397a81933ca88a9a338caaac2a4689354f9 | 2026-01-04T15:34:40.545819Z | false |
iced-rs/iced | https://github.com/iced-rs/iced/blob/15c0e397a81933ca88a9a338caaac2a4689354f9/examples/game_of_life/src/preset.rs | examples/game_of_life/src/preset.rs | #[derive(Debug, Clone, Copy, Default, PartialEq, Eq)]
pub enum Preset {
Custom,
#[default]
Xkcd,
Glider,
SmallExploder,
Exploder,
TenCellRow,
LightweightSpaceship,
Tumbler,
GliderGun,
Acorn,
}
pub static ALL: &[Preset] = &[
Preset::Custom,
Preset::Xkcd,
Preset::G... | rust | MIT | 15c0e397a81933ca88a9a338caaac2a4689354f9 | 2026-01-04T15:34:40.545819Z | false |
iced-rs/iced | https://github.com/iced-rs/iced/blob/15c0e397a81933ca88a9a338caaac2a4689354f9/examples/game_of_life/src/main.rs | examples/game_of_life/src/main.rs | //! This example showcases an interactive version of the Game of Life, invented
//! by John Conway. It leverages a `Canvas` together with other widgets.
mod preset;
use grid::Grid;
use preset::Preset;
use iced::time::{self, milliseconds};
use iced::widget::{button, checkbox, column, container, pick_list, row, slider,... | rust | MIT | 15c0e397a81933ca88a9a338caaac2a4689354f9 | 2026-01-04T15:34:40.545819Z | false |
iced-rs/iced | https://github.com/iced-rs/iced/blob/15c0e397a81933ca88a9a338caaac2a4689354f9/examples/screenshot/src/main.rs | examples/screenshot/src/main.rs | use iced::keyboard;
use iced::widget::{button, center_y, column, container, image, row, text, text_input};
use iced::window;
use iced::window::screenshot::{self, Screenshot};
use iced::{Center, ContentFit, Element, Fill, FillPortion, Rectangle, Subscription, Task};
use ::image as img;
use ::image::ColorType;
fn main(... | rust | MIT | 15c0e397a81933ca88a9a338caaac2a4689354f9 | 2026-01-04T15:34:40.545819Z | false |
iced-rs/iced | https://github.com/iced-rs/iced/blob/15c0e397a81933ca88a9a338caaac2a4689354f9/examples/the_matrix/src/main.rs | examples/the_matrix/src/main.rs | use iced::mouse;
use iced::time::{self, milliseconds};
use iced::widget::canvas;
use iced::{Color, Element, Fill, Font, Point, Rectangle, Renderer, Subscription, Theme};
use std::cell::RefCell;
pub fn main() -> iced::Result {
tracing_subscriber::fmt::init();
iced::application(TheMatrix::default, TheMatrix::u... | rust | MIT | 15c0e397a81933ca88a9a338caaac2a4689354f9 | 2026-01-04T15:34:40.545819Z | false |
iced-rs/iced | https://github.com/iced-rs/iced/blob/15c0e397a81933ca88a9a338caaac2a4689354f9/examples/clock/src/main.rs | examples/clock/src/main.rs | use iced::alignment;
use iced::mouse;
use iced::time::{self, milliseconds};
use iced::widget::canvas::{Cache, Geometry, LineCap, Path, Stroke, stroke};
use iced::widget::{canvas, container, text};
use iced::{
Degrees, Element, Fill, Font, Point, Radians, Rectangle, Renderer, Size, Subscription, Theme,
Vector,
}... | rust | MIT | 15c0e397a81933ca88a9a338caaac2a4689354f9 | 2026-01-04T15:34:40.545819Z | false |
iced-rs/iced | https://github.com/iced-rs/iced/blob/15c0e397a81933ca88a9a338caaac2a4689354f9/examples/table/src/main.rs | examples/table/src/main.rs | use iced::font;
use iced::time::{Duration, hours, minutes};
use iced::widget::{
center_x, center_y, column, container, row, scrollable, slider, table, text, tooltip,
};
use iced::{Center, Element, Fill, Font, Right, Theme};
pub fn main() -> iced::Result {
iced::application(Table::new, Table::update, Table::vie... | rust | MIT | 15c0e397a81933ca88a9a338caaac2a4689354f9 | 2026-01-04T15:34:40.545819Z | false |
iced-rs/iced | https://github.com/iced-rs/iced/blob/15c0e397a81933ca88a9a338caaac2a4689354f9/examples/progress_bar/src/main.rs | examples/progress_bar/src/main.rs | use iced::Element;
use iced::widget::{
center, center_x, checkbox, column, progress_bar, row, slider, vertical_slider,
};
pub fn main() -> iced::Result {
iced::run(Progress::update, Progress::view)
}
#[derive(Default)]
struct Progress {
value: f32,
is_vertical: bool,
}
#[derive(Debug, Clone, Copy)]
e... | rust | MIT | 15c0e397a81933ca88a9a338caaac2a4689354f9 | 2026-01-04T15:34:40.545819Z | false |
iced-rs/iced | https://github.com/iced-rs/iced/blob/15c0e397a81933ca88a9a338caaac2a4689354f9/examples/svg/src/main.rs | examples/svg/src/main.rs | use iced::widget::{center, center_x, checkbox, column, svg};
use iced::{Element, Fill, color};
pub fn main() -> iced::Result {
iced::run(Tiger::update, Tiger::view)
}
#[derive(Debug, Default)]
struct Tiger {
apply_color_filter: bool,
}
#[derive(Debug, Clone, Copy)]
pub enum Message {
ToggleColorFilter(bo... | rust | MIT | 15c0e397a81933ca88a9a338caaac2a4689354f9 | 2026-01-04T15:34:40.545819Z | false |
iced-rs/iced | https://github.com/iced-rs/iced/blob/15c0e397a81933ca88a9a338caaac2a4689354f9/examples/todos/src/main.rs | examples/todos/src/main.rs | use iced::keyboard;
use iced::widget::{
self, Text, button, center, center_x, checkbox, column, keyed_column, operation, row,
scrollable, text, text_input,
};
use iced::window;
use iced::{
Application, Center, Element, Fill, Font, Function, Preset, Program, Subscription,
Task as Command, Theme,
};
use ... | rust | MIT | 15c0e397a81933ca88a9a338caaac2a4689354f9 | 2026-01-04T15:34:40.545819Z | false |
iced-rs/iced | https://github.com/iced-rs/iced/blob/15c0e397a81933ca88a9a338caaac2a4689354f9/examples/gradient/src/main.rs | examples/gradient/src/main.rs | use iced::gradient;
use iced::theme;
use iced::widget::{checkbox, column, container, row, slider, space, text};
use iced::{Center, Color, Element, Fill, Radians, Theme, color};
pub fn main() -> iced::Result {
tracing_subscriber::fmt::init();
iced::application(Gradient::default, Gradient::update, Gradient::vie... | rust | MIT | 15c0e397a81933ca88a9a338caaac2a4689354f9 | 2026-01-04T15:34:40.545819Z | false |
iced-rs/iced | https://github.com/iced-rs/iced/blob/15c0e397a81933ca88a9a338caaac2a4689354f9/examples/markdown/build.rs | examples/markdown/build.rs | pub fn main() {
// println!("cargo::rerun-if-changed=fonts/markdown-icons.toml");
// iced_fontello::build("fonts/markdown-icons.toml")
// .expect("Build icons font");
}
| rust | MIT | 15c0e397a81933ca88a9a338caaac2a4689354f9 | 2026-01-04T15:34:40.545819Z | false |
iced-rs/iced | https://github.com/iced-rs/iced/blob/15c0e397a81933ca88a9a338caaac2a4689354f9/examples/markdown/src/icon.rs | examples/markdown/src/icon.rs | // Generated automatically by iced_fontello at build time.
// Do not edit manually. Source: ../fonts/markdown-icons.toml
// dcd2f0c969d603e2ee9237a4b70fa86b1a6e84d86f4689046d8fdd10440b06b9
use iced::Font;
use iced::widget::{Text, text};
pub const FONT: &[u8] = include_bytes!("../fonts/markdown-icons.ttf");
pub fn cop... | rust | MIT | 15c0e397a81933ca88a9a338caaac2a4689354f9 | 2026-01-04T15:34:40.545819Z | false |
iced-rs/iced | https://github.com/iced-rs/iced/blob/15c0e397a81933ca88a9a338caaac2a4689354f9/examples/markdown/src/main.rs | examples/markdown/src/main.rs | mod icon;
use iced::animation;
use iced::clipboard;
use iced::highlighter;
use iced::time::{self, Instant, milliseconds};
use iced::widget::{
button, center_x, container, hover, image, markdown, operation, right, row, scrollable, sensor,
space, text_editor, toggler,
};
use iced::window;
use iced::{Animation, E... | rust | MIT | 15c0e397a81933ca88a9a338caaac2a4689354f9 | 2026-01-04T15:34:40.545819Z | false |
iced-rs/iced | https://github.com/iced-rs/iced/blob/15c0e397a81933ca88a9a338caaac2a4689354f9/examples/websocket/src/echo.rs | examples/websocket/src/echo.rs | pub mod server;
use iced::futures;
use iced::task::{Never, Sipper, sipper};
use iced::widget::text;
use futures::channel::mpsc;
use futures::sink::SinkExt;
use futures::stream::StreamExt;
use async_tungstenite::tungstenite;
use std::fmt;
pub fn connect() -> impl Sipper<Never, Event> {
sipper(async |mut output| ... | rust | MIT | 15c0e397a81933ca88a9a338caaac2a4689354f9 | 2026-01-04T15:34:40.545819Z | false |
iced-rs/iced | https://github.com/iced-rs/iced/blob/15c0e397a81933ca88a9a338caaac2a4689354f9/examples/websocket/src/main.rs | examples/websocket/src/main.rs | mod echo;
use iced::widget::{button, center, column, operation, row, scrollable, text, text_input};
use iced::{Center, Element, Fill, Subscription, Task, color};
pub fn main() -> iced::Result {
iced::application(WebSocket::new, WebSocket::update, WebSocket::view)
.subscription(WebSocket::subscription)
... | rust | MIT | 15c0e397a81933ca88a9a338caaac2a4689354f9 | 2026-01-04T15:34:40.545819Z | false |
iced-rs/iced | https://github.com/iced-rs/iced/blob/15c0e397a81933ca88a9a338caaac2a4689354f9/examples/websocket/src/echo/server.rs | examples/websocket/src/echo/server.rs | use iced::futures;
use futures::channel::mpsc;
use futures::{SinkExt, StreamExt};
use warp::Filter;
use warp::ws::WebSocket;
// Basic WebSocket echo server adapted from:
// https://github.com/seanmonstar/warp/blob/3ff2eaf41eb5ac9321620e5a6434d5b5ec6f313f/examples/websockets_chat.rs
//
// Copyright (c) 2018-2020 Sean ... | rust | MIT | 15c0e397a81933ca88a9a338caaac2a4689354f9 | 2026-01-04T15:34:40.545819Z | false |
iced-rs/iced | https://github.com/iced-rs/iced/blob/15c0e397a81933ca88a9a338caaac2a4689354f9/futures/src/stream.rs | futures/src/stream.rs | //! Create asynchronous streams of data.
use futures::channel::mpsc;
use futures::stream::{self, Stream, StreamExt};
/// Creates a new [`Stream`] that produces the items sent from a [`Future`]
/// to the [`mpsc::Sender`] provided to the closure.
///
/// This is a more ergonomic [`stream::unfold`], which allows you to ... | rust | MIT | 15c0e397a81933ca88a9a338caaac2a4689354f9 | 2026-01-04T15:34:40.545819Z | false |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.