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
frostsnap/frostsnap
https://github.com/frostsnap/frostsnap/blob/961deb080a81c754f402aaea24286bd141178e9d/frostsnap_coordinator/src/bitcoin/wallet.rs
frostsnap_coordinator/src/bitcoin/wallet.rs
use super::{chain_sync::ChainClient, multi_x_descriptor_for_account}; use crate::persist::Persisted; use anyhow::{anyhow, Context, Result}; use bdk_chain::{ bitcoin::{self, bip32, Amount, BlockHash, OutPoint, ScriptBuf, TxOut, Txid}, indexed_tx_graph::{self}, indexer::keychain_txout::{self, KeychainTxOutInd...
rust
MIT
961deb080a81c754f402aaea24286bd141178e9d
2026-01-04T20:21:09.467677Z
true
frostsnap/frostsnap
https://github.com/frostsnap/frostsnap/blob/961deb080a81c754f402aaea24286bd141178e9d/frostsnap_coordinator/src/bitcoin/outgoing.rs
frostsnap_coordinator/src/bitcoin/outgoing.rs
use std::collections::VecDeque; use bdk_chain::bitcoin::Txid; /// Tracks outgoing transactions. #[derive(Clone, Default)] pub struct OutgoingTracker { /// Queue of the outgoing transactions. queue: VecDeque<Txid>, } pub enum Mutation { Push(Txid), Forget(Txid), } impl OutgoingTracker { pub fn qu...
rust
MIT
961deb080a81c754f402aaea24286bd141178e9d
2026-01-04T20:21:09.467677Z
false
frostsnap/frostsnap
https://github.com/frostsnap/frostsnap/blob/961deb080a81c754f402aaea24286bd141178e9d/frostsnap_coordinator/src/bitcoin/tofu/connection.rs
frostsnap_coordinator/src/bitcoin/tofu/connection.rs
use anyhow::anyhow; use bdk_chain::bitcoin::BlockHash; use futures::{pin_mut, select, FutureExt, StreamExt}; use rustls::client::WebPkiServerVerifier; use rustls::pki_types::ServerName; use rustls::ClientConfig; use std::sync::Arc; use std::time::Duration; use tokio::net::TcpStream; use tokio_rustls::{client::TlsStream...
rust
MIT
961deb080a81c754f402aaea24286bd141178e9d
2026-01-04T20:21:09.467677Z
false
frostsnap/frostsnap
https://github.com/frostsnap/frostsnap/blob/961deb080a81c754f402aaea24286bd141178e9d/frostsnap_coordinator/src/bitcoin/tofu/mod.rs
frostsnap_coordinator/src/bitcoin/tofu/mod.rs
pub mod connection; pub mod trusted_certs; pub mod verifier;
rust
MIT
961deb080a81c754f402aaea24286bd141178e9d
2026-01-04T20:21:09.467677Z
false
frostsnap/frostsnap
https://github.com/frostsnap/frostsnap/blob/961deb080a81c754f402aaea24286bd141178e9d/frostsnap_coordinator/src/bitcoin/tofu/verifier.rs
frostsnap_coordinator/src/bitcoin/tofu/verifier.rs
use rustls::client::danger::{HandshakeSignatureValid, ServerCertVerified, ServerCertVerifier}; use rustls::pki_types::{CertificateDer, ServerName, UnixTime}; use rustls::{DigitallySignedStruct, Error as RustlsError, SignatureScheme}; use std::collections::HashMap; use std::sync::{Arc, Mutex}; use super::trusted_certs:...
rust
MIT
961deb080a81c754f402aaea24286bd141178e9d
2026-01-04T20:21:09.467677Z
false
frostsnap/frostsnap
https://github.com/frostsnap/frostsnap/blob/961deb080a81c754f402aaea24286bd141178e9d/frostsnap_coordinator/src/bitcoin/tofu/trusted_certs.rs
frostsnap_coordinator/src/bitcoin/tofu/trusted_certs.rs
use anyhow::Result; use bdk_chain::{bitcoin, rusqlite_impl::migrate_schema}; use rusqlite::params; use rustls::RootCertStore; use rustls_pki_types::CertificateDer; use std::collections::HashMap; use std::time::{SystemTime, UNIX_EPOCH}; use super::verifier::CertificateExt; use crate::persist::Persist; #[derive(Clone,...
rust
MIT
961deb080a81c754f402aaea24286bd141178e9d
2026-01-04T20:21:09.467677Z
false
frostsnap/frostsnap
https://github.com/frostsnap/frostsnap/blob/961deb080a81c754f402aaea24286bd141178e9d/frostsnap_coordinator/tests/firmware_digest_test.rs
frostsnap_coordinator/tests/firmware_digest_test.rs
use frostsnap_coordinator::{firmware::VersionNumber, FirmwareBin}; use frostsnap_core::hex; #[test] fn test_v0_0_1_firmware_digests() { let firmware_signed_bytes = include_bytes!("v0.0.1-firmware-signed.bin"); let firmware_unsigned_bytes = include_bytes!("v0.0.1-firmware-unsigned.bin"); let firmware_signe...
rust
MIT
961deb080a81c754f402aaea24286bd141178e9d
2026-01-04T20:21:09.467677Z
false
frostsnap/frostsnap
https://github.com/frostsnap/frostsnap/blob/961deb080a81c754f402aaea24286bd141178e9d/frostsnap_coordinator/tests/tofu_tests.rs
frostsnap_coordinator/tests/tofu_tests.rs
use frostsnap_coordinator::bitcoin::tofu::trusted_certs::TrustedCertificates; use frostsnap_coordinator::persist::Persist; use rusqlite::Connection; use rustls_pki_types::ServerName; use std::sync::Arc; use tempfile::NamedTempFile; use tokio::net::TcpStream; use tokio_rustls::TlsConnector; #[tokio::test] async fn test...
rust
MIT
961deb080a81c754f402aaea24286bd141178e9d
2026-01-04T20:21:09.467677Z
false
frostsnap/frostsnap
https://github.com/frostsnap/frostsnap/blob/961deb080a81c754f402aaea24286bd141178e9d/frostsnap_comms/src/genuine_certificate.rs
frostsnap_comms/src/genuine_certificate.rs
use alloc::{string::String, vec::Vec}; use frostsnap_core::{ schnorr_fun::{ fun::{marker::EvenY, KeyPair, Point}, nonce::NonceGen, Message, Schnorr, Signature, }, sha2::Sha256, Versioned, }; pub const CERTIFICATE_BINCODE_CONFIG: bincode::config::Configuration< bincode::confi...
rust
MIT
961deb080a81c754f402aaea24286bd141178e9d
2026-01-04T20:21:09.467677Z
false
frostsnap/frostsnap
https://github.com/frostsnap/frostsnap/blob/961deb080a81c754f402aaea24286bd141178e9d/frostsnap_comms/src/lib.rs
frostsnap_comms/src/lib.rs
#![no_std] #[cfg(feature = "std")] extern crate std; #[macro_use] extern crate alloc; pub mod factory; pub mod firmware_reader; pub mod fixed_string; pub mod genuine_certificate; use alloc::boxed::Box; use alloc::string::ToString; use alloc::vec::Vec; use alloc::{collections::BTreeSet, string::String}; use bincode::{...
rust
MIT
961deb080a81c754f402aaea24286bd141178e9d
2026-01-04T20:21:09.467677Z
false
frostsnap/frostsnap
https://github.com/frostsnap/frostsnap/blob/961deb080a81c754f402aaea24286bd141178e9d/frostsnap_comms/src/fixed_string.rs
frostsnap_comms/src/fixed_string.rs
use alloc::string::{String, ToString}; use core::fmt; use core::ops::Deref; use core::str::FromStr; #[derive(Clone, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)] pub struct FixedString<const N: usize> { inner: String, } #[derive(Debug, Clone, PartialEq, Eq)] pub struct StringTooLong { pub max_len: usize, ...
rust
MIT
961deb080a81c754f402aaea24286bd141178e9d
2026-01-04T20:21:09.467677Z
false
frostsnap/frostsnap
https://github.com/frostsnap/frostsnap/blob/961deb080a81c754f402aaea24286bd141178e9d/frostsnap_comms/src/firmware_reader.rs
frostsnap_comms/src/firmware_reader.rs
//! # Firmware Reading and Parsing //! //! This module provides a trait-based abstraction for reading firmware from different sources //! (flash partitions on devices, or in-memory buffers on coordinators) and parsing ESP32 //! firmware image format. use crate::SIGNATURE_BLOCK_MAGIC; use alloc::boxed::Box; use alloc::...
rust
MIT
961deb080a81c754f402aaea24286bd141178e9d
2026-01-04T20:21:09.467677Z
false
frostsnap/frostsnap
https://github.com/frostsnap/frostsnap/blob/961deb080a81c754f402aaea24286bd141178e9d/frostsnap_comms/src/factory.rs
frostsnap_comms/src/factory.rs
use crate::{ genuine_certificate::Certificate, Direction, HasMagicBytes, MagicBytesVersion, MAGIC_BYTES_LEN, }; use alloc::{string::String, vec::Vec}; use frostsnap_core::Gist; pub const DS_KEY_SIZE_BITS: usize = 3072; pub const DS_KEY_SIZE_BYTES: usize = DS_KEY_SIZE_BITS / 8; pub fn pad_message_for_rsa(message_d...
rust
MIT
961deb080a81c754f402aaea24286bd141178e9d
2026-01-04T20:21:09.467677Z
false
frostsnap/frostsnap
https://github.com/frostsnap/frostsnap/blob/961deb080a81c754f402aaea24286bd141178e9d/frostsnap_factory/src/db.rs
frostsnap_factory/src/db.rs
use frostsnap_comms::Sha256Digest; use mysql::prelude::*; use mysql::{Pool, PooledConn}; use std::time::SystemTime; pub struct Database { pool: Pool, } impl Database { pub fn new(db_connection: String) -> Result<Self, Box<dyn std::error::Error>> { let opts = mysql::Opts::from_url(&db_connection)?; ...
rust
MIT
961deb080a81c754f402aaea24286bd141178e9d
2026-01-04T20:21:09.467677Z
false
frostsnap/frostsnap
https://github.com/frostsnap/frostsnap/blob/961deb080a81c754f402aaea24286bd141178e9d/frostsnap_factory/src/process.rs
frostsnap_factory/src/process.rs
use frostsnap_comms::factory::{DeviceFactorySend, FactoryDownstream, FactorySend}; use frostsnap_comms::genuine_certificate::CertificateVerifier; use frostsnap_comms::{ CoordinatorSendBody, CoordinatorSendMessage, DeviceSendBody, Direction, Downstream, ReceiveSerial, Sha256Digest, MAGIC_BYTES_PERIOD, }; use fro...
rust
MIT
961deb080a81c754f402aaea24286bd141178e9d
2026-01-04T20:21:09.467677Z
false
frostsnap/frostsnap
https://github.com/frostsnap/frostsnap/blob/961deb080a81c754f402aaea24286bd141178e9d/frostsnap_factory/src/cli.rs
frostsnap_factory/src/cli.rs
use clap::{Parser, Subcommand}; use frostsnap_comms::genuine_certificate::CaseColor; use std::path::PathBuf; #[derive(Parser, Debug)] #[command(version, about, long_about = None)] pub struct Args { #[command(subcommand)] pub command: Commands, } #[derive(Subcommand, Debug)] pub enum Commands { /// Start a...
rust
MIT
961deb080a81c754f402aaea24286bd141178e9d
2026-01-04T20:21:09.467677Z
false
frostsnap/frostsnap
https://github.com/frostsnap/frostsnap/blob/961deb080a81c754f402aaea24286bd141178e9d/frostsnap_factory/src/ds.rs
frostsnap_factory/src/ds.rs
use aes::cipher::BlockEncryptMut; use aes::cipher::{block_padding::NoPadding, KeyIvInit}; use aes::Aes256; use cbc::Encryptor; use frostsnap_comms::factory::{pad_message_for_rsa, Esp32DsKey, DS_KEY_SIZE_BITS}; use frostsnap_core::sha2::{Digest, Sha256}; use hmac::{Hmac, Mac}; use num_traits::ToPrimitive; use num_traits...
rust
MIT
961deb080a81c754f402aaea24286bd141178e9d
2026-01-04T20:21:09.467677Z
false
frostsnap/frostsnap
https://github.com/frostsnap/frostsnap/blob/961deb080a81c754f402aaea24286bd141178e9d/frostsnap_factory/src/main.rs
frostsnap_factory/src/main.rs
use std::{collections::HashSet, env}; use clap::Parser; use frostsnap_comms::{genuine_certificate::CaseColor, Sha256Digest}; use frostsnap_core::{ hex, schnorr_fun::fun::{marker::EvenY, KeyPair, Scalar}, }; pub mod cli; pub mod db; pub mod ds; pub mod process; const BOARD_REVISION: &str = "2.7-1625"; pub con...
rust
MIT
961deb080a81c754f402aaea24286bd141178e9d
2026-01-04T20:21:09.467677Z
false
frostsnap/frostsnap
https://github.com/frostsnap/frostsnap/blob/961deb080a81c754f402aaea24286bd141178e9d/frostsnap_fonts/src/noto_sans_14_light.rs
frostsnap_fonts/src/noto_sans_14_light.rs
//! Gray4 (4-bit, 16-level) anti-aliased font with minimal line height //! Generated from: NotoSans-Variable.ttf //! Size: 14px //! Weight: 300 //! Characters: 95 //! Line height: 15px (minimal - actual glyph bounds) use super::gray4_font::{GlyphInfo, Gray4Font}; /// Packed pixel data (2 pixels per byte, 4 bits each)...
rust
MIT
961deb080a81c754f402aaea24286bd141178e9d
2026-01-04T20:21:09.467677Z
true
frostsnap/frostsnap
https://github.com/frostsnap/frostsnap/blob/961deb080a81c754f402aaea24286bd141178e9d/frostsnap_fonts/src/lib.rs
frostsnap_fonts/src/lib.rs
#![no_std] // Core font types pub mod gray4_font; pub use gray4_font::{GlyphInfo, Gray4Font}; // Font modules pub mod noto_sans_14_light; pub mod noto_sans_17_regular; pub mod noto_sans_18_light; pub mod noto_sans_18_medium; pub mod noto_sans_24_bold; pub mod noto_sans_mono_14_regular; pub mod noto_sans_mono_15_regul...
rust
MIT
961deb080a81c754f402aaea24286bd141178e9d
2026-01-04T20:21:09.467677Z
false
frostsnap/frostsnap
https://github.com/frostsnap/frostsnap/blob/961deb080a81c754f402aaea24286bd141178e9d/frostsnap_fonts/src/gray4_font.rs
frostsnap_fonts/src/gray4_font.rs
use embedded_graphics::{pixelcolor::Gray4, prelude::*}; /// Gray4 font format - 4-bit anti-aliased fonts with 16 levels of gray /// Glyph info - stores position in packed data array #[derive(Debug, Clone, Copy, PartialEq)] pub struct GlyphInfo { pub character: char, pub width: u8, pub height: u8, pub x...
rust
MIT
961deb080a81c754f402aaea24286bd141178e9d
2026-01-04T20:21:09.467677Z
false
frostsnap/frostsnap
https://github.com/frostsnap/frostsnap/blob/961deb080a81c754f402aaea24286bd141178e9d/frostsnap_fonts/src/noto_sans_mono_15_regular.rs
frostsnap_fonts/src/noto_sans_mono_15_regular.rs
//! Gray4 (4-bit, 16-level) anti-aliased font with minimal line height //! Generated from: NotoSansMono-Variable.ttf //! Size: 15px //! Weight: 400 //! Characters: 95 //! Line height: 16px (minimal - actual glyph bounds) use super::gray4_font::{GlyphInfo, Gray4Font}; /// Packed pixel data (2 pixels per byte, 4 bits e...
rust
MIT
961deb080a81c754f402aaea24286bd141178e9d
2026-01-04T20:21:09.467677Z
true
frostsnap/frostsnap
https://github.com/frostsnap/frostsnap/blob/961deb080a81c754f402aaea24286bd141178e9d/frostsnap_fonts/src/noto_sans_24_bold.rs
frostsnap_fonts/src/noto_sans_24_bold.rs
//! Gray4 (4-bit, 16-level) anti-aliased font with minimal line height //! Generated from: NotoSans-Variable.ttf //! Size: 24px //! Weight: 700 //! Characters: 95 //! Line height: 25px (minimal - actual glyph bounds) use super::gray4_font::{GlyphInfo, Gray4Font}; /// Packed pixel data (2 pixels per byte, 4 bits each)...
rust
MIT
961deb080a81c754f402aaea24286bd141178e9d
2026-01-04T20:21:09.467677Z
true
frostsnap/frostsnap
https://github.com/frostsnap/frostsnap/blob/961deb080a81c754f402aaea24286bd141178e9d/frostsnap_fonts/src/noto_sans_18_light.rs
frostsnap_fonts/src/noto_sans_18_light.rs
//! Gray4 (4-bit, 16-level) anti-aliased font with minimal line height //! Generated from: NotoSans-Variable.ttf //! Size: 18px //! Weight: 300 //! Characters: 95 //! Line height: 19px (minimal - actual glyph bounds) use super::gray4_font::{GlyphInfo, Gray4Font}; /// Packed pixel data (2 pixels per byte, 4 bits each)...
rust
MIT
961deb080a81c754f402aaea24286bd141178e9d
2026-01-04T20:21:09.467677Z
true
frostsnap/frostsnap
https://github.com/frostsnap/frostsnap/blob/961deb080a81c754f402aaea24286bd141178e9d/frostsnap_fonts/src/noto_sans_18_medium.rs
frostsnap_fonts/src/noto_sans_18_medium.rs
//! Gray4 (4-bit, 16-level) anti-aliased font with minimal line height //! Generated from: NotoSans-Variable.ttf //! Size: 18px //! Weight: 500 //! Characters: 95 //! Line height: 19px (minimal - actual glyph bounds) use super::gray4_font::{GlyphInfo, Gray4Font}; /// Packed pixel data (2 pixels per byte, 4 bits each)...
rust
MIT
961deb080a81c754f402aaea24286bd141178e9d
2026-01-04T20:21:09.467677Z
true
frostsnap/frostsnap
https://github.com/frostsnap/frostsnap/blob/961deb080a81c754f402aaea24286bd141178e9d/frostsnap_fonts/src/noto_sans_mono_18_light.rs
frostsnap_fonts/src/noto_sans_mono_18_light.rs
//! Gray4 (4-bit, 16-level) anti-aliased font with minimal line height //! Generated from: NotoSansMono-Variable.ttf //! Size: 18px //! Weight: 300 //! Characters: 95 //! Line height: 19px (minimal - actual glyph bounds) use super::gray4_font::{GlyphInfo, Gray4Font}; /// Packed pixel data (2 pixels per byte, 4 bits e...
rust
MIT
961deb080a81c754f402aaea24286bd141178e9d
2026-01-04T20:21:09.467677Z
true
frostsnap/frostsnap
https://github.com/frostsnap/frostsnap/blob/961deb080a81c754f402aaea24286bd141178e9d/frostsnap_fonts/src/noto_sans_mono_28_bold.rs
frostsnap_fonts/src/noto_sans_mono_28_bold.rs
//! Gray4 (4-bit, 16-level) anti-aliased font with minimal line height //! Generated from: NotoSansMono-Variable.ttf //! Size: 28px //! Weight: 700 //! Characters: 95 //! Line height: 29px (minimal - actual glyph bounds) use super::gray4_font::{GlyphInfo, Gray4Font}; /// Packed pixel data (2 pixels per byte, 4 bits e...
rust
MIT
961deb080a81c754f402aaea24286bd141178e9d
2026-01-04T20:21:09.467677Z
true
frostsnap/frostsnap
https://github.com/frostsnap/frostsnap/blob/961deb080a81c754f402aaea24286bd141178e9d/frostsnap_fonts/src/noto_sans_mono_17_regular.rs
frostsnap_fonts/src/noto_sans_mono_17_regular.rs
//! Gray4 (4-bit, 16-level) anti-aliased font with minimal line height //! Generated from: NotoSansMono-Variable.ttf //! Size: 17px //! Weight: 400 //! Characters: 95 //! Line height: 19px (minimal - actual glyph bounds) use super::gray4_font::{GlyphInfo, Gray4Font}; /// Packed pixel data (2 pixels per byte, 4 bits e...
rust
MIT
961deb080a81c754f402aaea24286bd141178e9d
2026-01-04T20:21:09.467677Z
true
frostsnap/frostsnap
https://github.com/frostsnap/frostsnap/blob/961deb080a81c754f402aaea24286bd141178e9d/frostsnap_fonts/src/noto_sans_mono_14_regular.rs
frostsnap_fonts/src/noto_sans_mono_14_regular.rs
//! Gray4 (4-bit, 16-level) anti-aliased font with minimal line height //! Generated from: NotoSansMono-Variable.ttf //! Size: 14px //! Weight: 400 //! Characters: 95 //! Line height: 15px (minimal - actual glyph bounds) use super::gray4_font::{GlyphInfo, Gray4Font}; /// Packed pixel data (2 pixels per byte, 4 bits e...
rust
MIT
961deb080a81c754f402aaea24286bd141178e9d
2026-01-04T20:21:09.467677Z
true
frostsnap/frostsnap
https://github.com/frostsnap/frostsnap/blob/961deb080a81c754f402aaea24286bd141178e9d/frostsnap_fonts/src/noto_sans_17_regular.rs
frostsnap_fonts/src/noto_sans_17_regular.rs
//! Gray4 (4-bit, 16-level) anti-aliased font with minimal line height //! Generated from: NotoSans-Variable.ttf //! Size: 17px //! Weight: 400 //! Characters: 95 //! Line height: 19px (minimal - actual glyph bounds) use super::gray4_font::{GlyphInfo, Gray4Font}; /// Packed pixel data (2 pixels per byte, 4 bits each)...
rust
MIT
961deb080a81c754f402aaea24286bd141178e9d
2026-01-04T20:21:09.467677Z
true
frostsnap/frostsnap
https://github.com/frostsnap/frostsnap/blob/961deb080a81c754f402aaea24286bd141178e9d/frostsnap_fonts/src/noto_sans_mono_24_bold.rs
frostsnap_fonts/src/noto_sans_mono_24_bold.rs
//! Gray4 (4-bit, 16-level) anti-aliased font with minimal line height //! Generated from: NotoSansMono-Variable.ttf //! Size: 24px //! Weight: 700 //! Characters: 95 //! Line height: 25px (minimal - actual glyph bounds) use super::gray4_font::{GlyphInfo, Gray4Font}; /// Packed pixel data (2 pixels per byte, 4 bits e...
rust
MIT
961deb080a81c754f402aaea24286bd141178e9d
2026-01-04T20:21:09.467677Z
true
frostsnap/frostsnap
https://github.com/frostsnap/frostsnap/blob/961deb080a81c754f402aaea24286bd141178e9d/widget_simulator/src/main.rs
widget_simulator/src/main.rs
#![cfg(not(target_arch = "riscv32"))] use embedded_graphics_simulator::{ OutputSettingsBuilder, SimulatorDisplay, SimulatorEvent, Window, }; use std::cell::RefCell; use std::io::{self, BufRead}; use std::rc::Rc; use std::sync::mpsc; use std::thread; use std::time::SystemTime; const SCREEN_WIDTH: u32 = 240; const ...
rust
MIT
961deb080a81c754f402aaea24286bd141178e9d
2026-01-04T20:21:09.467677Z
false
m-ou-se/floatconv
https://github.com/m-ou-se/floatconv/blob/47a928b570dbfb9b70bd27a92f63548302ce00a2/benchmark/benchmark.rs
benchmark/benchmark.rs
use criterion::{black_box, criterion_group, criterion_main, BenchmarkId, Criterion}; use compiler_builtins::float::conv::*; macro_rules! benches { ($c:ident $f:ident $builtin_conv:ident $t:ident $t2:ident $inputs:ident) => {{ #[inline(never)] fn soft_conv(x: $t) -> $t2 { $t2::from_bits(floatconv::s...
rust
BSD-2-Clause
47a928b570dbfb9b70bd27a92f63548302ce00a2
2026-01-04T20:21:37.255145Z
false
m-ou-se/floatconv
https://github.com/m-ou-se/floatconv/blob/47a928b570dbfb9b70bd27a92f63548302ce00a2/src/test.rs
src/test.rs
use crate::*; #[test] fn test_all_from_u8() { for i in 0..=u8::MAX { let a = f32::from_bits(soft::u8_to_f32(i)); let b = i as f32; assert_eq!(a, b, "{} -> f32", i); let a = f64::from_bits(soft::u8_to_f64(i)); let b = i as f64; assert_eq!(a, b, "{} -> f64", i); ...
rust
BSD-2-Clause
47a928b570dbfb9b70bd27a92f63548302ce00a2
2026-01-04T20:21:37.255145Z
false
m-ou-se/floatconv
https://github.com/m-ou-se/floatconv/blob/47a928b570dbfb9b70bd27a92f63548302ce00a2/src/lib.rs
src/lib.rs
#![cfg_attr(not(test), no_std)] //! Floating point conversion functions. //! //! ## Software and hardware implementations //! //! The [`soft`] module provides a software implementation of all //! conversion functions, for targets which do not provide them natively. //! These are implemented without any floating point ...
rust
BSD-2-Clause
47a928b570dbfb9b70bd27a92f63548302ce00a2
2026-01-04T20:21:37.255145Z
false
m-ou-se/floatconv
https://github.com/m-ou-se/floatconv/blob/47a928b570dbfb9b70bd27a92f63548302ce00a2/src/soft.rs
src/soft.rs
//! Software implementations of all conversion functions that don't use any //! floating point instructions. //! //! Available on all platforms. //! //! To avoid using any floating point instructions or registers, all functions //! in this module take or return the bits of the floating point value as `u32` //! or `u64`...
rust
BSD-2-Clause
47a928b570dbfb9b70bd27a92f63548302ce00a2
2026-01-04T20:21:37.255145Z
false
m-ou-se/floatconv
https://github.com/m-ou-se/floatconv/blob/47a928b570dbfb9b70bd27a92f63548302ce00a2/src/special.rs
src/special.rs
//! Specialized implementations for specific targets. #[allow(unused_macros)] macro_rules! impl_signed { ($name:tt $from:tt $bits:tt $unsigned:tt) => { #[inline] pub fn $name(x: $from) -> f64 { let s = ((x >> $bits - 1) as u64) << 63; f64::from_bits($unsigned(x.wrapping_abs(...
rust
BSD-2-Clause
47a928b570dbfb9b70bd27a92f63548302ce00a2
2026-01-04T20:21:37.255145Z
false
m-ou-se/floatconv
https://github.com/m-ou-se/floatconv/blob/47a928b570dbfb9b70bd27a92f63548302ce00a2/src/fast.rs
src/fast.rs
//! Fast implementations of all conversion functions. //! //! These are implemented using a mix of native floating point instructions (if //! available) and (partial) soft implementations. #[allow(unused_macros)] macro_rules! impl_native { ($name:tt $from:tt $to:tt) => { #[cfg_attr(not(noinline), inline)] ...
rust
BSD-2-Clause
47a928b570dbfb9b70bd27a92f63548302ce00a2
2026-01-04T20:21:37.255145Z
false
PistonDevelopers/resize
https://github.com/PistonDevelopers/resize/blob/f48a38b1e110089e93533c164dab451aaf83fcdb/src/lib.rs
src/lib.rs
//! Simple resampling library in pure Rust. //! //! # Examples //! //! ``` //! use resize::Pixel::RGB8; //! use resize::Type::Lanczos3; //! use rgb::RGB8; //! use rgb::FromSlice; //! //! // Downscale by 2x. //! let (w1, h1) = (640, 480); //! let (w2, h2) = (320, 240); //! // Don't forget to fill `src` with image data (...
rust
MIT
f48a38b1e110089e93533c164dab451aaf83fcdb
2026-01-04T20:21:21.473088Z
false
PistonDevelopers/resize
https://github.com/PistonDevelopers/resize/blob/f48a38b1e110089e93533c164dab451aaf83fcdb/src/no_std_float.rs
src/no_std_float.rs
/// Alternative basic float operations for no_std pub(crate) trait FloatExt { fn floor(self) -> Self; fn ceil(self) -> Self; fn sqrt(self) -> Self; fn round(self) -> Self; fn abs(self) -> Self; fn trunc(self) -> Self; fn fract(self) -> Self; fn sin(self) -> Self; fn exp(self) -> Self...
rust
MIT
f48a38b1e110089e93533c164dab451aaf83fcdb
2026-01-04T20:21:21.473088Z
false
PistonDevelopers/resize
https://github.com/PistonDevelopers/resize/blob/f48a38b1e110089e93533c164dab451aaf83fcdb/src/px.rs
src/px.rs
use crate::formats; pub use rgb::Gray; pub use rgb::Rgb as RGB; pub use rgb::Rgba as RGBA; /// Use [`Pixel`](crate::Pixel) presets to specify pixel format. /// /// The trait represents a temporary object that adds pixels together. pub trait PixelFormat: Send + Sync { /// Pixel type in the source image type Inp...
rust
MIT
f48a38b1e110089e93533c164dab451aaf83fcdb
2026-01-04T20:21:21.473088Z
false
PistonDevelopers/resize
https://github.com/PistonDevelopers/resize/blob/f48a38b1e110089e93533c164dab451aaf83fcdb/tests/qa.rs
tests/qa.rs
use resize::Pixel::*; use resize::Type::*; use std::fs; use std::path::Path; fn load_png(mut data: &[u8]) -> Result<(usize, usize, Vec<u8>), png::DecodingError> { let decoder = png::Decoder::new(&mut data); let mut reader = decoder.read_info()?; let info = reader.info(); let w = info.width as usize; ...
rust
MIT
f48a38b1e110089e93533c164dab451aaf83fcdb
2026-01-04T20:21:21.473088Z
false
PistonDevelopers/resize
https://github.com/PistonDevelopers/resize/blob/f48a38b1e110089e93533c164dab451aaf83fcdb/benches/bench.rs
benches/bench.rs
#![feature(test)] extern crate test; use rgb::FromSlice; use test::Bencher; use resize::Pixel::{Gray16, Gray8, RGB8, RGBA16, RGBA16P, RGBA8}; use resize::Type::Catrom; use resize::Type::Lanczos3; use resize::Type::Point; use resize::Type::Triangle; use std::fs::File; use std::path::PathBuf; fn get_image() -> (u32, u...
rust
MIT
f48a38b1e110089e93533c164dab451aaf83fcdb
2026-01-04T20:21:21.473088Z
false
PistonDevelopers/resize
https://github.com/PistonDevelopers/resize/blob/f48a38b1e110089e93533c164dab451aaf83fcdb/examples/resize.rs
examples/resize.rs
use png::BitDepth; use png::ColorType; use resize::Pixel; use resize::Type::Triangle; use rgb::FromSlice; use std::env; use std::fs::File; fn main() { let args: Vec<_> = env::args().collect(); if args.len() != 4 { return println!("Usage: {} in.png WxH out.png", args[0]); } let decoder = png::D...
rust
MIT
f48a38b1e110089e93533c164dab451aaf83fcdb
2026-01-04T20:21:21.473088Z
false
InQuicker/kaws
https://github.com/InQuicker/kaws/blob/39de6450a2836fb7230c7064ca2b9170272f2644/src/aws.rs
src/aws.rs
use rusoto_core::{ChainProvider, ProfileProvider}; pub fn credentials_provider(path: Option<&str>, profile: Option<&str>) -> ChainProvider { let mut profile_provider = ProfileProvider::new().expect( "Failed to create AWS credentials provider." ); if let Some(path) = path { profile_provider...
rust
MIT
39de6450a2836fb7230c7064ca2b9170272f2644
2026-01-04T20:21:40.832464Z
false
InQuicker/kaws
https://github.com/InQuicker/kaws/blob/39de6450a2836fb7230c7064ca2b9170272f2644/src/process.rs
src/process.rs
use std::ffi::OsStr; use std::fmt::Display; use std::process::Command; use error::{KawsError, KawsResult}; pub fn execute_child_process<S: AsRef<OsStr> + Display>(program: S, args: &[S]) -> KawsResult { let mut command = Command::new(&program); command.args(args); let output = command.output()?; if !...
rust
MIT
39de6450a2836fb7230c7064ca2b9170272f2644
2026-01-04T20:21:40.832464Z
false
InQuicker/kaws
https://github.com/InQuicker/kaws/blob/39de6450a2836fb7230c7064ca2b9170272f2644/src/encryption.rs
src/encryption.rs
use std::fs::{File, remove_file}; use std::io::{ErrorKind, Read, Write}; use hyper::Client as HyperClient; use rusoto_core::{ ChainProvider, DispatchSignedRequest, ProvideAwsCredentials, Region, default_tls_client, }; use rusoto_kms::{ DecryptError, DecryptRequest, DecryptResponse, ...
rust
MIT
39de6450a2836fb7230c7064ca2b9170272f2644
2026-01-04T20:21:40.832464Z
false
InQuicker/kaws
https://github.com/InQuicker/kaws/blob/39de6450a2836fb7230c7064ca2b9170272f2644/src/cli.rs
src/cli.rs
use std::cmp::Ordering; use bitstring::BitString; use cidr::Ipv4Cidr; use clap::{App, AppSettings, Arg, SubCommand}; pub fn app<'a, 'b>() -> App<'a, 'b> { App::new("kaws") .version(env!("CARGO_PKG_VERSION")) .about("Deploys Kubernetes clusters using AWS, CoreOS, and Terraform") .after_help...
rust
MIT
39de6450a2836fb7230c7064ca2b9170272f2644
2026-01-04T20:21:40.832464Z
false
InQuicker/kaws
https://github.com/InQuicker/kaws/blob/39de6450a2836fb7230c7064ca2b9170272f2644/src/cluster.rs
src/cluster.rs
use std::fs::{create_dir_all, File}; use std::io::Write; use clap::ArgMatches; use rusoto_core::ChainProvider; use aws::credentials_provider; use encryption::Encryptor; use error::KawsResult; use pki::CertificateAuthority; pub struct Cluster<'a> { name: &'a str, region: &'a str, } pub struct ExistingCluster...
rust
MIT
39de6450a2836fb7230c7064ca2b9170272f2644
2026-01-04T20:21:40.832464Z
false
InQuicker/kaws
https://github.com/InQuicker/kaws/blob/39de6450a2836fb7230c7064ca2b9170272f2644/src/pki.rs
src/pki.rs
use std::fs::File; use std::io::{Read, Write}; use std::process::{Command, Stdio}; use hyper::Client; use rusoto_core::ChainProvider; use serde_json::{from_slice, to_vec}; use tempdir::TempDir; use encryption::Encryptor; use error::{KawsError, KawsResult}; pub struct Certificate(Vec<u8>); pub struct CertificateAuth...
rust
MIT
39de6450a2836fb7230c7064ca2b9170272f2644
2026-01-04T20:21:40.832464Z
false
InQuicker/kaws
https://github.com/InQuicker/kaws/blob/39de6450a2836fb7230c7064ca2b9170272f2644/src/error.rs
src/error.rs
use std::error::Error; use std::fmt::{Debug, Display, Formatter}; use std::fmt::Error as FmtError; use std::str::Utf8Error; use rusoto_core::ParseRegionError; use rusoto_kms::{DecryptError, EncryptError}; use rustc_serialize::base64::FromBase64Error; use serde_json::Error as SerdeJsonError; pub struct KawsError { ...
rust
MIT
39de6450a2836fb7230c7064ca2b9170272f2644
2026-01-04T20:21:40.832464Z
false
InQuicker/kaws
https://github.com/InQuicker/kaws/blob/39de6450a2836fb7230c7064ca2b9170272f2644/src/admin.rs
src/admin.rs
use std::fs::create_dir_all; use std::process::Command; use clap::ArgMatches; use rusoto_core::ChainProvider; use aws::credentials_provider; use encryption::Encryptor; use error::KawsResult; use pki::{CertificateAuthority, CertificateSigningRequest}; use process::execute_child_process; pub struct Admin<'a> { adm...
rust
MIT
39de6450a2836fb7230c7064ca2b9170272f2644
2026-01-04T20:21:40.832464Z
false
InQuicker/kaws
https://github.com/InQuicker/kaws/blob/39de6450a2836fb7230c7064ca2b9170272f2644/src/terraform.rs
src/terraform.rs
use std::process::{Command, Stdio}; use clap::ArgMatches; use rusoto_core::{ChainProvider, ProvideAwsCredentials}; use aws::credentials_provider; use error::{KawsError, KawsResult}; pub struct Terraform<'a> { aws_credentials_provider: ChainProvider, cluster: &'a str, output: Option<&'a str>, terrafor...
rust
MIT
39de6450a2836fb7230c7064ca2b9170272f2644
2026-01-04T20:21:40.832464Z
false
InQuicker/kaws
https://github.com/InQuicker/kaws/blob/39de6450a2836fb7230c7064ca2b9170272f2644/src/main.rs
src/main.rs
extern crate ansi_term; extern crate bitstring; extern crate env_logger; extern crate cidr; extern crate clap; #[macro_use] extern crate log; extern crate hyper; extern crate rusoto_core; extern crate rusoto_kms; extern crate rustc_serialize; extern crate serde; #[macro_use] extern crate serde_derive; #[macro_use] exte...
rust
MIT
39de6450a2836fb7230c7064ca2b9170272f2644
2026-01-04T20:21:40.832464Z
false
InQuicker/kaws
https://github.com/InQuicker/kaws/blob/39de6450a2836fb7230c7064ca2b9170272f2644/src/dependencies.rs
src/dependencies.rs
use std::process::{Command, Stdio}; use error::{KawsError, KawsResult}; pub fn ensure_dependencies() -> KawsResult { ensure_cfssl().and(ensure_kubectl()).and(ensure_terraform()) } fn ensure_cfssl() -> KawsResult { let installed = match Command::new("cfssl") .arg("version") .stdout(Stdio::null...
rust
MIT
39de6450a2836fb7230c7064ca2b9170272f2644
2026-01-04T20:21:40.832464Z
false
InQuicker/kaws
https://github.com/InQuicker/kaws/blob/39de6450a2836fb7230c7064ca2b9170272f2644/src/repository.rs
src/repository.rs
use std::fs::{create_dir_all, File}; use std::io::Write; use clap::ArgMatches; use error::KawsResult; pub struct Repository<'a> { name: &'a str, terraform_source: &'a str, } impl<'a> Repository<'a> { pub fn new(matches: &'a ArgMatches) -> Self { Repository { name: matches.value_of("n...
rust
MIT
39de6450a2836fb7230c7064ca2b9170272f2644
2026-01-04T20:21:40.832464Z
false
etra0/yakuza-freecam
https://github.com/etra0/yakuza-freecam/blob/347fadfb8d6120ff3be2d404ef45cbe5a8eb69c2/kiwami/build.rs
kiwami/build.rs
extern crate winres; fn main() { let mut res = winres::WindowsResource::new(); res.set_icon("../assets/kiwami.ico"); cc::Build::new() .file("src/interceptor.asm") .compile("interceptor"); println!("cargo:rerun-if-changed=interceptor.asm"); res.compile().unwrap(); }
rust
MIT
347fadfb8d6120ff3be2d404ef45cbe5a8eb69c2
2026-01-04T20:21:25.264098Z
false
etra0/yakuza-freecam
https://github.com/etra0/yakuza-freecam/blob/347fadfb8d6120ff3be2d404ef45cbe5a8eb69c2/kiwami/src/main.rs
kiwami/src/main.rs
use common::external::{get_version, Camera, Injection}; use memory_rs::external::process::Process; use std::f32; use std::io::Error; use std::rc::Rc; use std::thread; use std::time::{Duration, Instant}; use winapi::shared::windef::POINT; use winapi::um::winuser; use winapi::um::winuser::{GetAsyncKeyState, GetCursorPos,...
rust
MIT
347fadfb8d6120ff3be2d404ef45cbe5a8eb69c2
2026-01-04T20:21:25.264098Z
false
etra0/yakuza-freecam
https://github.com/etra0/yakuza-freecam/blob/347fadfb8d6120ff3be2d404ef45cbe5a8eb69c2/kiwami2/build.rs
kiwami2/build.rs
extern crate winres; fn main() { let mut res = winres::WindowsResource::new(); res.set_icon("../assets/kiwami2.ico"); cc::Build::new() .file("src/interceptor.asm") .compile("interceptor"); println!("cargo:rerun-if-changed=interceptor.asm"); res.compile().unwrap(); }
rust
MIT
347fadfb8d6120ff3be2d404ef45cbe5a8eb69c2
2026-01-04T20:21:25.264098Z
false
etra0/yakuza-freecam
https://github.com/etra0/yakuza-freecam/blob/347fadfb8d6120ff3be2d404ef45cbe5a8eb69c2/kiwami2/src/main.rs
kiwami2/src/main.rs
use common::external::{get_version, Camera, Injection}; use memory_rs::external::process::Process; use std::f32; use std::io::Error; use std::rc::Rc; use std::thread; use std::time::{Duration, Instant}; use winapi::shared::windef::POINT; use winapi::um::winuser; use winapi::um::winuser::{GetAsyncKeyState, GetCursorPos,...
rust
MIT
347fadfb8d6120ff3be2d404ef45cbe5a8eb69c2
2026-01-04T20:21:25.264098Z
false
etra0/yakuza-freecam
https://github.com/etra0/yakuza-freecam/blob/347fadfb8d6120ff3be2d404ef45cbe5a8eb69c2/common/src/external.rs
common/src/external.rs
use memory_rs::external::process::Process; use nalgebra_glm as glm; use std::ffi::CString; use std::rc::Rc; use winapi; use winapi::um::winuser; const CARGO_VERSION: Option<&'static str> = option_env!("CARGO_PKG_VERSION"); const GIT_VERSION: Option<&'static str> = option_env!("GIT_VERSION"); /// Generate current vers...
rust
MIT
347fadfb8d6120ff3be2d404ef45cbe5a8eb69c2
2026-01-04T20:21:25.264098Z
false
etra0/yakuza-freecam
https://github.com/etra0/yakuza-freecam/blob/347fadfb8d6120ff3be2d404ef45cbe5a8eb69c2/common/src/lib.rs
common/src/lib.rs
pub mod external; pub mod internal;
rust
MIT
347fadfb8d6120ff3be2d404ef45cbe5a8eb69c2
2026-01-04T20:21:25.264098Z
false
etra0/yakuza-freecam
https://github.com/etra0/yakuza-freecam/blob/347fadfb8d6120ff3be2d404ef45cbe5a8eb69c2/common/src/internal.rs
common/src/internal.rs
use winapi::um::xinput; const DEADZONE: i16 = 2000; const MINIMUM_ENGINE_SPEED: f32 = 1e-3; #[derive(Default, Debug)] pub struct Input { pub engine_speed: f32, // Deltas with X and Y pub delta_pos: (f32, f32), pub delta_focus: (f32, f32), pub delta_rotation: f32, pub delta_altitude: f32, ...
rust
MIT
347fadfb8d6120ff3be2d404ef45cbe5a8eb69c2
2026-01-04T20:21:25.264098Z
false
etra0/yakuza-freecam
https://github.com/etra0/yakuza-freecam/blob/347fadfb8d6120ff3be2d404ef45cbe5a8eb69c2/yakuza0/build.rs
yakuza0/build.rs
extern crate winres; fn main() { let mut res = winres::WindowsResource::new(); res.set_icon("../assets/yakuza0.ico"); cc::Build::new() .file("src/interceptor.asm") .compile("interceptor"); println!("cargo:rerun-if-changed=interceptor.asm"); res.compile().unwrap(); }
rust
MIT
347fadfb8d6120ff3be2d404ef45cbe5a8eb69c2
2026-01-04T20:21:25.264098Z
false
etra0/yakuza-freecam
https://github.com/etra0/yakuza-freecam/blob/347fadfb8d6120ff3be2d404ef45cbe5a8eb69c2/yakuza0/src/main.rs
yakuza0/src/main.rs
use common::external::{get_version, Camera, Injection}; use memory_rs::external::process::Process; use std::f32; use std::io::Error; use std::rc::Rc; use std::thread; use std::time::{Duration, Instant}; use winapi::shared::windef::POINT; use winapi::um::winuser; use winapi::um::winuser::{GetAsyncKeyState, GetCursorPos,...
rust
MIT
347fadfb8d6120ff3be2d404ef45cbe5a8eb69c2
2026-01-04T20:21:25.264098Z
false
etra0/yakuza-freecam
https://github.com/etra0/yakuza-freecam/blob/347fadfb8d6120ff3be2d404ef45cbe5a8eb69c2/likeadragon/injector/build.rs
likeadragon/injector/build.rs
extern crate winres; fn main() { let mut res = winres::WindowsResource::new(); res.set_icon("../../assets/likeadragon.ico") .set("InternalName", "likeadragon-freecam"); res.compile().unwrap(); }
rust
MIT
347fadfb8d6120ff3be2d404ef45cbe5a8eb69c2
2026-01-04T20:21:25.264098Z
false
etra0/yakuza-freecam
https://github.com/etra0/yakuza-freecam/blob/347fadfb8d6120ff3be2d404ef45cbe5a8eb69c2/likeadragon/injector/src/main.rs
likeadragon/injector/src/main.rs
use memory_rs::external::process::Process; use simple_injector::inject_dll; use std::env::current_exe; fn main() { println!("Waiting for the process to start"); let p = loop { if let Ok(p) = Process::new("YakuzaLikeADragon.exe") { break p; } std::thread::sleep(std::time::Du...
rust
MIT
347fadfb8d6120ff3be2d404ef45cbe5a8eb69c2
2026-01-04T20:21:25.264098Z
false
etra0/yakuza-freecam
https://github.com/etra0/yakuza-freecam/blob/347fadfb8d6120ff3be2d404ef45cbe5a8eb69c2/likeadragon/lib/build.rs
likeadragon/lib/build.rs
extern crate winres; fn main() { let res = winres::WindowsResource::new(); println!("cargo:rerun-if-changed=interceptor.asm"); println!("cargo:rustc-env=CARGO_CFG_TARGET_FEATURE=fxsr,sse,sse2,avx"); cc::Build::new() .file("src/interceptor.asm") .compile("interceptor"); res.compile...
rust
MIT
347fadfb8d6120ff3be2d404ef45cbe5a8eb69c2
2026-01-04T20:21:25.264098Z
false
etra0/yakuza-freecam
https://github.com/etra0/yakuza-freecam/blob/347fadfb8d6120ff3be2d404ef45cbe5a8eb69c2/likeadragon/lib/src/lib.rs
likeadragon/lib/src/lib.rs
#![allow(clippy::clippy::missing_safety_doc)] pub mod globals; use crate::globals::*; use anyhow::{Context, Result}; use common::external::{error_message, Camera}; use common::internal::{handle_controller, Input}; use memory_rs::internal::injections::*; use memory_rs::internal::memory::{resolve_module_path}; use memor...
rust
MIT
347fadfb8d6120ff3be2d404ef45cbe5a8eb69c2
2026-01-04T20:21:25.264098Z
false
etra0/yakuza-freecam
https://github.com/etra0/yakuza-freecam/blob/347fadfb8d6120ff3be2d404ef45cbe5a8eb69c2/likeadragon/lib/src/globals.rs
likeadragon/lib/src/globals.rs
#![allow(non_upper_case_globals)] use memory_rs::scoped_no_mangle; use std::sync::atomic::AtomicUsize; scoped_no_mangle! { // Pointer to the camera struct (the lookat is at +0x80 offset g_camera_struct: usize = 0; // Boolean that says if the camera is active g_camera_active: u8 = 0x0; // Address...
rust
MIT
347fadfb8d6120ff3be2d404ef45cbe5a8eb69c2
2026-01-04T20:21:25.264098Z
false
vertexclique/lever
https://github.com/vertexclique/lever/blob/690d85eb4790caed0bb2c11faf2b2e3e526bbf09/src/lib.rs
src/lib.rs
// Behind the feature gates #![cfg_attr(feature = "hw", feature(stdsimd))] #![cfg_attr(feature = "hw", feature(llvm_asm))] // FIXME: Baking still #![allow(dead_code)] #![allow(unused_imports)] // #![feature(core_intrinsics)] // #![feature(get_mut_unchecked)] //! //! Lever is a library for writing transactional systems...
rust
Apache-2.0
690d85eb4790caed0bb2c11faf2b2e3e526bbf09
2026-01-04T20:21:42.422655Z
false
vertexclique/lever
https://github.com/vertexclique/lever/blob/690d85eb4790caed0bb2c11faf2b2e3e526bbf09/src/index/zonemap.rs
src/index/zonemap.rs
use crate::stats::bitonics::CountingBitonic; use crate::table::lotable::LOTable; use anyhow::*; use itertools::Itertools; use slice_group_by::GroupBy; use std::any::Any; use std::borrow::{Borrow, Cow}; use std::ops::{Deref, Range, RangeBounds}; use std::sync::Arc; /// /// Represents single zone definition for the sele...
rust
Apache-2.0
690d85eb4790caed0bb2c11faf2b2e3e526bbf09
2026-01-04T20:21:42.422655Z
false
vertexclique/lever
https://github.com/vertexclique/lever/blob/690d85eb4790caed0bb2c11faf2b2e3e526bbf09/src/index/mod.rs
src/index/mod.rs
/// Zone map implementation pub mod zonemap;
rust
Apache-2.0
690d85eb4790caed0bb2c11faf2b2e3e526bbf09
2026-01-04T20:21:42.422655Z
false
vertexclique/lever
https://github.com/vertexclique/lever/blob/690d85eb4790caed0bb2c11faf2b2e3e526bbf09/src/stats/bitonics.rs
src/stats/bitonics.rs
use std::sync::{ atomic::{self, AtomicBool, AtomicU8, AtomicUsize, Ordering}, Arc, }; #[derive(Clone, Debug)] struct Balancer { toggle: Arc<AtomicBool>, } impl Balancer { pub fn new() -> Balancer { Balancer { toggle: Arc::new(AtomicBool::new(true)), } } /// Returns...
rust
Apache-2.0
690d85eb4790caed0bb2c11faf2b2e3e526bbf09
2026-01-04T20:21:42.422655Z
false
vertexclique/lever
https://github.com/vertexclique/lever/blob/690d85eb4790caed0bb2c11faf2b2e3e526bbf09/src/stats/mod.rs
src/stats/mod.rs
/// Bitonic network implementations pub mod bitonics;
rust
Apache-2.0
690d85eb4790caed0bb2c11faf2b2e3e526bbf09
2026-01-04T20:21:42.422655Z
false
vertexclique/lever
https://github.com/vertexclique/lever/blob/690d85eb4790caed0bb2c11faf2b2e3e526bbf09/src/htm/x86_64.rs
src/htm/x86_64.rs
use super::ops::*; #[cfg(target_arch = "x86")] use std::arch::x86::{ _xabort, _xabort_code, _xbegin, _xend, _xtest, _XABORT_CAPACITY, _XABORT_CONFLICT, _XABORT_DEBUG, _XABORT_EXPLICIT, _XABORT_RETRY, _XBEGIN_STARTED, }; #[cfg(target_arch = "x86_64")] use std::arch::x86_64::{ _xabort, _xabort_code, _xbegin,...
rust
Apache-2.0
690d85eb4790caed0bb2c11faf2b2e3e526bbf09
2026-01-04T20:21:42.422655Z
false
vertexclique/lever
https://github.com/vertexclique/lever/blob/690d85eb4790caed0bb2c11faf2b2e3e526bbf09/src/htm/mod.rs
src/htm/mod.rs
#[cfg(all(any(target_arch = "x86", target_arch = "x86_64"), feature = "hw"))] mod x86_64; #[cfg(all(target_arch = "aarch64", feature = "hw"))] mod aarch64; /// Architecture operations #[cfg(feature = "hw")] pub mod ops;
rust
Apache-2.0
690d85eb4790caed0bb2c11faf2b2e3e526bbf09
2026-01-04T20:21:42.422655Z
false
vertexclique/lever
https://github.com/vertexclique/lever/blob/690d85eb4790caed0bb2c11faf2b2e3e526bbf09/src/htm/aarch64.rs
src/htm/aarch64.rs
use super::ops::*; #[cfg(target_arch = "aarch64")] use std::arch::aarch64::{ __tcancel, __tcommit, __tstart, __ttest, _TMFAILURE_CNCL, _TMFAILURE_DBG, _TMFAILURE_ERR, _TMFAILURE_IMP, _TMFAILURE_INT, _TMFAILURE_MEM, _TMFAILURE_NEST, _TMFAILURE_REASON, _TMFAILURE_RTRY, _TMFAILURE_SIZE, _TMFAILURE_TRIVIAL, _T...
rust
Apache-2.0
690d85eb4790caed0bb2c11faf2b2e3e526bbf09
2026-01-04T20:21:42.422655Z
false
vertexclique/lever
https://github.com/vertexclique/lever/blob/690d85eb4790caed0bb2c11faf2b2e3e526bbf09/src/htm/ops.rs
src/htm/ops.rs
//#[cfg_attr(hw, attr)] // Intel RTM #[cfg(all(any(target_arch = "x86", target_arch = "x86_64"), feature = "hw"))] use super::x86_64 as htm; // Aarch64 TME #[cfg(all(target_arch = "aarch64", feature = "hw"))] use super::aarch64 as htm; use crate::txn::errors::{TxnError, TxnResult}; use crate::txn::transact::TxnManag...
rust
Apache-2.0
690d85eb4790caed0bb2c11faf2b2e3e526bbf09
2026-01-04T20:21:42.422655Z
false
vertexclique/lever
https://github.com/vertexclique/lever/blob/690d85eb4790caed0bb2c11faf2b2e3e526bbf09/src/alloc/mod.rs
src/alloc/mod.rs
use anyhow::*; use std::alloc::Layout; pub(crate) fn bucket_allocate_cont<T>(buckets: usize) -> Result<Vec<T>> { // debug_assert!((buckets != 0) && ((buckets & (buckets - 1)) == 0), "Capacity should be power of 2"); // Array of buckets let data = Layout::array::<T>(buckets)?; unsafe { let p =...
rust
Apache-2.0
690d85eb4790caed0bb2c11faf2b2e3e526bbf09
2026-01-04T20:21:42.422655Z
false
vertexclique/lever
https://github.com/vertexclique/lever/blob/690d85eb4790caed0bb2c11faf2b2e3e526bbf09/src/txn/errors.rs
src/txn/errors.rs
use std::result; use thiserror::Error; #[derive(Clone, Error, Debug)] pub enum TxnError { #[error("Retry mechanism triggered")] Retry, #[error("Abort triggered")] Abort, #[error("Txn retry with: {0}")] RetryWithContext(String), #[error("Txn abort with: {0}")] AbortWithContext(String) } ...
rust
Apache-2.0
690d85eb4790caed0bb2c11faf2b2e3e526bbf09
2026-01-04T20:21:42.422655Z
false
vertexclique/lever
https://github.com/vertexclique/lever/blob/690d85eb4790caed0bb2c11faf2b2e3e526bbf09/src/txn/vars.rs
src/txn/vars.rs
use std::{ borrow::Borrow, cell::UnsafeCell, marker::PhantomData as marker, ops::{Deref, DerefMut}, sync::{ atomic::{self, Ordering}, Arc, }, time::Duration, }; use super::{ readset::ReadSet, transact::{TransactionState, Txn, TxnManager}, }; use super::version::*; u...
rust
Apache-2.0
690d85eb4790caed0bb2c11faf2b2e3e526bbf09
2026-01-04T20:21:42.422655Z
false
vertexclique/lever
https://github.com/vertexclique/lever/blob/690d85eb4790caed0bb2c11faf2b2e3e526bbf09/src/txn/version.rs
src/txn/version.rs
use std::any::Any; use std::fmt; use std::fmt::Formatter; use std::hash::{Hash, Hasher}; use std::marker::PhantomData as marker; use std::ptr::NonNull; use std::sync::atomic::AtomicUsize; use std::sync::Arc; pub type Var = Arc<dyn Any + Send + Sync>; #[derive(Clone)] pub enum Version { Read(Var), Write(Var), ...
rust
Apache-2.0
690d85eb4790caed0bb2c11faf2b2e3e526bbf09
2026-01-04T20:21:42.422655Z
false
vertexclique/lever
https://github.com/vertexclique/lever/blob/690d85eb4790caed0bb2c11faf2b2e3e526bbf09/src/txn/readset.rs
src/txn/readset.rs
use super::utils; use super::vars::TVar; use crate::txn::conflicts::*; use crate::txn::version::{Var, Version}; use std::cell::RefCell; use std::{ borrow::{Borrow, BorrowMut}, collections::HashSet, }; thread_local! { // real: Arc<TVar<T>> // virtual: Var pub(crate) static LRS: RefCell<HashSet<Vers...
rust
Apache-2.0
690d85eb4790caed0bb2c11faf2b2e3e526bbf09
2026-01-04T20:21:42.422655Z
false
vertexclique/lever
https://github.com/vertexclique/lever/blob/690d85eb4790caed0bb2c11faf2b2e3e526bbf09/src/txn/utils.rs
src/txn/utils.rs
use crate::txn::vars::TVar; use crate::txn::version::*; use std::any::Any; use std::sync::Arc; pub(crate) fn convert_ref<R: Any + Clone + Send + Sync>(from: Var) -> R { (&*from as &dyn Any).downcast_ref::<R>().unwrap().clone() } // TODO: Nightly stuff, polish up a bit with feature gates. // pub fn print_type_of<T...
rust
Apache-2.0
690d85eb4790caed0bb2c11faf2b2e3e526bbf09
2026-01-04T20:21:42.422655Z
false
vertexclique/lever
https://github.com/vertexclique/lever/blob/690d85eb4790caed0bb2c11faf2b2e3e526bbf09/src/txn/conflicts.rs
src/txn/conflicts.rs
use super::transact::TransactionIsolation; use crate::txn::readset::ReadSet; use crate::txn::writeset::WriteSet; use std::cmp::Ordering; #[derive(Clone, Debug, PartialEq, Eq, PartialOrd, Ord)] pub(in crate::txn) enum CompareSet { ReadLocal, WriteLocal, } #[derive(Clone, Debug, PartialEq, Eq, Ord)] pub(in crat...
rust
Apache-2.0
690d85eb4790caed0bb2c11faf2b2e3e526bbf09
2026-01-04T20:21:42.422655Z
false
vertexclique/lever
https://github.com/vertexclique/lever/blob/690d85eb4790caed0bb2c11faf2b2e3e526bbf09/src/txn/mod.rs
src/txn/mod.rs
mod conflicts; mod constants; mod readset; mod utils; mod version; mod writeset; /// Transactional system errors pub mod errors; /// Transaction management definitions pub mod transact; /// Transactional variable definitions pub mod vars; /// Prelude of transactional system pub mod prelude { pub use super::transa...
rust
Apache-2.0
690d85eb4790caed0bb2c11faf2b2e3e526bbf09
2026-01-04T20:21:42.422655Z
false
vertexclique/lever
https://github.com/vertexclique/lever/blob/690d85eb4790caed0bb2c11faf2b2e3e526bbf09/src/txn/writeset.rs
src/txn/writeset.rs
use super::vars::TVar; use crate::sync::treiber::TreiberStack; use std::cell::RefCell; use std::{ borrow::{Borrow, BorrowMut}, collections::HashMap, collections::HashSet, ptr::NonNull, }; use std::{fmt, time::Duration}; use super::utils; use crate::txn::conflicts::*; use crate::txn::version::{Var, Ver...
rust
Apache-2.0
690d85eb4790caed0bb2c11faf2b2e3e526bbf09
2026-01-04T20:21:42.422655Z
false
vertexclique/lever
https://github.com/vertexclique/lever/blob/690d85eb4790caed0bb2c11faf2b2e3e526bbf09/src/txn/constants.rs
src/txn/constants.rs
use super::transact::{TransactionConcurrency, TransactionIsolation}; pub(crate) const DEFAULT_TX_TIMEOUT: usize = 0_usize; pub(crate) const DEFAULT_TX_SERIALIZABLE_ENABLED: bool = false; pub(crate) const DEFAULT_TX_CONCURRENCY: TransactionConcurrency = TransactionConcurrency::Pessimistic; pub(crate) const DEFAULT_...
rust
Apache-2.0
690d85eb4790caed0bb2c11faf2b2e3e526bbf09
2026-01-04T20:21:42.422655Z
false
vertexclique/lever
https://github.com/vertexclique/lever/blob/690d85eb4790caed0bb2c11faf2b2e3e526bbf09/src/txn/transact.rs
src/txn/transact.rs
use log::*; use crate::{ sync::{atomics::AtomicBox, treiber::TreiberStack}, table::prelude::*, }; use std::{ sync::atomic::{AtomicU64, Ordering}, thread, }; use thread::ThreadId; use super::errors::*; use super::readset::ReadSet; use super::utils; use crate::sync::ttas::TTas; use std::cell::RefCell; ...
rust
Apache-2.0
690d85eb4790caed0bb2c11faf2b2e3e526bbf09
2026-01-04T20:21:42.422655Z
false
vertexclique/lever
https://github.com/vertexclique/lever/blob/690d85eb4790caed0bb2c11faf2b2e3e526bbf09/src/table/hoptable.rs
src/table/hoptable.rs
use crate::sync::atomics::AtomicBox; use anyhow::*; use std::sync::atomic::{AtomicU64, Ordering}; use std::sync::Arc; use std::hash::Hash; use std::hash::{BuildHasher, Hasher}; use std::{ alloc::Layout, collections::hash_map::{Iter, Keys, RandomState}, }; const HOP_RANGE: usize = 1 << 5; const ADD_RANGE: usiz...
rust
Apache-2.0
690d85eb4790caed0bb2c11faf2b2e3e526bbf09
2026-01-04T20:21:42.422655Z
false
vertexclique/lever
https://github.com/vertexclique/lever/blob/690d85eb4790caed0bb2c11faf2b2e3e526bbf09/src/table/mod.rs
src/table/mod.rs
pub mod hoptable; /// Lever Transactional Table implementation with [Optimistic](crate::txn::transact::TransactionConcurrency::Optimistic) /// concurrency and [RepeatableRead](crate::txn::transact::TransactionIsolation::RepeatableRead) isolation. pub mod lotable; #[doc(hidden)] pub mod ltable; /// Prelude for transact...
rust
Apache-2.0
690d85eb4790caed0bb2c11faf2b2e3e526bbf09
2026-01-04T20:21:42.422655Z
false
vertexclique/lever
https://github.com/vertexclique/lever/blob/690d85eb4790caed0bb2c11faf2b2e3e526bbf09/src/table/lotable.rs
src/table/lotable.rs
use crate::sync::atomics::AtomicBox; use crate::txn::prelude::*; use std::collections::hash_map::{Iter, Keys, RandomState}; use std::collections::HashMap; use anyhow::Result; use std::collections::hash_map; use std::fmt; use std::hash::Hash; use std::hash::{BuildHasher, Hasher}; use std::ptr::NonNull; use std::sync::...
rust
Apache-2.0
690d85eb4790caed0bb2c11faf2b2e3e526bbf09
2026-01-04T20:21:42.422655Z
false
vertexclique/lever
https://github.com/vertexclique/lever/blob/690d85eb4790caed0bb2c11faf2b2e3e526bbf09/src/table/ltable.rs
src/table/ltable.rs
use crate::txn::prelude::*; use std::{ cell::UnsafeCell, collections::{ hash_map::{RandomState, Values}, BTreeMap, HashMap, }, hash::{self, BuildHasher, Hash}, sync::atomic::AtomicPtr, }; use std::{ borrow::Borrow, fmt, sync::{ atomic::{AtomicU64, Ordering}, ...
rust
Apache-2.0
690d85eb4790caed0bb2c11faf2b2e3e526bbf09
2026-01-04T20:21:42.422655Z
false
vertexclique/lever
https://github.com/vertexclique/lever/blob/690d85eb4790caed0bb2c11faf2b2e3e526bbf09/src/sync/rerwlock.rs
src/sync/rerwlock.rs
use super::{ ifaces::RwLockIface, ttas::{TTas, TTasGuard}, }; use std::cell::UnsafeCell; use std::{ fmt, time::{Duration, Instant}, }; use std::{ marker::PhantomData as marker, ops::{Deref, DerefMut}, }; use std::{thread, thread::ThreadId}; const READ_OPTIMIZED_ALLOC: usize = 50_usize; struct ...
rust
Apache-2.0
690d85eb4790caed0bb2c11faf2b2e3e526bbf09
2026-01-04T20:21:42.422655Z
false
vertexclique/lever
https://github.com/vertexclique/lever/blob/690d85eb4790caed0bb2c11faf2b2e3e526bbf09/src/sync/arcunique.rs
src/sync/arcunique.rs
use std::convert::TryFrom; use std::ops::{Deref, DerefMut}; use std::ptr::NonNull; use std::sync::Arc; pub struct ArcUnique<T: Clone>(NonNull<T>); impl<T: Clone> From<T> for ArcUnique<T> { fn from(value: T) -> Self { unsafe { Self(NonNull::new_unchecked( Arc::into_raw(Arc::new(...
rust
Apache-2.0
690d85eb4790caed0bb2c11faf2b2e3e526bbf09
2026-01-04T20:21:42.422655Z
false
vertexclique/lever
https://github.com/vertexclique/lever/blob/690d85eb4790caed0bb2c11faf2b2e3e526bbf09/src/sync/ifaces.rs
src/sync/ifaces.rs
pub unsafe trait LockIface { fn lock(&self); fn try_lock(&self) -> bool; fn is_locked(&self) -> bool; fn unlock(&self); fn try_unlock(&self) -> bool; } pub unsafe trait RwLockIface { fn try_lock_read(&mut self) -> bool; fn try_release_read(&mut self) -> bool; fn try_lock_write(&mu...
rust
Apache-2.0
690d85eb4790caed0bb2c11faf2b2e3e526bbf09
2026-01-04T20:21:42.422655Z
false
vertexclique/lever
https://github.com/vertexclique/lever/blob/690d85eb4790caed0bb2c11faf2b2e3e526bbf09/src/sync/atomics.rs
src/sync/atomics.rs
use crate::sync::arcunique::ArcUnique; use anyhow::Result; use std::convert::TryFrom; use std::ops::Deref; use std::sync::atomic::{AtomicPtr, Ordering}; use std::sync::Arc; /// AtomicBox<T> is a safe wrapper around AtomicPtr<T> #[derive(Debug)] pub struct AtomicBox<T: Sized> { ptr: AtomicPtr<T>, } impl<T: Sized> ...
rust
Apache-2.0
690d85eb4790caed0bb2c11faf2b2e3e526bbf09
2026-01-04T20:21:42.422655Z
false
vertexclique/lever
https://github.com/vertexclique/lever/blob/690d85eb4790caed0bb2c11faf2b2e3e526bbf09/src/sync/mod.rs
src/sync/mod.rs
/// Ifaces for lock-free concurrency primitives pub mod ifaces; pub(crate) mod arcunique; /// Atomic heap location pub mod atomics; /// Tas based reentrant RW lock implementation pub mod rerwlock; /// Basic treiber stack pub mod treiber; /// TTas based spin lock implementation pub(crate) mod ttas; /// /// Prelude fo...
rust
Apache-2.0
690d85eb4790caed0bb2c11faf2b2e3e526bbf09
2026-01-04T20:21:42.422655Z
false
vertexclique/lever
https://github.com/vertexclique/lever/blob/690d85eb4790caed0bb2c11faf2b2e3e526bbf09/src/sync/treiber.rs
src/sync/treiber.rs
use std::mem::ManuallyDrop; use std::ptr; use std::sync::atomic::Ordering; use std::sync::atomic::Ordering::{Acquire, Relaxed, Release}; use crossbeam_epoch as epoch; use crossbeam_epoch::{Atomic, Owned}; // Taken from crossbeam. // // TODO: Make elimination for the stack. // This will perform bad. /// Treiber's loc...
rust
Apache-2.0
690d85eb4790caed0bb2c11faf2b2e3e526bbf09
2026-01-04T20:21:42.422655Z
false