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
Finomnis/tokio-graceful-shutdown
https://github.com/Finomnis/tokio-graceful-shutdown/blob/21f915e6cd39cd139c5ab4fa8199b9d87dc5aaa3/tests/integration_test_2.rs
tests/integration_test_2.rs
use tokio::time::{Duration, sleep}; use tokio_graceful_shutdown::{SubsystemBuilder, SubsystemHandle, Toplevel}; use tracing_test::traced_test; pub mod common; use std::sync::atomic::{AtomicBool, Ordering}; use crate::common::Event; use common::BoxedResult; #[tokio::test(start_paused = true)] #[traced_test] async fn...
rust
Apache-2.0
21f915e6cd39cd139c5ab4fa8199b9d87dc5aaa3
2026-01-04T20:24:42.405407Z
false
Finomnis/tokio-graceful-shutdown
https://github.com/Finomnis/tokio-graceful-shutdown/blob/21f915e6cd39cd139c5ab4fa8199b9d87dc5aaa3/tests/abort.rs
tests/abort.rs
pub mod common; use std::sync::Arc; use futures::future::BoxFuture; use std::sync::atomic::{self, AtomicBool}; use common::BoxedResult; use futures::FutureExt; use std::convert::Infallible; use tokio::time::Duration; use tokio_graceful_shutdown::{SubsystemBuilder, SubsystemHandle, Toplevel}; use tracing_test::traced_...
rust
Apache-2.0
21f915e6cd39cd139c5ab4fa8199b9d87dc5aaa3
2026-01-04T20:24:42.405407Z
false
Finomnis/tokio-graceful-shutdown
https://github.com/Finomnis/tokio-graceful-shutdown/blob/21f915e6cd39cd139c5ab4fa8199b9d87dc5aaa3/tests/common/event.rs
tests/common/event.rs
#![allow(dead_code)] use tokio::sync::watch; pub struct Event { receiver: watch::Receiver<bool>, } impl Event { pub fn create() -> (Self, impl FnOnce()) { let (sender, receiver) = watch::channel(false); (Self { receiver }, move || { sender.send_replace(true); }) } ...
rust
Apache-2.0
21f915e6cd39cd139c5ab4fa8199b9d87dc5aaa3
2026-01-04T20:24:42.405407Z
false
Finomnis/tokio-graceful-shutdown
https://github.com/Finomnis/tokio-graceful-shutdown/blob/21f915e6cd39cd139c5ab4fa8199b9d87dc5aaa3/tests/common/mod.rs
tests/common/mod.rs
#![allow(unused_imports)] mod event; pub use event::Event; use std::error::Error; /// Wrapper type to simplify lambdas pub type BoxedError = Box<dyn Error + Sync + Send>; pub type BoxedResult = Result<(), BoxedError>;
rust
Apache-2.0
21f915e6cd39cd139c5ab4fa8199b9d87dc5aaa3
2026-01-04T20:24:42.405407Z
false
Finomnis/tokio-graceful-shutdown
https://github.com/Finomnis/tokio-graceful-shutdown/blob/21f915e6cd39cd139c5ab4fa8199b9d87dc5aaa3/examples/18_error_type_passthrough.rs
examples/18_error_type_passthrough.rs
//! This example shows to pass custom error types all the way through to the top, //! to recover them from the return value of `handle_shutdown_requests`. use tokio::time::{Duration, sleep}; use tokio_graceful_shutdown::{ IntoSubsystem, SubsystemBuilder, SubsystemHandle, Toplevel, errors::{GracefulShutdownErro...
rust
Apache-2.0
21f915e6cd39cd139c5ab4fa8199b9d87dc5aaa3
2026-01-04T20:24:42.405407Z
false
Finomnis/tokio-graceful-shutdown
https://github.com/Finomnis/tokio-graceful-shutdown/blob/21f915e6cd39cd139c5ab4fa8199b9d87dc5aaa3/examples/19_sequential_shutdown.rs
examples/19_sequential_shutdown.rs
//! This example demonstrates how multiple subsystems could be shut down sequentially. //! //! When a shutdown gets triggered (via Ctrl+C), Nested1 will shutdown first, //! followed by Nested2 and Nested3. Only once the previous subsystem is finished shutting down, //! the next subsystem will follow. use miette::Resul...
rust
Apache-2.0
21f915e6cd39cd139c5ab4fa8199b9d87dc5aaa3
2026-01-04T20:24:42.405407Z
false
Finomnis/tokio-graceful-shutdown
https://github.com/Finomnis/tokio-graceful-shutdown/blob/21f915e6cd39cd139c5ab4fa8199b9d87dc5aaa3/examples/09_task_cancellation.rs
examples/09_task_cancellation.rs
//! This example demonstrates how to implement a clean shutdown //! of a subsystem, through the example of a countdown that //! gets cancelled on shutdown. //! //! There are two options to cancel tasks on shutdown: //! - with [tokio::select] //! - with [FutureExt::cancel_on_shutdown()] //! //! In this case we go wi...
rust
Apache-2.0
21f915e6cd39cd139c5ab4fa8199b9d87dc5aaa3
2026-01-04T20:24:42.405407Z
false
Finomnis/tokio-graceful-shutdown
https://github.com/Finomnis/tokio-graceful-shutdown/blob/21f915e6cd39cd139c5ab4fa8199b9d87dc5aaa3/examples/04_subsystem_finished.rs
examples/04_subsystem_finished.rs
//! This example demonstrates that subsystems can also stop //! prematurely. //! //! Returning Ok(()) from a subsystem indicates that the subsystem //! stopped intentionally, and no further measures by the runtime are performed. //! (unless there are no more subsystems left, in that case TopLevel would shut down anyway...
rust
Apache-2.0
21f915e6cd39cd139c5ab4fa8199b9d87dc5aaa3
2026-01-04T20:24:42.405407Z
false
Finomnis/tokio-graceful-shutdown
https://github.com/Finomnis/tokio-graceful-shutdown/blob/21f915e6cd39cd139c5ab4fa8199b9d87dc5aaa3/examples/12_subsystem_auto_restart.rs
examples/12_subsystem_auto_restart.rs
//! This example demonstrates how a subsystem could get implemented that auto-restarts //! every time a panic occurs. //! //! This isn't really a usecase related to this library, but seems to be used regularly, //! so I included it anyway. use miette::Result; use tokio::time::{Duration, sleep}; use tokio_graceful_shut...
rust
Apache-2.0
21f915e6cd39cd139c5ab4fa8199b9d87dc5aaa3
2026-01-04T20:24:42.405407Z
false
Finomnis/tokio-graceful-shutdown
https://github.com/Finomnis/tokio-graceful-shutdown/blob/21f915e6cd39cd139c5ab4fa8199b9d87dc5aaa3/examples/03_shutdown_timeout.rs
examples/03_shutdown_timeout.rs
//! This subsystem demonstrates the shutdown timeout mechanism. //! //! The subsystem takes longer to shut down than the timeout allows, //! so the subsystem gets cancelled and the program returns an appropriate //! error code. use miette::Result; use tokio::time::{Duration, sleep}; use tokio_graceful_shutdown::{Subsy...
rust
Apache-2.0
21f915e6cd39cd139c5ab4fa8199b9d87dc5aaa3
2026-01-04T20:24:42.405407Z
false
Finomnis/tokio-graceful-shutdown
https://github.com/Finomnis/tokio-graceful-shutdown/blob/21f915e6cd39cd139c5ab4fa8199b9d87dc5aaa3/examples/08_panic_handling.rs
examples/08_panic_handling.rs
//! This example demonstrates that like errors, panics also get dealt with //! gracefully. //! //! A normal program shutdown is performed, and other subsystems get the //! chance to clean up their work. use miette::Result; use tokio::time::{Duration, sleep}; use tokio_graceful_shutdown::{SubsystemBuilder, SubsystemHan...
rust
Apache-2.0
21f915e6cd39cd139c5ab4fa8199b9d87dc5aaa3
2026-01-04T20:24:42.405407Z
false
Finomnis/tokio-graceful-shutdown
https://github.com/Finomnis/tokio-graceful-shutdown/blob/21f915e6cd39cd139c5ab4fa8199b9d87dc5aaa3/examples/14_partial_shutdown_error.rs
examples/14_partial_shutdown_error.rs
//! This example demonstrates how an error during partial shutdown behaves. //! //! If an error during partial a shutdown happens, it will not cause a global //! shutdown, but instead it will be delivered to the task that initiated //! the partial shutdown. use miette::Result; use tokio::time::{Duration, sleep}; use t...
rust
Apache-2.0
21f915e6cd39cd139c5ab4fa8199b9d87dc5aaa3
2026-01-04T20:24:42.405407Z
false
Finomnis/tokio-graceful-shutdown
https://github.com/Finomnis/tokio-graceful-shutdown/blob/21f915e6cd39cd139c5ab4fa8199b9d87dc5aaa3/examples/05_subsystem_finished_with_error.rs
examples/05_subsystem_finished_with_error.rs
//! This example shows how the library reacts to failing subsystems. //! //! If a subsystem returns an `Err(...)` value, it is assumed that the //! subsystem failed and in response the program will be shut down. //! //! As expected, this is a graceful shutdown, giving other subsystems //! the chance to also shut down g...
rust
Apache-2.0
21f915e6cd39cd139c5ab4fa8199b9d87dc5aaa3
2026-01-04T20:24:42.405407Z
false
Finomnis/tokio-graceful-shutdown
https://github.com/Finomnis/tokio-graceful-shutdown/blob/21f915e6cd39cd139c5ab4fa8199b9d87dc5aaa3/examples/22_subsystem_abort.rs
examples/22_subsystem_abort.rs
//! This example demonstrates how a subsystem that is stuck (in an await) can get aborted. use miette::Result; use tokio::time::{Duration, sleep}; use tokio_graceful_shutdown::{SubsystemBuilder, SubsystemHandle, Toplevel}; async fn subsys1(subsys: &mut SubsystemHandle) -> Result<()> { tracing::info!("Subsystem1 s...
rust
Apache-2.0
21f915e6cd39cd139c5ab4fa8199b9d87dc5aaa3
2026-01-04T20:24:42.405407Z
false
Finomnis/tokio-graceful-shutdown
https://github.com/Finomnis/tokio-graceful-shutdown/blob/21f915e6cd39cd139c5ab4fa8199b9d87dc5aaa3/examples/17_with_eyre.rs
examples/17_with_eyre.rs
//! This example shows how to use this library with eyre instead of miette use eyre::{Result, eyre}; use tokio::time::{Duration, sleep}; use tokio_graceful_shutdown::{SubsystemBuilder, SubsystemHandle, Toplevel}; async fn subsys1(_subsys: &mut SubsystemHandle) -> Result<()> { tracing::info!("Subsystem1 started.")...
rust
Apache-2.0
21f915e6cd39cd139c5ab4fa8199b9d87dc5aaa3
2026-01-04T20:24:42.405407Z
false
Finomnis/tokio-graceful-shutdown
https://github.com/Finomnis/tokio-graceful-shutdown/blob/21f915e6cd39cd139c5ab4fa8199b9d87dc5aaa3/examples/hyper.rs
examples/hyper.rs
//! This example demonstrates how to gracefully shutdown a hyper //! server using this crate. //! //! This example closely follows hyper's "hello" example. //! //! Note that while we could spawn one subsystem per connection, //! tokio-graceful-shutdown's subsystems are quite heavy. //! So for a large amount of dynamic ...
rust
Apache-2.0
21f915e6cd39cd139c5ab4fa8199b9d87dc5aaa3
2026-01-04T20:24:42.405407Z
false
Finomnis/tokio-graceful-shutdown
https://github.com/Finomnis/tokio-graceful-shutdown/blob/21f915e6cd39cd139c5ab4fa8199b9d87dc5aaa3/examples/13_partial_shutdown.rs
examples/13_partial_shutdown.rs
//! This example demonstrates how to perform a partial shutdown of the system. //! //! Subsys1 will perform a partial shutdown after 5 seconds, which will in turn //! shut down Subsys2 and Subsys3, leaving Subsys1 running. use miette::Result; use tokio::time::{Duration, sleep}; use tokio_graceful_shutdown::{ErrorActio...
rust
Apache-2.0
21f915e6cd39cd139c5ab4fa8199b9d87dc5aaa3
2026-01-04T20:24:42.405407Z
false
Finomnis/tokio-graceful-shutdown
https://github.com/Finomnis/tokio-graceful-shutdown/blob/21f915e6cd39cd139c5ab4fa8199b9d87dc5aaa3/examples/01_normal_shutdown.rs
examples/01_normal_shutdown.rs
//! This example demonstrates the basic usage pattern of this crate. //! //! It shows that subsystems get started, and when the program //! gets shut down (by pressing Ctrl-C), the subsystems get shut down //! gracefully. //! //! If custom arguments for the subsystem coroutines are required, //! a struct has to be used...
rust
Apache-2.0
21f915e6cd39cd139c5ab4fa8199b9d87dc5aaa3
2026-01-04T20:24:42.405407Z
false
Finomnis/tokio-graceful-shutdown
https://github.com/Finomnis/tokio-graceful-shutdown/blob/21f915e6cd39cd139c5ab4fa8199b9d87dc5aaa3/examples/07_nested_error.rs
examples/07_nested_error.rs
//! This example demonstrates that if one subsystem returns an error, //! a graceful shutdown is performed and other subsystems get the chance //! to clean up. use miette::{Result, miette}; use tokio::time::{Duration, sleep}; use tokio_graceful_shutdown::{SubsystemBuilder, SubsystemHandle, Toplevel}; async fn subsys1...
rust
Apache-2.0
21f915e6cd39cd139c5ab4fa8199b9d87dc5aaa3
2026-01-04T20:24:42.405407Z
false
Finomnis/tokio-graceful-shutdown
https://github.com/Finomnis/tokio-graceful-shutdown/blob/21f915e6cd39cd139c5ab4fa8199b9d87dc5aaa3/examples/02_structs.rs
examples/02_structs.rs
//! This example demonstrates how using subsystem structs enables //! custom parameters to be passed to the subsystem. //! //! There are two ways of using structs as subsystems, by either //! wrapping them in a closure, or by implementing the //! IntoSubsystem trait. use miette::Result; use tokio::time::{Duration, sle...
rust
Apache-2.0
21f915e6cd39cd139c5ab4fa8199b9d87dc5aaa3
2026-01-04T20:24:42.405407Z
false
Finomnis/tokio-graceful-shutdown
https://github.com/Finomnis/tokio-graceful-shutdown/blob/21f915e6cd39cd139c5ab4fa8199b9d87dc5aaa3/examples/tokio_console.rs
examples/tokio_console.rs
//! This example demonstrates how to use the tokio-console application for tracing tokio tasks's //! runtime behaviour. Subsystems will appear under their registration names. //! //! Run this example with: //! //! ``` //! RUSTFLAGS="--cfg tokio_unstable" cargo run --features "tracing" --example tokio_console //! ``` //...
rust
Apache-2.0
21f915e6cd39cd139c5ab4fa8199b9d87dc5aaa3
2026-01-04T20:24:42.405407Z
false
Finomnis/tokio-graceful-shutdown
https://github.com/Finomnis/tokio-graceful-shutdown/blob/21f915e6cd39cd139c5ab4fa8199b9d87dc5aaa3/examples/10_request_shutdown.rs
examples/10_request_shutdown.rs
//! This example demonstrates how a subsystem can initiate //! a shutdown. use miette::Result; use tokio::time::{Duration, sleep}; use tokio_graceful_shutdown::{ FutureExt, SubsystemBuilder, SubsystemHandle, Toplevel, errors::CancelledByShutdown, }; struct CountdownSubsystem {} impl CountdownSubsystem { fn ne...
rust
Apache-2.0
21f915e6cd39cd139c5ab4fa8199b9d87dc5aaa3
2026-01-04T20:24:42.405407Z
false
Finomnis/tokio-graceful-shutdown
https://github.com/Finomnis/tokio-graceful-shutdown/blob/21f915e6cd39cd139c5ab4fa8199b9d87dc5aaa3/examples/11_double_panic.rs
examples/11_double_panic.rs
//! This example demonstrates if a subsystem panics during a shutdown caused //! by another panic, the shutdown is still performed normally and the third //! subsystem gets cleaned up without a problem. //! //! Note that this even works when running in tokio's single-threaded mode. //! //! There is no real programming ...
rust
Apache-2.0
21f915e6cd39cd139c5ab4fa8199b9d87dc5aaa3
2026-01-04T20:24:42.405407Z
false
Finomnis/tokio-graceful-shutdown
https://github.com/Finomnis/tokio-graceful-shutdown/blob/21f915e6cd39cd139c5ab4fa8199b9d87dc5aaa3/examples/23_shutdown_from_external.rs
examples/23_shutdown_from_external.rs
//! This example demonstrates how the entire tokio runtime can be run //! in its own thread and how the subsystem tree can then be shut down //! from another thread thread. use miette::{Result, miette}; use tokio::{ runtime::Runtime, time::{Duration, sleep}, }; use tokio_graceful_shutdown::{FutureExt, Subsyste...
rust
Apache-2.0
21f915e6cd39cd139c5ab4fa8199b9d87dc5aaa3
2026-01-04T20:24:42.405407Z
false
Finomnis/tokio-graceful-shutdown
https://github.com/Finomnis/tokio-graceful-shutdown/blob/21f915e6cd39cd139c5ab4fa8199b9d87dc5aaa3/examples/06_nested_subsystems.rs
examples/06_nested_subsystems.rs
//! This example demonstrates how one subsystem can launch another //! nested subsystem. use miette::Result; use tokio::time::{Duration, sleep}; use tokio_graceful_shutdown::{SubsystemBuilder, SubsystemHandle, Toplevel}; async fn subsys1(subsys: &mut SubsystemHandle) -> Result<()> { subsys.start(SubsystemBuilder:...
rust
Apache-2.0
21f915e6cd39cd139c5ab4fa8199b9d87dc5aaa3
2026-01-04T20:24:42.405407Z
false
Finomnis/tokio-graceful-shutdown
https://github.com/Finomnis/tokio-graceful-shutdown/blob/21f915e6cd39cd139c5ab4fa8199b9d87dc5aaa3/examples/15_without_miette.rs
examples/15_without_miette.rs
//! This example shows how to use this library with std::error::Error instead of miette::Error use std::error::Error; use std::fmt; use tokio::time::{Duration, sleep}; use tokio_graceful_shutdown::{SubsystemBuilder, SubsystemHandle, Toplevel}; #[derive(Debug, Clone)] struct MyError; impl fmt::Display for MyError { ...
rust
Apache-2.0
21f915e6cd39cd139c5ab4fa8199b9d87dc5aaa3
2026-01-04T20:24:42.405407Z
false
Finomnis/tokio-graceful-shutdown
https://github.com/Finomnis/tokio-graceful-shutdown/blob/21f915e6cd39cd139c5ab4fa8199b9d87dc5aaa3/examples/20_orchestrated_shutdown_order.rs
examples/20_orchestrated_shutdown_order.rs
//! This example demonstrates how a parent subsystem could orchestrate //! the shutdown order of its children manually. //! //! This is done by spawning the children in 'detached' mode to prevent //! that the shutdown signal gets passed to the children. //! Then, the parent calls `initialize_shutdown` on each child man...
rust
Apache-2.0
21f915e6cd39cd139c5ab4fa8199b9d87dc5aaa3
2026-01-04T20:24:42.405407Z
false
Finomnis/tokio-graceful-shutdown
https://github.com/Finomnis/tokio-graceful-shutdown/blob/21f915e6cd39cd139c5ab4fa8199b9d87dc5aaa3/examples/16_with_anyhow.rs
examples/16_with_anyhow.rs
//! This example shows how to use this library with anyhow instead of miette use anyhow::{Result, anyhow}; use tokio::time::{Duration, sleep}; use tokio_graceful_shutdown::{SubsystemBuilder, SubsystemHandle, Toplevel}; async fn subsys1(_subsys: &mut SubsystemHandle) -> Result<()> { tracing::info!("Subsystem1 star...
rust
Apache-2.0
21f915e6cd39cd139c5ab4fa8199b9d87dc5aaa3
2026-01-04T20:24:42.405407Z
false
Finomnis/tokio-graceful-shutdown
https://github.com/Finomnis/tokio-graceful-shutdown/blob/21f915e6cd39cd139c5ab4fa8199b9d87dc5aaa3/examples/21_tcp_echo_server.rs
examples/21_tcp_echo_server.rs
//! This example demonstrates how to gracefully shutdown a server //! that spawns an indefinite number of connection tasks. //! //! The server is a simple TCP echo server, capitalizing the data //! it echos (to demonstrate that it computes things). //! On shutdown, it transmits a goodbye message, to demonstrate //! tha...
rust
Apache-2.0
21f915e6cd39cd139c5ab4fa8199b9d87dc5aaa3
2026-01-04T20:24:42.405407Z
false
laysakura/trie-rs
https://github.com/laysakura/trie-rs/blob/9fdacbb6a3abf8a81bdb479a9beaf6fceb99e90c/src/lib.rs
src/lib.rs
#![forbid(missing_docs)] #![doc(html_root_url = "https://docs.rs/trie-rs/0.4.2")] #![doc = include_str!("../README.md")] pub mod inc_search; mod internal_data_structure; pub mod iter; pub mod map; mod trie; pub mod try_collect; pub use trie::{Trie, TrieBuilder};
rust
Apache-2.0
9fdacbb6a3abf8a81bdb479a9beaf6fceb99e90c
2026-01-04T20:24:45.056613Z
false
laysakura/trie-rs
https://github.com/laysakura/trie-rs/blob/9fdacbb6a3abf8a81bdb479a9beaf6fceb99e90c/src/try_collect.rs
src/try_collect.rs
//! Try to collect from an iterator; operation may fail. //! //! Any type can that be `collect()`ed can be `try_collect()`ed without fail. //! //! # Usage //! //! The simplest usage is like this. //! //! ``` //! use trie_rs::try_collect::*; //! let bytes: Vec<u8> = vec![72, 105]; //! let s: String = bytes.into_iter().t...
rust
Apache-2.0
9fdacbb6a3abf8a81bdb479a9beaf6fceb99e90c
2026-01-04T20:24:45.056613Z
false
laysakura/trie-rs
https://github.com/laysakura/trie-rs/blob/9fdacbb6a3abf8a81bdb479a9beaf6fceb99e90c/src/map.rs
src/map.rs
//! A trie that maps sequence of `Label`s to a `Value`. use crate::internal_data_structure::naive_trie::NaiveTrie; use louds_rs::Louds; mod trie; mod trie_builder; #[cfg(feature = "mem_dbg")] use mem_dbg::MemDbg; #[derive(Debug, Clone)] #[cfg_attr(feature = "mem_dbg", derive(mem_dbg::MemDbg, mem_dbg::MemSize))] #[cf...
rust
Apache-2.0
9fdacbb6a3abf8a81bdb479a9beaf6fceb99e90c
2026-01-04T20:24:45.056613Z
false
laysakura/trie-rs
https://github.com/laysakura/trie-rs/blob/9fdacbb6a3abf8a81bdb479a9beaf6fceb99e90c/src/inc_search.rs
src/inc_search.rs
//! Incremental search //! //! # Motivation //! //! The motivation for this struct is for "online" or interactive use cases. One //! often accumulates input to match against a trie. Using the standard //! [`exact_match()`][crate::trie::Trie::exact_match] faculties which has a time //! complexity of _O(m log n)_ where _...
rust
Apache-2.0
9fdacbb6a3abf8a81bdb479a9beaf6fceb99e90c
2026-01-04T20:24:45.056613Z
false
laysakura/trie-rs
https://github.com/laysakura/trie-rs/blob/9fdacbb6a3abf8a81bdb479a9beaf6fceb99e90c/src/internal_data_structure.rs
src/internal_data_structure.rs
pub mod naive_trie;
rust
Apache-2.0
9fdacbb6a3abf8a81bdb479a9beaf6fceb99e90c
2026-01-04T20:24:45.056613Z
false
laysakura/trie-rs
https://github.com/laysakura/trie-rs/blob/9fdacbb6a3abf8a81bdb479a9beaf6fceb99e90c/src/internal_data_structure/naive_trie.rs
src/internal_data_structure/naive_trie.rs
pub mod naive_trie_b_f_iter; pub mod naive_trie_impl; #[cfg(feature = "mem_dbg")] use mem_dbg::MemDbg; #[derive(Debug, Clone)] #[cfg_attr(feature = "mem_dbg", derive(mem_dbg::MemDbg, mem_dbg::MemSize))] #[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))] /// Naive trie with ordered Label sequ...
rust
Apache-2.0
9fdacbb6a3abf8a81bdb479a9beaf6fceb99e90c
2026-01-04T20:24:45.056613Z
false
laysakura/trie-rs
https://github.com/laysakura/trie-rs/blob/9fdacbb6a3abf8a81bdb479a9beaf6fceb99e90c/src/internal_data_structure/naive_trie/naive_trie_impl.rs
src/internal_data_structure/naive_trie/naive_trie_impl.rs
use super::naive_trie_b_f_iter::NaiveTrieBFIter; use super::{NaiveTrie, NaiveTrieIntermOrLeaf, NaiveTrieRoot}; use std::vec::Drain; impl<'trie, Label: Ord, Value> NaiveTrie<Label, Value> { pub fn make_root() -> Self { NaiveTrie::Root(NaiveTrieRoot { children: vec![] }) } pub fn make_interm_or_leaf...
rust
Apache-2.0
9fdacbb6a3abf8a81bdb479a9beaf6fceb99e90c
2026-01-04T20:24:45.056613Z
false
laysakura/trie-rs
https://github.com/laysakura/trie-rs/blob/9fdacbb6a3abf8a81bdb479a9beaf6fceb99e90c/src/internal_data_structure/naive_trie/naive_trie_b_f_iter.rs
src/internal_data_structure/naive_trie/naive_trie_b_f_iter.rs
use super::NaiveTrie; use std::collections::VecDeque; #[derive(Debug)] /// Iterates over NaiveTrie in Breadth-First manner. pub struct NaiveTrieBFIter<Label, Value> { unvisited: VecDeque<NaiveTrie<Label, Value>>, } impl<Label, Value> NaiveTrieBFIter<Label, Value> { pub fn new(iter_start: NaiveTrie<Label, Valu...
rust
Apache-2.0
9fdacbb6a3abf8a81bdb479a9beaf6fceb99e90c
2026-01-04T20:24:45.056613Z
false
laysakura/trie-rs
https://github.com/laysakura/trie-rs/blob/9fdacbb6a3abf8a81bdb479a9beaf6fceb99e90c/src/trie/mod.rs
src/trie/mod.rs
mod trie_builder; mod trie_impl; pub use trie_builder::TrieBuilder; pub use trie_impl::Trie;
rust
Apache-2.0
9fdacbb6a3abf8a81bdb479a9beaf6fceb99e90c
2026-01-04T20:24:45.056613Z
false
laysakura/trie-rs
https://github.com/laysakura/trie-rs/blob/9fdacbb6a3abf8a81bdb479a9beaf6fceb99e90c/src/trie/trie_impl.rs
src/trie/trie_impl.rs
use crate::inc_search::IncSearch; use crate::iter::{Keys, KeysExt, PostfixIter, PrefixIter, SearchIter}; use crate::map; use crate::try_collect::TryFromIterator; use std::iter::FromIterator; #[cfg(feature = "mem_dbg")] use mem_dbg::MemDbg; #[derive(Debug, Clone)] #[cfg_attr(feature = "mem_dbg", derive(mem_dbg::MemDbg...
rust
Apache-2.0
9fdacbb6a3abf8a81bdb479a9beaf6fceb99e90c
2026-01-04T20:24:45.056613Z
false
laysakura/trie-rs
https://github.com/laysakura/trie-rs/blob/9fdacbb6a3abf8a81bdb479a9beaf6fceb99e90c/src/trie/trie_builder.rs
src/trie/trie_builder.rs
use super::Trie; use crate::map; #[cfg(feature = "mem_dbg")] use mem_dbg::MemDbg; #[derive(Debug, Clone)] #[cfg_attr(feature = "mem_dbg", derive(mem_dbg::MemDbg, mem_dbg::MemSize))] #[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))] /// A trie builder for [Trie]. pub struct TrieBuilder<Label...
rust
Apache-2.0
9fdacbb6a3abf8a81bdb479a9beaf6fceb99e90c
2026-01-04T20:24:45.056613Z
false
laysakura/trie-rs
https://github.com/laysakura/trie-rs/blob/9fdacbb6a3abf8a81bdb479a9beaf6fceb99e90c/src/iter/search_iter.rs
src/iter/search_iter.rs
use crate::iter::PostfixIter; use crate::map::Trie; use crate::try_collect::{Collect, TryCollect, TryFromIterator}; use louds_rs::LoudsNodeNum; use std::marker::PhantomData; #[derive(Debug, Clone)] /// Iterates through all the matches of a query. pub struct SearchIter<'a, Label, Value, C, M> { prefix: Vec<Label>, ...
rust
Apache-2.0
9fdacbb6a3abf8a81bdb479a9beaf6fceb99e90c
2026-01-04T20:24:45.056613Z
false
laysakura/trie-rs
https://github.com/laysakura/trie-rs/blob/9fdacbb6a3abf8a81bdb479a9beaf6fceb99e90c/src/iter/postfix_iter.rs
src/iter/postfix_iter.rs
use crate::map::Trie; use crate::try_collect::{TryCollect, TryFromIterator}; use louds_rs::LoudsNodeNum; use std::marker::PhantomData; #[derive(Debug, Clone)] /// Iterates through all the postfixes of a matching query. pub struct PostfixIter<'a, Label, Value, C, M> { trie: &'a Trie<Label, Value>, queue: Vec<(u...
rust
Apache-2.0
9fdacbb6a3abf8a81bdb479a9beaf6fceb99e90c
2026-01-04T20:24:45.056613Z
false
laysakura/trie-rs
https://github.com/laysakura/trie-rs/blob/9fdacbb6a3abf8a81bdb479a9beaf6fceb99e90c/src/iter/mod.rs
src/iter/mod.rs
//! Trie iterators mod keys; mod postfix_iter; mod prefix_iter; mod search_iter; pub use keys::{Keys, KeysExt}; pub use postfix_iter::PostfixIter; pub use prefix_iter::PrefixIter; pub use search_iter::SearchIter;
rust
Apache-2.0
9fdacbb6a3abf8a81bdb479a9beaf6fceb99e90c
2026-01-04T20:24:45.056613Z
false
laysakura/trie-rs
https://github.com/laysakura/trie-rs/blob/9fdacbb6a3abf8a81bdb479a9beaf6fceb99e90c/src/iter/prefix_iter.rs
src/iter/prefix_iter.rs
use crate::map::Trie; use crate::try_collect::{TryCollect, TryFromIterator}; use louds_rs::LoudsNodeNum; use std::marker::PhantomData; #[derive(Debug, Clone)] /// Iterates through all the common prefixes of a given query. pub struct PrefixIter<'a, Label, Value, C, M> { trie: &'a Trie<Label, Value>, query: Vec<...
rust
Apache-2.0
9fdacbb6a3abf8a81bdb479a9beaf6fceb99e90c
2026-01-04T20:24:45.056613Z
false
laysakura/trie-rs
https://github.com/laysakura/trie-rs/blob/9fdacbb6a3abf8a81bdb479a9beaf6fceb99e90c/src/iter/keys.rs
src/iter/keys.rs
#[derive(Debug, Clone)] /// Retains keys and strips off `Value`s from a [crate::iter] iterator. pub struct Keys<I>(I); impl<I> Keys<I> { ///Creates a new `Keys` iterator. pub fn new(iter: I) -> Self { Self(iter) } } // TODO: This is generic for V, which is a stand-in for the Value, but in a // `ma...
rust
Apache-2.0
9fdacbb6a3abf8a81bdb479a9beaf6fceb99e90c
2026-01-04T20:24:45.056613Z
false
laysakura/trie-rs
https://github.com/laysakura/trie-rs/blob/9fdacbb6a3abf8a81bdb479a9beaf6fceb99e90c/src/map/trie_builder.rs
src/map/trie_builder.rs
use crate::internal_data_structure::naive_trie::NaiveTrie; use crate::map::TrieLabel; use crate::map::{Trie, TrieBuilder}; use louds_rs::Louds; impl<Label: Ord, Value> Default for TrieBuilder<Label, Value> { fn default() -> Self { Self::new() } } impl<Label: Ord, Value> TrieBuilder<Label, Value> { ...
rust
Apache-2.0
9fdacbb6a3abf8a81bdb479a9beaf6fceb99e90c
2026-01-04T20:24:45.056613Z
false
laysakura/trie-rs
https://github.com/laysakura/trie-rs/blob/9fdacbb6a3abf8a81bdb479a9beaf6fceb99e90c/src/map/trie.rs
src/map/trie.rs
//! A trie map stores a value with each word or key. use super::Trie; use crate::inc_search::IncSearch; use crate::iter::{PostfixIter, PrefixIter, SearchIter}; use crate::try_collect::{TryCollect, TryFromIterator}; use louds_rs::{AncestorNodeIter, ChildNodeIter, LoudsNodeNum}; use std::iter::FromIterator; impl<Label: ...
rust
Apache-2.0
9fdacbb6a3abf8a81bdb479a9beaf6fceb99e90c
2026-01-04T20:24:45.056613Z
false
laysakura/trie-rs
https://github.com/laysakura/trie-rs/blob/9fdacbb6a3abf8a81bdb479a9beaf6fceb99e90c/tests/test_versions.rs
tests/test_versions.rs
#[test] fn test_readme_deps() { version_sync::assert_markdown_deps_updated!("README.md"); } #[test] fn test_html_root_url() { version_sync::assert_html_root_url_updated!("src/lib.rs"); }
rust
Apache-2.0
9fdacbb6a3abf8a81bdb479a9beaf6fceb99e90c
2026-01-04T20:24:45.056613Z
false
laysakura/trie-rs
https://github.com/laysakura/trie-rs/blob/9fdacbb6a3abf8a81bdb479a9beaf6fceb99e90c/benches/bench.rs
benches/bench.rs
#[macro_use] extern crate criterion; #[macro_use] extern crate lazy_static; use criterion::Criterion; use std::time::Duration; fn c() -> Criterion { Criterion::default() .sample_size(10) // must be >= 10 for Criterion v0.3 .warm_up_time(Duration::from_secs(1)) .with_plots() } fn git_hash...
rust
Apache-2.0
9fdacbb6a3abf8a81bdb479a9beaf6fceb99e90c
2026-01-04T20:24:45.056613Z
false
jackTabsCode/asphalt
https://github.com/jackTabsCode/asphalt/blob/f44f6d2be32d429b0eb05c112f69dfdbc4c9f719/src/config.rs
src/config.rs
use crate::glob::Glob; use anyhow::Context; use clap::ValueEnum; use fs_err::tokio as fs; use relative_path::RelativePathBuf; use schemars::JsonSchema; use serde::Deserialize; use std::{collections::HashMap, path::PathBuf}; #[derive(Debug, Deserialize, Clone, JsonSchema)] pub struct Config { pub creator: Creator, ...
rust
MIT
f44f6d2be32d429b0eb05c112f69dfdbc4c9f719
2026-01-04T20:24:56.172033Z
false
jackTabsCode/asphalt
https://github.com/jackTabsCode/asphalt/blob/f44f6d2be32d429b0eb05c112f69dfdbc4c9f719/src/lockfile.rs
src/lockfile.rs
use anyhow::{Context, bail}; use blake3::Hasher; use fs_err::tokio as fs; use serde::{Deserialize, Serialize}; use std::{ collections::BTreeMap, path::{Path, PathBuf}, }; pub const FILE_NAME: &str = "asphalt.lock.toml"; #[derive(Debug, Serialize, Deserialize)] pub struct Lockfile { version: u32, input...
rust
MIT
f44f6d2be32d429b0eb05c112f69dfdbc4c9f719
2026-01-04T20:24:56.172033Z
false
jackTabsCode/asphalt
https://github.com/jackTabsCode/asphalt/blob/f44f6d2be32d429b0eb05c112f69dfdbc4c9f719/src/cli.rs
src/cli.rs
use crate::config::CreatorType; use clap::{Args, Parser, Subcommand}; use clap_verbosity_flag::{InfoLevel, Verbosity}; #[derive(Parser)] #[command(version, about = "Upload and reference Roblox assets in code.")] pub struct Cli { #[command(subcommand)] pub command: Commands, #[command(flatten)] pub ver...
rust
MIT
f44f6d2be32d429b0eb05c112f69dfdbc4c9f719
2026-01-04T20:24:56.172033Z
false
jackTabsCode/asphalt
https://github.com/jackTabsCode/asphalt/blob/f44f6d2be32d429b0eb05c112f69dfdbc4c9f719/src/asset.rs
src/asset.rs
use crate::{ config::WebAsset, lockfile::LockfileEntry, util::{alpha_bleed::alpha_bleed, svg::svg_to_png}, }; use anyhow::Context; use blake3::Hasher; use bytes::Bytes; use image::DynamicImage; use relative_path::RelativePathBuf; use resvg::usvg::fontdb::{self}; use serde::Serialize; use std::{ffi::OsStr, f...
rust
MIT
f44f6d2be32d429b0eb05c112f69dfdbc4c9f719
2026-01-04T20:24:56.172033Z
false
jackTabsCode/asphalt
https://github.com/jackTabsCode/asphalt/blob/f44f6d2be32d429b0eb05c112f69dfdbc4c9f719/src/glob.rs
src/glob.rs
//! Wrapper around globset's Glob type that has better serialization //! characteristics by coupling Glob and GlobMatcher into a single type. //! https://github.com/Roblox/tarmac/blob/master/src/glob.rs use std::{ fmt, path::{Path, PathBuf}, }; use globset::{Glob as InnerGlob, GlobMatcher}; use serde::{Deseri...
rust
MIT
f44f6d2be32d429b0eb05c112f69dfdbc4c9f719
2026-01-04T20:24:56.172033Z
false
jackTabsCode/asphalt
https://github.com/jackTabsCode/asphalt/blob/f44f6d2be32d429b0eb05c112f69dfdbc4c9f719/src/migrate_lockfile.rs
src/migrate_lockfile.rs
use crate::{cli::MigrateLockfileArgs, lockfile::RawLockfile}; pub async fn migrate_lockfile(args: MigrateLockfileArgs) -> anyhow::Result<()> { let file = RawLockfile::read().await?; let migrated = file.migrate(args.input_name.as_deref()).await?; migrated.write(None).await?; Ok(()) }
rust
MIT
f44f6d2be32d429b0eb05c112f69dfdbc4c9f719
2026-01-04T20:24:56.172033Z
false
jackTabsCode/asphalt
https://github.com/jackTabsCode/asphalt/blob/f44f6d2be32d429b0eb05c112f69dfdbc4c9f719/src/upload.rs
src/upload.rs
use crate::{asset::Asset, cli::UploadArgs, config::Creator, web_api::WebApiClient}; use anyhow::Context; use fs_err::tokio as fs; use relative_path::PathExt; use resvg::usvg::fontdb::Database; use std::{path::PathBuf, sync::Arc}; pub async fn upload(args: UploadArgs) -> anyhow::Result<()> { let path = PathBuf::fro...
rust
MIT
f44f6d2be32d429b0eb05c112f69dfdbc4c9f719
2026-01-04T20:24:56.172033Z
false
jackTabsCode/asphalt
https://github.com/jackTabsCode/asphalt/blob/f44f6d2be32d429b0eb05c112f69dfdbc4c9f719/src/web_api.rs
src/web_api.rs
use crate::{ asset::{Asset, AssetType}, config, }; use anyhow::{Context, bail}; use log::{debug, warn}; use reqwest::{RequestBuilder, Response, StatusCode, multipart}; use serde::{Deserialize, Serialize}; use std::{ env, sync::atomic::{AtomicBool, Ordering}, time::Duration, }; use tokio::sync::Mutex...
rust
MIT
f44f6d2be32d429b0eb05c112f69dfdbc4c9f719
2026-01-04T20:24:56.172033Z
false
jackTabsCode/asphalt
https://github.com/jackTabsCode/asphalt/blob/f44f6d2be32d429b0eb05c112f69dfdbc4c9f719/src/main.rs
src/main.rs
use clap::Parser; use cli::{Cli, Commands}; use dotenvy::dotenv; use fs_err::tokio as fs; use indicatif::MultiProgress; use log::LevelFilter; use migrate_lockfile::migrate_lockfile; use schemars::schema_for; use sync::sync; use upload::upload; use crate::config::Config; mod asset; mod cli; mod config; mod glob; mod l...
rust
MIT
f44f6d2be32d429b0eb05c112f69dfdbc4c9f719
2026-01-04T20:24:56.172033Z
false
jackTabsCode/asphalt
https://github.com/jackTabsCode/asphalt/blob/f44f6d2be32d429b0eb05c112f69dfdbc4c9f719/src/util/alpha_bleed.rs
src/util/alpha_bleed.rs
//! Changes pixels in an image that are totally transparent to the color of //! their nearest non-transparent neighbor. This fixes artifacting when images //! are resized in some contexts. use std::collections::VecDeque; use bit_vec::BitVec; use image::{DynamicImage, GenericImage, GenericImageView, Rgba}; pub fn alp...
rust
MIT
f44f6d2be32d429b0eb05c112f69dfdbc4c9f719
2026-01-04T20:24:56.172033Z
false
jackTabsCode/asphalt
https://github.com/jackTabsCode/asphalt/blob/f44f6d2be32d429b0eb05c112f69dfdbc4c9f719/src/util/svg.rs
src/util/svg.rs
use resvg::{ tiny_skia::Pixmap, usvg::{Options, Transform, Tree, fontdb::Database}, }; use std::sync::Arc; pub fn svg_to_png(data: &[u8], fontdb: Arc<Database>) -> anyhow::Result<Vec<u8>> { let opt = Options { fontdb, ..Default::default() }; let rtree = Tree::from_data(data, &opt)?...
rust
MIT
f44f6d2be32d429b0eb05c112f69dfdbc4c9f719
2026-01-04T20:24:56.172033Z
false
jackTabsCode/asphalt
https://github.com/jackTabsCode/asphalt/blob/f44f6d2be32d429b0eb05c112f69dfdbc4c9f719/src/util/mod.rs
src/util/mod.rs
pub mod alpha_bleed; pub mod svg;
rust
MIT
f44f6d2be32d429b0eb05c112f69dfdbc4c9f719
2026-01-04T20:24:56.172033Z
false
jackTabsCode/asphalt
https://github.com/jackTabsCode/asphalt/blob/f44f6d2be32d429b0eb05c112f69dfdbc4c9f719/src/sync/collect.rs
src/sync/collect.rs
use indicatif::{MultiProgress, ProgressBar, ProgressStyle}; use std::{ collections::{HashMap, HashSet}, path::PathBuf, }; use tokio::sync::mpsc::UnboundedReceiver; use crate::{ asset::AssetRef, cli::SyncTarget, config::InputMap, lockfile::{Lockfile, LockfileEntry}, sync::codegen::NodeSource...
rust
MIT
f44f6d2be32d429b0eb05c112f69dfdbc4c9f719
2026-01-04T20:24:56.172033Z
false
jackTabsCode/asphalt
https://github.com/jackTabsCode/asphalt/blob/f44f6d2be32d429b0eb05c112f69dfdbc4c9f719/src/sync/walk.rs
src/sync/walk.rs
use crate::{ asset::{self, Asset}, cli::SyncTarget, config::Config, lockfile::Lockfile, sync::TargetBackend, }; use anyhow::Context; use fs_err::tokio as fs; use log::{debug, warn}; use relative_path::PathExt; use resvg::usvg::fontdb; use std::{ collections::{ HashMap, hash_map::...
rust
MIT
f44f6d2be32d429b0eb05c112f69dfdbc4c9f719
2026-01-04T20:24:56.172033Z
false
jackTabsCode/asphalt
https://github.com/jackTabsCode/asphalt/blob/f44f6d2be32d429b0eb05c112f69dfdbc4c9f719/src/sync/mod.rs
src/sync/mod.rs
use crate::{ asset::{Asset, AssetRef}, cli::{SyncArgs, SyncTarget}, config::Config, lockfile::{LockfileEntry, RawLockfile}, sync::{backend::Backend, collect::collect_events}, }; use anyhow::{Context, bail}; use fs_err::tokio as fs; use indicatif::MultiProgress; use log::info; use relative_path::Rela...
rust
MIT
f44f6d2be32d429b0eb05c112f69dfdbc4c9f719
2026-01-04T20:24:56.172033Z
false
jackTabsCode/asphalt
https://github.com/jackTabsCode/asphalt/blob/f44f6d2be32d429b0eb05c112f69dfdbc4c9f719/src/sync/codegen.rs
src/sync/codegen.rs
use crate::{asset::AssetRef, config}; use anyhow::bail; use relative_path::{RelativePath, RelativePathBuf}; use std::{collections::BTreeMap, path::Path}; pub enum Node { Table(BTreeMap<String, Node>), String(String), Content(String), #[allow(dead_code)] Number(u64), } pub enum Language { TypeS...
rust
MIT
f44f6d2be32d429b0eb05c112f69dfdbc4c9f719
2026-01-04T20:24:56.172033Z
false
jackTabsCode/asphalt
https://github.com/jackTabsCode/asphalt/blob/f44f6d2be32d429b0eb05c112f69dfdbc4c9f719/src/sync/backend/cloud.rs
src/sync/backend/cloud.rs
use super::Backend; use crate::{ asset::{Asset, AssetRef}, lockfile::LockfileEntry, sync::backend::Params, web_api::WebApiClient, }; use anyhow::{Context, bail}; pub struct Cloud { client: WebApiClient, } impl Backend for Cloud { async fn new(params: Params) -> anyhow::Result<Self> where ...
rust
MIT
f44f6d2be32d429b0eb05c112f69dfdbc4c9f719
2026-01-04T20:24:56.172033Z
false
jackTabsCode/asphalt
https://github.com/jackTabsCode/asphalt/blob/f44f6d2be32d429b0eb05c112f69dfdbc4c9f719/src/sync/backend/debug.rs
src/sync/backend/debug.rs
use super::{AssetRef, Backend}; use crate::{asset::Asset, lockfile::LockfileEntry, sync::backend::Params}; use anyhow::Context; use fs_err::tokio as fs; use log::info; use std::{env, path::PathBuf}; pub struct Debug { sync_path: PathBuf, } impl Backend for Debug { async fn new(_: Params) -> anyhow::Result<Sel...
rust
MIT
f44f6d2be32d429b0eb05c112f69dfdbc4c9f719
2026-01-04T20:24:56.172033Z
false
jackTabsCode/asphalt
https://github.com/jackTabsCode/asphalt/blob/f44f6d2be32d429b0eb05c112f69dfdbc4c9f719/src/sync/backend/mod.rs
src/sync/backend/mod.rs
use crate::{ asset::{Asset, AssetRef}, config, lockfile::LockfileEntry, }; mod cloud; pub use cloud::Cloud; mod debug; pub use debug::Debug; mod studio; pub use studio::Studio; pub trait Backend { async fn new(params: Params) -> anyhow::Result<Self> where Self: Sized; async fn sync(...
rust
MIT
f44f6d2be32d429b0eb05c112f69dfdbc4c9f719
2026-01-04T20:24:56.172033Z
false
jackTabsCode/asphalt
https://github.com/jackTabsCode/asphalt/blob/f44f6d2be32d429b0eb05c112f69dfdbc4c9f719/src/sync/backend/studio.rs
src/sync/backend/studio.rs
use super::{AssetRef, Backend}; use crate::{ asset::{Asset, AssetType}, lockfile::LockfileEntry, sync::backend::Params, }; use anyhow::{Context, bail}; use fs_err::tokio as fs; use log::{debug, info, warn}; use relative_path::RelativePathBuf; use roblox_install::RobloxStudio; use std::{env, path::PathBuf}; ...
rust
MIT
f44f6d2be32d429b0eb05c112f69dfdbc4c9f719
2026-01-04T20:24:56.172033Z
false
jackTabsCode/asphalt
https://github.com/jackTabsCode/asphalt/blob/f44f6d2be32d429b0eb05c112f69dfdbc4c9f719/tests/sync.rs
tests/sync.rs
use assert_fs::{fixture::ChildPath, prelude::*}; use common::Project; use predicates::{Predicate, prelude::predicate, str::contains}; use std::{fs, path::Path}; use toml::toml; mod common; fn hash(path: &ChildPath) -> String { let mut hasher = blake3::Hasher::new(); hasher.update(&fs::read(path).unwrap()); ...
rust
MIT
f44f6d2be32d429b0eb05c112f69dfdbc4c9f719
2026-01-04T20:24:56.172033Z
false
jackTabsCode/asphalt
https://github.com/jackTabsCode/asphalt/blob/f44f6d2be32d429b0eb05c112f69dfdbc4c9f719/tests/common/mod.rs
tests/common/mod.rs
use assert_cmd::cargo::cargo_bin_cmd; use assert_fs::{TempDir, fixture::ChildPath, prelude::*}; use std::{fs, path::Path}; pub struct Project { pub dir: TempDir, } impl Project { pub fn new() -> Self { Self { dir: TempDir::new().unwrap(), } } pub fn write_config(&self, con...
rust
MIT
f44f6d2be32d429b0eb05c112f69dfdbc4c9f719
2026-01-04T20:24:56.172033Z
false
MitchelPaulin/Walleye
https://github.com/MitchelPaulin/Walleye/blob/2cbd6df821e306f3c04d5af9e98b8650cdcb6d79/src/draw_table.rs
src/draw_table.rs
use crate::{board::BoardState, zobrist::ZobristKey}; use std::collections::HashMap; #[derive(Clone)] pub struct DrawTable { pub table: HashMap<ZobristKey, u8>, } impl DrawTable { pub fn new() -> DrawTable { DrawTable { table: HashMap::new(), } } pub fn clear(&mut self) { ...
rust
MIT
2cbd6df821e306f3c04d5af9e98b8650cdcb6d79
2026-01-04T20:24:54.383263Z
false
MitchelPaulin/Walleye
https://github.com/MitchelPaulin/Walleye/blob/2cbd6df821e306f3c04d5af9e98b8650cdcb6d79/src/engine.rs
src/engine.rs
pub use crate::board::*; pub use crate::board::{PieceColor::*, PieceKind::*}; use crate::draw_table::DrawTable; pub use crate::evaluation::*; pub use crate::move_generation::*; pub use crate::search::{Search, KILLER_MOVE_PLY_SIZE, MAX_DEPTH}; pub use crate::uci::send_to_gui; pub use crate::utils::out_of_time; use crate...
rust
MIT
2cbd6df821e306f3c04d5af9e98b8650cdcb6d79
2026-01-04T20:24:54.383263Z
false
MitchelPaulin/Walleye
https://github.com/MitchelPaulin/Walleye/blob/2cbd6df821e306f3c04d5af9e98b8650cdcb6d79/src/uci.rs
src/uci.rs
pub use crate::board::*; use crate::draw_table::DrawTable; pub use crate::engine::*; pub use crate::time_control::*; pub use crate::utils::*; use crate::zobrist::ZobristHasher; use log::{error, info}; use std::io::{self, BufRead}; use std::process; use std::sync::mpsc; use std::thread; use std::time::{Duration, Instant...
rust
MIT
2cbd6df821e306f3c04d5af9e98b8650cdcb6d79
2026-01-04T20:24:54.383263Z
false
MitchelPaulin/Walleye
https://github.com/MitchelPaulin/Walleye/blob/2cbd6df821e306f3c04d5af9e98b8650cdcb6d79/src/board.rs
src/board.rs
use crate::engine::*; use crate::utils::*; use crate::zobrist::ZobristHasher; use colored::*; use std::fmt; use std::str::FromStr; // Board position for the start of a new game pub const DEFAULT_FEN_STRING: &str = "rnbqkbnr/pppppppp/8/8/8/8/PPPPPPPP/RNBQKBNR w KQkq - 0 1"; #[derive(Copy, Clone, PartialEq, Eq, Debug)]...
rust
MIT
2cbd6df821e306f3c04d5af9e98b8650cdcb6d79
2026-01-04T20:24:54.383263Z
true
MitchelPaulin/Walleye
https://github.com/MitchelPaulin/Walleye/blob/2cbd6df821e306f3c04d5af9e98b8650cdcb6d79/src/search.rs
src/search.rs
pub use crate::board::*; pub const MAX_DEPTH: u8 = 100; pub const KILLER_MOVE_PLY_SIZE: usize = 2; type MoveArray = [Option<(Point, Point)>; MAX_DEPTH as usize]; type KillerMoveArray = [[Option<(Point, Point)>; KILLER_MOVE_PLY_SIZE]; MAX_DEPTH as usize]; /* Keep track of global information about the current s...
rust
MIT
2cbd6df821e306f3c04d5af9e98b8650cdcb6d79
2026-01-04T20:24:54.383263Z
false
MitchelPaulin/Walleye
https://github.com/MitchelPaulin/Walleye/blob/2cbd6df821e306f3c04d5af9e98b8650cdcb6d79/src/move_generation.rs
src/move_generation.rs
pub use crate::board::*; pub use crate::evaluation::*; use crate::zobrist::ZobristHasher; const KNIGHT_CORDS: [(i8, i8); 8] = [ (1, 2), (1, -2), (2, 1), (2, -1), (-1, 2), (-1, -2), (-2, -1), (-2, 1), ]; // MVV-LVA score, see https://www.chessprogramming.org/MVV-LVA // addressed as [vic...
rust
MIT
2cbd6df821e306f3c04d5af9e98b8650cdcb6d79
2026-01-04T20:24:54.383263Z
true
MitchelPaulin/Walleye
https://github.com/MitchelPaulin/Walleye/blob/2cbd6df821e306f3c04d5af9e98b8650cdcb6d79/src/time_control.rs
src/time_control.rs
use crate::board::PieceColor; pub const SAFEGUARD: f64 = 100.0; // msecs const GAME_LENGTH: u32 = 30; // moves const MAX_USAGE: f64 = 0.8; // percentage const NO_TIME: u128 = 0; pub struct GameTime { // all time is in ms unless otherwise specified pub wtime: i128, pub btime: i128, pub winc: i128, ...
rust
MIT
2cbd6df821e306f3c04d5af9e98b8650cdcb6d79
2026-01-04T20:24:54.383263Z
false
MitchelPaulin/Walleye
https://github.com/MitchelPaulin/Walleye/blob/2cbd6df821e306f3c04d5af9e98b8650cdcb6d79/src/utils.rs
src/utils.rs
use std::time::Instant; /* Remove new line characters from the end of a string Works on windows and linux */ pub fn trim_newline(s: &mut String) { if s.ends_with('\n') { s.pop(); if s.ends_with('\r') { s.pop(); } } } pub fn clean_input(buffer: &str) -> String { ...
rust
MIT
2cbd6df821e306f3c04d5af9e98b8650cdcb6d79
2026-01-04T20:24:54.383263Z
false
MitchelPaulin/Walleye
https://github.com/MitchelPaulin/Walleye/blob/2cbd6df821e306f3c04d5af9e98b8650cdcb6d79/src/main.rs
src/main.rs
extern crate clap; use clap::{App, Arg}; use std::{cmp::max, time::Instant}; mod board; mod draw_table; mod engine; mod evaluation; mod move_generation; mod search; mod time_control; mod uci; mod utils; mod zobrist; /* A custom memory allocator with better performance characteristics than rusts default. Du...
rust
MIT
2cbd6df821e306f3c04d5af9e98b8650cdcb6d79
2026-01-04T20:24:54.383263Z
false
MitchelPaulin/Walleye
https://github.com/MitchelPaulin/Walleye/blob/2cbd6df821e306f3c04d5af9e98b8650cdcb6d79/src/zobrist.rs
src/zobrist.rs
use crate::board::{Piece, PieceColor::*, Point}; pub use crate::move_generation::CastlingType; use rand_chacha::rand_core::{RngCore, SeedableRng}; /* For simplicity use a 12x12 board so we do not need to convert between an 8x8 and 12x12 board coordinate system Since this array is not initialized very ...
rust
MIT
2cbd6df821e306f3c04d5af9e98b8650cdcb6d79
2026-01-04T20:24:54.383263Z
false
MitchelPaulin/Walleye
https://github.com/MitchelPaulin/Walleye/blob/2cbd6df821e306f3c04d5af9e98b8650cdcb6d79/src/evaluation.rs
src/evaluation.rs
pub use crate::board::*; pub use crate::board::{PieceColor::*, PieceKind::*}; /* Evaluation function based on https://www.chessprogramming.org/PeSTO%27s_Evaluation_Function */ #[rustfmt::skip] const MG_PAWN_TABLE: [[i32; 8]; 8] = [ [ 0, 0, 0, 0, 0, 0, 0, 0], [ 98, 134, 61, 95, 68, 126, 34, -1...
rust
MIT
2cbd6df821e306f3c04d5af9e98b8650cdcb6d79
2026-01-04T20:24:54.383263Z
false
irevenko/ferris-fetch
https://github.com/irevenko/ferris-fetch/blob/229ab7029109865b9fd6aab5953875942bdf3e33/src/main.rs
src/main.rs
use colored::*; use std::string::ToString; use sysinfo::{System, SystemExt, RefreshKind, ProcessorExt}; const FERRIS_ART: &[&str] = &[ " ", " ▄ ▓▄ ▄▓▓ ▓▓ ", " ▄ ▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓ ▄ ", " ▐▓▓▓▓▓...
rust
MIT
229ab7029109865b9fd6aab5953875942bdf3e33
2026-01-04T20:24:53.210634Z
false
trinhminhtriet/rmrfrs
https://github.com/trinhminhtriet/rmrfrs/blob/6b824c29d827efbca1c8022d0b4c2d82eb8ef7c2/rmrfrs/src/main.rs
rmrfrs/src/main.rs
use std::{ env::current_dir, error::Error, fmt, io::{stdin, stdout, Write}, num::ParseIntError, path::PathBuf, sync::mpsc::{Receiver, Sender, SyncSender}, }; use clap::{Command, CommandFactory, Parser}; use clap_complete::{generate, Generator, Shell}; use rmrfrs_lib::{ dir_size, path_c...
rust
MIT
6b824c29d827efbca1c8022d0b4c2d82eb8ef7c2
2026-01-04T20:24:58.804688Z
false
trinhminhtriet/rmrfrs
https://github.com/trinhminhtriet/rmrfrs/blob/6b824c29d827efbca1c8022d0b4c2d82eb8ef7c2/rmrfrs-ui/src/main.rs
rmrfrs-ui/src/main.rs
// On the Windows platform, disable the console when opening the app #![windows_subsystem = "windows"] use std::{ cmp::Ordering, path, sync::{mpsc, Arc}, thread, }; use druid::{ commands::{OPEN_FILE, SHOW_OPEN_PANEL}, widget::{ Button, Controller, CrossAxisAlignment, Flex, FlexParams, ...
rust
MIT
6b824c29d827efbca1c8022d0b4c2d82eb8ef7c2
2026-01-04T20:24:58.804688Z
false
trinhminhtriet/rmrfrs
https://github.com/trinhminhtriet/rmrfrs/blob/6b824c29d827efbca1c8022d0b4c2d82eb8ef7c2/rmrfrs-lib/src/lib.rs
rmrfrs-lib/src/lib.rs
use std::{ borrow::Cow, error::{self, Error}, fs, path::{self, Path}, time::SystemTime, }; const FILE_CARGO_TOML: &str = "Cargo.toml"; const FILE_PACKAGE_JSON: &str = "package.json"; const FILE_ASSEMBLY_CSHARP: &str = "Assembly-CSharp.csproj"; const FILE_STACK_HASKELL: &str = "stack.yaml"; const FI...
rust
MIT
6b824c29d827efbca1c8022d0b4c2d82eb8ef7c2
2026-01-04T20:24:58.804688Z
false
0xMiden/crypto
https://github.com/0xMiden/crypto/blob/b30552ecceb5f70565cc0267fca227f30c5af7ab/miden-crypto-fuzz/fuzz_targets/smt.rs
miden-crypto-fuzz/fuzz_targets/smt.rs
#![no_main] use libfuzzer_sys::fuzz_target; use miden_crypto::{Felt, ONE, Word, merkle::smt::Smt}; use rand::Rng; // Needed for randomizing the split percentage struct FuzzInput { entries: Vec<(Word, Word)>, updates: Vec<(Word, Word)>, } impl FuzzInput { fn from_bytes(data: &[u8]) -> Self { let m...
rust
Apache-2.0
b30552ecceb5f70565cc0267fca227f30c5af7ab
2026-01-04T20:24:48.363198Z
false
0xMiden/crypto
https://github.com/0xMiden/crypto/blob/b30552ecceb5f70565cc0267fca227f30c5af7ab/miden-crypto-derive/src/lib.rs
miden-crypto-derive/src/lib.rs
use proc_macro::TokenStream; use quote::quote; use syn::{DeriveInput, parse_macro_input}; /// Derives a Debug implementation that elides secret values. /// /// This macro generates a Debug implementation that outputs `<elided secret for TypeName>` /// instead of the actual field values, preventing accidental leakage o...
rust
Apache-2.0
b30552ecceb5f70565cc0267fca227f30c5af7ab
2026-01-04T20:24:48.363198Z
false
0xMiden/crypto
https://github.com/0xMiden/crypto/blob/b30552ecceb5f70565cc0267fca227f30c5af7ab/miden-crypto/build.rs
miden-crypto/build.rs
fn main() { #[cfg(target_feature = "sve")] compile_arch_arm64_sve(); } #[cfg(target_feature = "sve")] fn compile_arch_arm64_sve() { const RPO_SVE_PATH: &str = "arch/arm64-sve/rpo"; println!("cargo:rerun-if-changed={RPO_SVE_PATH}/library.c"); println!("cargo:rerun-if-changed={RPO_SVE_PATH}/library....
rust
Apache-2.0
b30552ecceb5f70565cc0267fca227f30c5af7ab
2026-01-04T20:24:48.363198Z
false
0xMiden/crypto
https://github.com/0xMiden/crypto/blob/b30552ecceb5f70565cc0267fca227f30c5af7ab/miden-crypto/src/lib.rs
miden-crypto/src/lib.rs
#![no_std] #[macro_use] extern crate alloc; #[cfg(feature = "std")] extern crate std; use field::PrimeCharacteristicRing; pub mod aead; pub mod dsa; pub mod ecdh; pub mod hash; pub mod ies; pub mod merkle; pub mod rand; pub mod utils; pub mod word; // RE-EXPORTS // ==================================================...
rust
Apache-2.0
b30552ecceb5f70565cc0267fca227f30c5af7ab
2026-01-04T20:24:48.363198Z
false
0xMiden/crypto
https://github.com/0xMiden/crypto/blob/b30552ecceb5f70565cc0267fca227f30c5af7ab/miden-crypto/src/main.rs
miden-crypto/src/main.rs
use std::{path::PathBuf, time::Instant}; use clap::{Parser, ValueEnum}; #[cfg(feature = "rocksdb")] use miden_crypto::merkle::smt::{RocksDbConfig, RocksDbStorage}; use miden_crypto::{ EMPTY_WORD, Felt, ONE, Word, hash::rpo::Rpo256, merkle::smt::{LargeSmt, LargeSmtError, MemoryStorage, SmtStorage}, rand...
rust
Apache-2.0
b30552ecceb5f70565cc0267fca227f30c5af7ab
2026-01-04T20:24:48.363198Z
false
0xMiden/crypto
https://github.com/0xMiden/crypto/blob/b30552ecceb5f70565cc0267fca227f30c5af7ab/miden-crypto/src/dsa/mod.rs
miden-crypto/src/dsa/mod.rs
//! Digital signature schemes supported by default in the Miden VM. pub mod ecdsa_k256_keccak; pub mod eddsa_25519_sha512; pub mod falcon512_rpo;
rust
Apache-2.0
b30552ecceb5f70565cc0267fca227f30c5af7ab
2026-01-04T20:24:48.363198Z
false
0xMiden/crypto
https://github.com/0xMiden/crypto/blob/b30552ecceb5f70565cc0267fca227f30c5af7ab/miden-crypto/src/dsa/eddsa_25519_sha512/tests.rs
miden-crypto/src/dsa/eddsa_25519_sha512/tests.rs
use super::*; #[test] fn sign_and_verify_roundtrip() { use rand::rng; let mut rng = rng(); let sk = SecretKey::with_rng(&mut rng); let pk = sk.public_key(); let msg = Word::default(); // all zeros let sig = sk.sign(msg); assert!(pk.verify(msg, &sig)); } #[test] fn test_key_generation_se...
rust
Apache-2.0
b30552ecceb5f70565cc0267fca227f30c5af7ab
2026-01-04T20:24:48.363198Z
false
0xMiden/crypto
https://github.com/0xMiden/crypto/blob/b30552ecceb5f70565cc0267fca227f30c5af7ab/miden-crypto/src/dsa/eddsa_25519_sha512/mod.rs
miden-crypto/src/dsa/eddsa_25519_sha512/mod.rs
//! Ed25519 (EdDSA) signature implementation using Curve25519 and SHA-512 to hash //! the messages when signing. use alloc::{string::ToString, vec::Vec}; use ed25519_dalek::{Signer, Verifier}; use miden_crypto_derive::{SilentDebug, SilentDisplay}; use rand::{CryptoRng, RngCore}; use thiserror::Error; use crate::{ ...
rust
Apache-2.0
b30552ecceb5f70565cc0267fca227f30c5af7ab
2026-01-04T20:24:48.363198Z
false
0xMiden/crypto
https://github.com/0xMiden/crypto/blob/b30552ecceb5f70565cc0267fca227f30c5af7ab/miden-crypto/src/dsa/falcon512_rpo/hash_to_point.rs
miden-crypto/src/dsa/falcon512_rpo/hash_to_point.rs
use alloc::vec::Vec; use p3_field::PrimeField64; use super::{MODULUS, N, Nonce, Polynomial, Rpo256, ZERO, math::FalconFelt}; use crate::{Felt, Word}; // HASH-TO-POINT FUNCTIONS // ================================================================================================ /// Returns a polynomial in Z_p[x]/(phi...
rust
Apache-2.0
b30552ecceb5f70565cc0267fca227f30c5af7ab
2026-01-04T20:24:48.363198Z
false
0xMiden/crypto
https://github.com/0xMiden/crypto/blob/b30552ecceb5f70565cc0267fca227f30c5af7ab/miden-crypto/src/dsa/falcon512_rpo/signature.rs
miden-crypto/src/dsa/falcon512_rpo/signature.rs
use alloc::{string::ToString, vec::Vec}; use core::ops::Deref; use num::Zero; use super::{ ByteReader, ByteWriter, Deserializable, DeserializationError, LOG_N, MODULUS, N, Nonce, SIG_L2_BOUND, SIG_POLY_BYTE_LEN, Serializable, hash_to_point::hash_to_point_rpo256, keys::PublicKey, math::{FalconFelt,...
rust
Apache-2.0
b30552ecceb5f70565cc0267fca227f30c5af7ab
2026-01-04T20:24:48.363198Z
false
0xMiden/crypto
https://github.com/0xMiden/crypto/blob/b30552ecceb5f70565cc0267fca227f30c5af7ab/miden-crypto/src/dsa/falcon512_rpo/mod.rs
miden-crypto/src/dsa/falcon512_rpo/mod.rs
//! A deterministic RPO Falcon512 signature over a message. //! //! This version differs from the reference implementation in its use of the RPO algebraic hash //! function in its hash-to-point algorithm. //! //! Another point of difference is the determinism in the signing process. The approach used to //! achieve thi...
rust
Apache-2.0
b30552ecceb5f70565cc0267fca227f30c5af7ab
2026-01-04T20:24:48.363198Z
false
0xMiden/crypto
https://github.com/0xMiden/crypto/blob/b30552ecceb5f70565cc0267fca227f30c5af7ab/miden-crypto/src/dsa/falcon512_rpo/math/field.rs
miden-crypto/src/dsa/falcon512_rpo/math/field.rs
use alloc::string::String; use core::ops::{Add, AddAssign, Div, DivAssign, Mul, MulAssign, Neg, Sub, SubAssign}; use num::{One, Zero}; use super::{Inverse, MODULUS, fft::CyclotomicFourier}; #[derive(Debug, Clone, Copy, PartialEq, Eq, Default)] pub struct FalconFelt(u32); impl FalconFelt { pub const fn new(value...
rust
Apache-2.0
b30552ecceb5f70565cc0267fca227f30c5af7ab
2026-01-04T20:24:48.363198Z
false
0xMiden/crypto
https://github.com/0xMiden/crypto/blob/b30552ecceb5f70565cc0267fca227f30c5af7ab/miden-crypto/src/dsa/falcon512_rpo/math/polynomial.rs
miden-crypto/src/dsa/falcon512_rpo/math/polynomial.rs
//! Generic polynomial type and operations used in Falcon. use alloc::vec::Vec; use core::{ default::Default, fmt::Debug, ops::{Add, AddAssign, Div, Mul, MulAssign, Neg, Sub, SubAssign}, }; use num::{One, Zero}; use p3_field::PrimeCharacteristicRing; use super::{Inverse, field::FalconFelt}; use crate::{ ...
rust
Apache-2.0
b30552ecceb5f70565cc0267fca227f30c5af7ab
2026-01-04T20:24:48.363198Z
false
0xMiden/crypto
https://github.com/0xMiden/crypto/blob/b30552ecceb5f70565cc0267fca227f30c5af7ab/miden-crypto/src/dsa/falcon512_rpo/math/mod.rs
miden-crypto/src/dsa/falcon512_rpo/math/mod.rs
//! Contains different structs and methods related to the Falcon DSA. //! //! It uses and acknowledges the work in: //! //! 1. The [reference](https://falcon-sign.info/impl/README.txt.html) implementation by Thomas //! Pornin. //! 2. The [Rust](https://github.com/aszepieniec/falcon-rust) implementation by Alan Szepi...
rust
Apache-2.0
b30552ecceb5f70565cc0267fca227f30c5af7ab
2026-01-04T20:24:48.363198Z
false