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
rust-cli/climake
https://github.com/rust-cli/climake/blob/07a87ab9e8721d01ce6e37c3107c69b835e83ee7/src/core/utils.rs
src/core/utils.rs
//! Utility items for internal crate operation use crate::CLI_TABBING; use std::io::{LineWriter, Write}; /// Writes a given buffer to terminal using [LineWriter] and splits every 80 /// characters, making it ideal for concise terminal displays for help messages pub(crate) fn writeln_term( to_write: impl Into<Str...
rust
Apache-2.0
07a87ab9e8721d01ce6e37c3107c69b835e83ee7
2026-01-04T20:21:15.127100Z
false
rust-cli/climake
https://github.com/rust-cli/climake/blob/07a87ab9e8721d01ce6e37c3107c69b835e83ee7/src/core/mod.rs
src/core/mod.rs
//! Core components of climake, re-exported with wildcard into library root mod argument; mod cli_make; mod subcommand; mod utils; pub use argument::Argument; pub use cli_make::CliMake; pub use subcommand::Subcommand;
rust
Apache-2.0
07a87ab9e8721d01ce6e37c3107c69b835e83ee7
2026-01-04T20:21:15.127100Z
false
rust-cli/climake
https://github.com/rust-cli/climake/blob/07a87ab9e8721d01ce6e37c3107c69b835e83ee7/src/core/cli_make/impl_help.rs
src/core/cli_make/impl_help.rs
//! Contains help implementations for [CliMake] use super::CliMake; use crate::core::utils::writeln_term; use std::io::Write; use std::env; impl<'a> CliMake<'a> { /// Generates header and streams to given [Write] buffer for displaying info /// about this cli. /// /// Please check [CliMake::help_msg] ...
rust
Apache-2.0
07a87ab9e8721d01ce6e37c3107c69b835e83ee7
2026-01-04T20:21:15.127100Z
false
rust-cli/climake
https://github.com/rust-cli/climake/blob/07a87ab9e8721d01ce6e37c3107c69b835e83ee7/src/core/cli_make/mod.rs
src/core/cli_make/mod.rs
//! Contains [CliMake]-related items, see specific documentation for more information mod impl_basic; mod impl_help; mod impl_parse; pub use impl_basic::*; pub use impl_help::*; pub use impl_parse::*; use crate::{Argument, Subcommand}; /// The core climake structure, facilitating creation and parsing of both argume...
rust
Apache-2.0
07a87ab9e8721d01ce6e37c3107c69b835e83ee7
2026-01-04T20:21:15.127100Z
false
rust-cli/climake
https://github.com/rust-cli/climake/blob/07a87ab9e8721d01ce6e37c3107c69b835e83ee7/src/core/cli_make/impl_basic.rs
src/core/cli_make/impl_basic.rs
//! Contains basic implementations for [CliMake] use super::CliMake; use crate::{Argument, Subcommand, CLI_TABBING}; impl<'a> CliMake<'a> { /// Creates a new [Argument] from given passed values pub fn new( name: impl Into<&'a str>, arguments: impl Into<Vec<&'a Argument<'a>>>, subcomman...
rust
Apache-2.0
07a87ab9e8721d01ce6e37c3107c69b835e83ee7
2026-01-04T20:21:15.127100Z
false
rust-cli/climake
https://github.com/rust-cli/climake/blob/07a87ab9e8721d01ce6e37c3107c69b835e83ee7/src/core/cli_make/impl_parse.rs
src/core/cli_make/impl_parse.rs
//! Contains parsing implementations for [CliMake] use super::{Argument, CliMake, Subcommand}; use crate::core::argument::CallType; use crate::parsed::{ParsedArgument, ParsedCli, ParsedSubcommand}; use std::env; /// Container enumeration for [crate::parsed]-related structs to be sent up the /// chain from [match_nex...
rust
Apache-2.0
07a87ab9e8721d01ce6e37c3107c69b835e83ee7
2026-01-04T20:21:15.127100Z
false
rust-cli/climake
https://github.com/rust-cli/climake/blob/07a87ab9e8721d01ce6e37c3107c69b835e83ee7/examples/simple.rs
examples/simple.rs
//! Demo of a simple package manager use climake::prelude::*; fn main() { let package = Argument::new( "The package name", vec!['p', 'i'], vec!["pkg, package"], Input::Text, ); let add = Subcommand::new("add", vec![&package], vec![], "Adds a package"); let rem = Subcom...
rust
Apache-2.0
07a87ab9e8721d01ce6e37c3107c69b835e83ee7
2026-01-04T20:21:15.127100Z
false
ekzhang/jute
https://github.com/ekzhang/jute/blob/18723a036b843d9efc1d07b326bda5614b2020e7/src-tauri/build.rs
src-tauri/build.rs
fn main() { tauri_build::build() }
rust
MIT
18723a036b843d9efc1d07b326bda5614b2020e7
2026-01-04T20:21:18.693962Z
false
ekzhang/jute
https://github.com/ekzhang/jute/blob/18723a036b843d9efc1d07b326bda5614b2020e7/src-tauri/src/lib.rs
src-tauri/src/lib.rs
//! Library code for the Jute application. #![deny(unsafe_code)] #![warn(missing_docs)] use std::io; pub mod backend; pub mod commands; pub mod entity; pub mod menu; pub mod plugins; pub mod state; pub mod window; /// A serializable error type for application errors. #[derive(Debug, thiserror::Error)] pub enum Erro...
rust
MIT
18723a036b843d9efc1d07b326bda5614b2020e7
2026-01-04T20:21:18.693962Z
false
ekzhang/jute
https://github.com/ekzhang/jute/blob/18723a036b843d9efc1d07b326bda5614b2020e7/src-tauri/src/entity.rs
src-tauri/src/entity.rs
//! Types for generating and representing unique, labelled IDs. use std::{array, fmt, str::FromStr}; use anyhow::bail; use rand::Rng; use serde_with::{DeserializeFromStr, SerializeDisplay}; use strum::{EnumIter, IntoEnumIterator}; /// Entity category for generated IDs. #[derive(Debug, Clone, Copy, PartialEq, Eq, Enu...
rust
MIT
18723a036b843d9efc1d07b326bda5614b2020e7
2026-01-04T20:21:18.693962Z
false
ekzhang/jute
https://github.com/ekzhang/jute/blob/18723a036b843d9efc1d07b326bda5614b2020e7/src-tauri/src/backend.rs
src-tauri/src/backend.rs
//! Backend for Jute, connecting to local Jupyter kernels or remote servers. //! //! The local and remote kernels have a shared wire protocol, so that lives //! outside either folder. pub use wire_protocol::{create_websocket_connection, create_zeromq_connection, KernelConnection}; pub mod commands; pub mod local; pub...
rust
MIT
18723a036b843d9efc1d07b326bda5614b2020e7
2026-01-04T20:21:18.693962Z
false
ekzhang/jute
https://github.com/ekzhang/jute/blob/18723a036b843d9efc1d07b326bda5614b2020e7/src-tauri/src/state.rs
src-tauri/src/state.rs
//! Defines state and stores for the Tauri application. use dashmap::DashMap; use crate::backend::local::LocalKernel; /// State for the running Tauri application. #[derive(Default)] pub struct State { /// Current kernels running in the application. pub kernels: DashMap<String, LocalKernel>, } impl State { ...
rust
MIT
18723a036b843d9efc1d07b326bda5614b2020e7
2026-01-04T20:21:18.693962Z
false
ekzhang/jute
https://github.com/ekzhang/jute/blob/18723a036b843d9efc1d07b326bda5614b2020e7/src-tauri/src/menu.rs
src-tauri/src/menu.rs
//! Sets up the native window menu with file, about, and other commands. //! //! Menus in Tauri v2 are attached to each window for Windows and Linux, but //! they are global for macOS. Each item in the menu has a `MenuId` string //! attached to it, and it emits a `MenuEvent` when clicked. //! //! There is no way to ass...
rust
MIT
18723a036b843d9efc1d07b326bda5614b2020e7
2026-01-04T20:21:18.693962Z
false
ekzhang/jute
https://github.com/ekzhang/jute/blob/18723a036b843d9efc1d07b326bda5614b2020e7/src-tauri/src/commands.rs
src-tauri/src/commands.rs
//! Invoke handlers for commands callable from the frontend. use std::env; use sysinfo::{Pid, System}; use tauri::ipc::Channel; use tracing::info; use crate::{ backend::{ commands::{self, RunCellEvent}, local::{environment, KernelUsageInfo, LocalKernel}, notebook::NotebookRoot, }, ...
rust
MIT
18723a036b843d9efc1d07b326bda5614b2020e7
2026-01-04T20:21:18.693962Z
false
ekzhang/jute
https://github.com/ekzhang/jute/blob/18723a036b843d9efc1d07b326bda5614b2020e7/src-tauri/src/window.rs
src-tauri/src/window.rs
//! Shared code to open windows in Jute and notebooks. use std::path::Path; use anyhow::Context; use tauri::{AppHandle, Manager, Runtime, WebviewWindow, WebviewWindowBuilder}; use uuid::Uuid; /// Initializes window size, min width, and other common settings on the /// builder. pub fn initialize_builder<'a, R: Runtim...
rust
MIT
18723a036b843d9efc1d07b326bda5614b2020e7
2026-01-04T20:21:18.693962Z
false
ekzhang/jute
https://github.com/ekzhang/jute/blob/18723a036b843d9efc1d07b326bda5614b2020e7/src-tauri/src/plugins.rs
src-tauri/src/plugins.rs
//! Module containing custom plugins for the Tauri app. #[cfg(target_os = "macos")] pub mod macos_traffic_lights;
rust
MIT
18723a036b843d9efc1d07b326bda5614b2020e7
2026-01-04T20:21:18.693962Z
false
ekzhang/jute
https://github.com/ekzhang/jute/blob/18723a036b843d9efc1d07b326bda5614b2020e7/src-tauri/src/main.rs
src-tauri/src/main.rs
// Prevents additional console window on Windows in release, DO NOT REMOVE!! #![cfg_attr(not(debug_assertions), windows_subsystem = "windows")] use std::{env, path::PathBuf}; use jute::state::State; use tauri::AppHandle; #[allow(unused_imports)] use tauri::Manager; /// Handle file associations opened in the applicat...
rust
MIT
18723a036b843d9efc1d07b326bda5614b2020e7
2026-01-04T20:21:18.693962Z
false
ekzhang/jute
https://github.com/ekzhang/jute/blob/18723a036b843d9efc1d07b326bda5614b2020e7/src-tauri/src/commands/venv.rs
src-tauri/src/commands/venv.rs
//! Commands for the management of local virtual environments with `uv`. use std::io; use ini::Ini; use serde::Serialize; use tauri::{AppHandle, Manager}; use tauri_plugin_shell::ShellExt; use tracing::{error, info}; use crate::{ entity::{Entity, EntityId}, Error, }; /// Return a list of Python versions tha...
rust
MIT
18723a036b843d9efc1d07b326bda5614b2020e7
2026-01-04T20:21:18.693962Z
false
ekzhang/jute
https://github.com/ekzhang/jute/blob/18723a036b843d9efc1d07b326bda5614b2020e7/src-tauri/src/plugins/macos_traffic_lights.rs
src-tauri/src/plugins/macos_traffic_lights.rs
//! Traffic light positioner for Tauri, making inset controls on macOS. //! //! This plugin is sourced from a [Gist], and it uses the macOS native APIs to //! position the standard window buttons on the top-left of the screen at a //! different offset padding. //! //! [Gist]: https://gist.github.com/charrondev/43150e94...
rust
MIT
18723a036b843d9efc1d07b326bda5614b2020e7
2026-01-04T20:21:18.693962Z
false
ekzhang/jute
https://github.com/ekzhang/jute/blob/18723a036b843d9efc1d07b326bda5614b2020e7/src-tauri/src/backend/notebook.rs
src-tauri/src/backend/notebook.rs
//! JSON schema for the Jupyter notebook `.ipynb` file format and Jute's //! extensions. //! //! This file is based on the official [nbformat v4]. //! //! [nbformat v4]: https://github.com/jupyter/nbformat/blob/v5.10.4/nbformat/v4/nbformat.v4.schema.json use std::collections::BTreeMap; use serde::{Deserialize, Serial...
rust
MIT
18723a036b843d9efc1d07b326bda5614b2020e7
2026-01-04T20:21:18.693962Z
false
ekzhang/jute
https://github.com/ekzhang/jute/blob/18723a036b843d9efc1d07b326bda5614b2020e7/src-tauri/src/backend/local.rs
src-tauri/src/backend/local.rs
//! Code that starts local kernels to be `jupyter-server` compatible. //! //! This is currently unused while Jute relies on `jupyter-server`, but in the //! future it could replace the Jupyter installation by directly invoking //! kernels, or introduce new APIs for developer experience. use std::process::Stdio; use s...
rust
MIT
18723a036b843d9efc1d07b326bda5614b2020e7
2026-01-04T20:21:18.693962Z
false
ekzhang/jute
https://github.com/ekzhang/jute/blob/18723a036b843d9efc1d07b326bda5614b2020e7/src-tauri/src/backend/wire_protocol.rs
src-tauri/src/backend/wire_protocol.rs
//! Jupyter kernel wire protocol implementations. //! //! See the [Messaging in Jupyter](https://jupyter-client.readthedocs.io/en/stable/messaging.html) //! page for documentation about how this works. The wire protocol is used to //! communicate with Jupyter kernels over ZeroMQ or WebSocket. use std::collections::BTr...
rust
MIT
18723a036b843d9efc1d07b326bda5614b2020e7
2026-01-04T20:21:18.693962Z
false
ekzhang/jute
https://github.com/ekzhang/jute/blob/18723a036b843d9efc1d07b326bda5614b2020e7/src-tauri/src/backend/remote.rs
src-tauri/src/backend/remote.rs
//! Connections to remote Jupyter servers over HTTP and WebSocket. use std::time::Duration; use reqwest::{ header::{self, HeaderMap}, StatusCode, }; use serde::Deserialize; use serde_json::json; use time::OffsetDateTime; use url::Url; use super::{create_websocket_connection, KernelConnection}; use crate::Err...
rust
MIT
18723a036b843d9efc1d07b326bda5614b2020e7
2026-01-04T20:21:18.693962Z
false
ekzhang/jute
https://github.com/ekzhang/jute/blob/18723a036b843d9efc1d07b326bda5614b2020e7/src-tauri/src/backend/commands.rs
src-tauri/src/backend/commands.rs
//! High-level APIs for doing operations over [`KernelConnection`] objects. use serde::Serialize; use ts_rs::TS; use super::{ wire_protocol::{ ClearOutput, DisplayData, ErrorReply, ExecuteRequest, ExecuteResult, KernelInfoReply, KernelInfoRequest, KernelMessage, KernelMessageType, KernelStatus, Re...
rust
MIT
18723a036b843d9efc1d07b326bda5614b2020e7
2026-01-04T20:21:18.693962Z
false
ekzhang/jute
https://github.com/ekzhang/jute/blob/18723a036b843d9efc1d07b326bda5614b2020e7/src-tauri/src/backend/wire_protocol/driver_zeromq.rs
src-tauri/src/backend/wire_protocol/driver_zeromq.rs
//! Adapter for the Jupyter wire protocol over ZeroMQ. //! //! This protocol is documented in the `jupyter-client` project at //! <https://jupyter-client.readthedocs.io/en/stable/messaging.html>. It relies //! on 5 dedicated sockets for different types of messages. use std::sync::Arc; use bytes::Bytes; use dashmap::D...
rust
MIT
18723a036b843d9efc1d07b326bda5614b2020e7
2026-01-04T20:21:18.693962Z
false
ekzhang/jute
https://github.com/ekzhang/jute/blob/18723a036b843d9efc1d07b326bda5614b2020e7/src-tauri/src/backend/wire_protocol/driver_websocket.rs
src-tauri/src/backend/wire_protocol/driver_websocket.rs
//! Adapter for the Jupyter wire protocol over WebSocket. //! //! This protocol is documented in the `jupyter-server` project at //! <https://jupyter-server.readthedocs.io/en/latest/developers/websocket-protocols.html>. //! //! It is very similar to the ZeroMQ protocol, but there is a thin framing layer //! that allows...
rust
MIT
18723a036b843d9efc1d07b326bda5614b2020e7
2026-01-04T20:21:18.693962Z
false
ekzhang/jute
https://github.com/ekzhang/jute/blob/18723a036b843d9efc1d07b326bda5614b2020e7/src-tauri/src/backend/local/environment.rs
src-tauri/src/backend/local/environment.rs
//! Metadata about the kernel environment and file system configuration. use std::{ collections::BTreeMap, env, path::{Path, PathBuf}, }; use futures_util::future::join_all; use serde::Deserialize; use tokio::fs; /// The path separator for the current platform. pub const SEP: &str = if cfg!(windows) { "\...
rust
MIT
18723a036b843d9efc1d07b326bda5614b2020e7
2026-01-04T20:21:18.693962Z
false
ekzhang/jute
https://github.com/ekzhang/jute/blob/18723a036b843d9efc1d07b326bda5614b2020e7/src-tauri/src/bin/ts-rs-export.rs
src-tauri/src/bin/ts-rs-export.rs
use std::{ fs, path::Path, process::{exit, Command}, }; use jute::backend::{commands::RunCellEvent, local::KernelUsageInfo, notebook::NotebookRoot}; use ts_rs::TS; fn main() { let export_path = Path::new("../src/bindings"); // print the full path of the export directory println!( "Exp...
rust
MIT
18723a036b843d9efc1d07b326bda5614b2020e7
2026-01-04T20:21:18.693962Z
false
ekzhang/jute
https://github.com/ekzhang/jute/blob/18723a036b843d9efc1d07b326bda5614b2020e7/src-tauri/examples/run_kernel.rs
src-tauri/examples/run_kernel.rs
//! Shell example of running a kernel from Rust code. use std::io::Write; use jute::backend::{ commands::{self, RunCellEvent}, local::{environment, LocalKernel}, }; #[tokio::main] async fn main() { tracing_subscriber::fmt::init(); println!("Available kernels:"); let kernels = environment::list_...
rust
MIT
18723a036b843d9efc1d07b326bda5614b2020e7
2026-01-04T20:21:18.693962Z
false
ekzhang/jute
https://github.com/ekzhang/jute/blob/18723a036b843d9efc1d07b326bda5614b2020e7/src-tauri/examples/list_kernels.rs
src-tauri/examples/list_kernels.rs
//! An example that lists all available kernels. use jute::backend::local::environment; #[tokio::main] async fn main() { println!("Available kernels:"); for (path, kernel_spec) in environment::list_kernels(None).await { println!(" {:20} {}", kernel_spec.display_name, path.display()); } }
rust
MIT
18723a036b843d9efc1d07b326bda5614b2020e7
2026-01-04T20:21:18.693962Z
false
huggingface/inference-benchmarker
https://github.com/huggingface/inference-benchmarker/blob/0a54882d9ae3d2e183005345bd86b5c47382a338/build.rs
build.rs
use std::error::Error; use vergen_gitcl::{Emitter, GitclBuilder}; fn main() -> Result<(), Box<dyn Error>> { // Try to get the git sha from the local git repository match GitclBuilder::all_git() { Ok(gitcl) => match Emitter::default().fail_on_error().add_instructions(&gitcl) { Ok(emitter) =>...
rust
Apache-2.0
0a54882d9ae3d2e183005345bd86b5c47382a338
2026-01-04T20:20:59.288369Z
false
huggingface/inference-benchmarker
https://github.com/huggingface/inference-benchmarker/blob/0a54882d9ae3d2e183005345bd86b5c47382a338/src/flux.rs
src/flux.rs
use crate::results::BenchmarkResults; use std::sync::{Arc, Mutex}; // Flux pattern #[derive(Clone)] pub struct Dispatcher { store: Arc<Mutex<Store>>, } impl Dispatcher { pub(crate) fn new(store: Arc<Mutex<Store>>) -> Self { Self { store } } pub(crate) fn dispatch(&mut self, action: Action) { ...
rust
Apache-2.0
0a54882d9ae3d2e183005345bd86b5c47382a338
2026-01-04T20:20:59.288369Z
false
huggingface/inference-benchmarker
https://github.com/huggingface/inference-benchmarker/blob/0a54882d9ae3d2e183005345bd86b5c47382a338/src/app.rs
src/app.rs
use crate::benchmark::Event as BenchmarkEvent; use crate::event::{terminal_event_task, AppEvent}; use crate::flux::{Action, AppState, Dispatcher, Store}; use crate::scheduler::ExecutorType; use crate::BenchmarkConfig; use crossterm::event::{KeyCode, KeyEvent, KeyModifiers}; use ratatui::layout::{Constraint, Direction, ...
rust
Apache-2.0
0a54882d9ae3d2e183005345bd86b5c47382a338
2026-01-04T20:20:59.288369Z
false
huggingface/inference-benchmarker
https://github.com/huggingface/inference-benchmarker/blob/0a54882d9ae3d2e183005345bd86b5c47382a338/src/profiles.rs
src/profiles.rs
use crate::{RunConfiguration, TokenizeOptions}; use std::string::ToString; pub fn apply_profile( profile: &str, run_configuration: RunConfiguration, ) -> anyhow::Result<RunConfiguration> { match profile { "fixed-length" => Ok(RunConfiguration { max_vus: 128, duration: std::t...
rust
Apache-2.0
0a54882d9ae3d2e183005345bd86b5c47382a338
2026-01-04T20:20:59.288369Z
false
huggingface/inference-benchmarker
https://github.com/huggingface/inference-benchmarker/blob/0a54882d9ae3d2e183005345bd86b5c47382a338/src/event.rs
src/event.rs
use crossterm::event; use crossterm::event::KeyEvent; use std::time::{Duration, Instant}; use tokio::sync::{broadcast, mpsc}; pub enum AppEvent { Tick, Key(KeyEvent), Resize, } pub async fn terminal_event_task( fps: u32, event_sender: mpsc::Sender<AppEvent>, mut shutdown_receiver: broadcast::R...
rust
Apache-2.0
0a54882d9ae3d2e183005345bd86b5c47382a338
2026-01-04T20:20:59.288369Z
false
huggingface/inference-benchmarker
https://github.com/huggingface/inference-benchmarker/blob/0a54882d9ae3d2e183005345bd86b5c47382a338/src/lib.rs
src/lib.rs
use std::collections::HashMap; use std::fs::File; use std::io; use std::io::Write; use std::path::Path; use std::sync::Arc; pub use crate::app::run_console; pub use crate::benchmark::{BenchmarkConfig, BenchmarkKind}; use crate::benchmark::{Event, MessageEvent}; pub use crate::profiles::apply_profile; use crate::reques...
rust
Apache-2.0
0a54882d9ae3d2e183005345bd86b5c47382a338
2026-01-04T20:20:59.288369Z
false
huggingface/inference-benchmarker
https://github.com/huggingface/inference-benchmarker/blob/0a54882d9ae3d2e183005345bd86b5c47382a338/src/benchmark.rs
src/benchmark.rs
use crate::requests::{TextGenerationBackend, TextRequestGenerator, TokenizeOptions}; use crate::results::{BenchmarkReport, BenchmarkResults}; use crate::scheduler::{ExecutorType, SchedulerProgress}; use crate::{executors, scheduler}; use log::{debug, info}; use serde::Serialize; use std::collections::HashMap; use std::...
rust
Apache-2.0
0a54882d9ae3d2e183005345bd86b5c47382a338
2026-01-04T20:20:59.288369Z
false
huggingface/inference-benchmarker
https://github.com/huggingface/inference-benchmarker/blob/0a54882d9ae3d2e183005345bd86b5c47382a338/src/executors.rs
src/executors.rs
use std::sync::atomic::AtomicI64; use std::sync::Arc; use std::time::Duration; use async_trait::async_trait; use log::{info, trace, warn}; use serde::Serialize; use tokio::sync::mpsc::{Receiver, Sender, UnboundedSender}; use tokio::sync::{broadcast, Mutex}; use tokio::task::JoinHandle; use crate::requests::{ Text...
rust
Apache-2.0
0a54882d9ae3d2e183005345bd86b5c47382a338
2026-01-04T20:20:59.288369Z
false
huggingface/inference-benchmarker
https://github.com/huggingface/inference-benchmarker/blob/0a54882d9ae3d2e183005345bd86b5c47382a338/src/results.rs
src/results.rs
use crate::executors::ExecutorConfig; use crate::requests::TextGenerationAggregatedResponse; use crate::results::BenchmarkErrors::NoResponses; use crate::scheduler::ExecutorType; use chrono::Utc; use std::fmt::{Debug, Display, Formatter}; use std::time::Duration; #[derive(Debug)] pub(crate) enum BenchmarkErrors { ...
rust
Apache-2.0
0a54882d9ae3d2e183005345bd86b5c47382a338
2026-01-04T20:20:59.288369Z
false
huggingface/inference-benchmarker
https://github.com/huggingface/inference-benchmarker/blob/0a54882d9ae3d2e183005345bd86b5c47382a338/src/table.rs
src/table.rs
use crate::results::BenchmarkReport; use crate::BenchmarkConfig; use tabled::builder::Builder; pub fn parameters_table(benchmark: BenchmarkConfig) -> anyhow::Result<tabled::Table> { let mut builder = Builder::default(); let rates = benchmark .rates .map_or("N/A".to_string(), |e| format!("{:?}",...
rust
Apache-2.0
0a54882d9ae3d2e183005345bd86b5c47382a338
2026-01-04T20:20:59.288369Z
false
huggingface/inference-benchmarker
https://github.com/huggingface/inference-benchmarker/blob/0a54882d9ae3d2e183005345bd86b5c47382a338/src/writers.rs
src/writers.rs
use crate::results::{BenchmarkReport, BenchmarkResults}; use crate::{executors, table, BenchmarkConfig}; use serde::Serialize; use std::path::Path; use sysinfo::{CpuRefreshKind, MemoryRefreshKind, System}; use tokio::fs; #[derive(Serialize)] pub struct PercentilesWriter { pub p50: f64, pub p60: f64, pub p7...
rust
Apache-2.0
0a54882d9ae3d2e183005345bd86b5c47382a338
2026-01-04T20:20:59.288369Z
false
huggingface/inference-benchmarker
https://github.com/huggingface/inference-benchmarker/blob/0a54882d9ae3d2e183005345bd86b5c47382a338/src/main.rs
src/main.rs
use clap::error::ErrorKind::InvalidValue; use clap::{ArgGroup, Error, Parser}; use inference_benchmarker::{run, RunConfiguration, TokenizeOptions}; use log::{debug, error}; use reqwest::Url; use std::collections::HashMap; use std::time::Duration; use tokio::sync::broadcast; #[derive(Parser, Debug)] #[clap(author, vers...
rust
Apache-2.0
0a54882d9ae3d2e183005345bd86b5c47382a338
2026-01-04T20:20:59.288369Z
false
huggingface/inference-benchmarker
https://github.com/huggingface/inference-benchmarker/blob/0a54882d9ae3d2e183005345bd86b5c47382a338/src/scheduler.rs
src/scheduler.rs
use crate::executors::{ ConstantArrivalRateExecutor, ConstantVUsExecutor, Executor, ExecutorConfig, }; use crate::requests::{ TextGenerationAggregatedResponse, TextGenerationBackend, TextRequestGenerator, }; use crate::results::BenchmarkErrors::NoResponses; use crate::results::BenchmarkResults; use log::{debug,...
rust
Apache-2.0
0a54882d9ae3d2e183005345bd86b5c47382a338
2026-01-04T20:20:59.288369Z
false
huggingface/inference-benchmarker
https://github.com/huggingface/inference-benchmarker/blob/0a54882d9ae3d2e183005345bd86b5c47382a338/src/requests.rs
src/requests.rs
use async_trait::async_trait; use futures_util::StreamExt; use hf_hub::api::sync::ApiBuilder; use indicatif::{ProgressBar, ProgressStyle}; use log::{debug, error, info, trace, warn}; use rand_distr::Distribution; use rayon::iter::split; use rayon::prelude::*; use reqwest::Url; use reqwest_eventsource::{Error, Event, Ev...
rust
Apache-2.0
0a54882d9ae3d2e183005345bd86b5c47382a338
2026-01-04T20:20:59.288369Z
true
BirdbrainEngineer/lenia_ca
https://github.com/BirdbrainEngineer/lenia_ca/blob/ee7b79b09334928a25dbcc96edc33edd57362724/src/lib.rs
src/lib.rs
//! `Lenia_ca` is a crate that provides core functionality for simulating the Lenia system of cellular automata. The crate was made //! as a programming excersize in making a large-ish Rust project. Since this was the first proper Rust project for the author, then //! the crate has some weird quirks and inefficient... ...
rust
MIT
ee7b79b09334928a25dbcc96edc33edd57362724
2026-01-04T20:21:17.859970Z
true
BirdbrainEngineer/lenia_ca
https://github.com/BirdbrainEngineer/lenia_ca/blob/ee7b79b09334928a25dbcc96edc33edd57362724/src/lenias.rs
src/lenias.rs
//! Collection of different types of Lenia systems. use num_complex::Complex; use std::sync::{Arc, Mutex, RwLock}; use std::thread; use super::*; use super::fft::ParPlannedFFTND; /// Standard type of Lenia /// /// `StandardLenia` struct implements the non-expanded Lenia system with a 2d field and /// pre-set parame...
rust
MIT
ee7b79b09334928a25dbcc96edc33edd57362724
2026-01-04T20:21:17.859970Z
false
BirdbrainEngineer/lenia_ca
https://github.com/BirdbrainEngineer/lenia_ca/blob/ee7b79b09334928a25dbcc96edc33edd57362724/src/growth_functions.rs
src/growth_functions.rs
//! A collection of often used growth functions. #![allow(dead_code)] #![allow(unused_variables)] /// Standard unimodal "gaussian bump". /// /// ### Parameters /// /// * `params[0]` - **mu**: The position of the mean / highest point of the growth function. /// /// * `params[1]` - **sigma**: Standard deviation of t...
rust
MIT
ee7b79b09334928a25dbcc96edc33edd57362724
2026-01-04T20:21:17.859970Z
false
BirdbrainEngineer/lenia_ca
https://github.com/BirdbrainEngineer/lenia_ca/blob/ee7b79b09334928a25dbcc96edc33edd57362724/src/kernels.rs
src/kernels.rs
//! Collection of generators for often used kernel shapes. #![allow(dead_code)] #![allow(unused_variables)] use super::*; use ndarray::IxDyn; /// Generates a kernel base of a gaussian donut in 2d. /// /// The mean (position of the highest value) is placed at `0.5` /// in the range `[0.0..1.0]`, where `0.0` is the...
rust
MIT
ee7b79b09334928a25dbcc96edc33edd57362724
2026-01-04T20:21:17.859970Z
false
BirdbrainEngineer/lenia_ca
https://github.com/BirdbrainEngineer/lenia_ca/blob/ee7b79b09334928a25dbcc96edc33edd57362724/src/fft.rs
src/fft.rs
//! Contains the required functionality for performing n-dimensional fast-fourier-transforms. #![allow(dead_code)] #![allow(unused_variables)] use std::{fmt, sync::Arc}; use rustfft::{Fft, FftPlanner, FftDirection}; use rustfft::num_complex::Complex; use rayon::prelude::*; /// Holds all the relevant data for a pre-p...
rust
MIT
ee7b79b09334928a25dbcc96edc33edd57362724
2026-01-04T20:21:17.859970Z
false
LilyFirefly/django-rusty-templates
https://github.com/LilyFirefly/django-rusty-templates/blob/86be8c9afbb5f98da786657fa0c3d044fab87e37/dtl-lexer/src/variable.rs
dtl-lexer/src/variable.rs
use miette::{Diagnostic, SourceSpan}; use num_bigint::BigInt; use thiserror::Error; use unicode_xid::UnicodeXID; use crate::common::{ LexerError, NextChar, check_variable_attrs, lex_numeric, lex_text, lex_translated, lex_variable_argument, trim_variable, }; use crate::types::{At, TemplateString}; use crate::{E...
rust
BSD-3-Clause
86be8c9afbb5f98da786657fa0c3d044fab87e37
2026-01-04T20:21:11.003630Z
false
LilyFirefly/django-rusty-templates
https://github.com/LilyFirefly/django-rusty-templates/blob/86be8c9afbb5f98da786657fa0c3d044fab87e37/dtl-lexer/src/lib.rs
dtl-lexer/src/lib.rs
use crate::types::TemplateString; pub mod common; pub mod core; pub mod tag; pub mod types; pub mod variable; pub const START_TAG_LEN: usize = 2; const END_TAG_LEN: usize = 2; const START_TRANSLATE_LEN: usize = 2; const END_TRANSLATE_LEN: usize = 1; const QUOTE_LEN: usize = 1; pub trait TemplateContent<'t> { fn...
rust
BSD-3-Clause
86be8c9afbb5f98da786657fa0c3d044fab87e37
2026-01-04T20:21:11.003630Z
false
LilyFirefly/django-rusty-templates
https://github.com/LilyFirefly/django-rusty-templates/blob/86be8c9afbb5f98da786657fa0c3d044fab87e37/dtl-lexer/src/core.rs
dtl-lexer/src/core.rs
use crate::types::{At, TemplateString}; use crate::{END_TAG_LEN, START_TAG_LEN}; enum EndTag { Variable, Tag, Comment, } #[derive(Debug, PartialEq, Eq)] pub enum TokenType { Text, Variable, Tag, Comment, } #[derive(Debug, PartialEq, Eq)] pub struct Token { pub token_type: TokenType, ...
rust
BSD-3-Clause
86be8c9afbb5f98da786657fa0c3d044fab87e37
2026-01-04T20:21:11.003630Z
false
LilyFirefly/django-rusty-templates
https://github.com/LilyFirefly/django-rusty-templates/blob/86be8c9afbb5f98da786657fa0c3d044fab87e37/dtl-lexer/src/types.rs
dtl-lexer/src/types.rs
use crate::TemplateContent; pub type At = (usize, usize); #[derive(Clone, Copy)] pub struct TemplateString<'t>(pub &'t str); impl<'t> TemplateString<'t> { pub fn content(&self, at: At) -> &'t str { let (start, len) = at; &self.0[start..start + len] } } impl<'t> From<&'t str> for TemplateStri...
rust
BSD-3-Clause
86be8c9afbb5f98da786657fa0c3d044fab87e37
2026-01-04T20:21:11.003630Z
false
LilyFirefly/django-rusty-templates
https://github.com/LilyFirefly/django-rusty-templates/blob/86be8c9afbb5f98da786657fa0c3d044fab87e37/dtl-lexer/src/common.rs
dtl-lexer/src/common.rs
use miette::{Diagnostic, SourceSpan}; use thiserror::Error; use unicode_xid::UnicodeXID; use crate::types::At; use crate::{END_TRANSLATE_LEN, QUOTE_LEN, START_TRANSLATE_LEN}; pub trait NextChar { fn next_whitespace(&self) -> usize; fn next_non_whitespace(&self) -> usize; } impl NextChar for str { fn next...
rust
BSD-3-Clause
86be8c9afbb5f98da786657fa0c3d044fab87e37
2026-01-04T20:21:11.003630Z
false
LilyFirefly/django-rusty-templates
https://github.com/LilyFirefly/django-rusty-templates/blob/86be8c9afbb5f98da786657fa0c3d044fab87e37/dtl-lexer/src/tag.rs
dtl-lexer/src/tag.rs
pub mod autoescape; pub mod custom_tag; pub mod forloop; pub mod ifcondition; pub mod include; pub mod load; pub mod lorem; use crate::common::NextChar; use crate::types::{At, TemplateString}; use crate::{END_TAG_LEN, START_TAG_LEN, TemplateContent}; use miette::{Diagnostic, SourceSpan}; use thiserror::Error; use unic...
rust
BSD-3-Clause
86be8c9afbb5f98da786657fa0c3d044fab87e37
2026-01-04T20:21:11.003630Z
false
LilyFirefly/django-rusty-templates
https://github.com/LilyFirefly/django-rusty-templates/blob/86be8c9afbb5f98da786657fa0c3d044fab87e37/dtl-lexer/src/tag/autoescape.rs
dtl-lexer/src/tag/autoescape.rs
use miette::{Diagnostic, SourceSpan}; use thiserror::Error; use crate::tag::TagParts; use crate::types::{At, TemplateString}; #[derive(Clone, Debug, PartialEq)] pub enum AutoescapeEnabled { On, Off, } impl From<&AutoescapeEnabled> for bool { fn from(enabled: &AutoescapeEnabled) -> Self { match en...
rust
BSD-3-Clause
86be8c9afbb5f98da786657fa0c3d044fab87e37
2026-01-04T20:21:11.003630Z
false
LilyFirefly/django-rusty-templates
https://github.com/LilyFirefly/django-rusty-templates/blob/86be8c9afbb5f98da786657fa0c3d044fab87e37/dtl-lexer/src/tag/lorem.rs
dtl-lexer/src/tag/lorem.rs
#![expect(unused_assignments)] use crate::common::NextChar; use crate::tag::TagParts; use crate::types::{At, TemplateString}; use miette::{Diagnostic, SourceSpan}; use thiserror::Error; #[derive(Debug, PartialEq, Clone)] pub enum LoremMethod { Words, Paragraphs, Blocks, } #[derive(Debug, PartialEq, Clone)...
rust
BSD-3-Clause
86be8c9afbb5f98da786657fa0c3d044fab87e37
2026-01-04T20:21:11.003630Z
false
LilyFirefly/django-rusty-templates
https://github.com/LilyFirefly/django-rusty-templates/blob/86be8c9afbb5f98da786657fa0c3d044fab87e37/dtl-lexer/src/tag/include.rs
dtl-lexer/src/tag/include.rs
#![expect(unused_assignments)] use miette::{Diagnostic, SourceSpan}; use thiserror::Error; use crate::common::text_content_at; use crate::tag::TagParts; use crate::tag::custom_tag::{ SimpleTagLexer, SimpleTagLexerError, SimpleTagToken, SimpleTagTokenType, }; use crate::types::{At, TemplateString}; #[derive(Debug,...
rust
BSD-3-Clause
86be8c9afbb5f98da786657fa0c3d044fab87e37
2026-01-04T20:21:11.003630Z
false
LilyFirefly/django-rusty-templates
https://github.com/LilyFirefly/django-rusty-templates/blob/86be8c9afbb5f98da786657fa0c3d044fab87e37/dtl-lexer/src/tag/custom_tag.rs
dtl-lexer/src/tag/custom_tag.rs
use miette::{Diagnostic, SourceSpan}; use thiserror::Error; use unicode_xid::UnicodeXID; use crate::common::{ LexerError, NextChar, lex_numeric, lex_text, lex_translated, lex_variable, text_content_at, translated_text_content_at, }; use crate::tag::TagParts; use crate::types::{At, TemplateString}; #[derive(De...
rust
BSD-3-Clause
86be8c9afbb5f98da786657fa0c3d044fab87e37
2026-01-04T20:21:11.003630Z
false
LilyFirefly/django-rusty-templates
https://github.com/LilyFirefly/django-rusty-templates/blob/86be8c9afbb5f98da786657fa0c3d044fab87e37/dtl-lexer/src/tag/load.rs
dtl-lexer/src/tag/load.rs
use crate::common::NextChar; use crate::tag::TagParts; use crate::types::{At, TemplateString}; #[derive(Debug, PartialEq)] pub struct LoadToken { pub at: At, } pub struct LoadLexer<'t> { rest: &'t str, byte: usize, } impl<'t> LoadLexer<'t> { pub fn new(template: TemplateString<'t>, parts: TagParts) -...
rust
BSD-3-Clause
86be8c9afbb5f98da786657fa0c3d044fab87e37
2026-01-04T20:21:11.003630Z
false
LilyFirefly/django-rusty-templates
https://github.com/LilyFirefly/django-rusty-templates/blob/86be8c9afbb5f98da786657fa0c3d044fab87e37/dtl-lexer/src/tag/ifcondition.rs
dtl-lexer/src/tag/ifcondition.rs
use crate::common::{ LexerError, NextChar, lex_numeric, lex_text, lex_translated, lex_variable, text_content_at, translated_text_content_at, }; use crate::tag::TagParts; use crate::types::{At, TemplateString}; #[derive(Debug, PartialEq, Eq)] pub enum IfConditionAtom { Numeric, Text, TranslatedText,...
rust
BSD-3-Clause
86be8c9afbb5f98da786657fa0c3d044fab87e37
2026-01-04T20:21:11.003630Z
false
LilyFirefly/django-rusty-templates
https://github.com/LilyFirefly/django-rusty-templates/blob/86be8c9afbb5f98da786657fa0c3d044fab87e37/dtl-lexer/src/tag/forloop.rs
dtl-lexer/src/tag/forloop.rs
// Silence lint warnings for Miette Diagnostic // https://github.com/zkat/miette/issues/458 // https://github.com/rust-lang/rust/issues/147648 #![expect(unused_assignments)] use miette::{Diagnostic, SourceSpan}; use thiserror::Error; use crate::common::{LexerError, NextChar, lex_numeric, lex_text, lex_translated, lex_...
rust
BSD-3-Clause
86be8c9afbb5f98da786657fa0c3d044fab87e37
2026-01-04T20:21:11.003630Z
false
LilyFirefly/django-rusty-templates
https://github.com/LilyFirefly/django-rusty-templates/blob/86be8c9afbb5f98da786657fa0c3d044fab87e37/src/path.rs
src/path.rs
#![expect(unused_assignments)] use std::borrow::Cow; use std::path::{Path, PathBuf}; use miette::{Diagnostic, SourceSpan}; use sugar_path::SugarPath; use thiserror::Error; use dtl_lexer::types::At; #[derive(Error, Debug, Diagnostic, PartialEq, Eq)] pub enum RelativePathError { #[error( "The relative path...
rust
BSD-3-Clause
86be8c9afbb5f98da786657fa0c3d044fab87e37
2026-01-04T20:21:11.003630Z
false
LilyFirefly/django-rusty-templates
https://github.com/LilyFirefly/django-rusty-templates/blob/86be8c9afbb5f98da786657fa0c3d044fab87e37/src/lib.rs
src/lib.rs
/// Custom `todo!` macro that returns a pickable `PyNotImplementedError` instead of /// a non-pickable `PanicException`. This allows Django's test suite to run in parallel. /// /// This macro shadows the standard library's `todo!` macro throughout the crate. #[macro_export] macro_rules! todo { () => {{ let ...
rust
BSD-3-Clause
86be8c9afbb5f98da786657fa0c3d044fab87e37
2026-01-04T20:21:11.003630Z
false
LilyFirefly/django-rusty-templates
https://github.com/LilyFirefly/django-rusty-templates/blob/86be8c9afbb5f98da786657fa0c3d044fab87e37/src/filters.rs
src/filters.rs
use std::sync::Arc; use pyo3::prelude::*; use crate::types::Argument; use dtl_lexer::types::At; #[derive(Clone, Debug, PartialEq)] pub enum FilterType { Add(AddFilter), AddSlashes(AddSlashesFilter), Capfirst(CapfirstFilter), Center(CenterFilter), Cut(CutFilter), Default(DefaultFilter), De...
rust
BSD-3-Clause
86be8c9afbb5f98da786657fa0c3d044fab87e37
2026-01-04T20:21:11.003630Z
false
LilyFirefly/django-rusty-templates
https://github.com/LilyFirefly/django-rusty-templates/blob/86be8c9afbb5f98da786657fa0c3d044fab87e37/src/parse.rs
src/parse.rs
// Silence lint warnings for Miette Diagnostic // https://github.com/zkat/miette/issues/458 // https://github.com/rust-lang/rust/issues/147648 #![expect(unused_assignments)] use std::borrow::Cow; use std::collections::{HashMap, HashSet}; use std::iter::Peekable; use std::sync::Arc; use either::Either; use miette::{Dia...
rust
BSD-3-Clause
86be8c9afbb5f98da786657fa0c3d044fab87e37
2026-01-04T20:21:11.003630Z
true
LilyFirefly/django-rusty-templates
https://github.com/LilyFirefly/django-rusty-templates/blob/86be8c9afbb5f98da786657fa0c3d044fab87e37/src/template.rs
src/template.rs
use pyo3::prelude::*; #[pymodule] pub mod django_rusty_templates { use std::borrow::Cow; use std::collections::HashMap; use std::path::PathBuf; use std::sync::{Arc, Mutex}; use encoding_rs::Encoding; use pyo3::exceptions::{ PyAttributeError, PyImportError, PyOverflowError, PyTypeError,...
rust
BSD-3-Clause
86be8c9afbb5f98da786657fa0c3d044fab87e37
2026-01-04T20:21:11.003630Z
true
LilyFirefly/django-rusty-templates
https://github.com/LilyFirefly/django-rusty-templates/blob/86be8c9afbb5f98da786657fa0c3d044fab87e37/src/error.rs
src/error.rs
// Silence lint warnings for Miette Diagnostic // https://github.com/zkat/miette/issues/458 // https://github.com/rust-lang/rust/issues/147648 #![expect(unused_assignments)] use miette::{Diagnostic, LabeledSpan, SourceSpan, miette}; use pyo3::exceptions::PyKeyError; use pyo3::prelude::*; use thiserror::Error; use crat...
rust
BSD-3-Clause
86be8c9afbb5f98da786657fa0c3d044fab87e37
2026-01-04T20:21:11.003630Z
false
LilyFirefly/django-rusty-templates
https://github.com/LilyFirefly/django-rusty-templates/blob/86be8c9afbb5f98da786657fa0c3d044fab87e37/src/types.rs
src/types.rs
use num_bigint::BigInt; use dtl_lexer::types::{At, Variable}; #[derive(Clone, Copy, Debug, PartialEq, Eq)] pub struct Text { pub at: At, } impl Text { pub fn new(at: At) -> Self { Self { at } } } #[derive(Clone, Copy, Debug, PartialEq, Eq)] pub struct TranslatedText { pub at: At, } impl Tra...
rust
BSD-3-Clause
86be8c9afbb5f98da786657fa0c3d044fab87e37
2026-01-04T20:21:11.003630Z
false
LilyFirefly/django-rusty-templates
https://github.com/LilyFirefly/django-rusty-templates/blob/86be8c9afbb5f98da786657fa0c3d044fab87e37/src/render.rs
src/render.rs
pub mod common; pub mod filters; pub mod lorem; pub mod tags; pub mod types; use std::borrow::Cow; use pyo3::prelude::*; use dtl_lexer::types::TemplateString; use crate::error::PyRenderError; use types::{Content, Context}; pub type ResolveResult<'t, 'py> = Result<Option<Content<'t, 'py>>, PyRenderError>; pub type ...
rust
BSD-3-Clause
86be8c9afbb5f98da786657fa0c3d044fab87e37
2026-01-04T20:21:11.003630Z
false
LilyFirefly/django-rusty-templates
https://github.com/LilyFirefly/django-rusty-templates/blob/86be8c9afbb5f98da786657fa0c3d044fab87e37/src/utils.rs
src/utils.rs
use pyo3::prelude::*; use pyo3::type_object::PyTypeInfo; pub trait PyResultMethods<T> { fn ok_or_isinstance_of<E>(self, py: Python<'_>) -> PyResult<PyResult<T>> where E: PyTypeInfo; } impl<T> PyResultMethods<T> for PyResult<T> { fn ok_or_isinstance_of<E>(self, py: Python<'_>) -> PyResult<Self> ...
rust
BSD-3-Clause
86be8c9afbb5f98da786657fa0c3d044fab87e37
2026-01-04T20:21:11.003630Z
false
LilyFirefly/django-rusty-templates
https://github.com/LilyFirefly/django-rusty-templates/blob/86be8c9afbb5f98da786657fa0c3d044fab87e37/src/loaders.rs
src/loaders.rs
use std::collections::HashMap; use std::path::{Path, PathBuf}; use std::sync::Arc; use cached::proc_macro::cached; use encoding_rs::Encoding; use pyo3::exceptions::PyUnicodeError; use pyo3::prelude::*; use pyo3::sync::PyOnceLock; use sugar_path::SugarPath; use crate::template::django_rusty_templates::{Engine, Templat...
rust
BSD-3-Clause
86be8c9afbb5f98da786657fa0c3d044fab87e37
2026-01-04T20:21:11.003630Z
false
LilyFirefly/django-rusty-templates
https://github.com/LilyFirefly/django-rusty-templates/blob/86be8c9afbb5f98da786657fa0c3d044fab87e37/src/render/filters.rs
src/render/filters.rs
use std::borrow::Cow; use html_escape::encode_quoted_attribute_to_string; use num_traits::ToPrimitive; use pyo3::prelude::*; use pyo3::sync::PyOnceLock; use pyo3::types::PyType; use pyo3::types::{PyDate, PyDateTime, PyTime}; use crate::error::{AnnotatePyErr, PyRenderError, RenderError}; use crate::filters::{ AddF...
rust
BSD-3-Clause
86be8c9afbb5f98da786657fa0c3d044fab87e37
2026-01-04T20:21:11.003630Z
true
LilyFirefly/django-rusty-templates
https://github.com/LilyFirefly/django-rusty-templates/blob/86be8c9afbb5f98da786657fa0c3d044fab87e37/src/render/lorem.rs
src/render/lorem.rs
use rand::Rng; use rand::seq::SliceRandom; use std::borrow::Cow; static COMMON_P: &str = "Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod \ tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud \ exercitation ullamco laboris nisi ut aliquip ex ea commodo con...
rust
BSD-3-Clause
86be8c9afbb5f98da786657fa0c3d044fab87e37
2026-01-04T20:21:11.003630Z
false
LilyFirefly/django-rusty-templates
https://github.com/LilyFirefly/django-rusty-templates/blob/86be8c9afbb5f98da786657fa0c3d044fab87e37/src/render/types.rs
src/render/types.rs
use std::borrow::Cow; use std::collections::BTreeMap; use std::collections::HashMap; use std::collections::HashSet; use std::collections::hash_map::Entry; use std::iter::zip; use std::sync::{Arc, Mutex}; use html_escape::encode_quoted_attribute; use miette::SourceSpan; use num_bigint::{BigInt, ToBigInt}; use num_trait...
rust
BSD-3-Clause
86be8c9afbb5f98da786657fa0c3d044fab87e37
2026-01-04T20:21:11.003630Z
false
LilyFirefly/django-rusty-templates
https://github.com/LilyFirefly/django-rusty-templates/blob/86be8c9afbb5f98da786657fa0c3d044fab87e37/src/render/tags.rs
src/render/tags.rs
use std::borrow::Cow; use std::collections::{HashMap, VecDeque}; use std::sync::Arc; use num_bigint::{BigInt, Sign}; use num_traits::cast::ToPrimitive; use pyo3::exceptions::{PyAttributeError, PyTypeError}; use pyo3::intern; use pyo3::prelude::*; use pyo3::sync::{MutexExt, PyOnceLock}; use pyo3::types::{PyBool, PyDict...
rust
BSD-3-Clause
86be8c9afbb5f98da786657fa0c3d044fab87e37
2026-01-04T20:21:11.003630Z
true
LilyFirefly/django-rusty-templates
https://github.com/LilyFirefly/django-rusty-templates/blob/86be8c9afbb5f98da786657fa0c3d044fab87e37/src/render/common.rs
src/render/common.rs
use std::borrow::Cow; use pyo3::intern; use pyo3::prelude::*; use pyo3::sync::PyOnceLock; use pyo3::types::PyString; use dtl_lexer::types::TemplateString; use super::types::{AsBorrowedContent, Content, ContentString, Context}; use super::{Evaluate, Render, RenderResult, Resolve, ResolveFailures, ResolveResult}; use ...
rust
BSD-3-Clause
86be8c9afbb5f98da786657fa0c3d044fab87e37
2026-01-04T20:21:11.003630Z
false
LilyFirefly/django-rusty-templates
https://github.com/LilyFirefly/django-rusty-templates/blob/86be8c9afbb5f98da786657fa0c3d044fab87e37/dtl-benchmark/src/lib.rs
dtl-benchmark/src/lib.rs
// Empty for now
rust
BSD-3-Clause
86be8c9afbb5f98da786657fa0c3d044fab87e37
2026-01-04T20:21:11.003630Z
false
LilyFirefly/django-rusty-templates
https://github.com/LilyFirefly/django-rusty-templates/blob/86be8c9afbb5f98da786657fa0c3d044fab87e37/dtl-benchmark/benches/slugify.rs
dtl-benchmark/benches/slugify.rs
use std::borrow::Cow; use std::fmt; use divan::black_box; use django_rusty_templates::render::filters::slugify; fn main() { divan::main(); } struct BenchCase { name: &'static str, input: &'static str, } impl fmt::Display for BenchCase { fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { ...
rust
BSD-3-Clause
86be8c9afbb5f98da786657fa0c3d044fab87e37
2026-01-04T20:21:11.003630Z
false
biandratti/huginn-net
https://github.com/biandratti/huginn-net/blob/ef479d3357bc040b4dcdacffbb4ab8db07051f1b/huginn-net/src/lib.rs
huginn-net/src/lib.rs
#![forbid(unsafe_code)] // ============================================================================ // CORE IMPORTS (database, errors, results - always required) // ============================================================================ use crate::output::FingerprintResult; use huginn_net_db::MatchQualityType...
rust
Apache-2.0
ef479d3357bc040b4dcdacffbb4ab8db07051f1b
2026-01-04T20:21:12.648216Z
false
biandratti/huginn-net
https://github.com/biandratti/huginn-net/blob/ef479d3357bc040b4dcdacffbb4ab8db07051f1b/huginn-net/src/process.rs
huginn-net/src/process.rs
use crate::error::HuginnNetError; use crate::packet_parser::{parse_packet, IpPacket}; use crate::AnalysisConfig; use huginn_net_http::http_process::{FlowKey, HttpProcessors, ObservableHttpPackage, TcpFlow}; use huginn_net_http::observable::{ObservableHttpRequest, ObservableHttpResponse}; use huginn_net_tcp::observable:...
rust
Apache-2.0
ef479d3357bc040b4dcdacffbb4ab8db07051f1b
2026-01-04T20:21:12.648216Z
false
biandratti/huginn-net
https://github.com/biandratti/huginn-net/blob/ef479d3357bc040b4dcdacffbb4ab8db07051f1b/huginn-net/src/error.rs
huginn-net/src/error.rs
use pnet::packet::ethernet::EtherType; use thiserror::Error; /// Error handling during network packet analysis and Database parsing. #[derive(Error, Debug)] pub enum HuginnNetError { /// An error occurred while parsing data. /// /// This variant is used when a parsing operation fails. /// The associate...
rust
Apache-2.0
ef479d3357bc040b4dcdacffbb4ab8db07051f1b
2026-01-04T20:21:12.648216Z
false
biandratti/huginn-net
https://github.com/biandratti/huginn-net/blob/ef479d3357bc040b4dcdacffbb4ab8db07051f1b/huginn-net/src/matcher.rs
huginn-net/src/matcher.rs
/// Macro for quality matching pattern. /// This macro provides a zero-cost abstraction for the common pattern of /// conditional quality matching based on matcher_enabled configuration. /// /// # Usage /// /// ```rust /// use huginn_net::quality_match; /// # use huginn_net_tcp::output::{OperativeSystem, OSQualityMatch...
rust
Apache-2.0
ef479d3357bc040b4dcdacffbb4ab8db07051f1b
2026-01-04T20:21:12.648216Z
false
biandratti/huginn-net
https://github.com/biandratti/huginn-net/blob/ef479d3357bc040b4dcdacffbb4ab8db07051f1b/huginn-net/src/output.rs
huginn-net/src/output.rs
use huginn_net_http::output::{HttpRequestOutput, HttpResponseOutput}; use huginn_net_tcp::output::{MTUOutput, SynAckTCPOutput, SynTCPOutput, UptimeOutput}; use huginn_net_tls::output::TlsClientOutput; /// Represents the output from the Huginn Net analyzer. /// /// This struct contains various optional outputs that can...
rust
Apache-2.0
ef479d3357bc040b4dcdacffbb4ab8db07051f1b
2026-01-04T20:21:12.648216Z
false
biandratti/huginn-net
https://github.com/biandratti/huginn-net/blob/ef479d3357bc040b4dcdacffbb4ab8db07051f1b/huginn-net/src/packet_parser.rs
huginn-net/src/packet_parser.rs
/// Packet parsing utilities for different network packet formats /// /// This module provides unified parsing for various network packet formats /// from both live network capture and PCAP files: /// - Ethernet frames (most common in network interfaces) /// - Raw IP packets (tunnels, loopback interfaces) /// - NULL da...
rust
Apache-2.0
ef479d3357bc040b4dcdacffbb4ab8db07051f1b
2026-01-04T20:21:12.648216Z
false
biandratti/huginn-net
https://github.com/biandratti/huginn-net/blob/ef479d3357bc040b4dcdacffbb4ab8db07051f1b/huginn-net/tests/packet_parser.rs
huginn-net/tests/packet_parser.rs
use huginn_net::packet_parser::{detect_datalink_format, parse_packet, DatalinkFormat, IpPacket}; #[test] fn test_detect_null_datalink() { // NULL datalink: 4-byte header + IPv6 packet let null_packet = vec![ 0x1e, 0x00, 0x00, 0x00, // NULL header 0x60, 0x00, 0x00, 0x00, // IPv6 header start (ve...
rust
Apache-2.0
ef479d3357bc040b4dcdacffbb4ab8db07051f1b
2026-01-04T20:21:12.648216Z
false
biandratti/huginn-net
https://github.com/biandratti/huginn-net/blob/ef479d3357bc040b4dcdacffbb4ab8db07051f1b/huginn-net-tls/src/observable.rs
huginn-net-tls/src/observable.rs
use crate::tls::{Ja4Payload, TlsVersion}; /// Observable TLS Client signals #[derive(Debug, Clone)] pub struct ObservableTlsClient { /// TLS version from ClientHello pub version: TlsVersion, /// Server Name Indication (SNI) if present pub sni: Option<String>, /// Application-Layer Protocol Negotiat...
rust
Apache-2.0
ef479d3357bc040b4dcdacffbb4ab8db07051f1b
2026-01-04T20:21:12.648216Z
false
biandratti/huginn-net
https://github.com/biandratti/huginn-net/blob/ef479d3357bc040b4dcdacffbb4ab8db07051f1b/huginn-net-tls/src/tls.rs
huginn-net-tls/src/tls.rs
use sha2::{Digest, Sha256}; use std::fmt::{self}; /// TLS version for fingerprinting /// Includes legacy SSL versions for complete JA4 specification compatibility. /// Note: SSL 2.0 is not supported by tls-parser (too legacy/vulnerable) #[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)] pub enum TlsVersion { V1_3,...
rust
Apache-2.0
ef479d3357bc040b4dcdacffbb4ab8db07051f1b
2026-01-04T20:21:12.648216Z
false
biandratti/huginn-net
https://github.com/biandratti/huginn-net/blob/ef479d3357bc040b4dcdacffbb4ab8db07051f1b/huginn-net-tls/src/tls_process.rs
huginn-net-tls/src/tls_process.rs
use crate::error::HuginnNetTlsError; use crate::observable::ObservableTlsClient; use crate::observable::ObservableTlsPackage; use crate::tls::{Signature, TlsVersion, TLS_GREASE_VALUES}; use pnet::packet::ip::IpNextHeaderProtocols; use pnet::packet::ipv4::Ipv4Packet; use pnet::packet::ipv6::Ipv6Packet; use pnet::packet:...
rust
Apache-2.0
ef479d3357bc040b4dcdacffbb4ab8db07051f1b
2026-01-04T20:21:12.648216Z
false
biandratti/huginn-net
https://github.com/biandratti/huginn-net/blob/ef479d3357bc040b4dcdacffbb4ab8db07051f1b/huginn-net-tls/src/lib.rs
huginn-net-tls/src/lib.rs
pub mod error; pub mod filter; pub mod observable; pub mod output; pub mod packet_parser; pub mod parallel; pub mod process; pub mod raw_filter; pub mod tls; pub mod tls_client_hello_reader; pub mod tls_process; // Re-exports pub use error::*; pub use filter::*; pub use observable::*; pub use output::*; pub use parall...
rust
Apache-2.0
ef479d3357bc040b4dcdacffbb4ab8db07051f1b
2026-01-04T20:21:12.648216Z
false
biandratti/huginn-net
https://github.com/biandratti/huginn-net/blob/ef479d3357bc040b4dcdacffbb4ab8db07051f1b/huginn-net-tls/src/process.rs
huginn-net-tls/src/process.rs
use crate::error::HuginnNetTlsError; use crate::output::{IpPort, TlsClientOutput}; use crate::ObservableTlsClient; use pnet::packet::ipv4::Ipv4Packet; use pnet::packet::ipv6::Ipv6Packet; use pnet::packet::tcp::TcpPacket; use pnet::packet::Packet; use std::net::IpAddr; #[derive(Clone)] pub struct ObservablePackage { ...
rust
Apache-2.0
ef479d3357bc040b4dcdacffbb4ab8db07051f1b
2026-01-04T20:21:12.648216Z
false
biandratti/huginn-net
https://github.com/biandratti/huginn-net/blob/ef479d3357bc040b4dcdacffbb4ab8db07051f1b/huginn-net-tls/src/filter.rs
huginn-net-tls/src/filter.rs
use pnet::ipnetwork::{IpNetwork, Ipv4Network, Ipv6Network}; use std::net::{IpAddr, Ipv4Addr, Ipv6Addr}; /// Filter mode: Allow (allowlist) or Deny (denylist) #[derive(Debug, Clone, Copy, PartialEq, Eq, Default)] pub enum FilterMode { /// Allow only matching packets (allowlist mode) #[default] Allow, //...
rust
Apache-2.0
ef479d3357bc040b4dcdacffbb4ab8db07051f1b
2026-01-04T20:21:12.648216Z
false
biandratti/huginn-net
https://github.com/biandratti/huginn-net/blob/ef479d3357bc040b4dcdacffbb4ab8db07051f1b/huginn-net-tls/src/tls_client_hello_reader.rs
huginn-net-tls/src/tls_client_hello_reader.rs
use crate::tls::Signature; use crate::tls_process::parse_tls_client_hello; /// TLS ClientHello reader with incremental parsing support /// /// This struct manages reading and parsing TLS ClientHello messages incrementally, /// handling cases where the ClientHello arrives in multiple TCP packets. /// /// # Example /// ...
rust
Apache-2.0
ef479d3357bc040b4dcdacffbb4ab8db07051f1b
2026-01-04T20:21:12.648216Z
false
biandratti/huginn-net
https://github.com/biandratti/huginn-net/blob/ef479d3357bc040b4dcdacffbb4ab8db07051f1b/huginn-net-tls/src/error.rs
huginn-net-tls/src/error.rs
use thiserror::Error; #[derive(Error, Debug)] pub enum HuginnNetTlsError { /// An error occurred while parsing TLS data. #[error("Parse error: {0}")] Parse(String), /// An unsupported protocol was encountered. #[error("Unsupported protocol: {0}")] UnsupportedProtocol(String), /// Misconfi...
rust
Apache-2.0
ef479d3357bc040b4dcdacffbb4ab8db07051f1b
2026-01-04T20:21:12.648216Z
false
biandratti/huginn-net
https://github.com/biandratti/huginn-net/blob/ef479d3357bc040b4dcdacffbb4ab8db07051f1b/huginn-net-tls/src/parallel.rs
huginn-net-tls/src/parallel.rs
use crate::filter::FilterConfig; use crate::output::TlsClientOutput; use crate::packet_parser::{parse_packet, IpPacket}; use crate::process::{process_ipv4_packet, process_ipv6_packet}; use crate::raw_filter; use crate::HuginnNetTlsError; use crossbeam_channel::{bounded, Receiver, RecvTimeoutError, Sender, TryRecvError,...
rust
Apache-2.0
ef479d3357bc040b4dcdacffbb4ab8db07051f1b
2026-01-04T20:21:12.648216Z
false
biandratti/huginn-net
https://github.com/biandratti/huginn-net/blob/ef479d3357bc040b4dcdacffbb4ab8db07051f1b/huginn-net-tls/src/raw_filter.rs
huginn-net-tls/src/raw_filter.rs
use crate::filter::FilterConfig; use std::net::{IpAddr, Ipv4Addr, Ipv6Addr}; use tracing::debug; /// Apply raw filter check on raw packet bytes /// /// Extracts only IPs and ports without creating full packet structures. /// This is much faster than parsing the entire packet first. /// /// # Returns /// /// - `true`: ...
rust
Apache-2.0
ef479d3357bc040b4dcdacffbb4ab8db07051f1b
2026-01-04T20:21:12.648216Z
false
biandratti/huginn-net
https://github.com/biandratti/huginn-net/blob/ef479d3357bc040b4dcdacffbb4ab8db07051f1b/huginn-net-tls/src/output.rs
huginn-net-tls/src/output.rs
use crate::ObservableTlsClient; use std::fmt; use std::fmt::Formatter; #[derive(Debug, Clone, PartialEq)] pub struct IpPort { pub ip: std::net::IpAddr, pub port: u16, } impl IpPort { pub fn new(ip: std::net::IpAddr, port: u16) -> Self { Self { ip, port } } } /// Holds information derived from...
rust
Apache-2.0
ef479d3357bc040b4dcdacffbb4ab8db07051f1b
2026-01-04T20:21:12.648216Z
false
biandratti/huginn-net
https://github.com/biandratti/huginn-net/blob/ef479d3357bc040b4dcdacffbb4ab8db07051f1b/huginn-net-tls/src/packet_parser.rs
huginn-net-tls/src/packet_parser.rs
/// Packet parsing utilities for different network packet formats /// /// This module provides unified parsing for various network packet formats /// from both live network capture and PCAP files: /// - Ethernet frames (most common in network interfaces) /// - Raw IP packets (tunnels, loopback interfaces) /// - NULL da...
rust
Apache-2.0
ef479d3357bc040b4dcdacffbb4ab8db07051f1b
2026-01-04T20:21:12.648216Z
false
biandratti/huginn-net
https://github.com/biandratti/huginn-net/blob/ef479d3357bc040b4dcdacffbb4ab8db07051f1b/huginn-net-tls/tests/tls.rs
huginn-net-tls/tests/tls.rs
use huginn_net_tls::*; fn create_test_signature() -> Signature { Signature { version: TlsVersion::V1_3, cipher_suites: vec![ 0x1301, 0x1302, 0x1303, 0xc02b, 0xc02f, 0xc02c, 0xc030, 0xcca9, 0xcca8, 0xc013, 0xc014, 0x009c, 0x009d, 0x002f, 0x0035, ], extensions:...
rust
Apache-2.0
ef479d3357bc040b4dcdacffbb4ab8db07051f1b
2026-01-04T20:21:12.648216Z
false
biandratti/huginn-net
https://github.com/biandratti/huginn-net/blob/ef479d3357bc040b4dcdacffbb4ab8db07051f1b/huginn-net-tls/tests/raw_filter_tests.rs
huginn-net-tls/tests/raw_filter_tests.rs
use std::net::IpAddr; use huginn_net_tls::filter::{FilterConfig, FilterMode, IpFilter, PortFilter}; /// Helper to create an IPv4 TCP packet (minimal: IP header + TCP ports) fn create_ipv4_tcp_packet( src_ip: [u8; 4], dst_ip: [u8; 4], src_port: u16, dst_port: u16, ) -> Vec<u8> { let mut packet = ve...
rust
Apache-2.0
ef479d3357bc040b4dcdacffbb4ab8db07051f1b
2026-01-04T20:21:12.648216Z
false