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
tauri-apps/tauri
https://github.com/tauri-apps/tauri/blob/a03219ca196372fca542633900a5ad26d805fcf7/crates/tauri-cli/src/info/mod.rs
crates/tauri-cli/src/info/mod.rs
// Copyright 2019-2024 Tauri Programme within The Commons Conservancy // SPDX-License-Identifier: Apache-2.0 // SPDX-License-Identifier: MIT use crate::{ error::Context, helpers::app_paths::{resolve_frontend_dir, resolve_tauri_dir}, Result, }; use clap::Parser; use colored::{ColoredString, Colorize}; use dialogu...
rust
Apache-2.0
a03219ca196372fca542633900a5ad26d805fcf7
2026-01-04T15:31:58.627796Z
false
tauri-apps/tauri
https://github.com/tauri-apps/tauri/blob/a03219ca196372fca542633900a5ad26d805fcf7/crates/tauri-cli/src/info/packages_nodejs.rs
crates/tauri-cli/src/info/packages_nodejs.rs
// Copyright 2019-2024 Tauri Programme within The Commons Conservancy // SPDX-License-Identifier: Apache-2.0 // SPDX-License-Identifier: MIT use super::SectionItem; use super::VersionMetadata; use colored::Colorize; use serde::Deserialize; use std::path::PathBuf; use crate::error::Context; use crate::{ error::Error...
rust
Apache-2.0
a03219ca196372fca542633900a5ad26d805fcf7
2026-01-04T15:31:58.627796Z
false
tauri-apps/tauri
https://github.com/tauri-apps/tauri/blob/a03219ca196372fca542633900a5ad26d805fcf7/crates/tauri-cli/src/info/plugins.rs
crates/tauri-cli/src/info/plugins.rs
// Copyright 2019-2024 Tauri Programme within The Commons Conservancy // SPDX-License-Identifier: Apache-2.0 // SPDX-License-Identifier: MIT use std::{ collections::HashMap, iter, path::{Path, PathBuf}, }; use crate::{ helpers::{ self, cargo_manifest::{cargo_manifest_and_lock, crate_version}, npm:...
rust
Apache-2.0
a03219ca196372fca542633900a5ad26d805fcf7
2026-01-04T15:31:58.627796Z
false
tauri-apps/tauri
https://github.com/tauri-apps/tauri/blob/a03219ca196372fca542633900a5ad26d805fcf7/crates/tauri-cli/src/info/env_system.rs
crates/tauri-cli/src/info/env_system.rs
// Copyright 2019-2024 Tauri Programme within The Commons Conservancy // SPDX-License-Identifier: Apache-2.0 // SPDX-License-Identifier: MIT use super::{SectionItem, Status}; #[cfg(windows)] use crate::error::Context; use colored::Colorize; #[cfg(windows)] use serde::Deserialize; use std::process::Command; #[cfg(wind...
rust
Apache-2.0
a03219ca196372fca542633900a5ad26d805fcf7
2026-01-04T15:31:58.627796Z
false
tauri-apps/tauri
https://github.com/tauri-apps/tauri/blob/a03219ca196372fca542633900a5ad26d805fcf7/crates/tauri-cli/templates/plugin/build.rs
crates/tauri-cli/templates/plugin/build.rs
const COMMANDS: &[&str] = &["ping"]; fn main() { tauri_plugin::Builder::new(COMMANDS) .android_path("android") .ios_path("ios") .build(); }
rust
Apache-2.0
a03219ca196372fca542633900a5ad26d805fcf7
2026-01-04T15:31:58.627796Z
false
tauri-apps/tauri
https://github.com/tauri-apps/tauri/blob/a03219ca196372fca542633900a5ad26d805fcf7/crates/tauri-cli/templates/plugin/__example-basic/vanilla/src-tauri/build.rs
crates/tauri-cli/templates/plugin/__example-basic/vanilla/src-tauri/build.rs
fn main() { tauri_build::build() }
rust
Apache-2.0
a03219ca196372fca542633900a5ad26d805fcf7
2026-01-04T15:31:58.627796Z
false
tauri-apps/tauri
https://github.com/tauri-apps/tauri/blob/a03219ca196372fca542633900a5ad26d805fcf7/crates/tauri-cli/templates/plugin/__example-basic/vanilla/src-tauri/src/lib.rs
crates/tauri-cli/templates/plugin/__example-basic/vanilla/src-tauri/src/lib.rs
#[cfg_attr(mobile, tauri::mobile_entry_point)] pub fn run() { tauri::Builder::default() .plugin(tauri_plugin_{{ plugin_name_snake_case }}::init()) .run(tauri::generate_context!()) .expect("error while running tauri application"); }
rust
Apache-2.0
a03219ca196372fca542633900a5ad26d805fcf7
2026-01-04T15:31:58.627796Z
false
tauri-apps/tauri
https://github.com/tauri-apps/tauri/blob/a03219ca196372fca542633900a5ad26d805fcf7/crates/tauri-cli/templates/plugin/__example-basic/vanilla/src-tauri/src/main.rs
crates/tauri-cli/templates/plugin/__example-basic/vanilla/src-tauri/src/main.rs
// Prevents additional console window on Windows in release, DO NOT REMOVE!! #![cfg_attr(not(debug_assertions), windows_subsystem = "windows")] fn main() { tauri_app_lib::run(); }
rust
Apache-2.0
a03219ca196372fca542633900a5ad26d805fcf7
2026-01-04T15:31:58.627796Z
false
tauri-apps/tauri
https://github.com/tauri-apps/tauri/blob/a03219ca196372fca542633900a5ad26d805fcf7/crates/tauri-cli/templates/plugin/src/mobile.rs
crates/tauri-cli/templates/plugin/src/mobile.rs
{{#if license_header}} {{ license_header }} {{/if}} use serde::de::DeserializeOwned; use tauri::{ plugin::{PluginApi, PluginHandle}, AppHandle, Runtime, }; use crate::models::*; #[cfg(target_os = "ios")] tauri::ios_plugin_binding!(init_plugin_{{ plugin_name_snake_case }}); // initializes the Kotlin or Swift plug...
rust
Apache-2.0
a03219ca196372fca542633900a5ad26d805fcf7
2026-01-04T15:31:58.627796Z
false
tauri-apps/tauri
https://github.com/tauri-apps/tauri/blob/a03219ca196372fca542633900a5ad26d805fcf7/crates/tauri-cli/templates/plugin/src/lib.rs
crates/tauri-cli/templates/plugin/src/lib.rs
{{#if license_header}} {{ license_header }} {{/if}} use tauri::{ plugin::{Builder, TauriPlugin}, Manager, Runtime, }; pub use models::*; #[cfg(desktop)] mod desktop; #[cfg(mobile)] mod mobile; mod commands; mod error; mod models; pub use error::{Error, Result}; #[cfg(desktop)] use desktop::{{ plugin_name_pasca...
rust
Apache-2.0
a03219ca196372fca542633900a5ad26d805fcf7
2026-01-04T15:31:58.627796Z
false
tauri-apps/tauri
https://github.com/tauri-apps/tauri/blob/a03219ca196372fca542633900a5ad26d805fcf7/crates/tauri-cli/templates/plugin/src/error.rs
crates/tauri-cli/templates/plugin/src/error.rs
{{#if license_header}} {{ license_header }} {{/if}} use serde::{ser::Serializer, Serialize}; pub type Result<T> = std::result::Result<T, Error>; #[derive(Debug, thiserror::Error)] pub enum Error { #[error(transparent)] Io(#[from] std::io::Error), #[cfg(mobile)] #[error(transparent)] PluginInvoke(#[from] tau...
rust
Apache-2.0
a03219ca196372fca542633900a5ad26d805fcf7
2026-01-04T15:31:58.627796Z
false
tauri-apps/tauri
https://github.com/tauri-apps/tauri/blob/a03219ca196372fca542633900a5ad26d805fcf7/crates/tauri-cli/templates/plugin/src/commands.rs
crates/tauri-cli/templates/plugin/src/commands.rs
{{#if license_header}} {{ license_header }} {{/if}} use tauri::{AppHandle, command, Runtime}; use crate::models::*; use crate::Result; use crate::{{ plugin_name_pascal_case }}Ext; #[command] pub(crate) async fn ping<R: Runtime>( app: AppHandle<R>, payload: PingRequest, ) -> Result<PingResponse> { app.{{ p...
rust
Apache-2.0
a03219ca196372fca542633900a5ad26d805fcf7
2026-01-04T15:31:58.627796Z
false
tauri-apps/tauri
https://github.com/tauri-apps/tauri/blob/a03219ca196372fca542633900a5ad26d805fcf7/crates/tauri-cli/templates/plugin/src/desktop.rs
crates/tauri-cli/templates/plugin/src/desktop.rs
{{#if license_header}} {{ license_header }} {{/if}} use serde::de::DeserializeOwned; use tauri::{plugin::PluginApi, AppHandle, Runtime}; use crate::models::*; pub fn init<R: Runtime, C: DeserializeOwned>( app: &AppHandle<R>, _api: PluginApi<R, C>, ) -> crate::Result<{{ plugin_name_pascal_case }}<R>> { Ok({{ plu...
rust
Apache-2.0
a03219ca196372fca542633900a5ad26d805fcf7
2026-01-04T15:31:58.627796Z
false
tauri-apps/tauri
https://github.com/tauri-apps/tauri/blob/a03219ca196372fca542633900a5ad26d805fcf7/crates/tauri-cli/templates/plugin/src/models.rs
crates/tauri-cli/templates/plugin/src/models.rs
{{#if license_header}} {{ license_header }} {{/if}} use serde::{Deserialize, Serialize}; #[derive(Debug, Deserialize, Serialize)] #[serde(rename_all = "camelCase")] pub struct PingRequest { pub value: Option<String>, } #[derive(Debug, Clone, Default, Deserialize, Serialize)] #[serde(rename_all = "camelCase")] pub s...
rust
Apache-2.0
a03219ca196372fca542633900a5ad26d805fcf7
2026-01-04T15:31:58.627796Z
false
tauri-apps/tauri
https://github.com/tauri-apps/tauri/blob/a03219ca196372fca542633900a5ad26d805fcf7/crates/tauri-cli/templates/plugin/__example-api/tauri-app/src-tauri/build.rs
crates/tauri-cli/templates/plugin/__example-api/tauri-app/src-tauri/build.rs
fn main() { tauri_build::build() }
rust
Apache-2.0
a03219ca196372fca542633900a5ad26d805fcf7
2026-01-04T15:31:58.627796Z
false
tauri-apps/tauri
https://github.com/tauri-apps/tauri/blob/a03219ca196372fca542633900a5ad26d805fcf7/crates/tauri-cli/templates/plugin/__example-api/tauri-app/src-tauri/src/lib.rs
crates/tauri-cli/templates/plugin/__example-api/tauri-app/src-tauri/src/lib.rs
// Learn more about Tauri commands at https://v2.tauri.app/develop/calling-rust/#commands #[tauri::command] fn greet(name: &str) -> String { format!("Hello, {}! You've been greeted from Rust!", name) } #[cfg_attr(mobile, tauri::mobile_entry_point)] pub fn run() { tauri::Builder::default() .invoke_handl...
rust
Apache-2.0
a03219ca196372fca542633900a5ad26d805fcf7
2026-01-04T15:31:58.627796Z
false
tauri-apps/tauri
https://github.com/tauri-apps/tauri/blob/a03219ca196372fca542633900a5ad26d805fcf7/crates/tauri-cli/templates/plugin/__example-api/tauri-app/src-tauri/src/main.rs
crates/tauri-cli/templates/plugin/__example-api/tauri-app/src-tauri/src/main.rs
// Prevents additional console window on Windows in release, DO NOT REMOVE!! #![cfg_attr(not(debug_assertions), windows_subsystem = "windows")] fn main() { tauri_app_lib::run(); }
rust
Apache-2.0
a03219ca196372fca542633900a5ad26d805fcf7
2026-01-04T15:31:58.627796Z
false
tauri-apps/tauri
https://github.com/tauri-apps/tauri/blob/a03219ca196372fca542633900a5ad26d805fcf7/crates/tauri-cli/templates/app/src-tauri/build.rs
crates/tauri-cli/templates/app/src-tauri/build.rs
fn main() { tauri_build::build() }
rust
Apache-2.0
a03219ca196372fca542633900a5ad26d805fcf7
2026-01-04T15:31:58.627796Z
false
tauri-apps/tauri
https://github.com/tauri-apps/tauri/blob/a03219ca196372fca542633900a5ad26d805fcf7/crates/tauri-cli/templates/app/src-tauri/src/lib.rs
crates/tauri-cli/templates/app/src-tauri/src/lib.rs
#[cfg_attr(mobile, tauri::mobile_entry_point)] pub fn run() { tauri::Builder::default() .setup(|app| { if cfg!(debug_assertions) { app.handle().plugin( tauri_plugin_log::Builder::default() .level(log::LevelFilter::Info) .build(), )?; } Ok(()) ...
rust
Apache-2.0
a03219ca196372fca542633900a5ad26d805fcf7
2026-01-04T15:31:58.627796Z
false
tauri-apps/tauri
https://github.com/tauri-apps/tauri/blob/a03219ca196372fca542633900a5ad26d805fcf7/crates/tauri-cli/templates/app/src-tauri/src/main.rs
crates/tauri-cli/templates/app/src-tauri/src/main.rs
// Prevents additional console window on Windows in release, DO NOT REMOVE!! #![cfg_attr(not(debug_assertions), windows_subsystem = "windows")] fn main() { app_lib::run(); }
rust
Apache-2.0
a03219ca196372fca542633900a5ad26d805fcf7
2026-01-04T15:31:58.627796Z
false
tauri-apps/tauri
https://github.com/tauri-apps/tauri/blob/a03219ca196372fca542633900a5ad26d805fcf7/examples/state/main.rs
examples/state/main.rs
// Copyright 2019-2024 Tauri Programme within The Commons Conservancy // SPDX-License-Identifier: Apache-2.0 // SPDX-License-Identifier: MIT #![cfg_attr(not(debug_assertions), windows_subsystem = "windows")] use std::sync::Mutex; use tauri::State; struct Counter(Mutex<isize>); #[tauri::command] fn increment(counte...
rust
Apache-2.0
a03219ca196372fca542633900a5ad26d805fcf7
2026-01-04T15:31:58.627796Z
false
tauri-apps/tauri
https://github.com/tauri-apps/tauri/blob/a03219ca196372fca542633900a5ad26d805fcf7/examples/isolation/main.rs
examples/isolation/main.rs
// Copyright 2019-2024 Tauri Programme within The Commons Conservancy // SPDX-License-Identifier: Apache-2.0 // SPDX-License-Identifier: MIT #![cfg_attr(not(debug_assertions), windows_subsystem = "windows")] #[tauri::command] fn ping() { println!("ping: {:?}", std::time::Instant::now()); } fn main() { tauri::Bui...
rust
Apache-2.0
a03219ca196372fca542633900a5ad26d805fcf7
2026-01-04T15:31:58.627796Z
false
tauri-apps/tauri
https://github.com/tauri-apps/tauri/blob/a03219ca196372fca542633900a5ad26d805fcf7/examples/multiwebview/main.rs
examples/multiwebview/main.rs
// Copyright 2019-2024 Tauri Programme within The Commons Conservancy // SPDX-License-Identifier: Apache-2.0 // SPDX-License-Identifier: MIT #![cfg_attr(not(debug_assertions), windows_subsystem = "windows")] use tauri::{LogicalPosition, LogicalSize, WebviewUrl}; fn main() { tauri::Builder::default() .setup(|ap...
rust
Apache-2.0
a03219ca196372fca542633900a5ad26d805fcf7
2026-01-04T15:31:58.627796Z
false
tauri-apps/tauri
https://github.com/tauri-apps/tauri/blob/a03219ca196372fca542633900a5ad26d805fcf7/examples/streaming/main.rs
examples/streaming/main.rs
// Copyright 2019-2024 Tauri Programme within The Commons Conservancy // SPDX-License-Identifier: Apache-2.0 // SPDX-License-Identifier: MIT #![cfg_attr(not(debug_assertions), windows_subsystem = "windows")] use http::{header::*, response::Builder as ResponseBuilder, status::StatusCode}; use http_range::HttpRange; us...
rust
Apache-2.0
a03219ca196372fca542633900a5ad26d805fcf7
2026-01-04T15:31:58.627796Z
false
tauri-apps/tauri
https://github.com/tauri-apps/tauri/blob/a03219ca196372fca542633900a5ad26d805fcf7/examples/commands/commands.rs
examples/commands/commands.rs
// Copyright 2019-2024 Tauri Programme within The Commons Conservancy // SPDX-License-Identifier: Apache-2.0 // SPDX-License-Identifier: MIT use tauri::{command, State}; #[command] pub fn cmd(_argument: String) {} #[command] pub fn invoke(_argument: String) {} #[command] pub fn message(_argument: String) {} #[comm...
rust
Apache-2.0
a03219ca196372fca542633900a5ad26d805fcf7
2026-01-04T15:31:58.627796Z
false
tauri-apps/tauri
https://github.com/tauri-apps/tauri/blob/a03219ca196372fca542633900a5ad26d805fcf7/examples/commands/main.rs
examples/commands/main.rs
// Copyright 2019-2024 Tauri Programme within The Commons Conservancy // SPDX-License-Identifier: Apache-2.0 // SPDX-License-Identifier: MIT #![cfg_attr(not(debug_assertions), windows_subsystem = "windows")] // we move some basic commands to a separate module just to show it works mod commands; use commands::{cmd, in...
rust
Apache-2.0
a03219ca196372fca542633900a5ad26d805fcf7
2026-01-04T15:31:58.627796Z
false
tauri-apps/tauri
https://github.com/tauri-apps/tauri/blob/a03219ca196372fca542633900a5ad26d805fcf7/examples/helloworld/main.rs
examples/helloworld/main.rs
// Copyright 2019-2024 Tauri Programme within The Commons Conservancy // SPDX-License-Identifier: Apache-2.0 // SPDX-License-Identifier: MIT #![cfg_attr(not(debug_assertions), windows_subsystem = "windows")] #[tauri::command] fn greet(name: &str) -> String { format!("Hello {name}, You have been greeted from Rust!")...
rust
Apache-2.0
a03219ca196372fca542633900a5ad26d805fcf7
2026-01-04T15:31:58.627796Z
false
tauri-apps/tauri
https://github.com/tauri-apps/tauri/blob/a03219ca196372fca542633900a5ad26d805fcf7/examples/api/src-tauri/build.rs
examples/api/src-tauri/build.rs
// Copyright 2019-2024 Tauri Programme within The Commons Conservancy // SPDX-License-Identifier: Apache-2.0 // SPDX-License-Identifier: MIT use tauri_build::WindowsAttributes; fn main() { tauri_build::try_build( tauri_build::Attributes::new() .codegen(tauri_build::CodegenContext::new()) .windows_at...
rust
Apache-2.0
a03219ca196372fca542633900a5ad26d805fcf7
2026-01-04T15:31:58.627796Z
false
tauri-apps/tauri
https://github.com/tauri-apps/tauri/blob/a03219ca196372fca542633900a5ad26d805fcf7/examples/api/src-tauri/tauri-plugin-sample/build.rs
examples/api/src-tauri/tauri-plugin-sample/build.rs
// Copyright 2019-2024 Tauri Programme within The Commons Conservancy // SPDX-License-Identifier: Apache-2.0 // SPDX-License-Identifier: MIT const COMMANDS: &[&str] = &["ping"]; fn main() { tauri_plugin::Builder::new(COMMANDS) .android_path("android") .ios_path("ios") .global_api_script_path("./api-iife...
rust
Apache-2.0
a03219ca196372fca542633900a5ad26d805fcf7
2026-01-04T15:31:58.627796Z
false
tauri-apps/tauri
https://github.com/tauri-apps/tauri/blob/a03219ca196372fca542633900a5ad26d805fcf7/examples/api/src-tauri/tauri-plugin-sample/src/mobile.rs
examples/api/src-tauri/tauri-plugin-sample/src/mobile.rs
// Copyright 2019-2024 Tauri Programme within The Commons Conservancy // SPDX-License-Identifier: Apache-2.0 // SPDX-License-Identifier: MIT use serde::de::DeserializeOwned; use tauri::{ plugin::{PluginApi, PluginHandle}, AppHandle, Runtime, }; use crate::models::*; #[cfg(target_os = "android")] const PLUGIN_IDE...
rust
Apache-2.0
a03219ca196372fca542633900a5ad26d805fcf7
2026-01-04T15:31:58.627796Z
false
tauri-apps/tauri
https://github.com/tauri-apps/tauri/blob/a03219ca196372fca542633900a5ad26d805fcf7/examples/api/src-tauri/tauri-plugin-sample/src/lib.rs
examples/api/src-tauri/tauri-plugin-sample/src/lib.rs
// Copyright 2019-2024 Tauri Programme within The Commons Conservancy // SPDX-License-Identifier: Apache-2.0 // SPDX-License-Identifier: MIT use serde::Deserialize; use std::path::PathBuf; use tauri::{ plugin::{Builder, TauriPlugin}, Manager, Runtime, }; pub use models::*; #[cfg(desktop)] mod desktop; #[cfg(mobi...
rust
Apache-2.0
a03219ca196372fca542633900a5ad26d805fcf7
2026-01-04T15:31:58.627796Z
false
tauri-apps/tauri
https://github.com/tauri-apps/tauri/blob/a03219ca196372fca542633900a5ad26d805fcf7/examples/api/src-tauri/tauri-plugin-sample/src/error.rs
examples/api/src-tauri/tauri-plugin-sample/src/error.rs
// Copyright 2019-2024 Tauri Programme within The Commons Conservancy // SPDX-License-Identifier: Apache-2.0 // SPDX-License-Identifier: MIT #[derive(Debug, thiserror::Error)] pub enum Error { #[cfg(mobile)] #[error(transparent)] PluginInvoke(#[from] tauri::plugin::mobile::PluginInvokeError), #[error(transpare...
rust
Apache-2.0
a03219ca196372fca542633900a5ad26d805fcf7
2026-01-04T15:31:58.627796Z
false
tauri-apps/tauri
https://github.com/tauri-apps/tauri/blob/a03219ca196372fca542633900a5ad26d805fcf7/examples/api/src-tauri/tauri-plugin-sample/src/desktop.rs
examples/api/src-tauri/tauri-plugin-sample/src/desktop.rs
// Copyright 2019-2024 Tauri Programme within The Commons Conservancy // SPDX-License-Identifier: Apache-2.0 // SPDX-License-Identifier: MIT use serde::de::DeserializeOwned; use tauri::{plugin::PluginApi, AppHandle, Runtime}; use crate::models::*; pub fn init<R: Runtime, C: DeserializeOwned>( app: &AppHandle<R>, ...
rust
Apache-2.0
a03219ca196372fca542633900a5ad26d805fcf7
2026-01-04T15:31:58.627796Z
false
tauri-apps/tauri
https://github.com/tauri-apps/tauri/blob/a03219ca196372fca542633900a5ad26d805fcf7/examples/api/src-tauri/tauri-plugin-sample/src/models.rs
examples/api/src-tauri/tauri-plugin-sample/src/models.rs
// Copyright 2019-2024 Tauri Programme within The Commons Conservancy // SPDX-License-Identifier: Apache-2.0 // SPDX-License-Identifier: MIT use serde::{Deserialize, Serialize}; use tauri::ipc::Channel; #[derive(Serialize)] pub struct Event { pub kind: String, pub value: Option<String>, } #[derive(Serialize)] #[...
rust
Apache-2.0
a03219ca196372fca542633900a5ad26d805fcf7
2026-01-04T15:31:58.627796Z
false
tauri-apps/tauri
https://github.com/tauri-apps/tauri/blob/a03219ca196372fca542633900a5ad26d805fcf7/examples/api/src-tauri/src/lib.rs
examples/api/src-tauri/src/lib.rs
// Copyright 2019-2024 Tauri Programme within The Commons Conservancy // SPDX-License-Identifier: Apache-2.0 // SPDX-License-Identifier: MIT mod cmd; #[cfg(desktop)] mod menu_plugin; #[cfg(desktop)] mod tray; use serde::Serialize; use tauri::{ ipc::Channel, webview::{PageLoadEvent, WebviewWindowBuilder}, App, E...
rust
Apache-2.0
a03219ca196372fca542633900a5ad26d805fcf7
2026-01-04T15:31:58.627796Z
false
tauri-apps/tauri
https://github.com/tauri-apps/tauri/blob/a03219ca196372fca542633900a5ad26d805fcf7/examples/api/src-tauri/src/tray.rs
examples/api/src-tauri/src/tray.rs
// Copyright 2019-2024 Tauri Programme within The Commons Conservancy // SPDX-License-Identifier: Apache-2.0 // SPDX-License-Identifier: MIT #![cfg(all(desktop, not(test)))] use std::sync::atomic::{AtomicBool, Ordering}; use tauri::{ include_image, menu::{Menu, MenuItem}, tray::{MouseButton, MouseButtonState, T...
rust
Apache-2.0
a03219ca196372fca542633900a5ad26d805fcf7
2026-01-04T15:31:58.627796Z
false
tauri-apps/tauri
https://github.com/tauri-apps/tauri/blob/a03219ca196372fca542633900a5ad26d805fcf7/examples/api/src-tauri/src/main.rs
examples/api/src-tauri/src/main.rs
// Copyright 2019-2024 Tauri Programme within The Commons Conservancy // SPDX-License-Identifier: Apache-2.0 // SPDX-License-Identifier: MIT // Prevents additional console window on Windows in release, DO NOT REMOVE!! #![cfg_attr(not(debug_assertions), windows_subsystem = "windows")] fn main() { api_lib::run(); }
rust
Apache-2.0
a03219ca196372fca542633900a5ad26d805fcf7
2026-01-04T15:31:58.627796Z
false
tauri-apps/tauri
https://github.com/tauri-apps/tauri/blob/a03219ca196372fca542633900a5ad26d805fcf7/examples/api/src-tauri/src/menu_plugin.rs
examples/api/src-tauri/src/menu_plugin.rs
// Copyright 2019-2024 Tauri Programme within The Commons Conservancy // SPDX-License-Identifier: Apache-2.0 // SPDX-License-Identifier: MIT #![cfg(all(desktop, not(test)))] use tauri::{ command, plugin::{Builder, TauriPlugin}, Runtime, }; #[cfg(not(target_os = "macos"))] #[command] pub fn toggle<R: tauri::Runt...
rust
Apache-2.0
a03219ca196372fca542633900a5ad26d805fcf7
2026-01-04T15:31:58.627796Z
false
tauri-apps/tauri
https://github.com/tauri-apps/tauri/blob/a03219ca196372fca542633900a5ad26d805fcf7/examples/api/src-tauri/src/cmd.rs
examples/api/src-tauri/src/cmd.rs
// Copyright 2019-2024 Tauri Programme within The Commons Conservancy // SPDX-License-Identifier: Apache-2.0 // SPDX-License-Identifier: MIT use serde::{Deserialize, Serialize}; use tauri::{ command, ipc::{Channel, CommandScope}, }; #[derive(Debug, Deserialize)] #[allow(unused)] pub struct RequestBody { id: i32...
rust
Apache-2.0
a03219ca196372fca542633900a5ad26d805fcf7
2026-01-04T15:31:58.627796Z
false
tauri-apps/tauri
https://github.com/tauri-apps/tauri/blob/a03219ca196372fca542633900a5ad26d805fcf7/examples/file-associations/src-tauri/build.rs
examples/file-associations/src-tauri/build.rs
// Copyright 2019-2024 Tauri Programme within The Commons Conservancy // SPDX-License-Identifier: Apache-2.0 // SPDX-License-Identifier: MIT fn main() { tauri_build::build() }
rust
Apache-2.0
a03219ca196372fca542633900a5ad26d805fcf7
2026-01-04T15:31:58.627796Z
false
tauri-apps/tauri
https://github.com/tauri-apps/tauri/blob/a03219ca196372fca542633900a5ad26d805fcf7/examples/file-associations/src-tauri/src/main.rs
examples/file-associations/src-tauri/src/main.rs
// Copyright 2019-2024 Tauri Programme within The Commons Conservancy // SPDX-License-Identifier: Apache-2.0 // SPDX-License-Identifier: MIT #![cfg_attr( all(not(debug_assertions), target_os = "windows"), windows_subsystem = "windows" )] use std::path::PathBuf; use tauri::{AppHandle, Manager}; fn handle_file_ass...
rust
Apache-2.0
a03219ca196372fca542633900a5ad26d805fcf7
2026-01-04T15:31:58.627796Z
false
tauri-apps/tauri
https://github.com/tauri-apps/tauri/blob/a03219ca196372fca542633900a5ad26d805fcf7/examples/splashscreen/main.rs
examples/splashscreen/main.rs
// Copyright 2019-2024 Tauri Programme within The Commons Conservancy // SPDX-License-Identifier: Apache-2.0 // SPDX-License-Identifier: MIT #![cfg_attr(not(debug_assertions), windows_subsystem = "windows")] use tauri::{AppHandle, Manager}; #[tauri::command] fn close_splashscreen(app: AppHandle) { // Close splashs...
rust
Apache-2.0
a03219ca196372fca542633900a5ad26d805fcf7
2026-01-04T15:31:58.627796Z
false
tauri-apps/tauri
https://github.com/tauri-apps/tauri/blob/a03219ca196372fca542633900a5ad26d805fcf7/examples/resources/src-tauri/build.rs
examples/resources/src-tauri/build.rs
// Copyright 2019-2024 Tauri Programme within The Commons Conservancy // SPDX-License-Identifier: Apache-2.0 // SPDX-License-Identifier: MIT fn main() { tauri_build::build() }
rust
Apache-2.0
a03219ca196372fca542633900a5ad26d805fcf7
2026-01-04T15:31:58.627796Z
false
tauri-apps/tauri
https://github.com/tauri-apps/tauri/blob/a03219ca196372fca542633900a5ad26d805fcf7/examples/resources/src-tauri/src/main.rs
examples/resources/src-tauri/src/main.rs
// Copyright 2019-2024 Tauri Programme within The Commons Conservancy // SPDX-License-Identifier: Apache-2.0 // SPDX-License-Identifier: MIT #![cfg_attr(not(debug_assertions), windows_subsystem = "windows")] use tauri::Manager; #[tauri::command] fn read_to_string(path: &str) -> String { std::fs::read_to_string(pat...
rust
Apache-2.0
a03219ca196372fca542633900a5ad26d805fcf7
2026-01-04T15:31:58.627796Z
false
tauri-apps/tauri
https://github.com/tauri-apps/tauri/blob/a03219ca196372fca542633900a5ad26d805fcf7/examples/multiwindow/main.rs
examples/multiwindow/main.rs
// Copyright 2019-2024 Tauri Programme within The Commons Conservancy // SPDX-License-Identifier: Apache-2.0 // SPDX-License-Identifier: MIT #![cfg_attr(not(debug_assertions), windows_subsystem = "windows")] use tauri::WebviewWindowBuilder; fn main() { tauri::Builder::default() .setup(|app| { WebviewWind...
rust
Apache-2.0
a03219ca196372fca542633900a5ad26d805fcf7
2026-01-04T15:31:58.627796Z
false
tauri-apps/tauri
https://github.com/tauri-apps/tauri/blob/a03219ca196372fca542633900a5ad26d805fcf7/examples/run-return/main.rs
examples/run-return/main.rs
// Copyright 2019-2024 Tauri Programme within The Commons Conservancy // SPDX-License-Identifier: Apache-2.0 // SPDX-License-Identifier: MIT #![cfg_attr(not(debug_assertions), windows_subsystem = "windows")] fn main() { let app = tauri::Builder::default() .build(tauri::generate_context!( "../../examples/r...
rust
Apache-2.0
a03219ca196372fca542633900a5ad26d805fcf7
2026-01-04T15:31:58.627796Z
false
tauri-apps/tauri
https://github.com/tauri-apps/tauri/blob/a03219ca196372fca542633900a5ad26d805fcf7/packages/cli/build.rs
packages/cli/build.rs
// Copyright 2019-2024 Tauri Programme within The Commons Conservancy // SPDX-License-Identifier: Apache-2.0 // SPDX-License-Identifier: MIT fn main() { ::napi_build::setup(); }
rust
Apache-2.0
a03219ca196372fca542633900a5ad26d805fcf7
2026-01-04T15:31:58.627796Z
false
tauri-apps/tauri
https://github.com/tauri-apps/tauri/blob/a03219ca196372fca542633900a5ad26d805fcf7/packages/cli/src/lib.rs
packages/cli/src/lib.rs
// Copyright 2019-2024 Tauri Programme within The Commons Conservancy // SPDX-License-Identifier: Apache-2.0 // SPDX-License-Identifier: MIT #![cfg(any(target_os = "macos", target_os = "linux", windows))] use std::sync::Arc; use napi::{ threadsafe_function::{ThreadsafeFunction, ThreadsafeFunctionCallMode}, Error...
rust
Apache-2.0
a03219ca196372fca542633900a5ad26d805fcf7
2026-01-04T15:31:58.627796Z
false
yewstack/yew
https://github.com/yewstack/yew/blob/2019f4577cbdcd389b34973fdec3164be3af941a/tools/benchmark-core/benches/vnode.rs
tools/benchmark-core/benches/vnode.rs
use yew::prelude::*; fn main() { divan::main(); } #[function_component] fn Stuff(_: &()) -> Html { html! { <p>{"A custom component"}</p> } } #[divan::bench(sample_size = 10000000)] fn vnode_clone(bencher: divan::Bencher) { let html = html! { <div class={classes!("hello-world")}> ...
rust
Apache-2.0
2019f4577cbdcd389b34973fdec3164be3af941a
2026-01-04T15:33:05.007302Z
false
yewstack/yew
https://github.com/yewstack/yew/blob/2019f4577cbdcd389b34973fdec3164be3af941a/tools/benchmark-ssr/src/main.rs
tools/benchmark-ssr/src/main.rs
use std::collections::HashMap; use std::fs::File; use std::path::PathBuf; use std::time::{Duration, Instant}; use average::Variance; use clap::Parser; use function_router::{ServerApp, ServerAppProps}; use indicatif::{ProgressBar, ProgressStyle}; use serde::{Deserialize, Serialize}; use tabled::settings::Style; use tab...
rust
Apache-2.0
2019f4577cbdcd389b34973fdec3164be3af941a
2026-01-04T15:33:05.007302Z
false
yewstack/yew
https://github.com/yewstack/yew/blob/2019f4577cbdcd389b34973fdec3164be3af941a/tools/process-benchmark-results/src/main.rs
tools/process-benchmark-results/src/main.rs
use std::collections::HashMap; use std::io; use std::io::{Read, Write}; use anyhow::Result; use serde::{Deserialize, Serialize}; use serde_json::Value; #[derive(Serialize)] struct GhActionBenchmark { name: String, unit: String, value: Value, } // from https://github.com/krausest/js-framework-benchmark/bl...
rust
Apache-2.0
2019f4577cbdcd389b34973fdec3164be3af941a
2026-01-04T15:33:05.007302Z
false
yewstack/yew
https://github.com/yewstack/yew/blob/2019f4577cbdcd389b34973fdec3164be3af941a/tools/benchmark-hooks/src/lib.rs
tools/benchmark-hooks/src/lib.rs
use std::cmp::min; use std::ops::Deref; use std::rc::Rc; use rand::prelude::*; use wasm_bindgen::prelude::*; use web_sys::window; use yew::prelude::*; static ADJECTIVES: &[&str] = &[ "pretty", "large", "big", "small", "tall", "short", "long", "handsome", "plain", "quaint", ...
rust
Apache-2.0
2019f4577cbdcd389b34973fdec3164be3af941a
2026-01-04T15:33:05.007302Z
false
yewstack/yew
https://github.com/yewstack/yew/blob/2019f4577cbdcd389b34973fdec3164be3af941a/tools/benchmark-struct/src/lib.rs
tools/benchmark-struct/src/lib.rs
use std::cmp::min; use rand::prelude::*; use wasm_bindgen::prelude::*; use web_sys::window; use yew::prelude::*; static ADJECTIVES: &[&str] = &[ "pretty", "large", "big", "small", "tall", "short", "long", "handsome", "plain", "quaint", "clean", "elegant", "easy", ...
rust
Apache-2.0
2019f4577cbdcd389b34973fdec3164be3af941a
2026-01-04T15:33:05.007302Z
false
yewstack/yew
https://github.com/yewstack/yew/blob/2019f4577cbdcd389b34973fdec3164be3af941a/tools/website-test/build.rs
tools/website-test/build.rs
use std::collections::HashMap; use std::error::Error; use std::fmt::Write; use std::fs::File; use std::io::{self, BufRead, BufReader, ErrorKind, Read, Seek, SeekFrom}; use std::path::{Path, PathBuf}; use std::process::ExitCode; use std::{env, fs}; use glob::glob; type Result<T = ()> = core::result::Result<T, Box<dyn ...
rust
Apache-2.0
2019f4577cbdcd389b34973fdec3164be3af941a
2026-01-04T15:33:05.007302Z
false
yewstack/yew
https://github.com/yewstack/yew/blob/2019f4577cbdcd389b34973fdec3164be3af941a/tools/website-test/src/lib.rs
tools/website-test/src/lib.rs
include!(concat!(env!("OUT_DIR"), "/website_tests.rs"));
rust
Apache-2.0
2019f4577cbdcd389b34973fdec3164be3af941a
2026-01-04T15:33:05.007302Z
false
yewstack/yew
https://github.com/yewstack/yew/blob/2019f4577cbdcd389b34973fdec3164be3af941a/tools/changelog/src/lib.rs
tools/changelog/src/lib.rs
mod cli; pub mod create_log_line; pub mod create_log_lines; pub mod get_latest_version; pub mod github_fetch; pub mod github_issue_labels_fetcher; pub mod github_user_fetcher; pub mod log_line; pub mod new_version_level; pub mod stdout_tag_description_changelog; pub mod write_changelog_file; pub mod write_log_lines; pu...
rust
Apache-2.0
2019f4577cbdcd389b34973fdec3164be3af941a
2026-01-04T15:33:05.007302Z
false
yewstack/yew
https://github.com/yewstack/yew/blob/2019f4577cbdcd389b34973fdec3164be3af941a/tools/changelog/src/create_log_line.rs
tools/changelog/src/create_log_line.rs
use std::sync::Mutex; use anyhow::{anyhow, Context, Result}; use git2::{Error, Oid, Repository}; use once_cell::sync::Lazy; use regex::Regex; use crate::github_issue_labels_fetcher::GitHubIssueLabelsFetcher; use crate::github_user_fetcher::GitHubUsersFetcher; use crate::log_line::LogLine; static REGEX_FOR_ISSUE_ID_C...
rust
Apache-2.0
2019f4577cbdcd389b34973fdec3164be3af941a
2026-01-04T15:33:05.007302Z
false
yewstack/yew
https://github.com/yewstack/yew/blob/2019f4577cbdcd389b34973fdec3164be3af941a/tools/changelog/src/write_version_changelog.rs
tools/changelog/src/write_version_changelog.rs
use std::io::Write; use anyhow::Result; use semver::Version; use crate::yew_package::YewPackage; pub fn write_changelog_file( fixes_logs: &[u8], features_logs: &[u8], breaking_changes_logs: &[u8], package: YewPackage, next_version: Version, ) -> Result<Vec<u8>> { let mut version_only_changelo...
rust
Apache-2.0
2019f4577cbdcd389b34973fdec3164be3af941a
2026-01-04T15:33:05.007302Z
false
yewstack/yew
https://github.com/yewstack/yew/blob/2019f4577cbdcd389b34973fdec3164be3af941a/tools/changelog/src/cli.rs
tools/changelog/src/cli.rs
use anyhow::{bail, Result}; use clap::Parser; use semver::Version; use crate::create_log_lines::create_log_lines; use crate::get_latest_version::get_latest_version; use crate::new_version_level::NewVersionLevel; use crate::stdout_tag_description_changelog::stdout_tag_description_changelog; use crate::write_changelog_f...
rust
Apache-2.0
2019f4577cbdcd389b34973fdec3164be3af941a
2026-01-04T15:33:05.007302Z
false
yewstack/yew
https://github.com/yewstack/yew/blob/2019f4577cbdcd389b34973fdec3164be3af941a/tools/changelog/src/github_issue_labels_fetcher.rs
tools/changelog/src/github_issue_labels_fetcher.rs
use std::collections::HashMap; use anyhow::Result; use serde::Deserialize; use super::github_fetch::github_fetch; #[derive(Deserialize, Debug)] pub struct BodyListItem { name: String, } #[derive(Debug, Default)] pub struct GitHubIssueLabelsFetcher { cache: HashMap<String, Option<Vec<String>>>, } impl GitHu...
rust
Apache-2.0
2019f4577cbdcd389b34973fdec3164be3af941a
2026-01-04T15:33:05.007302Z
false
yewstack/yew
https://github.com/yewstack/yew/blob/2019f4577cbdcd389b34973fdec3164be3af941a/tools/changelog/src/stdout_tag_description_changelog.rs
tools/changelog/src/stdout_tag_description_changelog.rs
use std::io::{stdout, Write}; use anyhow::Result; pub fn stdout_tag_description_changelog( fixes_logs: &[u8], features_logs: &[u8], breaking_changes_logs: &[u8], ) -> Result<()> { let mut tag_changelog = Vec::new(); writeln!(tag_changelog, "# Changelog")?; writeln!(tag_changelog)?; if fi...
rust
Apache-2.0
2019f4577cbdcd389b34973fdec3164be3af941a
2026-01-04T15:33:05.007302Z
false
yewstack/yew
https://github.com/yewstack/yew/blob/2019f4577cbdcd389b34973fdec3164be3af941a/tools/changelog/src/write_log_lines.rs
tools/changelog/src/write_log_lines.rs
use std::io::Write; use anyhow::Result; use crate::log_line::LogLine; pub fn write_log_lines(log_lines: Vec<LogLine>) -> Result<Vec<u8>> { let mut logs_list = Vec::default(); for LogLine { message, user, issue_id, user_id, .. } in log_lines { writeln!( ...
rust
Apache-2.0
2019f4577cbdcd389b34973fdec3164be3af941a
2026-01-04T15:33:05.007302Z
false
yewstack/yew
https://github.com/yewstack/yew/blob/2019f4577cbdcd389b34973fdec3164be3af941a/tools/changelog/src/log_line.rs
tools/changelog/src/log_line.rs
#[derive(Debug)] pub struct LogLine { pub message: String, pub user: String, pub user_id: String, pub issue_id: String, pub is_breaking_change: bool, }
rust
Apache-2.0
2019f4577cbdcd389b34973fdec3164be3af941a
2026-01-04T15:33:05.007302Z
false
yewstack/yew
https://github.com/yewstack/yew/blob/2019f4577cbdcd389b34973fdec3164be3af941a/tools/changelog/src/github_fetch.rs
tools/changelog/src/github_fetch.rs
use std::thread; use std::time::Duration; use anyhow::{bail, Result}; use reqwest::blocking::Client; use reqwest::header::{HeaderMap, ACCEPT, AUTHORIZATION, USER_AGENT}; use serde::de::DeserializeOwned; pub fn github_fetch<T: DeserializeOwned>(url: &str, token: Option<String>) -> Result<T> { thread::sleep(Duratio...
rust
Apache-2.0
2019f4577cbdcd389b34973fdec3164be3af941a
2026-01-04T15:33:05.007302Z
false
yewstack/yew
https://github.com/yewstack/yew/blob/2019f4577cbdcd389b34973fdec3164be3af941a/tools/changelog/src/mod.rs
tools/changelog/src/mod.rs
pub mod github_fetch; pub mod github_issue_labels_fetcher; pub mod github_user_fetcher; pub mod log_line; pub mod yew_package;
rust
Apache-2.0
2019f4577cbdcd389b34973fdec3164be3af941a
2026-01-04T15:33:05.007302Z
false
yewstack/yew
https://github.com/yewstack/yew/blob/2019f4577cbdcd389b34973fdec3164be3af941a/tools/changelog/src/create_log_lines.rs
tools/changelog/src/create_log_lines.rs
use anyhow::{Context, Result}; use git2::{Repository, Sort}; use crate::create_log_line::create_log_line; use crate::github_user_fetcher::GitHubUsersFetcher; use crate::log_line::LogLine; pub fn create_log_lines( from: String, to: String, package_labels: &'static [&'static str], token: Option<String>,...
rust
Apache-2.0
2019f4577cbdcd389b34973fdec3164be3af941a
2026-01-04T15:33:05.007302Z
false
yewstack/yew
https://github.com/yewstack/yew/blob/2019f4577cbdcd389b34973fdec3164be3af941a/tools/changelog/src/github_user_fetcher.rs
tools/changelog/src/github_user_fetcher.rs
use std::collections::HashMap; use anyhow::Result; use serde::Deserialize; use super::github_fetch::github_fetch; #[derive(Deserialize, Debug)] struct ResponseBody { author: ResponseBodyAuthor, } #[derive(Deserialize, Debug)] struct ResponseBodyAuthor { login: String, } #[derive(Debug, Default)] pub struct...
rust
Apache-2.0
2019f4577cbdcd389b34973fdec3164be3af941a
2026-01-04T15:33:05.007302Z
false
yewstack/yew
https://github.com/yewstack/yew/blob/2019f4577cbdcd389b34973fdec3164be3af941a/tools/changelog/src/main.rs
tools/changelog/src/main.rs
use anyhow::Result; use changelog::Cli; use clap::Parser; fn main() -> Result<()> { Cli::parse().run() }
rust
Apache-2.0
2019f4577cbdcd389b34973fdec3164be3af941a
2026-01-04T15:33:05.007302Z
false
yewstack/yew
https://github.com/yewstack/yew/blob/2019f4577cbdcd389b34973fdec3164be3af941a/tools/changelog/src/get_latest_version.rs
tools/changelog/src/get_latest_version.rs
use anyhow::{Context, Result}; use git2::Repository; use semver::{Error, Version}; use crate::yew_package::YewPackage; pub fn get_latest_version(package: &YewPackage) -> Result<Version> { let common_tag_pattern = format!("{package}-v"); let search_pattern = format!("{common_tag_pattern}*"); let tags: Vec...
rust
Apache-2.0
2019f4577cbdcd389b34973fdec3164be3af941a
2026-01-04T15:33:05.007302Z
false
yewstack/yew
https://github.com/yewstack/yew/blob/2019f4577cbdcd389b34973fdec3164be3af941a/tools/changelog/src/yew_package.rs
tools/changelog/src/yew_package.rs
use strum::{Display, EnumString}; #[derive(Debug, Clone, EnumString, Display)] #[strum(serialize_all = "kebab-case")] pub enum YewPackage { Yew, YewAgent, YewRouter, } impl YewPackage { pub fn as_labels(&self) -> &'static [&'static str] { match self { YewPackage::Yew => &["A-yew", ...
rust
Apache-2.0
2019f4577cbdcd389b34973fdec3164be3af941a
2026-01-04T15:33:05.007302Z
false
yewstack/yew
https://github.com/yewstack/yew/blob/2019f4577cbdcd389b34973fdec3164be3af941a/tools/changelog/src/new_version_level.rs
tools/changelog/src/new_version_level.rs
use semver::Version; use strum::{Display, EnumString}; #[derive(Debug, Clone, EnumString, Display)] #[strum(serialize_all = "lowercase")] pub enum NewVersionLevel { Patch, Minor, Major, } impl NewVersionLevel { pub fn bump(&self, current_version: Version) -> Version { match self { ...
rust
Apache-2.0
2019f4577cbdcd389b34973fdec3164be3af941a
2026-01-04T15:33:05.007302Z
false
yewstack/yew
https://github.com/yewstack/yew/blob/2019f4577cbdcd389b34973fdec3164be3af941a/tools/changelog/src/write_changelog_file.rs
tools/changelog/src/write_changelog_file.rs
use std::fs; use std::fs::File; use std::io::{BufRead, BufReader, Write}; use anyhow::{Context, Result}; pub fn write_changelog(changelog_path: &str, version_changelog: &[u8]) -> Result<()> { let old_changelog = File::open(changelog_path) .context(format!("could not open {changelog_path} for reading"))?; ...
rust
Apache-2.0
2019f4577cbdcd389b34973fdec3164be3af941a
2026-01-04T15:33:05.007302Z
false
yewstack/yew
https://github.com/yewstack/yew/blob/2019f4577cbdcd389b34973fdec3164be3af941a/tools/changelog/tests/generate_yew_changelog_file.rs
tools/changelog/tests/generate_yew_changelog_file.rs
use std::fs; use std::fs::File; use std::io::{BufRead, BufReader}; use std::str::FromStr; use anyhow::Result; use changelog::new_version_level::NewVersionLevel; use changelog::yew_package::YewPackage; use changelog::Cli; use chrono::Utc; struct FileDeleteOnDrop; impl Drop for FileDeleteOnDrop { fn drop(&mut self...
rust
Apache-2.0
2019f4577cbdcd389b34973fdec3164be3af941a
2026-01-04T15:33:05.007302Z
false
yewstack/yew
https://github.com/yewstack/yew/blob/2019f4577cbdcd389b34973fdec3164be3af941a/tools/build-examples/src/lib.rs
tools/build-examples/src/lib.rs
use std::path::Path; use std::{env, fs}; use serde::Deserialize; use toml::Table; /// Examples that don't use Trunk for building pub const NO_TRUNK_EXAMPLES: [&str; 3] = ["simple_ssr", "ssr_router", "wasi_ssr_module"]; #[derive(Deserialize)] struct GitHubRelease { tag_name: String, } pub fn get_latest_wasm_opt_...
rust
Apache-2.0
2019f4577cbdcd389b34973fdec3164be3af941a
2026-01-04T15:33:05.007302Z
false
yewstack/yew
https://github.com/yewstack/yew/blob/2019f4577cbdcd389b34973fdec3164be3af941a/tools/build-examples/src/main.rs
tools/build-examples/src/main.rs
use std::path::Path; use std::process::{Command, ExitCode}; use std::{env, fs}; use build_examples::{get_latest_wasm_opt_version, is_wasm_opt_outdated, NO_TRUNK_EXAMPLES}; fn main() -> ExitCode { // Must be run from root of the repo: // yew $ cargo r -p build-examples -b build-examples let output_dir = en...
rust
Apache-2.0
2019f4577cbdcd389b34973fdec3164be3af941a
2026-01-04T15:33:05.007302Z
false
yewstack/yew
https://github.com/yewstack/yew/blob/2019f4577cbdcd389b34973fdec3164be3af941a/tools/build-examples/src/bin/update-wasm-opt.rs
tools/build-examples/src/bin/update-wasm-opt.rs
use std::fs; use std::path::{Path, PathBuf}; use std::process::ExitCode; use build_examples::{get_latest_wasm_opt_version, is_wasm_opt_outdated, NO_TRUNK_EXAMPLES}; use regex::Regex; fn main() -> ExitCode { // Must be run from root of the repo let examples_dir = Path::new("examples"); if !examples_dir.exi...
rust
Apache-2.0
2019f4577cbdcd389b34973fdec3164be3af941a
2026-01-04T15:33:05.007302Z
false
yewstack/yew
https://github.com/yewstack/yew/blob/2019f4577cbdcd389b34973fdec3164be3af941a/examples/communication_grandchild_with_grandparent/src/grandparent.rs
examples/communication_grandchild_with_grandparent/src/grandparent.rs
use super::*; pub enum Msg { ButtonClick(AttrValue), } /// Our top-level (grandparent) component that holds a reference to the shared state. pub struct GrandParent { state: Rc<AppState>, } impl Component for GrandParent { type Message = Msg; type Properties = (); fn create(ctx: &Context<Self>) ->...
rust
Apache-2.0
2019f4577cbdcd389b34973fdec3164be3af941a
2026-01-04T15:33:05.007302Z
false
yewstack/yew
https://github.com/yewstack/yew/blob/2019f4577cbdcd389b34973fdec3164be3af941a/examples/communication_grandchild_with_grandparent/src/child.rs
examples/communication_grandchild_with_grandparent/src/child.rs
use super::*; /// The `Child` component is the child of the `Parent` component, and will send and receive updates /// to/from the grandparent using the context. pub struct Child { state: Rc<AppState>, _listener: ContextHandle<Rc<AppState>>, } pub enum ChildMsg { ContextChanged(Rc<AppState>), } #[derive(C...
rust
Apache-2.0
2019f4577cbdcd389b34973fdec3164be3af941a
2026-01-04T15:33:05.007302Z
false
yewstack/yew
https://github.com/yewstack/yew/blob/2019f4577cbdcd389b34973fdec3164be3af941a/examples/communication_grandchild_with_grandparent/src/main.rs
examples/communication_grandchild_with_grandparent/src/main.rs
use std::rc::Rc; use child::Child; use grandparent::GrandParent; use parent::Parent; mod child; mod grandparent; mod parent; use yew::{ function_component, html, AttrValue, Callback, Component, Context, ContextHandle, ContextProvider, Html, Properties, }; /// This is the shared state between the parent and ...
rust
Apache-2.0
2019f4577cbdcd389b34973fdec3164be3af941a
2026-01-04T15:33:05.007302Z
false
yewstack/yew
https://github.com/yewstack/yew/blob/2019f4577cbdcd389b34973fdec3164be3af941a/examples/communication_grandchild_with_grandparent/src/parent.rs
examples/communication_grandchild_with_grandparent/src/parent.rs
use super::*; /// The `Parent` component is the parent of the `Child` component. It has no logic, and is here to /// show there is no direct relation between grandchild and grandparent. #[function_component] pub fn Parent() -> Html { html! { <div class="parent-body"> <div class="parent-tag"> ...
rust
Apache-2.0
2019f4577cbdcd389b34973fdec3164be3af941a
2026-01-04T15:33:05.007302Z
false
yewstack/yew
https://github.com/yewstack/yew/blob/2019f4577cbdcd389b34973fdec3164be3af941a/examples/inner_html/src/main.rs
examples/inner_html/src/main.rs
use yew::{Component, Context, Html}; const HTML: &str = include_str!("document.html"); pub struct App; impl Component for App { type Message = (); type Properties = (); fn create(_ctx: &Context<Self>) -> Self { Self } fn view(&self, _ctx: &Context<Self>) -> Html { Html::from_htm...
rust
Apache-2.0
2019f4577cbdcd389b34973fdec3164be3af941a
2026-01-04T15:33:05.007302Z
false
yewstack/yew
https://github.com/yewstack/yew/blob/2019f4577cbdcd389b34973fdec3164be3af941a/examples/communication_child_to_parent/src/child.rs
examples/communication_child_to_parent/src/child.rs
use super::*; /// The `Child` component is the child of the `Parent` component, and will send updates to the /// parent using a Callback. pub struct Child; #[derive(Clone, PartialEq, Properties)] pub struct ChildProps { pub name: AttrValue, pub on_clicked: Callback<AttrValue>, } impl Component for Child { ...
rust
Apache-2.0
2019f4577cbdcd389b34973fdec3164be3af941a
2026-01-04T15:33:05.007302Z
false
yewstack/yew
https://github.com/yewstack/yew/blob/2019f4577cbdcd389b34973fdec3164be3af941a/examples/communication_child_to_parent/src/main.rs
examples/communication_child_to_parent/src/main.rs
use child::Child; use parent::Parent; use yew::{html, AttrValue, Callback, Component, Context, Html, Properties}; mod child; mod parent; fn main() { yew::Renderer::<Parent>::new().render(); }
rust
Apache-2.0
2019f4577cbdcd389b34973fdec3164be3af941a
2026-01-04T15:33:05.007302Z
false
yewstack/yew
https://github.com/yewstack/yew/blob/2019f4577cbdcd389b34973fdec3164be3af941a/examples/communication_child_to_parent/src/parent.rs
examples/communication_child_to_parent/src/parent.rs
use super::*; pub enum Msg { ButtonClick(AttrValue), } /// The `Parent` component holds some state that is updated when its children are clicked pub struct Parent { /// The total number of clicks received total_clicks: u32, /// The name of the child that was last clicked last_updated: Option<AttrV...
rust
Apache-2.0
2019f4577cbdcd389b34973fdec3164be3af941a
2026-01-04T15:33:05.007302Z
false
yewstack/yew
https://github.com/yewstack/yew/blob/2019f4577cbdcd389b34973fdec3164be3af941a/examples/function_memory_game/src/state.rs
examples/function_memory_game/src/state.rs
use std::rc::Rc; use gloo::storage::{LocalStorage, Storage}; use serde::{Deserialize, Serialize}; use yew::prelude::*; use crate::constant::{CardName, Status, KEY_BEST_SCORE}; use crate::helper::shuffle_cards; #[derive(Debug, Serialize, Deserialize, Clone, PartialEq, Eq)] pub struct RawCard { pub id: String, ...
rust
Apache-2.0
2019f4577cbdcd389b34973fdec3164be3af941a
2026-01-04T15:33:05.007302Z
false
yewstack/yew
https://github.com/yewstack/yew/blob/2019f4577cbdcd389b34973fdec3164be3af941a/examples/function_memory_game/src/helper.rs
examples/function_memory_game/src/helper.rs
use nanoid::nanoid; use rand::rng; use rand::seq::SliceRandom; use crate::constant::RAW_CARDS; use crate::state::Card; pub fn shuffle_cards() -> Vec<Card> { let mut raw_cards = RAW_CARDS; raw_cards.shuffle(&mut rng()); raw_cards .iter() .map(|&p| Card { id: nanoid!(), ...
rust
Apache-2.0
2019f4577cbdcd389b34973fdec3164be3af941a
2026-01-04T15:33:05.007302Z
false
yewstack/yew
https://github.com/yewstack/yew/blob/2019f4577cbdcd389b34973fdec3164be3af941a/examples/function_memory_game/src/constant.rs
examples/function_memory_game/src/constant.rs
use serde::{Deserialize, Serialize}; use strum_macros::{Display, EnumIter}; pub const KEY_BEST_SCORE: &str = "memory.game.best.score"; #[derive(Clone, Copy, Debug, EnumIter, Display, PartialEq, Eq, Serialize, Deserialize)] pub enum CardName { EightBall, Kronos, BakedPotato, Dinosaur, Rocket, S...
rust
Apache-2.0
2019f4577cbdcd389b34973fdec3164be3af941a
2026-01-04T15:33:05.007302Z
false
yewstack/yew
https://github.com/yewstack/yew/blob/2019f4577cbdcd389b34973fdec3164be3af941a/examples/function_memory_game/src/main.rs
examples/function_memory_game/src/main.rs
mod components; mod constant; mod helper; mod state; use crate::components::app::App; fn main() { yew::Renderer::<App>::new().render(); }
rust
Apache-2.0
2019f4577cbdcd389b34973fdec3164be3af941a
2026-01-04T15:33:05.007302Z
false
yewstack/yew
https://github.com/yewstack/yew/blob/2019f4577cbdcd389b34973fdec3164be3af941a/examples/function_memory_game/src/components.rs
examples/function_memory_game/src/components.rs
pub mod app; pub mod chessboard; pub mod chessboard_card; pub mod game_status_board; pub mod score_board; pub mod score_board_best_score; pub mod score_board_logo; pub mod score_board_progress;
rust
Apache-2.0
2019f4577cbdcd389b34973fdec3164be3af941a
2026-01-04T15:33:05.007302Z
false
yewstack/yew
https://github.com/yewstack/yew/blob/2019f4577cbdcd389b34973fdec3164be3af941a/examples/function_memory_game/src/components/app.rs
examples/function_memory_game/src/components/app.rs
use std::cell::RefCell; use std::rc::Rc; use gloo::timers::callback::{Interval, Timeout}; use yew::prelude::*; use yew::{function_component, html}; use crate::components::chessboard::Chessboard; use crate::components::game_status_board::GameStatusBoard; use crate::components::score_board::ScoreBoard; use crate::const...
rust
Apache-2.0
2019f4577cbdcd389b34973fdec3164be3af941a
2026-01-04T15:33:05.007302Z
false
yewstack/yew
https://github.com/yewstack/yew/blob/2019f4577cbdcd389b34973fdec3164be3af941a/examples/function_memory_game/src/components/score_board_progress.rs
examples/function_memory_game/src/components/score_board_progress.rs
use yew::{function_component, html, Html, Properties}; #[derive(PartialEq, Eq, Properties, Clone)] pub struct Props { pub unresolved_card_pairs: u8, } #[function_component] pub fn GameProgress(props: &Props) -> Html { html! { <div class="game-progress"> <span>{"Cards not Matched"}</span> ...
rust
Apache-2.0
2019f4577cbdcd389b34973fdec3164be3af941a
2026-01-04T15:33:05.007302Z
false
yewstack/yew
https://github.com/yewstack/yew/blob/2019f4577cbdcd389b34973fdec3164be3af941a/examples/function_memory_game/src/components/score_board_best_score.rs
examples/function_memory_game/src/components/score_board_best_score.rs
use yew::{function_component, html, Html, Properties}; #[derive(PartialEq, Eq, Properties, Clone)] pub struct Props { pub best_score: u32, } #[function_component] pub fn BestScore(props: &Props) -> Html { html! { <div class="best-score"> <span>{"Highest Record"}</span> <h2>{ pr...
rust
Apache-2.0
2019f4577cbdcd389b34973fdec3164be3af941a
2026-01-04T15:33:05.007302Z
false
yewstack/yew
https://github.com/yewstack/yew/blob/2019f4577cbdcd389b34973fdec3164be3af941a/examples/function_memory_game/src/components/score_board.rs
examples/function_memory_game/src/components/score_board.rs
use yew::{function_component, html, Html, Properties}; use crate::components::score_board_best_score::BestScore; use crate::components::score_board_logo::Logo; use crate::components::score_board_progress::GameProgress; #[derive(PartialEq, Properties, Clone, Eq)] pub struct Props { pub unresolved_card_pairs: u8, ...
rust
Apache-2.0
2019f4577cbdcd389b34973fdec3164be3af941a
2026-01-04T15:33:05.007302Z
false
yewstack/yew
https://github.com/yewstack/yew/blob/2019f4577cbdcd389b34973fdec3164be3af941a/examples/function_memory_game/src/components/chessboard.rs
examples/function_memory_game/src/components/chessboard.rs
use yew::prelude::*; use yew::{function_component, html, Properties}; use crate::components::chessboard_card::ChessboardCard; use crate::state::{Card, RawCard}; #[derive(Properties, Clone, PartialEq)] pub struct Props { pub cards: Vec<Card>, pub on_flip: Callback<RawCard>, } #[function_component] pub fn Chess...
rust
Apache-2.0
2019f4577cbdcd389b34973fdec3164be3af941a
2026-01-04T15:33:05.007302Z
false
yewstack/yew
https://github.com/yewstack/yew/blob/2019f4577cbdcd389b34973fdec3164be3af941a/examples/function_memory_game/src/components/score_board_logo.rs
examples/function_memory_game/src/components/score_board_logo.rs
use yew::{function_component, html, Html}; #[function_component] pub fn Logo() -> Html { html! { <h1 class="logo"> <a href="https://examples.yew.rs/function_memory_game" target="_blank">{"Memory"}</a> </h1> } }
rust
Apache-2.0
2019f4577cbdcd389b34973fdec3164be3af941a
2026-01-04T15:33:05.007302Z
false
yewstack/yew
https://github.com/yewstack/yew/blob/2019f4577cbdcd389b34973fdec3164be3af941a/examples/function_memory_game/src/components/chessboard_card.rs
examples/function_memory_game/src/components/chessboard_card.rs
use web_sys::MouseEvent; use yew::prelude::*; use yew::{function_component, html, Html, Properties}; use crate::constant::CardName; use crate::state::{Card, RawCard}; #[derive(Properties, Clone, PartialEq)] pub struct Props { pub card: Card, pub on_flip: Callback<RawCard>, } #[function_component] pub fn Ches...
rust
Apache-2.0
2019f4577cbdcd389b34973fdec3164be3af941a
2026-01-04T15:33:05.007302Z
false
yewstack/yew
https://github.com/yewstack/yew/blob/2019f4577cbdcd389b34973fdec3164be3af941a/examples/function_memory_game/src/components/game_status_board.rs
examples/function_memory_game/src/components/game_status_board.rs
use yew::prelude::*; use yew::{function_component, html, Properties}; use crate::constant::Status; #[derive(Properties, Clone, PartialEq)] pub struct Props { pub status: Status, pub sec_past: u32, pub on_reset: Callback<()>, } #[function_component] pub fn GameStatusBoard(props: &Props) -> Html { let ...
rust
Apache-2.0
2019f4577cbdcd389b34973fdec3164be3af941a
2026-01-04T15:33:05.007302Z
false
yewstack/yew
https://github.com/yewstack/yew/blob/2019f4577cbdcd389b34973fdec3164be3af941a/examples/web_worker_fib/src/lib.rs
examples/web_worker_fib/src/lib.rs
#![recursion_limit = "1024"] #![allow(clippy::large_enum_variant)] pub mod agent; use web_sys::HtmlInputElement; use yew::platform::spawn_local; use yew::prelude::*; use yew_agent::oneshot::{use_oneshot_runner, OneshotProvider}; use crate::agent::{FibonacciTask, Postcard}; #[function_component] fn Main() -> Html { ...
rust
Apache-2.0
2019f4577cbdcd389b34973fdec3164be3af941a
2026-01-04T15:33:05.007302Z
false
yewstack/yew
https://github.com/yewstack/yew/blob/2019f4577cbdcd389b34973fdec3164be3af941a/examples/web_worker_fib/src/agent.rs
examples/web_worker_fib/src/agent.rs
use js_sys::Uint8Array; use serde::{Deserialize, Serialize}; use wasm_bindgen::JsValue; use yew_agent::prelude::*; use yew_agent::Codec; /// Example to use a custom codec. pub struct Postcard; impl Codec for Postcard { fn encode<I>(input: I) -> JsValue where I: Serialize, { let buf = postc...
rust
Apache-2.0
2019f4577cbdcd389b34973fdec3164be3af941a
2026-01-04T15:33:05.007302Z
false
yewstack/yew
https://github.com/yewstack/yew/blob/2019f4577cbdcd389b34973fdec3164be3af941a/examples/web_worker_fib/src/bin/app.rs
examples/web_worker_fib/src/bin/app.rs
fn main() { yew::Renderer::<yew_worker_fib::App>::new().render(); }
rust
Apache-2.0
2019f4577cbdcd389b34973fdec3164be3af941a
2026-01-04T15:33:05.007302Z
false