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
cambrian/accumulator
https://github.com/cambrian/accumulator/blob/8f460270c274a4a65d777378a587be6dbc986c18/benches/group/class.rs
benches/group/class.rs
/// See https://bheisler.github.io/criterion.rs/book/getting_started.html to add more benchmarks. #[macro_use] extern crate criterion; use accumulator::group::{ClassGroup, ElemFrom, Group, UnknownOrderGroup}; use criterion::Criterion; use rug::Integer; use std::str::FromStr; fn criterion_benchmark(c: &mut Criterion) ...
rust
MIT
8f460270c274a4a65d777378a587be6dbc986c18
2026-01-04T20:15:46.214781Z
false
cambrian/accumulator
https://github.com/cambrian/accumulator/blob/8f460270c274a4a65d777378a587be6dbc986c18/benches/group/rsa.rs
benches/group/rsa.rs
/// See https://bheisler.github.io/criterion.rs/book/getting_started.html to add more benchmarks. #[macro_use] extern crate criterion; use criterion::Criterion; use accumulator::group::{ElemFrom, Group, Rsa2048}; use rug::Integer; use std::str::FromStr; fn bench_op<G: Group + ElemFrom<Integer>>() { G::op( &G::e...
rust
MIT
8f460270c274a4a65d777378a587be6dbc986c18
2026-01-04T20:15:46.214781Z
false
cambrian/accumulator
https://github.com/cambrian/accumulator/blob/8f460270c274a4a65d777378a587be6dbc986c18/benches/proof/poke2.rs
benches/proof/poke2.rs
/// See https://bheisler.github.io/criterion.rs/book/getting_started.html to add more benchmarks. #[macro_use] extern crate criterion; use accumulator::group::Rsa2048; use accumulator::group::{ElemFrom, UnknownOrderGroup}; use accumulator::proof::Poke2; use accumulator::util::int; use criterion::Criterion; fn bench_p...
rust
MIT
8f460270c274a4a65d777378a587be6dbc986c18
2026-01-04T20:15:46.214781Z
false
cambrian/accumulator
https://github.com/cambrian/accumulator/blob/8f460270c274a4a65d777378a587be6dbc986c18/benches/proof/poe.rs
benches/proof/poe.rs
/// See https://bheisler.github.io/criterion.rs/book/getting_started.html to add more benchmarks. #[macro_use] extern crate criterion; use criterion::Criterion; use accumulator::group::{ElemFrom, Rsa2048, UnknownOrderGroup}; use accumulator::proof::Poe; use accumulator::util::int; fn bench_poe_rsa() { let base = Rs...
rust
MIT
8f460270c274a4a65d777378a587be6dbc986c18
2026-01-04T20:15:46.214781Z
false
cambrian/accumulator
https://github.com/cambrian/accumulator/blob/8f460270c274a4a65d777378a587be6dbc986c18/benches/proof/pokcr.rs
benches/proof/pokcr.rs
/// See https://bheisler.github.io/criterion.rs/book/getting_started.html to add more benchmarks. #[macro_use] extern crate criterion; use accumulator::group::{ElemFrom, Rsa2048}; use accumulator::proof::Pokcr; use accumulator::util::int; use criterion::Criterion; fn bench_pokcr_rsa() { let witnesses = [Rsa2048::el...
rust
MIT
8f460270c274a4a65d777378a587be6dbc986c18
2026-01-04T20:15:46.214781Z
false
jice-nospam/wgen
https://github.com/jice-nospam/wgen/blob/1c28d7c19c374683f31c91010c03549bc33b0852/src/panel_generator.rs
src/panel_generator.rs
use eframe::egui::{self, CursorIcon, Id, LayerId, Order, Sense}; use epaint::Color32; use serde::{Deserialize, Serialize}; use std::{ fs::File, io::{Read, Write}, }; use crate::{ generators::{ render_fbm, render_hills, render_island, render_landmass, render_mid_point, render_mudslide, rende...
rust
MIT
1c28d7c19c374683f31c91010c03549bc33b0852
2026-01-04T20:17:25.799607Z
false
jice-nospam/wgen
https://github.com/jice-nospam/wgen/blob/1c28d7c19c374683f31c91010c03549bc33b0852/src/exporter.rs
src/exporter.rs
use std::{path::Path, sync::mpsc::Sender}; use crate::{ panel_export::{ExportFileType, PanelExport}, worldgen::{Step, WorldGenerator}, ThreadMessage, }; pub fn export_heightmap( // random number generator's seed to use seed: u64, // list of generator steps with their configuration and optional...
rust
MIT
1c28d7c19c374683f31c91010c03549bc33b0852
2026-01-04T20:17:25.799607Z
false
jice-nospam/wgen
https://github.com/jice-nospam/wgen/blob/1c28d7c19c374683f31c91010c03549bc33b0852/src/panel_maskedit.rs
src/panel_maskedit.rs
use eframe::{ egui::{self, PointerButton}, emath, }; use epaint::{Color32, ColorImage, Pos2, Rect}; use three_d::{ vec3, Blend, Camera, ColorMaterial, CpuMaterial, CpuMesh, CpuTexture, Cull, DepthTest, Gm, Indices, Mat4, Mesh, Object, Positions, Srgba, TextureData, Viewport, }; use crate::{panel_2dview...
rust
MIT
1c28d7c19c374683f31c91010c03549bc33b0852
2026-01-04T20:17:25.799607Z
false
jice-nospam/wgen
https://github.com/jice-nospam/wgen/blob/1c28d7c19c374683f31c91010c03549bc33b0852/src/fps.rs
src/fps.rs
use std::time::{Duration, Instant}; pub struct FpsCounter { last: Instant, fps_counter: usize, fps: usize, } impl Default for FpsCounter { fn default() -> Self { Self { last: Instant::now(), fps_counter: 0, fps: 0, } } } impl FpsCounter { pu...
rust
MIT
1c28d7c19c374683f31c91010c03549bc33b0852
2026-01-04T20:17:25.799607Z
false
jice-nospam/wgen
https://github.com/jice-nospam/wgen/blob/1c28d7c19c374683f31c91010c03549bc33b0852/src/panel_3dview.rs
src/panel_3dview.rs
use eframe::egui::{self, PointerButton}; use image::EncodableLayout; use three_d::{ core::prelude::Srgba, degrees, radians, vec2, vec3, AmbientLight, Camera, ClearState, CpuMaterial, CpuMesh, CpuTexture, Cull, DirectionalLight, Gm, Indices, InnerSpace, Mat3, Mat4, Mesh, PhysicalMaterial, Positions, TextureD...
rust
MIT
1c28d7c19c374683f31c91010c03549bc33b0852
2026-01-04T20:17:25.799607Z
false
jice-nospam/wgen
https://github.com/jice-nospam/wgen/blob/1c28d7c19c374683f31c91010c03549bc33b0852/src/panel_2dview.rs
src/panel_2dview.rs
use eframe::egui; use egui_extras::RetainedImage; use epaint::{Color32, ColorImage}; use crate::{fps::FpsCounter, panel_maskedit::PanelMaskEdit, worldgen::ExportMap}; pub enum Panel2dAction { /// inform the main program that the preview size has changed. terrain/3d view must be recomputed ResizePreview(usize)...
rust
MIT
1c28d7c19c374683f31c91010c03549bc33b0852
2026-01-04T20:17:25.799607Z
false
jice-nospam/wgen
https://github.com/jice-nospam/wgen/blob/1c28d7c19c374683f31c91010c03549bc33b0852/src/main.rs
src/main.rs
extern crate exr; extern crate image; extern crate noise; extern crate rand; mod exporter; mod fps; mod generators; mod panel_2dview; mod panel_3dview; mod panel_export; mod panel_generator; mod panel_maskedit; mod panel_save; mod worldgen; use eframe::egui::{self, Visuals}; use epaint::emath; use exporter::export_he...
rust
MIT
1c28d7c19c374683f31c91010c03549bc33b0852
2026-01-04T20:17:25.799607Z
false
jice-nospam/wgen
https://github.com/jice-nospam/wgen/blob/1c28d7c19c374683f31c91010c03549bc33b0852/src/panel_export.rs
src/panel_export.rs
use std::path::PathBuf; use eframe::egui; pub const TEXTEDIT_WIDTH: f32 = 240.0; #[derive(Clone)] pub enum ExportFileType { PNG, EXR, } impl std::fmt::Display for ExportFileType { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { write!( f, "{}", ...
rust
MIT
1c28d7c19c374683f31c91010c03549bc33b0852
2026-01-04T20:17:25.799607Z
false
jice-nospam/wgen
https://github.com/jice-nospam/wgen/blob/1c28d7c19c374683f31c91010c03549bc33b0852/src/worldgen.rs
src/worldgen.rs
use std::sync::mpsc::Sender; use std::time::Instant; use std::{fmt::Display, sync::mpsc::Receiver}; use serde::{Deserialize, Serialize}; use crate::generators::{ gen_fbm, gen_hills, gen_island, gen_landmass, gen_mid_point, gen_mudslide, gen_normalize, gen_water_erosion, get_min_max, FbmConf, HillsConf, Island...
rust
MIT
1c28d7c19c374683f31c91010c03549bc33b0852
2026-01-04T20:17:25.799607Z
false
jice-nospam/wgen
https://github.com/jice-nospam/wgen/blob/1c28d7c19c374683f31c91010c03549bc33b0852/src/panel_save.rs
src/panel_save.rs
use std::path::PathBuf; use eframe::egui; use crate::panel_export::TEXTEDIT_WIDTH; pub struct PanelSaveLoad { /// the name of the file to load or save pub file_path: String, /// the program's current directory cur_dir: PathBuf, } pub enum SaveLoadAction { Save, Load, } impl Default for Panel...
rust
MIT
1c28d7c19c374683f31c91010c03549bc33b0852
2026-01-04T20:17:25.799607Z
false
jice-nospam/wgen
https://github.com/jice-nospam/wgen/blob/1c28d7c19c374683f31c91010c03549bc33b0852/src/generators/mid_point.rs
src/generators/mid_point.rs
use std::sync::mpsc::Sender; use eframe::egui; use rand::{rngs::StdRng, Rng, SeedableRng}; use serde::{Deserialize, Serialize}; use crate::ThreadMessage; use super::report_progress; #[derive(Debug, PartialEq, Clone, Serialize, Deserialize)] pub struct MidPointConf { pub roughness: f32, } impl Default for MidPo...
rust
MIT
1c28d7c19c374683f31c91010c03549bc33b0852
2026-01-04T20:17:25.799607Z
false
jice-nospam/wgen
https://github.com/jice-nospam/wgen/blob/1c28d7c19c374683f31c91010c03549bc33b0852/src/generators/water_erosion.rs
src/generators/water_erosion.rs
use std::sync::mpsc::Sender; use eframe::egui; use rand::{rngs::StdRng, Rng, SeedableRng}; use serde::{Deserialize, Serialize}; use crate::ThreadMessage; use super::report_progress; // water erosion algorithm adapted from https://www.firespark.de/resources/downloads/implementation%20of%20a%20methode%20for%20hydraul...
rust
MIT
1c28d7c19c374683f31c91010c03549bc33b0852
2026-01-04T20:17:25.799607Z
false
jice-nospam/wgen
https://github.com/jice-nospam/wgen/blob/1c28d7c19c374683f31c91010c03549bc33b0852/src/generators/landmass.rs
src/generators/landmass.rs
use std::sync::mpsc::Sender; use eframe::egui; use serde::{Deserialize, Serialize}; use crate::ThreadMessage; use super::{normalize, report_progress}; #[derive(Debug, PartialEq, Clone, Serialize, Deserialize)] pub struct LandMassConf { /// what proportion of the map should be above water 0.0-1.0 pub land_pr...
rust
MIT
1c28d7c19c374683f31c91010c03549bc33b0852
2026-01-04T20:17:25.799607Z
false
jice-nospam/wgen
https://github.com/jice-nospam/wgen/blob/1c28d7c19c374683f31c91010c03549bc33b0852/src/generators/island.rs
src/generators/island.rs
use std::sync::mpsc::Sender; use eframe::egui; use serde::{Deserialize, Serialize}; use crate::ThreadMessage; use super::{get_min_max, report_progress}; #[derive(Debug, PartialEq, Clone, Serialize, Deserialize)] pub struct IslandConf { pub coast_range: f32, } impl Default for IslandConf { fn default() -> S...
rust
MIT
1c28d7c19c374683f31c91010c03549bc33b0852
2026-01-04T20:17:25.799607Z
false
jice-nospam/wgen
https://github.com/jice-nospam/wgen/blob/1c28d7c19c374683f31c91010c03549bc33b0852/src/generators/mod.rs
src/generators/mod.rs
mod fbm; mod hills; mod island; mod landmass; mod mid_point; mod mudslide; mod normalize; mod water_erosion; use std::sync::mpsc::Sender; pub use fbm::{gen_fbm, render_fbm, FbmConf}; pub use hills::{gen_hills, render_hills, HillsConf}; pub use island::{gen_island, render_island, IslandConf}; pub use landmass::{gen_la...
rust
MIT
1c28d7c19c374683f31c91010c03549bc33b0852
2026-01-04T20:17:25.799607Z
false
jice-nospam/wgen
https://github.com/jice-nospam/wgen/blob/1c28d7c19c374683f31c91010c03549bc33b0852/src/generators/hills.rs
src/generators/hills.rs
use std::sync::mpsc::Sender; use eframe::egui; use rand::{prelude::*, rngs::StdRng}; use serde::{Deserialize, Serialize}; use crate::ThreadMessage; use super::report_progress; #[derive(Debug, PartialEq, Clone, Serialize, Deserialize)] pub struct HillsConf { pub nb_hill: usize, pub base_radius: f32, pub ...
rust
MIT
1c28d7c19c374683f31c91010c03549bc33b0852
2026-01-04T20:17:25.799607Z
false
jice-nospam/wgen
https://github.com/jice-nospam/wgen/blob/1c28d7c19c374683f31c91010c03549bc33b0852/src/generators/mudslide.rs
src/generators/mudslide.rs
use std::sync::mpsc::Sender; use eframe::egui; use serde::{Deserialize, Serialize}; use crate::ThreadMessage; use super::{report_progress, vec_get_safe, DIRX, DIRY}; #[derive(Debug, PartialEq, Clone, Serialize, Deserialize)] pub struct MudSlideConf { iterations: f32, max_erosion_alt: f32, strength: f32,...
rust
MIT
1c28d7c19c374683f31c91010c03549bc33b0852
2026-01-04T20:17:25.799607Z
false
jice-nospam/wgen
https://github.com/jice-nospam/wgen/blob/1c28d7c19c374683f31c91010c03549bc33b0852/src/generators/normalize.rs
src/generators/normalize.rs
use serde::{Deserialize, Serialize}; use super::normalize; #[derive(Debug, PartialEq, Clone, Serialize, Deserialize)] pub struct NormalizeConf { pub min: f32, pub max: f32, } impl Default for NormalizeConf { fn default() -> Self { Self { min: 0.0, max: 1.0 } } } pub fn gen_normalize(hmap: &m...
rust
MIT
1c28d7c19c374683f31c91010c03549bc33b0852
2026-01-04T20:17:25.799607Z
false
jice-nospam/wgen
https://github.com/jice-nospam/wgen/blob/1c28d7c19c374683f31c91010c03549bc33b0852/src/generators/fbm.rs
src/generators/fbm.rs
use std::sync::mpsc::Sender; use eframe::egui; use noise::{Fbm, MultiFractal, NoiseFn, Perlin}; use serde::{Deserialize, Serialize}; use crate::ThreadMessage; use super::report_progress; #[derive(Debug, PartialEq, Clone, Serialize, Deserialize)] pub struct FbmConf { pub mulx: f32, pub muly: f32, pub add...
rust
MIT
1c28d7c19c374683f31c91010c03549bc33b0852
2026-01-04T20:17:25.799607Z
false
the-lean-crate/criner
https://github.com/the-lean-crate/criner/blob/a075e734dede8e1de5fe1652ec86f42da0162c41/src/lib.rs
src/lib.rs
use std::ops::Add; mod args; pub mod error; pub use args::*; pub fn run_blocking(args: Args) -> criner::error::Result<()> { use SubCommands::*; let cmd = args.sub.unwrap_or_default(); match cmd { #[cfg(feature = "migration")] Migrate => criner::migration::migrate("./criner.db"), Ex...
rust
MIT
a075e734dede8e1de5fe1652ec86f42da0162c41
2026-01-04T20:17:28.169370Z
false
the-lean-crate/criner
https://github.com/the-lean-crate/criner/blob/a075e734dede8e1de5fe1652ec86f42da0162c41/src/args.rs
src/args.rs
use std::path::PathBuf; fn parse_local_time(src: &str) -> Result<time::Time, time::error::Parse> { time::Time::parse( src, &time::macros::format_description!("[hour repr:24 padding:none]:[minute padding:zero]"), ) } #[derive(Debug, clap::Parser)] #[clap(about = "Interact with crates.io from th...
rust
MIT
a075e734dede8e1de5fe1652ec86f42da0162c41
2026-01-04T20:17:28.169370Z
false
the-lean-crate/criner
https://github.com/the-lean-crate/criner/blob/a075e734dede8e1de5fe1652ec86f42da0162c41/src/error.rs
src/error.rs
use std::{error::Error, fmt, process}; struct WithCauses<'a>(&'a dyn Error); impl<'a> fmt::Display for WithCauses<'a> { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { write!(f, "ERROR: {}", self.0)?; let mut cursor = self.0; while let Some(err) = cursor.source() { write...
rust
MIT
a075e734dede8e1de5fe1652ec86f42da0162c41
2026-01-04T20:17:28.169370Z
false
the-lean-crate/criner
https://github.com/the-lean-crate/criner/blob/a075e734dede8e1de5fe1652ec86f42da0162c41/src/main.rs
src/main.rs
use clap::Parser; fn main() -> criner::error::Result<()> { let args = criner_cli::Args::parse(); if let Some(criner_cli::SubCommands::Mine { no_gui, .. }) = args.sub { if no_gui { env_logger::init_from_env(env_logger::Env::default().default_filter_or("info")); } } else { ...
rust
MIT
a075e734dede8e1de5fe1652ec86f42da0162c41
2026-01-04T20:17:28.169370Z
false
the-lean-crate/criner
https://github.com/the-lean-crate/criner/blob/a075e734dede8e1de5fe1652ec86f42da0162c41/criner/src/lib.rs
criner/src/lib.rs
#![allow(clippy::unneeded_field_pattern)] #![deny(unsafe_code)] #[macro_use] extern crate lazy_static; #[macro_use] extern crate quick_error; #[cfg(feature = "migration")] pub mod migration; pub mod error; pub use error::{Error, Result}; pub mod export; pub(crate) mod model; pub(crate) mod persistence; pub(crate) ...
rust
MIT
a075e734dede8e1de5fe1652ec86f42da0162c41
2026-01-04T20:17:28.169370Z
false
the-lean-crate/criner
https://github.com/the-lean-crate/criner/blob/a075e734dede8e1de5fe1652ec86f42da0162c41/criner/src/spawn.rs
criner/src/spawn.rs
// Copied and adapted from https://github.com/smol-rs/smol/blob/15447d6859df65fd1992f761ee46067bed62f8a5/src/spawn.rs use std::future::Future; use std::panic::catch_unwind; use std::thread; use async_executor::Executor; pub use async_executor::Task; use futures_lite::future; use once_cell::sync::Lazy; pub fn spawn<T:...
rust
MIT
a075e734dede8e1de5fe1652ec86f42da0162c41
2026-01-04T20:17:28.169370Z
false
the-lean-crate/criner
https://github.com/the-lean-crate/criner/blob/a075e734dede8e1de5fe1652ec86f42da0162c41/criner/src/error.rs
criner/src/error.rs
use std::{fmt, time}; #[derive(Debug)] pub struct FormatDeadline(pub time::SystemTime); impl fmt::Display for FormatDeadline { fn fmt(&self, f: &mut fmt::Formatter<'_>) -> std::result::Result<(), fmt::Error> { let now = time::SystemTime::now(); write!( f, "{} ago at {}", ...
rust
MIT
a075e734dede8e1de5fe1652ec86f42da0162c41
2026-01-04T20:17:28.169370Z
false
the-lean-crate/criner
https://github.com/the-lean-crate/criner/blob/a075e734dede8e1de5fe1652ec86f42da0162c41/criner/src/utils.rs
criner/src/utils.rs
use crate::error::{Error, FormatDeadline, Result}; use async_io::Timer; use dia_semver::Semver; use futures_util::{ future::{self, Either}, FutureExt, }; use std::{ convert::TryInto, future::Future, time::{Duration, SystemTime}, }; pub fn parse_semver(version: &str) -> Semver { use std::str::Fr...
rust
MIT
a075e734dede8e1de5fe1652ec86f42da0162c41
2026-01-04T20:17:28.169370Z
false
the-lean-crate/criner
https://github.com/the-lean-crate/criner/blob/a075e734dede8e1de5fe1652ec86f42da0162c41/criner/src/model.rs
criner/src/model.rs
pub use crate::engine::report::waste::TarHeader; use serde_derive::{Deserialize, Serialize}; use std::convert::TryFrom; use std::{collections::HashMap, ops::Add, time::Duration, time::SystemTime}; /// Represents a top-level crate and associated information #[derive(Serialize, Deserialize, Default, Clone)] pub struct C...
rust
MIT
a075e734dede8e1de5fe1652ec86f42da0162c41
2026-01-04T20:17:28.169370Z
false
the-lean-crate/criner
https://github.com/the-lean-crate/criner/blob/a075e734dede8e1de5fe1652ec86f42da0162c41/criner/src/migration.rs
criner/src/migration.rs
use crate::persistence::{TableAccess, TaskResultTable}; use rusqlite::params; use std::path::Path; pub fn migrate(db_path: impl AsRef<Path>) -> crate::Result<()> { log::info!("open db"); let db = crate::persistence::Db::open(&db_path)?; let mut connection = db.open_connection_no_async_with_busy_wait()?; ...
rust
MIT
a075e734dede8e1de5fe1652ec86f42da0162c41
2026-01-04T20:17:28.169370Z
false
the-lean-crate/criner
https://github.com/the-lean-crate/criner/blob/a075e734dede8e1de5fe1652ec86f42da0162c41/criner/src/persistence/merge.rs
criner/src/persistence/merge.rs
use crate::model::{self, Context, CrateVersion, Task}; use crate::utils::parse_semver; pub trait Merge<T> { fn merge(self, other: &T) -> Self; } impl Merge<model::Task> for model::Task { fn merge(mut self, other: &Task) -> Self { let my_state = self.state; self = other.clone(); self.st...
rust
MIT
a075e734dede8e1de5fe1652ec86f42da0162c41
2026-01-04T20:17:28.169370Z
false
the-lean-crate/criner
https://github.com/the-lean-crate/criner/blob/a075e734dede8e1de5fe1652ec86f42da0162c41/criner/src/persistence/serde.rs
criner/src/persistence/serde.rs
use crate::model::{db_dump, Context, Crate, CrateVersion, ReportResult, Task, TaskResult}; fn expect<T, E: std::fmt::Display>(r: std::result::Result<T, E>, panic_message: impl FnOnce(E) -> String) -> T { match r { Ok(v) => v, Err(e) => std::panic::panic_any(panic_message(e)), } } macro_rules! ...
rust
MIT
a075e734dede8e1de5fe1652ec86f42da0162c41
2026-01-04T20:17:28.169370Z
false
the-lean-crate/criner
https://github.com/the-lean-crate/criner/blob/a075e734dede8e1de5fe1652ec86f42da0162c41/criner/src/persistence/table.rs
criner/src/persistence/table.rs
use crate::persistence::KEY_SEP_CHAR; use crate::{ model::{Context, Crate, TaskResult}, model::{CrateVersion, Task}, persistence::{merge::Merge, Keyed}, Result, }; use rusqlite::{params, OptionalExtension}; use std::time::{Duration, SystemTime}; /// Required as we send futures to threads. The type syst...
rust
MIT
a075e734dede8e1de5fe1652ec86f42da0162c41
2026-01-04T20:17:28.169370Z
false
the-lean-crate/criner
https://github.com/the-lean-crate/criner/blob/a075e734dede8e1de5fe1652ec86f42da0162c41/criner/src/persistence/keyed.rs
criner/src/persistence/keyed.rs
use crate::model::{Context, Crate, CrateVersion, Task, TaskResult}; use std::time::SystemTime; pub const KEY_SEP_CHAR: char = ':'; pub trait Keyed { fn key_buf(&self, buf: &mut String); fn key(&self) -> String { let mut buf = String::with_capacity(16); self.key_buf(&mut buf); buf }...
rust
MIT
a075e734dede8e1de5fe1652ec86f42da0162c41
2026-01-04T20:17:28.169370Z
false
the-lean-crate/criner
https://github.com/the-lean-crate/criner/blob/a075e734dede8e1de5fe1652ec86f42da0162c41/criner/src/persistence/mod.rs
criner/src/persistence/mod.rs
use crate::Result; use std::path::{Path, PathBuf}; mod keyed; mod merge; pub use keyed::*; mod serde; mod table; pub use table::*; #[derive(Clone)] pub struct Db { sqlite_path: PathBuf, } impl Db { pub fn open(path: impl AsRef<Path>) -> Result<Db> { std::fs::create_dir_all(&path)?; let sqlit...
rust
MIT
a075e734dede8e1de5fe1652ec86f42da0162c41
2026-01-04T20:17:28.169370Z
false
the-lean-crate/criner
https://github.com/the-lean-crate/criner/blob/a075e734dede8e1de5fe1652ec86f42da0162c41/criner/src/export/mod.rs
criner/src/export/mod.rs
mod run; mod to_sql; pub use run::run_blocking;
rust
MIT
a075e734dede8e1de5fe1652ec86f42da0162c41
2026-01-04T20:17:28.169370Z
false
the-lean-crate/criner
https://github.com/the-lean-crate/criner/blob/a075e734dede8e1de5fe1652ec86f42da0162c41/criner/src/export/run.rs
criner/src/export/run.rs
use super::to_sql::SqlConvert; use crate::model; use rusqlite::Connection; use std::path::Path; pub fn run_blocking(source_db: impl AsRef<Path>, destination_db: impl AsRef<Path>) -> crate::Result<()> { if destination_db.as_ref().is_file() { return Err(crate::Error::Message(format!( "Destination...
rust
MIT
a075e734dede8e1de5fe1652ec86f42da0162c41
2026-01-04T20:17:28.169370Z
false
the-lean-crate/criner
https://github.com/the-lean-crate/criner/blob/a075e734dede8e1de5fe1652ec86f42da0162c41/criner/src/export/to_sql/krate.rs
criner/src/export/to_sql/krate.rs
use crate::{export::to_sql::SqlConvert, model}; use rusqlite::{params, Statement}; impl SqlConvert for model::Crate { fn replace_statement() -> &'static str { "REPLACE INTO crate (name, version) VALUES (?1, ?2)" } fn source_table_name() -> &'static str { "cr...
rust
MIT
a075e734dede8e1de5fe1652ec86f42da0162c41
2026-01-04T20:17:28.169370Z
false
the-lean-crate/criner
https://github.com/the-lean-crate/criner/blob/a075e734dede8e1de5fe1652ec86f42da0162c41/criner/src/export/to_sql/dbdump_crate.rs
criner/src/export/to_sql/dbdump_crate.rs
use crate::{ export::to_sql::{to_seconds_since_epoch, SqlConvert}, model, }; use rusqlite::{params, Statement}; impl SqlConvert for model::db_dump::Crate { fn replace_statement() -> &'static str { "will not be called" } fn source_table_name() -> &'static str { "crates.io-crate" ...
rust
MIT
a075e734dede8e1de5fe1652ec86f42da0162c41
2026-01-04T20:17:28.169370Z
false
the-lean-crate/criner
https://github.com/the-lean-crate/criner/blob/a075e734dede8e1de5fe1652ec86f42da0162c41/criner/src/export/to_sql/krate_version.rs
criner/src/export/to_sql/krate_version.rs
use crate::{export::to_sql::SqlConvert, model}; use rusqlite::{params, Statement}; impl SqlConvert for model::CrateVersion { fn replace_statement() -> &'static str { "REPLACE INTO crate_version (id, name, version, kind, checksum, features) VALUES (?1, ?2 , ?3 , ?4 , ?5 ...
rust
MIT
a075e734dede8e1de5fe1652ec86f42da0162c41
2026-01-04T20:17:28.169370Z
false
the-lean-crate/criner
https://github.com/the-lean-crate/criner/blob/a075e734dede8e1de5fe1652ec86f42da0162c41/criner/src/export/to_sql/result.rs
criner/src/export/to_sql/result.rs
use crate::export::to_sql::SqlConvert; use crate::model; use rusqlite::{params, Statement}; impl SqlConvert for model::TaskResult { fn convert_to_sql( istm: &mut rusqlite::Statement, transaction: &rusqlite::Transaction, ) -> Option<crate::Result<usize>> { let res = (|| { let...
rust
MIT
a075e734dede8e1de5fe1652ec86f42da0162c41
2026-01-04T20:17:28.169370Z
false
the-lean-crate/criner
https://github.com/the-lean-crate/criner/blob/a075e734dede8e1de5fe1652ec86f42da0162c41/criner/src/export/to_sql/mod.rs
criner/src/export/to_sql/mod.rs
mod dbdump_crate; mod krate; mod krate_version; mod meta; mod result; mod task; pub fn to_seconds_since_epoch(time: std::time::SystemTime) -> i64 { time.duration_since(std::time::UNIX_EPOCH).unwrap().as_secs() as i64 } pub trait SqlConvert { fn convert_to_sql( _input_statement: &mut rusqlite::Statemen...
rust
MIT
a075e734dede8e1de5fe1652ec86f42da0162c41
2026-01-04T20:17:28.169370Z
false
the-lean-crate/criner
https://github.com/the-lean-crate/criner/blob/a075e734dede8e1de5fe1652ec86f42da0162c41/criner/src/export/to_sql/meta.rs
criner/src/export/to_sql/meta.rs
use crate::export::to_sql::SqlConvert; use crate::model; use rusqlite::{params, Statement}; impl SqlConvert for model::Context { fn replace_statement() -> &'static str { "INSERT INTO runtime_statistic (sample_day, num_new_crate_versions, num_new_crates, dur_s_fetch_new_crate_versions) ...
rust
MIT
a075e734dede8e1de5fe1652ec86f42da0162c41
2026-01-04T20:17:28.169370Z
false
the-lean-crate/criner
https://github.com/the-lean-crate/criner/blob/a075e734dede8e1de5fe1652ec86f42da0162c41/criner/src/export/to_sql/task.rs
criner/src/export/to_sql/task.rs
use crate::{ export::to_sql::{to_seconds_since_epoch, SqlConvert}, model, }; use rusqlite::{params, Statement}; impl SqlConvert for model::Task { fn replace_statement() -> &'static str { "REPLACE INTO task (id, key, process, version, stored_at, state) VALUES (?1, ?2, ...
rust
MIT
a075e734dede8e1de5fe1652ec86f42da0162c41
2026-01-04T20:17:28.169370Z
false
the-lean-crate/criner
https://github.com/the-lean-crate/criner/blob/a075e734dede8e1de5fe1652ec86f42da0162c41/criner/src/engine/mod.rs
criner/src/engine/mod.rs
pub mod report; pub mod stage; pub mod work; pub mod run;
rust
MIT
a075e734dede8e1de5fe1652ec86f42da0162c41
2026-01-04T20:17:28.169370Z
false
the-lean-crate/criner
https://github.com/the-lean-crate/criner/blob/a075e734dede8e1de5fe1652ec86f42da0162c41/criner/src/engine/run.rs
criner/src/engine/run.rs
use crate::{engine::stage, error::Result, model, persistence::Db, utils::*}; use futures_util::{ future::{Either, FutureExt}, stream::StreamExt, }; use log::{info, warn}; use prodash::render::tui::{Event, Line}; use std::sync::Arc; use std::{ path::{Path, PathBuf}, time::{Duration, SystemTime}, }; pub ...
rust
MIT
a075e734dede8e1de5fe1652ec86f42da0162c41
2026-01-04T20:17:28.169370Z
false
the-lean-crate/criner
https://github.com/the-lean-crate/criner/blob/a075e734dede8e1de5fe1652ec86f42da0162c41/criner/src/engine/work/schedule.rs
criner/src/engine/work/schedule.rs
use crate::{ engine::{work::cpubound, work::iobound}, error::Result, model, persistence, persistence::{TableAccess, TaskTable}, }; use std::{ path::{Path, PathBuf}, time::SystemTime, }; const MAX_ATTEMPTS_BEFORE_WE_GIVE_UP: usize = 8; #[derive(Clone, Copy)] pub enum Scheduling { // /// C...
rust
MIT
a075e734dede8e1de5fe1652ec86f42da0162c41
2026-01-04T20:17:28.169370Z
false
the-lean-crate/criner
https://github.com/the-lean-crate/criner/blob/a075e734dede8e1de5fe1652ec86f42da0162c41/criner/src/engine/work/iobound.rs
criner/src/engine/work/iobound.rs
use crate::{ model, persistence::{self, TableAccess}, Error, Result, }; use bytesize::ByteSize; use futures_lite::{io::AsyncWriteExt, FutureExt}; use crate::utils::timeout_after; use async_trait::async_trait; use std::{ path::{Path, PathBuf}, time::{Duration, SystemTime}, }; const CONNECT_AND_FETC...
rust
MIT
a075e734dede8e1de5fe1652ec86f42da0162c41
2026-01-04T20:17:28.169370Z
false
the-lean-crate/criner
https://github.com/the-lean-crate/criner/blob/a075e734dede8e1de5fe1652ec86f42da0162c41/criner/src/engine/work/mod.rs
criner/src/engine/work/mod.rs
pub mod generic; pub mod iobound; pub mod schedule; pub mod cpubound;
rust
MIT
a075e734dede8e1de5fe1652ec86f42da0162c41
2026-01-04T20:17:28.169370Z
false
the-lean-crate/criner
https://github.com/the-lean-crate/criner/blob/a075e734dede8e1de5fe1652ec86f42da0162c41/criner/src/engine/work/cpubound.rs
criner/src/engine/work/cpubound.rs
use crate::engine::report::waste::{tar_path_to_utf8_str, CargoConfig}; use crate::{error::Result, model, persistence, Error}; use async_trait::async_trait; use std::io::Seek; use std::{fs::File, io::BufReader, io::Read, path::PathBuf, time::SystemTime}; struct ProcessingState { downloaded_crate: PathBuf, key: ...
rust
MIT
a075e734dede8e1de5fe1652ec86f42da0162c41
2026-01-04T20:17:28.169370Z
false
the-lean-crate/criner
https://github.com/the-lean-crate/criner/blob/a075e734dede8e1de5fe1652ec86f42da0162c41/criner/src/engine/work/generic.rs
criner/src/engine/work/generic.rs
use crate::{model, persistence, persistence::TableAccess, Error, Result}; use async_trait::async_trait; #[async_trait] pub trait Processor { type Item; fn set(&mut self, request: Self::Item, progress: &mut prodash::tree::Item) -> Result<(model::Task, String, String)>; fn idle_message(&self) -> Str...
rust
MIT
a075e734dede8e1de5fe1652ec86f42da0162c41
2026-01-04T20:17:28.169370Z
false
the-lean-crate/criner
https://github.com/the-lean-crate/criner/blob/a075e734dede8e1de5fe1652ec86f42da0162c41/criner/src/engine/stage/mod.rs
criner/src/engine/stage/mod.rs
pub mod changes; pub mod db_download; pub mod processing; pub mod report;
rust
MIT
a075e734dede8e1de5fe1652ec86f42da0162c41
2026-01-04T20:17:28.169370Z
false
the-lean-crate/criner
https://github.com/the-lean-crate/criner/blob/a075e734dede8e1de5fe1652ec86f42da0162c41/criner/src/engine/stage/processing.rs
criner/src/engine/stage/processing.rs
use crate::persistence::{new_value_query_recent_first, value_iter, CrateVersionTable}; use crate::{ engine::work, error::Result, model::CrateVersion, persistence::{Db, Keyed, TableAccess}, }; use futures_util::FutureExt; use std::{path::PathBuf, time::SystemTime}; pub async fn process( db: Db, ...
rust
MIT
a075e734dede8e1de5fe1652ec86f42da0162c41
2026-01-04T20:17:28.169370Z
false
the-lean-crate/criner
https://github.com/the-lean-crate/criner/blob/a075e734dede8e1de5fe1652ec86f42da0162c41/criner/src/engine/stage/changes.rs
criner/src/engine/stage/changes.rs
use crate::persistence::{key_value_iter, new_key_value_query_old_to_new, CrateTable, Keyed}; use crate::{ error::{Error, Result}, model, persistence::{self, new_key_value_insertion, CrateVersionTable, TableAccess}, utils::enforce_threaded, }; use crates_index_diff::Index; use rusqlite::params; use std::...
rust
MIT
a075e734dede8e1de5fe1652ec86f42da0162c41
2026-01-04T20:17:28.169370Z
false
the-lean-crate/criner
https://github.com/the-lean-crate/criner/blob/a075e734dede8e1de5fe1652ec86f42da0162c41/criner/src/engine/stage/db_download/csv_model.rs
criner/src/engine/stage/db_download/csv_model.rs
use serde_derive::Deserialize; use std::collections::BTreeMap; use std::time::SystemTime; type UserId = u32; pub type Id = u32; pub type GitHubId = i32; #[derive(Deserialize, Default, Clone)] pub struct Keyword { pub id: Id, #[serde(rename = "keyword")] pub name: String, // amount of crates using the ...
rust
MIT
a075e734dede8e1de5fe1652ec86f42da0162c41
2026-01-04T20:17:28.169370Z
false
the-lean-crate/criner
https://github.com/the-lean-crate/criner/blob/a075e734dede8e1de5fe1652ec86f42da0162c41/criner/src/engine/stage/db_download/convert.rs
criner/src/engine/stage/db_download/convert.rs
use super::csv_model; use crate::{model::db_dump, utils::parse_semver}; use std::collections::BTreeMap; use std::time::SystemTime; lazy_static! { static ref PERSON: regex::Regex = regex::Regex::new("(?P<name>[\\w ]+)(<(?P<email>.*)>)?").expect("valid statically known regex"); } impl From<csv_model::User> ...
rust
MIT
a075e734dede8e1de5fe1652ec86f42da0162c41
2026-01-04T20:17:28.169370Z
false
the-lean-crate/criner
https://github.com/the-lean-crate/criner/blob/a075e734dede8e1de5fe1652ec86f42da0162c41/criner/src/engine/stage/db_download/from_csv.rs
criner/src/engine/stage/db_download/from_csv.rs
use super::csv_model; use std::collections::BTreeMap; pub trait AsId { fn as_id(&self) -> csv_model::Id; } macro_rules! impl_as_id { ($name:ident) => { impl AsId for csv_model::$name { fn as_id(&self) -> csv_model::Id { self.id } } }; } impl_as_id!(...
rust
MIT
a075e734dede8e1de5fe1652ec86f42da0162c41
2026-01-04T20:17:28.169370Z
false
the-lean-crate/criner
https://github.com/the-lean-crate/criner/blob/a075e734dede8e1de5fe1652ec86f42da0162c41/criner/src/engine/stage/db_download/mod.rs
criner/src/engine/stage/db_download/mod.rs
use crate::model::db_dump; use crate::{ engine::work, persistence::new_key_value_insertion, persistence::Db, persistence::TableAccess, Error, Result, }; use bytesize::ByteSize; use futures_util::FutureExt; use rusqlite::params; use rusqlite::TransactionBehavior; use std::{collections::BTreeMap, fs::File, io::BufRea...
rust
MIT
a075e734dede8e1de5fe1652ec86f42da0162c41
2026-01-04T20:17:28.169370Z
false
the-lean-crate/criner
https://github.com/the-lean-crate/criner/blob/a075e734dede8e1de5fe1652ec86f42da0162c41/criner/src/engine/stage/report/git.rs
criner/src/engine/stage/report/git.rs
use crate::utils::enforce_threaded; use crate::{ engine::report::generic::{WriteCallback, WriteCallbackState, WriteInstruction, WriteRequest}, {Error, Result}, }; use futures_util::{future::BoxFuture, FutureExt}; use std::{ path::{Path, PathBuf}, sync::atomic::{AtomicU64, Ordering}, time::{SystemTim...
rust
MIT
a075e734dede8e1de5fe1652ec86f42da0162c41
2026-01-04T20:17:28.169370Z
false
the-lean-crate/criner
https://github.com/the-lean-crate/criner/blob/a075e734dede8e1de5fe1652ec86f42da0162c41/criner/src/engine/stage/report/mod.rs
criner/src/engine/stage/report/mod.rs
use crate::{ engine::report, persistence::{self, new_key_value_query_old_to_new_filtered, TableAccess}, utils::check, {Error, Result}, }; use futures_util::FutureExt; use std::{path::PathBuf, time::SystemTime}; mod git; pub async fn generate( db: persistence::Db, mut progress: prodash::tree::I...
rust
MIT
a075e734dede8e1de5fe1652ec86f42da0162c41
2026-01-04T20:17:28.169370Z
false
the-lean-crate/criner
https://github.com/the-lean-crate/criner/blob/a075e734dede8e1de5fe1652ec86f42da0162c41/criner/src/engine/report/mod.rs
criner/src/engine/report/mod.rs
pub mod generic; pub mod waste;
rust
MIT
a075e734dede8e1de5fe1652ec86f42da0162c41
2026-01-04T20:17:28.169370Z
false
the-lean-crate/criner
https://github.com/the-lean-crate/criner/blob/a075e734dede8e1de5fe1652ec86f42da0162c41/criner/src/engine/report/generic.rs
criner/src/engine/report/generic.rs
use crate::persistence::{CrateVersionTable, TableAccess}; use crate::{ error::Result, model, persistence, persistence::{new_key_insertion, ReportsTree}, }; use async_trait::async_trait; use rusqlite::{params, TransactionBehavior}; use std::path::{Path, PathBuf}; fn all_but_recently_yanked( crate_name: ...
rust
MIT
a075e734dede8e1de5fe1652ec86f42da0162c41
2026-01-04T20:17:28.169370Z
false
the-lean-crate/criner
https://github.com/the-lean-crate/criner/blob/a075e734dede8e1de5fe1652ec86f42da0162c41/criner/src/engine/report/waste/merge.rs
criner/src/engine/report/waste/merge.rs
use super::{AggregateFileInfo, AggregateVersionInfo, Dict, Fix, Report, VersionInfo, WastedFile}; use crate::Result; use async_trait::async_trait; use criner_waste_report::{add_optional_aggregate, html::NO_EXT_MARKER}; use std::{ collections::BTreeMap, ops::AddAssign, path::{Path, PathBuf}, }; const TOP_LE...
rust
MIT
a075e734dede8e1de5fe1652ec86f42da0162c41
2026-01-04T20:17:28.169370Z
false
the-lean-crate/criner
https://github.com/the-lean-crate/criner/blob/a075e734dede8e1de5fe1652ec86f42da0162c41/criner/src/engine/report/waste/mod.rs
criner/src/engine/report/waste/mod.rs
use crate::persistence::TableAccess; use crate::{error::Result, model::TaskResult, persistence}; use async_trait::async_trait; pub use criner_waste_report::*; mod merge; pub struct Generator; // NOTE: When multiple reports should be combined, this must become a compound generator which combines // multiple implemen...
rust
MIT
a075e734dede8e1de5fe1652ec86f42da0162c41
2026-01-04T20:17:28.169370Z
false
the-lean-crate/criner
https://github.com/the-lean-crate/criner/blob/a075e734dede8e1de5fe1652ec86f42da0162c41/criner/src/engine/report/waste/report_test/merge.rs
criner/src/engine/report/waste/report_test/merge.rs
use crate::{ engine::report::generic::Aggregate, engine::report::waste::{AggregateFileInfo, Fix, PotentialWaste, Report, VersionInfo}, model::TarHeader, }; use common_macros::b_tree_map; use std::collections::BTreeMap; #[test] fn crate_merging_version_equivalent_to_version_merging_crate() { let version...
rust
MIT
a075e734dede8e1de5fe1652ec86f42da0162c41
2026-01-04T20:17:28.169370Z
false
the-lean-crate/criner
https://github.com/the-lean-crate/criner/blob/a075e734dede8e1de5fe1652ec86f42da0162c41/criner/src/engine/report/waste/report_test/mod.rs
criner/src/engine/report/waste/report_test/mod.rs
mod merge;
rust
MIT
a075e734dede8e1de5fe1652ec86f42da0162c41
2026-01-04T20:17:28.169370Z
false
the-lean-crate/criner
https://github.com/the-lean-crate/criner/blob/a075e734dede8e1de5fe1652ec86f42da0162c41/criner-waste-report/src/html.rs
criner-waste-report/src/html.rs
use super::{AggregateFileInfo, Dict, Fix, Report, VersionInfo}; use bytesize::ByteSize; use dia_semver::Semver; use horrorshow::{box_html, helper::doctype, html, Render, RenderBox, RenderOnce, TemplateBuffer}; use std::time::SystemTime; pub fn fix_to_wasted_files_aggregate(fix: Option<Fix>) -> Option<AggregateFileInfo...
rust
MIT
a075e734dede8e1de5fe1652ec86f42da0162c41
2026-01-04T20:17:28.169370Z
false
the-lean-crate/criner
https://github.com/the-lean-crate/criner/blob/a075e734dede8e1de5fe1652ec86f42da0162c41/criner-waste-report/src/lib.rs
criner-waste-report/src/lib.rs
#![deny(unsafe_code)] #[macro_use] extern crate lazy_static; #[cfg(feature = "html")] pub mod html; pub mod result; #[cfg(test)] mod test; use serde_derive::{Deserialize, Serialize}; use std::collections::BTreeMap; pub use result::{globset_from_patterns, tar_path_to_utf8_str}; pub type Patterns = Vec<String>; //...
rust
MIT
a075e734dede8e1de5fe1652ec86f42da0162c41
2026-01-04T20:17:28.169370Z
false
the-lean-crate/criner
https://github.com/the-lean-crate/criner/blob/a075e734dede8e1de5fe1652ec86f42da0162c41/criner-waste-report/src/result.rs
criner-waste-report/src/result.rs
use super::{CargoConfig, Fix, Patterns, PotentialWaste, Report, TarHeader, WastedFile}; use std::{collections::BTreeSet, path::Path, path::PathBuf}; lazy_static! { static ref COMPILE_TIME_INCLUDE: regex::bytes::Regex = regex::bytes::Regex::new(r##"include_(str|bytes)!\("(?P<include>.+?)"\)"##) ...
rust
MIT
a075e734dede8e1de5fe1652ec86f42da0162c41
2026-01-04T20:17:28.169370Z
false
the-lean-crate/criner
https://github.com/the-lean-crate/criner/blob/a075e734dede8e1de5fe1652ec86f42da0162c41/criner-waste-report/src/test/from_package.rs
criner-waste-report/src/test/from_package.rs
use super::super::{Fix, Report, TarPackage}; use std::path::Path; fn tar_package(file_name: &str) -> TarPackage { rmp_serde::from_slice( std::fs::read( Path::new(env!("CARGO_MANIFEST_DIR")) .join("tests/fixtures") .join(format!("{}.package.rmp", file_name)), ...
rust
MIT
a075e734dede8e1de5fe1652ec86f42da0162c41
2026-01-04T20:17:28.169370Z
true
the-lean-crate/criner
https://github.com/the-lean-crate/criner/blob/a075e734dede8e1de5fe1652ec86f42da0162c41/criner-waste-report/src/test/mod.rs
criner-waste-report/src/test/mod.rs
mod from_package;
rust
MIT
a075e734dede8e1de5fe1652ec86f42da0162c41
2026-01-04T20:17:28.169370Z
false
MaikKlein/pyro
https://github.com/MaikKlein/pyro/blob/5b32b724c4e4656160248164a251a62e29954c5f/pyro/src/slice.rs
pyro/src/slice.rs
//! Temporary helper module until raw slices `*mut [T]` are on stable, or until `&[T]` is not UB //! anymore for unitialized memory. use std::marker::PhantomData; pub enum Mutable {} pub enum Immutable {} mod sealed { pub trait Sealed {} } pub trait Mutability: sealed::Sealed {} impl sealed::Sealed for Mutable {}...
rust
MIT
5b32b724c4e4656160248164a251a62e29954c5f
2026-01-04T20:17:30.804484Z
false
MaikKlein/pyro
https://github.com/MaikKlein/pyro/blob/5b32b724c4e4656160248164a251a62e29954c5f/pyro/src/lib.rs
pyro/src/lib.rs
//! # What is an Entity Component System? //! An Entity Component System or *ECS* is very similar to a relational database like *SQL*. The //! [`World`] is the data store where game objects (also known as [`Entity`]) live. An [`Entity`] //! contains data or [`Component`]s. //! The *ECS* can efficiently query those comp...
rust
MIT
5b32b724c4e4656160248164a251a62e29954c5f
2026-01-04T20:17:30.804484Z
false
MaikKlein/pyro
https://github.com/MaikKlein/pyro/blob/5b32b724c4e4656160248164a251a62e29954c5f/pyro/src/chunk.rs
pyro/src/chunk.rs
use crate::{expand, Component, Slice, SliceMut}; use std::{ alloc::{alloc, dealloc, realloc, Layout}, any::TypeId, collections::{HashMap, HashSet}, ptr::NonNull, }; unsafe fn drop_generic<T>(ptr: *mut u8) { std::ptr::drop_in_place(ptr as *mut T); } #[derive(Copy, Clone)] pub struct Metadata { ...
rust
MIT
5b32b724c4e4656160248164a251a62e29954c5f
2026-01-04T20:17:30.804484Z
false
MaikKlein/pyro
https://github.com/MaikKlein/pyro/blob/5b32b724c4e4656160248164a251a62e29954c5f/pyro/src/zip.rs
pyro/src/zip.rs
use crate::{expand, Index}; #[cfg(feature = "threading")] use rayon::iter::{ plumbing::{bridge, Consumer, Producer, ProducerCallback, UnindexedConsumer}, IndexedParallelIterator, ParallelIterator, }; use std::marker::PhantomData; pub struct ZipSlice<'a, Tuple> { tuple: Tuple, idx: usize, _m: std::m...
rust
MIT
5b32b724c4e4656160248164a251a62e29954c5f
2026-01-04T20:17:30.804484Z
false
MaikKlein/pyro
https://github.com/MaikKlein/pyro/blob/5b32b724c4e4656160248164a251a62e29954c5f/pyro/src/bin/example.rs
pyro/src/bin/example.rs
extern crate pyro; use pyro::{Entity, Read, World, Write}; #[derive(Debug)] struct Position(f32); struct Velocity; fn main() { // By default creates a world backed by a [`SoaStorage`] let mut world: World = World::new(); let add_pos_vel = (0..10).map(|i| (Position(i as f32), Velocity {})); // ...
rust
MIT
5b32b724c4e4656160248164a251a62e29954c5f
2026-01-04T20:17:30.804484Z
false
acarl005/toerings
https://github.com/acarl005/toerings/blob/24a55caf70cb19b0e7f5f88119012d8ae503b5d8/src-tauri/build.rs
src-tauri/build.rs
fn main() { tauri_build::build() }
rust
MIT
24a55caf70cb19b0e7f5f88119012d8ae503b5d8
2026-01-04T20:17:23.288089Z
false
acarl005/toerings
https://github.com/acarl005/toerings/blob/24a55caf70cb19b0e7f5f88119012d8ae503b5d8/src-tauri/src/main.rs
src-tauri/src/main.rs
#![cfg_attr( all(not(debug_assertions), target_os = "windows"), windows_subsystem = "windows" )] mod data_harvester; mod utils; use std::sync::Mutex; use crate::utils::error; use data_harvester::{Data, DataCollector}; use tauri::{AboutMetadata, CustomMenuItem, Menu, MenuItem, Submenu}; #[cfg(target_family =...
rust
MIT
24a55caf70cb19b0e7f5f88119012d8ae503b5d8
2026-01-04T20:17:23.288089Z
false
acarl005/toerings
https://github.com/acarl005/toerings/blob/24a55caf70cb19b0e7f5f88119012d8ae503b5d8/src-tauri/src/data_harvester.rs
src-tauri/src/data_harvester.rs
//! This is the main file to house data collection functions. use std::{ net::IpAddr, time::{Duration, Instant}, }; use futures::join; #[cfg(target_os = "linux")] use fxhash::FxHashMap; use serde::Serialize; #[cfg(feature = "battery")] use starship_battery::{Battery, Manager}; use sysinfo::{System, SystemE...
rust
MIT
24a55caf70cb19b0e7f5f88119012d8ae503b5d8
2026-01-04T20:17:23.288089Z
false
acarl005/toerings
https://github.com/acarl005/toerings/blob/24a55caf70cb19b0e7f5f88119012d8ae503b5d8/src-tauri/src/utils/error.rs
src-tauri/src/utils/error.rs
use std::{borrow::Cow, result}; use thiserror::Error; #[cfg(target_os = "linux")] use procfs::ProcError; /// A type alias for handling errors related to Bottom. pub type Result<T> = result::Result<T, ToeError>; /// An error that can occur while Bottom runs. #[derive(Debug, Error, PartialEq, Eq)] pub enum ToeError {...
rust
MIT
24a55caf70cb19b0e7f5f88119012d8ae503b5d8
2026-01-04T20:17:23.288089Z
false
acarl005/toerings
https://github.com/acarl005/toerings/blob/24a55caf70cb19b0e7f5f88119012d8ae503b5d8/src-tauri/src/utils/mod.rs
src-tauri/src/utils/mod.rs
pub mod error; pub mod logging;
rust
MIT
24a55caf70cb19b0e7f5f88119012d8ae503b5d8
2026-01-04T20:17:23.288089Z
false
acarl005/toerings
https://github.com/acarl005/toerings/blob/24a55caf70cb19b0e7f5f88119012d8ae503b5d8/src-tauri/src/utils/logging.rs
src-tauri/src/utils/logging.rs
#[cfg(feature = "fern")] pub fn init_logger( min_level: log::LevelFilter, debug_file_name: &std::ffi::OsStr, ) -> Result<(), fern::InitError> { fern::Dispatch::new() .format(|out, message, record| { // Note we aren't using local time since it only works on single-threaded processes. ...
rust
MIT
24a55caf70cb19b0e7f5f88119012d8ae503b5d8
2026-01-04T20:17:23.288089Z
false
acarl005/toerings
https://github.com/acarl005/toerings/blob/24a55caf70cb19b0e7f5f88119012d8ae503b5d8/src-tauri/src/data_harvester/network.rs
src-tauri/src/data_harvester/network.rs
//! Data collection for network usage/IO. //! //! For Linux and macOS, this is handled by Heim. //! For Windows, this is handled by sysinfo. use serde::Serialize; cfg_if::cfg_if! { if #[cfg(any(target_os = "linux", target_os = "macos"))] { pub mod heim; pub use self::heim::*; } else if #[cfg(a...
rust
MIT
24a55caf70cb19b0e7f5f88119012d8ae503b5d8
2026-01-04T20:17:23.288089Z
false
acarl005/toerings
https://github.com/acarl005/toerings/blob/24a55caf70cb19b0e7f5f88119012d8ae503b5d8/src-tauri/src/data_harvester/memory.rs
src-tauri/src/data_harvester/memory.rs
//! Data collection for memory. //! //! For Linux, macOS, and Windows, this is handled by Heim. On FreeBSD it is handled by sysinfo. cfg_if::cfg_if! { if #[cfg(any(target_os = "freebsd", target_os = "linux", target_os = "macos", target_os = "windows"))] { pub mod general; pub use self::general::*; ...
rust
MIT
24a55caf70cb19b0e7f5f88119012d8ae503b5d8
2026-01-04T20:17:23.288089Z
false
acarl005/toerings
https://github.com/acarl005/toerings/blob/24a55caf70cb19b0e7f5f88119012d8ae503b5d8/src-tauri/src/data_harvester/disks.rs
src-tauri/src/data_harvester/disks.rs
//! Data collection for disks (IO, usage, space, etc.). //! //! For Linux, macOS, and Windows, this is handled by heim. For FreeBSD there is a custom //! implementation. use serde::Serialize; cfg_if::cfg_if! { if #[cfg(any(target_os = "linux", target_os = "macos", target_os = "windows"))] { pub mod heim; ...
rust
MIT
24a55caf70cb19b0e7f5f88119012d8ae503b5d8
2026-01-04T20:17:23.288089Z
false
acarl005/toerings
https://github.com/acarl005/toerings/blob/24a55caf70cb19b0e7f5f88119012d8ae503b5d8/src-tauri/src/data_harvester/temperature.rs
src-tauri/src/data_harvester/temperature.rs
//! Data collection for temperature metrics. //! //! For Linux and macOS, this is handled by Heim. //! For Windows, this is handled by sysinfo. cfg_if::cfg_if! { if #[cfg(target_os = "linux")] { pub mod linux; pub use self::linux::*; } else if #[cfg(any(target_os = "freebsd", target_os = "macos...
rust
MIT
24a55caf70cb19b0e7f5f88119012d8ae503b5d8
2026-01-04T20:17:23.288089Z
false
acarl005/toerings
https://github.com/acarl005/toerings/blob/24a55caf70cb19b0e7f5f88119012d8ae503b5d8/src-tauri/src/data_harvester/nvidia.rs
src-tauri/src/data_harvester/nvidia.rs
use nvml_wrapper::{error::NvmlError, Nvml}; use once_cell::sync::Lazy; pub static NVML_DATA: Lazy<Result<Nvml, NvmlError>> = Lazy::new(Nvml::init);
rust
MIT
24a55caf70cb19b0e7f5f88119012d8ae503b5d8
2026-01-04T20:17:23.288089Z
false
acarl005/toerings
https://github.com/acarl005/toerings/blob/24a55caf70cb19b0e7f5f88119012d8ae503b5d8/src-tauri/src/data_harvester/processes.rs
src-tauri/src/data_harvester/processes.rs
//! Data collection for processes. //! //! For Linux, this is handled by a custom set of functions. //! For Windows and macOS, this is handled by sysinfo. cfg_if::cfg_if! { if #[cfg(target_os = "linux")] { pub mod linux; pub use self::linux::*; } else if #[cfg(target_os = "macos")] { pu...
rust
MIT
24a55caf70cb19b0e7f5f88119012d8ae503b5d8
2026-01-04T20:17:23.288089Z
false
acarl005/toerings
https://github.com/acarl005/toerings/blob/24a55caf70cb19b0e7f5f88119012d8ae503b5d8/src-tauri/src/data_harvester/cpu.rs
src-tauri/src/data_harvester/cpu.rs
//! Data collection for CPU usage and load average. //! //! For CPU usage, Linux, macOS, and Windows are handled by Heim, FreeBSD by sysinfo. //! //! For load average, macOS and Linux are supported through Heim, FreeBSD by sysinfo. use serde::Serialize; cfg_if::cfg_if! { if #[cfg(any(target_os = "linux", target_o...
rust
MIT
24a55caf70cb19b0e7f5f88119012d8ae503b5d8
2026-01-04T20:17:23.288089Z
false
acarl005/toerings
https://github.com/acarl005/toerings/blob/24a55caf70cb19b0e7f5f88119012d8ae503b5d8/src-tauri/src/data_harvester/batteries.rs
src-tauri/src/data_harvester/batteries.rs
//! Data collection for batteries. //! //! For Linux, macOS, Windows, FreeBSD, Dragonfly, and iOS, this is handled by the battery crate. cfg_if::cfg_if! { if #[cfg(any(target_os = "windows", target_os = "macos", target_os = "linux", target_os = "freebsd", target_os = "dragonfly", target_os = "ios"))] { pub...
rust
MIT
24a55caf70cb19b0e7f5f88119012d8ae503b5d8
2026-01-04T20:17:23.288089Z
false
acarl005/toerings
https://github.com/acarl005/toerings/blob/24a55caf70cb19b0e7f5f88119012d8ae503b5d8/src-tauri/src/data_harvester/batteries/battery.rs
src-tauri/src/data_harvester/batteries/battery.rs
//! Uses the battery crate from svartalf. //! Covers battery usage for: //! - Linux 2.6.39+ //! - MacOS 10.10+ //! - iOS //! - Windows 7+ //! - FreeBSD //! - DragonFlyBSD //! //! For more information, refer to the [starship_battery](https://github.com/starship/rust-battery) repo/docs. use starship_battery::{ units...
rust
MIT
24a55caf70cb19b0e7f5f88119012d8ae503b5d8
2026-01-04T20:17:23.288089Z
false
acarl005/toerings
https://github.com/acarl005/toerings/blob/24a55caf70cb19b0e7f5f88119012d8ae503b5d8/src-tauri/src/data_harvester/cpu/heim.rs
src-tauri/src/data_harvester/cpu/heim.rs
//! CPU stats through heim. //! Supports macOS, Linux, and Windows. cfg_if::cfg_if! { if #[cfg(target_os = "linux")] { pub mod linux; pub use linux::*; } else if #[cfg(any(target_os = "macos", target_os = "windows"))] { pub mod windows_macos; pub use windows_macos::*; } } c...
rust
MIT
24a55caf70cb19b0e7f5f88119012d8ae503b5d8
2026-01-04T20:17:23.288089Z
false
acarl005/toerings
https://github.com/acarl005/toerings/blob/24a55caf70cb19b0e7f5f88119012d8ae503b5d8/src-tauri/src/data_harvester/cpu/sysinfo.rs
src-tauri/src/data_harvester/cpu/sysinfo.rs
//! CPU stats through sysinfo. //! Supports FreeBSD. use std::collections::VecDeque; use sysinfo::{CpuExt, LoadAvg, System, SystemExt}; use super::{CpuData, CpuDataType, CpuHarvest, PastCpuTotal, PastCpuWork}; use crate::data_harvester::cpu::LoadAvgHarvest; pub async fn get_cpu_data_list( sys: &sysinfo::System,...
rust
MIT
24a55caf70cb19b0e7f5f88119012d8ae503b5d8
2026-01-04T20:17:23.288089Z
false
acarl005/toerings
https://github.com/acarl005/toerings/blob/24a55caf70cb19b0e7f5f88119012d8ae503b5d8/src-tauri/src/data_harvester/cpu/heim/unix.rs
src-tauri/src/data_harvester/cpu/heim/unix.rs
//! Unix-specific functions regarding CPU usage. use crate::data_harvester::cpu::LoadAvgHarvest; pub async fn get_load_avg() -> crate::error::Result<LoadAvgHarvest> { let (one, five, fifteen) = heim::cpu::os::unix::loadavg().await?; Ok([ one.get::<heim::units::ratio::ratio>(), five.get::<heim...
rust
MIT
24a55caf70cb19b0e7f5f88119012d8ae503b5d8
2026-01-04T20:17:23.288089Z
false
acarl005/toerings
https://github.com/acarl005/toerings/blob/24a55caf70cb19b0e7f5f88119012d8ae503b5d8/src-tauri/src/data_harvester/cpu/heim/windows_macos.rs
src-tauri/src/data_harvester/cpu/heim/windows_macos.rs
//! Windows and macOS-specific functions regarding CPU usage. use crate::data_harvester::cpu::Point; pub fn convert_cpu_times(cpu_time: &heim::cpu::CpuTime) -> Point { let working_time: f64 = (cpu_time.user() + cpu_time.system()).get::<heim::units::time::second>(); ( working_time, work...
rust
MIT
24a55caf70cb19b0e7f5f88119012d8ae503b5d8
2026-01-04T20:17:23.288089Z
false
acarl005/toerings
https://github.com/acarl005/toerings/blob/24a55caf70cb19b0e7f5f88119012d8ae503b5d8/src-tauri/src/data_harvester/cpu/heim/linux.rs
src-tauri/src/data_harvester/cpu/heim/linux.rs
//! Linux-specific functions regarding CPU usage. use heim::cpu::os::linux::CpuTimeExt; use crate::data_harvester::cpu::Point; pub fn convert_cpu_times(cpu_time: &heim::cpu::CpuTime) -> Point { let working_time: f64 = (cpu_time.user() + cpu_time.nice() + cpu_time.system() + cpu_time.irq()...
rust
MIT
24a55caf70cb19b0e7f5f88119012d8ae503b5d8
2026-01-04T20:17:23.288089Z
false