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
bluecatengineering/dhcproto
https://github.com/bluecatengineering/dhcproto/blob/b4ea30defc01e7ae66e7075d6a0533d9bb9503dc/src/v4/mod.rs
src/v4/mod.rs
//! # DHCPv4 //! //! This module provides types and utility functions for encoding/decoding a DHCPv4 message. //! //! ## Example - constructing messages //! //! ```rust //! # fn main() -> Result<(), Box<dyn std::error::Error>> { //! use dhcproto::{v4, Encodable, Encoder}; //! // arbitrary hardware addr //! let chaddr =...
rust
MIT
b4ea30defc01e7ae66e7075d6a0533d9bb9503dc
2026-01-04T20:19:33.979507Z
false
bluecatengineering/dhcproto
https://github.com/bluecatengineering/dhcproto/blob/b4ea30defc01e7ae66e7075d6a0533d9bb9503dc/src/v4/fqdn.rs
src/v4/fqdn.rs
use core::fmt; use hickory_proto::rr::Name; #[cfg(feature = "serde")] use serde::{Deserialize, Serialize}; /// A client FQDN #[cfg_attr(feature = "serde", derive(Serialize, Deserialize))] #[derive(Clone, PartialEq, Eq, Debug)] pub struct ClientFQDN { pub(crate) flags: FqdnFlags, pub(crate) r1: u8, pub(cra...
rust
MIT
b4ea30defc01e7ae66e7075d6a0533d9bb9503dc
2026-01-04T20:19:33.979507Z
false
bluecatengineering/dhcproto
https://github.com/bluecatengineering/dhcproto/blob/b4ea30defc01e7ae66e7075d6a0533d9bb9503dc/src/v4/borrowed.rs
src/v4/borrowed.rs
use alloc::borrow::Cow; use core::{fmt::Debug, net::Ipv4Addr}; use crate::{ Decoder, error::DecodeError, v4::{DecodeResult, Flags, HType, Opcode, OptionCode}, }; /// A lazily decoded DHCPv4 message. /// It holds a reference to the original byte buffer and provides /// methods to access fields. Most fields...
rust
MIT
b4ea30defc01e7ae66e7075d6a0533d9bb9503dc
2026-01-04T20:19:33.979507Z
false
bluecatengineering/dhcproto
https://github.com/bluecatengineering/dhcproto/blob/b4ea30defc01e7ae66e7075d6a0533d9bb9503dc/src/v6/oro_codes.rs
src/v6/oro_codes.rs
//! Valid Option Codes for ORO //! <https://datatracker.ietf.org/doc/html/rfc8415#section-24> #[cfg(feature = "serde")] use serde::{Deserialize, Serialize}; use crate::v6::OptionCode; #[cfg_attr(feature = "serde", derive(Serialize, Deserialize))] #[derive(Debug, Clone, Copy, PartialEq, Eq, Hash, PartialOrd, Ord)] pub...
rust
MIT
b4ea30defc01e7ae66e7075d6a0533d9bb9503dc
2026-01-04T20:19:33.979507Z
false
bluecatengineering/dhcproto
https://github.com/bluecatengineering/dhcproto/blob/b4ea30defc01e7ae66e7075d6a0533d9bb9503dc/src/v6/option_codes.rs
src/v6/option_codes.rs
use crate::v6::{UnknownOption, options::DhcpOption}; #[cfg(feature = "serde")] use serde::{Deserialize, Serialize}; /// option code type #[cfg_attr(feature = "serde", derive(Serialize, Deserialize))] #[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)] pub enum OptionCode { ClientId, ServerId, IANA, IAT...
rust
MIT
b4ea30defc01e7ae66e7075d6a0533d9bb9503dc
2026-01-04T20:19:33.979507Z
false
bluecatengineering/dhcproto
https://github.com/bluecatengineering/dhcproto/blob/b4ea30defc01e7ae66e7075d6a0533d9bb9503dc/src/v6/htype.rs
src/v6/htype.rs
/// In DHCPv6, the Hardware Types are expanded from u8 to u16, referring to https://www.iana.org/assignments/arp-parameters/arp-parameters.xhtml for implementation. use crate::{ decoder::{Decodable, Decoder}, encoder::{Encodable, Encoder}, error::{DecodeResult, EncodeResult}, }; #[cfg(feature = "serde")] u...
rust
MIT
b4ea30defc01e7ae66e7075d6a0533d9bb9503dc
2026-01-04T20:19:33.979507Z
false
bluecatengineering/dhcproto
https://github.com/bluecatengineering/dhcproto/blob/b4ea30defc01e7ae66e7075d6a0533d9bb9503dc/src/v6/options.rs
src/v6/options.rs
use hickory_proto::{ rr::Name, serialize::binary::{BinDecodable, BinDecoder, BinEncodable, BinEncoder}, }; #[cfg(feature = "serde")] use serde::{Deserialize, Serialize}; use alloc::{string::String, vec::Vec}; use core::{cmp::Ordering, net::Ipv6Addr, ops::RangeInclusive}; use crate::v6::option_codes::OptionCod...
rust
MIT
b4ea30defc01e7ae66e7075d6a0533d9bb9503dc
2026-01-04T20:19:33.979507Z
true
bluecatengineering/dhcproto
https://github.com/bluecatengineering/dhcproto/blob/b4ea30defc01e7ae66e7075d6a0533d9bb9503dc/src/v6/mod.rs
src/v6/mod.rs
//! # DHCPv6 //! //! This module provides types and utility functions for encoding/decoding a DHCPv4 message. //! //! ## Example - constructing messages //! //! ```rust //! # fn main() -> Result<(), Box<dyn std::error::Error>> { //! use dhcproto::{v6, Encodable, Encoder}; //! // arbitrary DUID //! let duid = vec![ //! ...
rust
MIT
b4ea30defc01e7ae66e7075d6a0533d9bb9503dc
2026-01-04T20:19:33.979507Z
false
bluecatengineering/dhcproto
https://github.com/bluecatengineering/dhcproto/blob/b4ea30defc01e7ae66e7075d6a0533d9bb9503dc/src/v6/duid.rs
src/v6/duid.rs
use alloc::vec::Vec; use core::net::Ipv6Addr; #[cfg(feature = "serde")] use serde::{Deserialize, Serialize}; use crate::Encoder; use crate::v6::HType; /// Duid helper type #[cfg_attr(feature = "serde", derive(Serialize, Deserialize))] #[derive(Debug, Clone, PartialEq, Eq)] pub struct Duid(Vec<u8>); // TODO: define s...
rust
MIT
b4ea30defc01e7ae66e7075d6a0533d9bb9503dc
2026-01-04T20:19:33.979507Z
false
bluecatengineering/dhcproto
https://github.com/bluecatengineering/dhcproto/blob/b4ea30defc01e7ae66e7075d6a0533d9bb9503dc/benches/encode.rs
benches/encode.rs
use criterion::{Criterion, criterion_group, criterion_main}; use dhcproto::v4::Message; use dhcproto::{Decodable, Encodable, Encoder}; fn encode_benches(c: &mut Criterion) { let mut g = c.benchmark_group("encode"); g.bench_function("encode_offer", |b| { let offer: &[u8] = &[ 0x02, 0x01, 0x...
rust
MIT
b4ea30defc01e7ae66e7075d6a0533d9bb9503dc
2026-01-04T20:19:33.979507Z
false
bluecatengineering/dhcproto
https://github.com/bluecatengineering/dhcproto/blob/b4ea30defc01e7ae66e7075d6a0533d9bb9503dc/benches/decode.rs
benches/decode.rs
use criterion::{Criterion, criterion_group, criterion_main}; use dhcproto::Decodable; fn decode_benches(c: &mut Criterion) { let mut g = c.benchmark_group("decode"); g.bench_function("decode_offer", |b| { let offer: &[u8] = &[ 0x02, 0x01, 0x06, 0x00, 0x00, 0x00, 0x15, 0x5c, 0x00, 0x00, 0x8...
rust
MIT
b4ea30defc01e7ae66e7075d6a0533d9bb9503dc
2026-01-04T20:19:33.979507Z
false
bluecatengineering/dhcproto
https://github.com/bluecatengineering/dhcproto/blob/b4ea30defc01e7ae66e7075d6a0533d9bb9503dc/dhcproto-macros/src/lib.rs
dhcproto-macros/src/lib.rs
use proc_macro::TokenStream; use quote::quote; use syn::{ Ident, LitInt, LitStr, Token, Type, parse::{Parse, ParseStream, Result}, parse_macro_input, }; // parses a single entry in the format: // {code, id, "description", (Type1, Type2, ...)} struct Entry { code: u8, id: Ident, description: Str...
rust
MIT
b4ea30defc01e7ae66e7075d6a0533d9bb9503dc
2026-01-04T20:19:33.979507Z
false
turnage/immense
https://github.com/turnage/immense/blob/cf415f6dc6edd0b88b27c48d6a55ad7c5173000b/src/lib.rs
src/lib.rs
// Copyright 2018 The immense Authors // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // https://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agre...
rust
Apache-2.0
cf415f6dc6edd0b88b27c48d6a55ad7c5173000b
2026-01-04T20:19:37.243955Z
false
turnage/immense
https://github.com/turnage/immense/blob/cf415f6dc6edd0b88b27c48d6a55ad7c5173000b/src/mesh.rs
src/mesh.rs
// Copyright 2018 The immense Authors // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // https://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agre...
rust
Apache-2.0
cf415f6dc6edd0b88b27c48d6a55ad7c5173000b
2026-01-04T20:19:37.243955Z
false
turnage/immense
https://github.com/turnage/immense/blob/cf415f6dc6edd0b88b27c48d6a55ad7c5173000b/src/error.rs
src/error.rs
// Copyright 2018 The immense Authors // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // https://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agre...
rust
Apache-2.0
cf415f6dc6edd0b88b27c48d6a55ad7c5173000b
2026-01-04T20:19:37.243955Z
false
turnage/immense
https://github.com/turnage/immense/blob/cf415f6dc6edd0b88b27c48d6a55ad7c5173000b/src/export.rs
src/export.rs
// Copyright 2018 The immense Authors // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // https://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agre...
rust
Apache-2.0
cf415f6dc6edd0b88b27c48d6a55ad7c5173000b
2026-01-04T20:19:37.243955Z
false
turnage/immense
https://github.com/turnage/immense/blob/cf415f6dc6edd0b88b27c48d6a55ad7c5173000b/src/rule.rs
src/rule.rs
// Copyright 2018 The immense Authors // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // https://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agre...
rust
Apache-2.0
cf415f6dc6edd0b88b27c48d6a55ad7c5173000b
2026-01-04T20:19:37.243955Z
false
turnage/immense
https://github.com/turnage/immense/blob/cf415f6dc6edd0b88b27c48d6a55ad7c5173000b/src/rule/transforms.rs
src/rule/transforms.rs
// Copyright 2018 The immense Authors // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // https://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agre...
rust
Apache-2.0
cf415f6dc6edd0b88b27c48d6a55ad7c5173000b
2026-01-04T20:19:37.243955Z
false
turnage/immense
https://github.com/turnage/immense/blob/cf415f6dc6edd0b88b27c48d6a55ad7c5173000b/src/rule/builtin.rs
src/rule/builtin.rs
// Copyright 2018 The immense Authors // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // https://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agre...
rust
Apache-2.0
cf415f6dc6edd0b88b27c48d6a55ad7c5173000b
2026-01-04T20:19:37.243955Z
false
turnage/immense
https://github.com/turnage/immense/blob/cf415f6dc6edd0b88b27c48d6a55ad7c5173000b/examples/torus.rs
examples/torus.rs
use immense::*; use std::fs::File; fn main() { let meshes = rule![ tf![ Tf::saturation(0.8), Tf::hue(160.0), Replicate::n(36, vec![Tf::rz(10.0), Tf::ty(0.1)]), Replicate::n(36, vec![Tf::ry(10.0), Tf::tz(1.2), Tf::hue(3.4)]), ] => cube(), ] .ge...
rust
Apache-2.0
cf415f6dc6edd0b88b27c48d6a55ad7c5173000b
2026-01-04T20:19:37.243955Z
false
turnage/immense
https://github.com/turnage/immense/blob/cf415f6dc6edd0b88b27c48d6a55ad7c5173000b/examples/randtower.rs
examples/randtower.rs
use immense::*; use rand::*; use std::fs::File; #[derive(Debug)] struct RandCube; impl ToRule for RandCube { fn to_rule(&self) -> Rule { rule![ *thread_rng() .choose(&[Tf::tx(0.1), Tf::tx(-0.1), Tf::tx(0.2), Tf::tx(-0.2)]) .unwrap() => cube() ...
rust
Apache-2.0
cf415f6dc6edd0b88b27c48d6a55ad7c5173000b
2026-01-04T20:19:37.243955Z
false
turnage/immense
https://github.com/turnage/immense/blob/cf415f6dc6edd0b88b27c48d6a55ad7c5173000b/examples/grid2d.rs
examples/grid2d.rs
use immense::*; use std::fs::File; struct Grid2D { rows: usize, cols: usize, } impl ToRule for Grid2D { fn to_rule(&self) -> Rule { rule![ tf![ Replicate::n(self.rows, Tf::ty(1.1)), Replicate::n(self.cols, Tf::tx(1.1)), ] => cube(...
rust
Apache-2.0
cf415f6dc6edd0b88b27c48d6a55ad7c5173000b
2026-01-04T20:19:37.243955Z
false
turnage/immense
https://github.com/turnage/immense/blob/cf415f6dc6edd0b88b27c48d6a55ad7c5173000b/examples/playpen.rs
examples/playpen.rs
use hex; use immense::*; use itertools::iproduct; use lazy_static::lazy_static; use noise::{Fbm, NoiseFn}; use palette::encoding::pixel::Pixel; use palette::encoding::srgb::Srgb; use palette::rgb::Rgb; use rand::seq::SliceRandom; use rand::thread_rng; use rand::Rng; use std::fs::File; use std::io::BufWriter; use std::r...
rust
Apache-2.0
cf415f6dc6edd0b88b27c48d6a55ad7c5173000b
2026-01-04T20:19:37.243955Z
false
turnage/immense
https://github.com/turnage/immense/blob/cf415f6dc6edd0b88b27c48d6a55ad7c5173000b/examples/recursive_tile.rs
examples/recursive_tile.rs
use immense::*; use std::fs::File; struct RecursiveTile { depth_budget: usize, } impl ToRule for RecursiveTile { fn to_rule(&self) -> Rule { let rule = rule![ tf![Tf::t(0.25, 0.25, 0.0), Tf::s(0.4)] => icosphere(), tf![Tf::t(-0.25, -0.25, 0.0), Tf::s(0.4)] => icosphere(), ...
rust
Apache-2.0
cf415f6dc6edd0b88b27c48d6a55ad7c5173000b
2026-01-04T20:19:37.243955Z
false
thebracket/rustyroguelike
https://github.com/thebracket/rustyroguelike/blob/06f6ef51829b07962e58896e0fad13a78bd1a92d/src/main.rs
src/main.rs
extern crate rltk; use rltk::Rltk; mod game; fn main() { let gs = game::State::new_menu(); let mut context = Rltk::init_simple8x8(80, 50, "Rusty Roguelike", "resources"); context.with_post_scanlines(true); rltk::main_loop(context, gs); }
rust
MIT
06f6ef51829b07962e58896e0fad13a78bd1a92d
2026-01-04T20:19:35.207300Z
false
thebracket/rustyroguelike
https://github.com/thebracket/rustyroguelike/blob/06f6ef51829b07962e58896e0fad13a78bd1a92d/src/game/fighter.rs
src/game/fighter.rs
use std::cmp::{min}; use super::{Player, Mob}; extern crate serde; use serde::{Serialize, Deserialize}; #[derive(Serialize, Deserialize, Clone)] pub struct Fighter { pub max_hp : i32, pub hp: i32, pub defense: i32, pub power: i32, pub dead: bool, pub xp_value : i32 } impl Fighter { pub fn ...
rust
MIT
06f6ef51829b07962e58896e0fad13a78bd1a92d
2026-01-04T20:19:35.207300Z
false
thebracket/rustyroguelike
https://github.com/thebracket/rustyroguelike/blob/06f6ef51829b07962e58896e0fad13a78bd1a92d/src/game/random.rs
src/game/random.rs
use rand::Rng; pub fn random_choice(table : Vec<(String, i32)>) -> String { let mut rng = rand::thread_rng(); let n = rng.gen_range(1,100); let mut running_sum = 0; for (opt,chance) in table.iter() { if n < chance+running_sum { return opt.to_string() } running_sum += chance; } ...
rust
MIT
06f6ef51829b07962e58896e0fad13a78bd1a92d
2026-01-04T20:19:35.207300Z
false
thebracket/rustyroguelike
https://github.com/thebracket/rustyroguelike/blob/06f6ef51829b07962e58896e0fad13a78bd1a92d/src/game/inventory.rs
src/game/inventory.rs
use super::{Item, gui, gui::ItemMenuResult, State, TickType, BaseEntity, player}; use crate::rltk; use rltk::Rltk; extern crate serde; use serde::{Serialize, Deserialize}; #[derive(Serialize, Deserialize, Clone)] pub struct Inventory { pub items : Vec<Item>, pub equipped : Vec<Item>, capacity: i32 } impl ...
rust
MIT
06f6ef51829b07962e58896e0fad13a78bd1a92d
2026-01-04T20:19:35.207300Z
false
thebracket/rustyroguelike
https://github.com/thebracket/rustyroguelike/blob/06f6ef51829b07962e58896e0fad13a78bd1a92d/src/game/player.rs
src/game/player.rs
use crate::rltk; use rltk::{RGB, Point, Rltk, field_of_view, Algorithm2D, VirtualKeyCode}; use super::{fighter::Fighter, Inventory, BaseEntity, Combat, Map, ItemType, State, attack, TickType, inventory, item_effects, TileType, Particle}; extern crate serde; use serde::{Serialize, Deserialize}; #[derive(Serialize, Dese...
rust
MIT
06f6ef51829b07962e58896e0fad13a78bd1a92d
2026-01-04T20:19:35.207300Z
false
thebracket/rustyroguelike
https://github.com/thebracket/rustyroguelike/blob/06f6ef51829b07962e58896e0fad13a78bd1a92d/src/game/entity.rs
src/game/entity.rs
use crate::rltk; use rltk::{RGB, Rltk, Point, Console}; use super::{Map, Player, Combat, Mob, Item}; extern crate typetag; #[typetag::serde(tag = "BaseEntity")] pub trait BaseEntity { fn get_position(&self) -> Point; fn get_fg_color(&self) -> RGB; fn get_glyph(&self) -> u8; fn draw_to_map(&self, ctx :...
rust
MIT
06f6ef51829b07962e58896e0fad13a78bd1a92d
2026-01-04T20:19:35.207300Z
false
thebracket/rustyroguelike
https://github.com/thebracket/rustyroguelike/blob/06f6ef51829b07962e58896e0fad13a78bd1a92d/src/game/item_effects.rs
src/game/item_effects.rs
use super::{State, BaseEntity, TickType, Combat, Particle}; use crate::rltk; use rltk::{RGB}; pub fn use_health_potion(item_index : i32, gs : &mut State, result : &mut Vec<String>) { let player = &mut gs.player_mut(); if player.fighter.hp == player.fighter.max_hp { result.push("You are already at maxim...
rust
MIT
06f6ef51829b07962e58896e0fad13a78bd1a92d
2026-01-04T20:19:35.207300Z
false
thebracket/rustyroguelike
https://github.com/thebracket/rustyroguelike/blob/06f6ef51829b07962e58896e0fad13a78bd1a92d/src/game/gui.rs
src/game/gui.rs
use crate ::rltk; use crate ::rltk::Console; use rltk::{Rltk, Point, RGB, Algorithm2D, VirtualKeyCode}; use super::{Map, TileType, State, TickType}; use std::cmp::{max, min}; use serde::{Serialize, Deserialize}; use rand::Rng; use std::path::Path; pub enum ItemMenuResult { Cancel, NoResponse, Selected } pub fn render...
rust
MIT
06f6ef51829b07962e58896e0fad13a78bd1a92d
2026-01-04T20:19:35.207300Z
false
thebracket/rustyroguelike
https://github.com/thebracket/rustyroguelike/blob/06f6ef51829b07962e58896e0fad13a78bd1a92d/src/game/mob.rs
src/game/mob.rs
use crate::rltk; use rltk::{RGB, Point, Algorithm2D, a_star_search, field_of_view}; use super::{fighter::Fighter, Map, Combat, BaseEntity, State, attack, random_choice, Particle}; use rand::Rng; extern crate serde; use serde::{Serialize, Deserialize}; #[derive(Serialize, Deserialize)] pub struct Mob { pub position...
rust
MIT
06f6ef51829b07962e58896e0fad13a78bd1a92d
2026-01-04T20:19:35.207300Z
false
thebracket/rustyroguelike
https://github.com/thebracket/rustyroguelike/blob/06f6ef51829b07962e58896e0fad13a78bd1a92d/src/game/rect.rs
src/game/rect.rs
pub struct Rect { pub x1 : i32, pub x2 : i32, pub y1 : i32, pub y2 : i32 } impl Rect { pub fn new(x1:i32, y1: i32, x2:i32, y2:i32) -> Rect { Rect{x1, y1, x2, y2} } // Returns true if this overlaps with other pub fn intersect(&self, other:&Rect) -> bool { self.x1 <= othe...
rust
MIT
06f6ef51829b07962e58896e0fad13a78bd1a92d
2026-01-04T20:19:35.207300Z
false
thebracket/rustyroguelike
https://github.com/thebracket/rustyroguelike/blob/06f6ef51829b07962e58896e0fad13a78bd1a92d/src/game/map.rs
src/game/map.rs
use crate::rltk; use rltk::{ Point, Algorithm2D, BaseMap }; use super::TileType; extern crate serde; use serde::{Serialize, Deserialize}; #[derive(Serialize, Deserialize)] pub struct Map { pub tiles : Vec<TileType>, pub visible : Vec<bool>, pub revealed : Vec<bool>, pub width: i32, pub height: i32,...
rust
MIT
06f6ef51829b07962e58896e0fad13a78bd1a92d
2026-01-04T20:19:35.207300Z
false
thebracket/rustyroguelike
https://github.com/thebracket/rustyroguelike/blob/06f6ef51829b07962e58896e0fad13a78bd1a92d/src/game/ticktype.rs
src/game/ticktype.rs
extern crate serde; use serde::{Serialize, Deserialize}; #[derive(Serialize, Deserialize, PartialEq)] pub enum TickType { None, MainMenu, PlayersTurn, EnemyTurn, GameOver, UseMenu, DropMenu, TargetingItem, LevelUpMenu, CharacterMenu, HelpMenu, WieldMenu, UnequipMenu }
rust
MIT
06f6ef51829b07962e58896e0fad13a78bd1a92d
2026-01-04T20:19:35.207300Z
false
thebracket/rustyroguelike
https://github.com/thebracket/rustyroguelike/blob/06f6ef51829b07962e58896e0fad13a78bd1a92d/src/game/mod.rs
src/game/mod.rs
use crate::rltk; use rltk::{ GameState }; extern crate serde; mod entity; pub use entity::BaseEntity; mod tiletype; pub use tiletype::TileType; mod ticktype; pub use ticktype::TickType; mod fighter; pub use fighter::Fighter; pub use fighter::Combat; pub use fighter::attack; mod player; pub use player::Player; m...
rust
MIT
06f6ef51829b07962e58896e0fad13a78bd1a92d
2026-01-04T20:19:35.207300Z
false
thebracket/rustyroguelike
https://github.com/thebracket/rustyroguelike/blob/06f6ef51829b07962e58896e0fad13a78bd1a92d/src/game/vfx.rs
src/game/vfx.rs
use crate::rltk; use crate ::rltk::Console; use rltk::{Point, RGB, Rltk}; use super::{ State }; extern crate serde; use serde::{Serialize, Deserialize}; #[derive(Serialize, Deserialize, Clone, Copy)] pub struct Particle { position : Point, lifetime_ms : f32, fg : RGB, bg : RGB, glyph : u8 } impl P...
rust
MIT
06f6ef51829b07962e58896e0fad13a78bd1a92d
2026-01-04T20:19:35.207300Z
false
thebracket/rustyroguelike
https://github.com/thebracket/rustyroguelike/blob/06f6ef51829b07962e58896e0fad13a78bd1a92d/src/game/tiletype.rs
src/game/tiletype.rs
extern crate serde; use serde::{Serialize, Deserialize}; #[derive(Serialize, Deserialize, PartialEq)] pub enum TileType { Wall, Floor, Stairs }
rust
MIT
06f6ef51829b07962e58896e0fad13a78bd1a92d
2026-01-04T20:19:35.207300Z
false
thebracket/rustyroguelike
https://github.com/thebracket/rustyroguelike/blob/06f6ef51829b07962e58896e0fad13a78bd1a92d/src/game/item.rs
src/game/item.rs
use crate::rltk; use rltk::{RGB, Point}; use super::{BaseEntity, Map, random_choice}; extern crate serde; use serde::{Serialize, Deserialize}; #[derive(PartialEq, Clone, Copy, Serialize, Deserialize)] pub enum ItemType { HealthPotion, ZapScroll, FireballScroll, ConfusionScroll, Sword, Shield } #[derive(PartialEq, Clo...
rust
MIT
06f6ef51829b07962e58896e0fad13a78bd1a92d
2026-01-04T20:19:35.207300Z
false
thebracket/rustyroguelike
https://github.com/thebracket/rustyroguelike/blob/06f6ef51829b07962e58896e0fad13a78bd1a92d/src/game/gamestate.rs
src/game/gamestate.rs
use super::{gui, TickType, inventory, Map, Player, map_builder, Combat, BaseEntity, GameState, rltk, player, mob, TileType, Particle, vfx}; use rltk::{Rltk, RGB, Point}; use serde::{Serialize, Deserialize}; use std::fs; use std::fs::File; use std::io::Write; use std::path::Path; #[derive(Serialize, Deserialize)] pub s...
rust
MIT
06f6ef51829b07962e58896e0fad13a78bd1a92d
2026-01-04T20:19:35.207300Z
false
thebracket/rustyroguelike
https://github.com/thebracket/rustyroguelike/blob/06f6ef51829b07962e58896e0fad13a78bd1a92d/src/game/map_builder.rs
src/game/map_builder.rs
use super::{ Map, Rect, TileType, Mob, Item }; use rand::Rng; use std::cmp::{max, min}; const ROOM_MAX_SIZE : i32 = 10; const ROOM_MIN_SIZE : i32 = 6; const MAX_ROOMS : i32 = 30; pub fn random_rooms_tut3(map : &mut Map) -> Vec<Rect> { let mut rng = rand::thread_rng(); let mut rooms : Vec<Rect> = Vec::new(); ...
rust
MIT
06f6ef51829b07962e58896e0fad13a78bd1a92d
2026-01-04T20:19:35.207300Z
false
acidnik/ppcp
https://github.com/acidnik/ppcp/blob/258f91eade20e9bbfb48fa022b0f028e056556ac/src/app.rs
src/app.rs
use clap::ArgMatches; use indicatif::*; use std::ops::{Deref, DerefMut}; use std::path::PathBuf; use std::sync::mpsc::*; use std::thread; use std::time::*; use crate::avgspeed::*; use crate::copy::*; use anyhow::Result; /// utility to track changes of variable #[derive(Default, Clone)] pub struct TrackChange<T: Parti...
rust
MIT
258f91eade20e9bbfb48fa022b0f028e056556ac
2026-01-04T20:19:37.965610Z
false
acidnik/ppcp
https://github.com/acidnik/ppcp/blob/258f91eade20e9bbfb48fa022b0f028e056556ac/src/avgspeed.rs
src/avgspeed.rs
use std::collections::VecDeque; use std::ops::*; use std::time::{Duration, Instant}; /// moving (rolling) average pub struct RollingAverage<T> { hist: VecDeque<T>, sum: T, size: usize, } impl<T> RollingAverage<T> // moments like this I miss dating duck typing where T: AddAssign + SubAssign ...
rust
MIT
258f91eade20e9bbfb48fa022b0f028e056556ac
2026-01-04T20:19:37.965610Z
false
acidnik/ppcp
https://github.com/acidnik/ppcp/blob/258f91eade20e9bbfb48fa022b0f028e056556ac/src/copy.rs
src/copy.rs
use anyhow::Result; use clap::ArgMatches; use std::collections::HashSet; use std::fs::{self, *}; use std::io::{self, *}; use std::path::PathBuf; use std::sync::mpsc::{channel, Receiver, Sender}; use std::thread; use std::time::Duration; use thiserror::Error; #[derive(Clone, PartialEq, Debug)] pub enum StatsChange { ...
rust
MIT
258f91eade20e9bbfb48fa022b0f028e056556ac
2026-01-04T20:19:37.965610Z
false
acidnik/ppcp
https://github.com/acidnik/ppcp/blob/258f91eade20e9bbfb48fa022b0f028e056556ac/src/main.rs
src/main.rs
use clap::{command, value_parser, ArgAction}; use std::error; use std::path::PathBuf; mod app; mod avgspeed; mod copy; use clap::Arg; fn main() -> Result<(), Box<dyn error::Error>> { let matches = command!() .version("0.0.1") .author("Nikita Bilous <nikita@bilous.me>") .about("Copy files in ...
rust
MIT
258f91eade20e9bbfb48fa022b0f028e056556ac
2026-01-04T20:19:37.965610Z
false
AlexAltea/milli-py
https://github.com/AlexAltea/milli-py/blob/a2a92e14710b2dc9a9505f2534ad2d389153041a/src/lib.rs
src/lib.rs
extern crate milli as mi; use std::ops::Deref; use pyo3::prelude::*; use pyo3::types::*; use mi::{DocumentId, Index, Search}; use mi::documents::{DocumentsBatchBuilder, DocumentsBatchReader}; use mi::update::{ClearDocuments, DocumentAdditionResult, IndexerConfig, IndexDocumentsConfig, IndexDocumentsMethod, Index...
rust
MIT
a2a92e14710b2dc9a9505f2534ad2d389153041a
2026-01-04T20:19:37.508142Z
false
AlexAltea/milli-py
https://github.com/AlexAltea/milli-py/blob/a2a92e14710b2dc9a9505f2534ad2d389153041a/src/conv.rs
src/conv.rs
use std::collections::BTreeMap; use std::fmt; use std::marker::PhantomData; use pyo3::exceptions::PyTypeError; use pyo3::prelude::*; use pyo3::types::{PyDict, PyFloat, PyList, PyTuple}; use serde::de::{DeserializeSeed, Deserializer, MapAccess, SeqAccess, Visitor}; // From https://github.com/mozilla-services/python-ca...
rust
MIT
a2a92e14710b2dc9a9505f2534ad2d389153041a
2026-01-04T20:19:37.508142Z
false
leakec/multitask
https://github.com/leakec/multitask/blob/acba08810ae8bac60f156361078cef0b5cff0453/src/parallel_tasks.rs
src/parallel_tasks.rs
use zellij_tile::prelude::{PaneManifest, rename_terminal_pane}; use std::fmt; #[derive(Default, Debug)] pub struct ParallelTasks { pub run_tasks: Vec<RunTask> } #[derive(Default, Debug)] pub struct RunTask { pub command: String, pub args: Vec<String>, pub terminal_pane_id: Option<u32>, pub is_com...
rust
MIT
acba08810ae8bac60f156361078cef0b5cff0453
2026-01-04T20:19:38.611485Z
false
leakec/multitask
https://github.com/leakec/multitask/blob/acba08810ae8bac60f156361078cef0b5cff0453/src/multitask_file.rs
src/multitask_file.rs
use zellij_tile::prelude::*; use std::path::{PathBuf, Path}; use std::io::prelude::*; use crate::parallel_tasks::{ParallelTasks, RunTask}; pub fn create_file_with_text(path: &Path, text: &str) { if !path.exists() { // Only create the file if it does not already exists. Otherwise, use the file that is ...
rust
MIT
acba08810ae8bac60f156361078cef0b5cff0453
2026-01-04T20:19:38.611485Z
false
leakec/multitask
https://github.com/leakec/multitask/blob/acba08810ae8bac60f156361078cef0b5cff0453/src/main.rs
src/main.rs
mod parallel_tasks; mod multitask_file; use zellij_tile::prelude::*; use std::collections::{VecDeque, BTreeMap}; use std::path::PathBuf; use std::time::Instant; use parallel_tasks::ParallelTasks; use multitask_file::{parse_multitask_file, create_file_with_text}; #[derive(Default)] struct State { tasks: VecDeque...
rust
MIT
acba08810ae8bac60f156361078cef0b5cff0453
2026-01-04T20:19:38.611485Z
false
integer32llc/margo
https://github.com/integer32llc/margo/blob/c29ba4782272af3bac69425eb3382f07687d63d1/src/html.rs
src/html.rs
use indoc::formatdoc; use maud::{html, Markup, PreEscaped, DOCTYPE}; use semver::Version; use snafu::prelude::*; use std::{fs, io, path::PathBuf}; use crate::{index_entry, ConfigV1, Index, ListAll, Registry}; #[rustfmt::skip] mod assets; pub fn write(registry: &Registry) -> Result<(), Error> { use error::*; ...
rust
Apache-2.0
c29ba4782272af3bac69425eb3382f07687d63d1
2026-01-04T20:19:37.290944Z
false
integer32llc/margo
https://github.com/integer32llc/margo/blob/c29ba4782272af3bac69425eb3382f07687d63d1/src/main.rs
src/main.rs
use common::CrateName; use semver::Version; use serde::{Deserialize, Serialize}; use snafu::prelude::*; use std::{ collections::{BTreeMap, BTreeSet}, env, fmt, fs::{self, File}, io::{self, BufRead, BufReader, BufWriter, Read, Write}, path::{Component, Path, PathBuf}, str, }; use url::Url; #[cfg...
rust
Apache-2.0
c29ba4782272af3bac69425eb3382f07687d63d1
2026-01-04T20:19:37.290944Z
true
integer32llc/margo
https://github.com/integer32llc/margo/blob/c29ba4782272af3bac69425eb3382f07687d63d1/xtask/src/main.rs
xtask/src/main.rs
use notify::{RecursiveMode, Watcher}; use quote::quote; use regex::Regex; use snafu::prelude::*; use std::{ env, fs, io, path::{Path, PathBuf}, process::Command, sync::mpsc, thread, time::Duration, }; use toml_edit::{DocumentMut, Item}; /// Build tools for Margo #[derive(Debug, argh::FromArgs)]...
rust
Apache-2.0
c29ba4782272af3bac69425eb3382f07687d63d1
2026-01-04T20:19:37.290944Z
false
integer32llc/margo
https://github.com/integer32llc/margo/blob/c29ba4782272af3bac69425eb3382f07687d63d1/conformance/src/main.rs
conformance/src/main.rs
use axum::{ extract::Request, http::StatusCode, middleware::{self, Next}, response::{IntoResponse, Response}, Router, }; use axum_extra::{ headers::{self, authorization::Basic}, TypedHeader, }; use registry_conformance::{CommandExt, CreatedCrate, Registry, RegistryBuilder}; use snafu::prelud...
rust
Apache-2.0
c29ba4782272af3bac69425eb3382f07687d63d1
2026-01-04T20:19:37.290944Z
false
helsing-ai/dson
https://github.com/helsing-ai/dson/blob/eef903f2120ed8415e5f9d1792d10c72c387f533/build.rs
build.rs
// (c) Copyright 2025 Helsing GmbH. All rights reserved. use rand::Rng as _; use rand_distr::Distribution; use std::{ collections::BTreeSet, fs::File, io::{BufRead, BufReader, Write}, ops::Bound, path::Path, }; /// Increment to indicate that random_dots.rs generated by an older build.rs must be re-...
rust
Apache-2.0
eef903f2120ed8415e5f9d1792d10c72c387f533
2026-01-04T20:19:34.202571Z
false
helsing-ai/dson
https://github.com/helsing-ai/dson/blob/eef903f2120ed8415e5f9d1792d10c72c387f533/src/dotstores.rs
src/dotstores.rs
// (c) Copyright 2025 Helsing GmbH. All rights reserved. //! # Dot Stores //! //! This module defines the core data structures, known as "dot stores", that underpin the DSON //! (JSON CRDT Using Delta-Mutations For Document Stores) implementation. The concepts and data //! structures defined here are based on the resea...
rust
Apache-2.0
eef903f2120ed8415e5f9d1792d10c72c387f533
2026-01-04T20:19:34.202571Z
true
helsing-ai/dson
https://github.com/helsing-ai/dson/blob/eef903f2120ed8415e5f9d1792d10c72c387f533/src/lib.rs
src/lib.rs
// (c) Copyright 2025 Helsing GmbH. All rights reserved. //! # DSON: A Delta-State CRDT for JSON-like Data Structures //! //! This crate provides a Rust implementation of **DSON**, a space-efficient, //! delta-state Conflict-Free Replicated Datatype (CRDT) for JSON-like data structures. //! It is based on the research ...
rust
Apache-2.0
eef903f2120ed8415e5f9d1792d10c72c387f533
2026-01-04T20:19:34.202571Z
false
helsing-ai/dson
https://github.com/helsing-ai/dson/blob/eef903f2120ed8415e5f9d1792d10c72c387f533/src/crdts.rs
src/crdts.rs
// (c) Copyright 2025 Helsing GmbH. All rights reserved. //! # Composable CRDTs for JSON-like Data //! //! This module provides a set of composable, conflict-free replicated data types (CRDTs) //! that can be used to build complex, JSON-like data structures. These CRDTs are the //! building blocks of the DSON library a...
rust
Apache-2.0
eef903f2120ed8415e5f9d1792d10c72c387f533
2026-01-04T20:19:34.202571Z
false
helsing-ai/dson
https://github.com/helsing-ai/dson/blob/eef903f2120ed8415e5f9d1792d10c72c387f533/src/json.rs
src/json.rs
// (c) Copyright 2025 Helsing GmbH. All rights reserved. //! JSON representation //! //! Value-level conflicts, which can only occur in [`MvReg`s](crate::crdts::MvReg), are //! represented as a JSON array of the conflicting values in an **arbitrary but deterministic order**. //! //! # Examples //! //! ## A simple docum...
rust
Apache-2.0
eef903f2120ed8415e5f9d1792d10c72c387f533
2026-01-04T20:19:34.202571Z
false
helsing-ai/dson
https://github.com/helsing-ai/dson/blob/eef903f2120ed8415e5f9d1792d10c72c387f533/src/sentinel.rs
src/sentinel.rs
// (c) Copyright 2025 Helsing GmbH. All rights reserved. //! Observe and validate changes to a CRDT. //! //! Sentinels are types that can be used to inspect the changes being applied to a CRDT. They are //! useful for validating that the changes conform to a schema, or simply to observe the changes //! for any other pu...
rust
Apache-2.0
eef903f2120ed8415e5f9d1792d10c72c387f533
2026-01-04T20:19:34.202571Z
false
helsing-ai/dson
https://github.com/helsing-ai/dson/blob/eef903f2120ed8415e5f9d1792d10c72c387f533/src/causal_context.rs
src/causal_context.rs
// (c) Copyright 2025 Helsing GmbH. All rights reserved. //! # Causal Context //! //! This module provides the core data structures for tracking causality in DSON. //! Causal consistency is maintained by tracking the history of operations using //! `Dot`s, which are globally unique identifiers for each operation. The s...
rust
Apache-2.0
eef903f2120ed8415e5f9d1792d10c72c387f533
2026-01-04T20:19:34.202571Z
true
helsing-ai/dson
https://github.com/helsing-ai/dson/blob/eef903f2120ed8415e5f9d1792d10c72c387f533/src/api.rs
src/api.rs
// (c) Copyright 2025 Helsing GmbH. All rights reserved. pub mod array; pub mod map; pub mod register; pub mod timestamp;
rust
Apache-2.0
eef903f2120ed8415e5f9d1792d10c72c387f533
2026-01-04T20:19:34.202571Z
false
helsing-ai/dson
https://github.com/helsing-ai/dson/blob/eef903f2120ed8415e5f9d1792d10c72c387f533/src/either.rs
src/either.rs
// (c) Copyright 2025 Helsing GmbH. All rights reserved. //! The enum Either with variants Left and Right is a general purpose sum type //! with two cases. #[derive(Debug, Clone, Ord, PartialOrd, PartialEq, Eq)] pub enum Either<A, B> { Left(A), Right(B), } impl<A, B> Either<Either<A, B>, B> { /// Converts...
rust
Apache-2.0
eef903f2120ed8415e5f9d1792d10c72c387f533
2026-01-04T20:19:34.202571Z
false
helsing-ai/dson
https://github.com/helsing-ai/dson/blob/eef903f2120ed8415e5f9d1792d10c72c387f533/src/macros.rs
src/macros.rs
// (c) Copyright 2025 Helsing GmbH. All rights reserved. /// Convenience macro for creating dot values. /// /// NOTE! This is mostly useful for tests, since it does not provide control /// over the app or priority fields of a dot. #[macro_export] macro_rules! dot { ($seq:expr) => { const { $crat...
rust
Apache-2.0
eef903f2120ed8415e5f9d1792d10c72c387f533
2026-01-04T20:19:34.202571Z
false
helsing-ai/dson
https://github.com/helsing-ai/dson/blob/eef903f2120ed8415e5f9d1792d10c72c387f533/src/datetime_literal.rs
src/datetime_literal.rs
// (c) Copyright 2025 Helsing GmbH. All rights reserved. /// Declarative macro to create a [`chrono::DateTime<chrono::Utc>`] suitable /// for const evaluation, as this is otherwise cumbersome. /// /// Usage: /// ```rust /// # use chrono::{DateTime, Utc}; /// # use dson::datetime; /// let datetime: DateTime<Utc...
rust
Apache-2.0
eef903f2120ed8415e5f9d1792d10c72c387f533
2026-01-04T20:19:34.202571Z
false
helsing-ai/dson
https://github.com/helsing-ai/dson/blob/eef903f2120ed8415e5f9d1792d10c72c387f533/src/crdts/mvreg.rs
src/crdts/mvreg.rs
// (c) Copyright 2025 Helsing GmbH. All rights reserved. use super::snapshot::{self, SingleValueError, SingleValueIssue, ToValue}; use crate::{ CausalContext, CausalDotStore, Dot, DotFun, DotStoreJoin, Identifier, api, dotstores::{DotChange, DotStore, DryJoinOutput}, sentinel::{Sentinel, ValueSentinel}, }; ...
rust
Apache-2.0
eef903f2120ed8415e5f9d1792d10c72c387f533
2026-01-04T20:19:34.202571Z
false
helsing-ai/dson
https://github.com/helsing-ai/dson/blob/eef903f2120ed8415e5f9d1792d10c72c387f533/src/crdts/test_util.rs
src/crdts/test_util.rs
// (c) Copyright 2025 Helsing GmbH. All rights reserved. use super::Value; use crate::{ CausalContext, CausalDotStore, DotStoreJoin, Identifier, dotstores::recording_sentinel::RecordingSentinel, sentinel::{DummySentinel, Sentinel}, }; use quickcheck::Gen; use std::{fmt, ops::RangeBounds}; mod arbitrary_del...
rust
Apache-2.0
eef903f2120ed8415e5f9d1792d10c72c387f533
2026-01-04T20:19:34.202571Z
false
helsing-ai/dson
https://github.com/helsing-ai/dson/blob/eef903f2120ed8415e5f9d1792d10c72c387f533/src/crdts/ormap.rs
src/crdts/ormap.rs
// (c) Copyright 2025 Helsing GmbH. All rights reserved. use super::{ Either, NoExtensionTypes, TypeVariantValue, Value, ValueRef, mvreg::MvRegValue, orarray::Uid, snapshot::{self, AllValues, CollapsedValue, SingleValueError, SingleValueIssue, ToValue}, }; use crate::{ CausalContext, CausalDotStore,...
rust
Apache-2.0
eef903f2120ed8415e5f9d1792d10c72c387f533
2026-01-04T20:19:34.202571Z
true
helsing-ai/dson
https://github.com/helsing-ai/dson/blob/eef903f2120ed8415e5f9d1792d10c72c387f533/src/crdts/orarray.rs
src/crdts/orarray.rs
// (c) Copyright 2025 Helsing GmbH. All rights reserved. use super::{ Either, NoExtensionTypes, TypeVariantValue, Value, ValueRef, mvreg::MvRegValue, snapshot::{self, AllValues, CollapsedValue, SingleValueError, SingleValueIssue, ToValue}, }; use crate::{ CausalContext, CausalDotStore, DETERMINISTIC_HAS...
rust
Apache-2.0
eef903f2120ed8415e5f9d1792d10c72c387f533
2026-01-04T20:19:34.202571Z
true
helsing-ai/dson
https://github.com/helsing-ai/dson/blob/eef903f2120ed8415e5f9d1792d10c72c387f533/src/crdts/snapshot.rs
src/crdts/snapshot.rs
// (c) Copyright 2025 Helsing GmbH. All rights reserved. //! Provides snapshots of CRDTs for inspection. //! //! A snapshot is a read-only, immutable view of the state of a CRDT at a //! particular point in time. //! //! This module provides two ways to get a snapshot of a CRDT, exposed via the //! [`ToValue`] trait: /...
rust
Apache-2.0
eef903f2120ed8415e5f9d1792d10c72c387f533
2026-01-04T20:19:34.202571Z
false
helsing-ai/dson
https://github.com/helsing-ai/dson/blob/eef903f2120ed8415e5f9d1792d10c72c387f533/src/crdts/test_util/qc_arbitrary_ops.rs
src/crdts/test_util/qc_arbitrary_ops.rs
// (c) Copyright 2025 Helsing GmbH. All rights reserved. //! This module implements Arbitrary for sequences of operations. use super::ArbitraryDelta; use crate::{ CausalDotStore, ComputeDeletionsArg, DotStoreJoin, Identifier, compute_deletions_unknown_to, crdts::{orarray::Uid, test_util::Delta}, dotstores:...
rust
Apache-2.0
eef903f2120ed8415e5f9d1792d10c72c387f533
2026-01-04T20:19:34.202571Z
false
helsing-ai/dson
https://github.com/helsing-ai/dson/blob/eef903f2120ed8415e5f9d1792d10c72c387f533/src/crdts/test_util/arbitrary_delta_impls.rs
src/crdts/test_util/arbitrary_delta_impls.rs
// (c) Copyright 2025 Helsing GmbH. All rights reserved. pub(crate) mod mvreg; pub(crate) mod orarray; pub(crate) mod ormap; pub(crate) use mvreg::RegisterOp; pub(crate) use orarray::ArrayOp; pub(crate) use ormap::MapOp; /// A type that holds a [`Delta`] for one of the known CRDT [`Delta`] types. /// /// This exists ...
rust
Apache-2.0
eef903f2120ed8415e5f9d1792d10c72c387f533
2026-01-04T20:19:34.202571Z
false
helsing-ai/dson
https://github.com/helsing-ai/dson/blob/eef903f2120ed8415e5f9d1792d10c72c387f533/src/crdts/test_util/qc_arbitrary_impls.rs
src/crdts/test_util/qc_arbitrary_impls.rs
// (c) Copyright 2025 Helsing GmbH. All rights reserved. //! Implementation of the quickcheck::Arbitrary trait for all of CRDT types. use crate::{ CausalContext, CausalDotStore, Dot, DotFun, DotFunMap, DotStore, DotStoreJoin, ExtensionType, Identifier, MvReg, OrArray, OrMap, api::timestamp::Timestamp, ...
rust
Apache-2.0
eef903f2120ed8415e5f9d1792d10c72c387f533
2026-01-04T20:19:34.202571Z
false
helsing-ai/dson
https://github.com/helsing-ai/dson/blob/eef903f2120ed8415e5f9d1792d10c72c387f533/src/crdts/test_util/arbitrary_delta_impls/mvreg.rs
src/crdts/test_util/arbitrary_delta_impls/mvreg.rs
// (c) Copyright 2025 Helsing GmbH. All rights reserved. use crate::{ CausalContext, CausalDotStore, Identifier, MvReg, crdts::{ mvreg::MvRegValue, test_util::{ArbitraryDelta, Delta, KeyTracker}, }, }; use quickcheck::{Arbitrary, Gen}; use std::{fmt, ops::RangeBounds}; #[cfg_attr(feature = ...
rust
Apache-2.0
eef903f2120ed8415e5f9d1792d10c72c387f533
2026-01-04T20:19:34.202571Z
false
helsing-ai/dson
https://github.com/helsing-ai/dson/blob/eef903f2120ed8415e5f9d1792d10c72c387f533/src/crdts/test_util/arbitrary_delta_impls/ormap.rs
src/crdts/test_util/arbitrary_delta_impls/ormap.rs
// (c) Copyright 2025 Helsing GmbH. All rights reserved. use super::ValueDelta; use crate::{ CausalContext, CausalDotStore, DotStore, Identifier, MvReg, OrArray, OrMap, crdts::{ NoExtensionTypes, Value, test_util::{ArbitraryDelta, Delta, KeyTracker}, }, }; use quickcheck::{Arbitrary, Gen}; u...
rust
Apache-2.0
eef903f2120ed8415e5f9d1792d10c72c387f533
2026-01-04T20:19:34.202571Z
false
helsing-ai/dson
https://github.com/helsing-ai/dson/blob/eef903f2120ed8415e5f9d1792d10c72c387f533/src/crdts/test_util/arbitrary_delta_impls/orarray.rs
src/crdts/test_util/arbitrary_delta_impls/orarray.rs
// (c) Copyright 2025 Helsing GmbH. All rights reserved. use super::ValueDelta; use crate::{ CausalContext, CausalDotStore, DotStore, Identifier, MvReg, OrArray, OrMap, crdts::{ NoExtensionTypes, Value, orarray::Position, test_util::{ArbitraryDelta, Delta, KeyTracker}, }, }; use quic...
rust
Apache-2.0
eef903f2120ed8415e5f9d1792d10c72c387f533
2026-01-04T20:19:34.202571Z
false
helsing-ai/dson
https://github.com/helsing-ai/dson/blob/eef903f2120ed8415e5f9d1792d10c72c387f533/src/crdts/orarray/position.rs
src/crdts/orarray/position.rs
// (c) Copyright 2025 Helsing GmbH. All rights reserved. use std::cmp::Ordering; // NOTE: the original implementation has an atoms field with node identifiers in them stored // inside each Position, but none of that is actually _used_ anywhere, so it's been left over. one // of the original DSON paper authors confirme...
rust
Apache-2.0
eef903f2120ed8415e5f9d1792d10c72c387f533
2026-01-04T20:19:34.202571Z
false
helsing-ai/dson
https://github.com/helsing-ai/dson/blob/eef903f2120ed8415e5f9d1792d10c72c387f533/src/transaction/conflicted.rs
src/transaction/conflicted.rs
use crate::crdts::TypeVariantValue; use crate::dotstores::DotStore; use crate::{ExtensionType, MvReg, OrArray, OrMap}; use std::{fmt, hash::Hash}; /// A value with concurrent type conflicts. /// /// When replicas concurrently write different types to the same key /// (e.g., one writes a map, another an array), DSON pr...
rust
Apache-2.0
eef903f2120ed8415e5f9d1792d10c72c387f533
2026-01-04T20:19:34.202571Z
false
helsing-ai/dson
https://github.com/helsing-ai/dson/blob/eef903f2120ed8415e5f9d1792d10c72c387f533/src/transaction/delta.rs
src/transaction/delta.rs
/// Changes to a CRDT, not full state. /// /// Prevents accidental misuse through type safety. Access the inner /// `CausalDotStore` via the public field. /// /// # Example /// ``` /// use dson::{Delta, CausalDotStore, OrMap}; /// /// # fn example(delta: Delta<CausalDotStore<OrMap<String>>>) { /// // Access inner value...
rust
Apache-2.0
eef903f2120ed8415e5f9d1792d10c72c387f533
2026-01-04T20:19:34.202571Z
false
helsing-ai/dson
https://github.com/helsing-ai/dson/blob/eef903f2120ed8415e5f9d1792d10c72c387f533/src/transaction/map_transaction.rs
src/transaction/map_transaction.rs
use super::{ArrayTransaction, CrdtValue, Delta}; use crate::crdts::mvreg::MvRegValue; use crate::dotstores::DotStoreJoin; use crate::sentinel::DummySentinel; use crate::{CausalDotStore, ExtensionType, Identifier, OrMap}; use std::{fmt, hash::Hash}; /// A transaction for making multiple mutations to a DSON store. /// /...
rust
Apache-2.0
eef903f2120ed8415e5f9d1792d10c72c387f533
2026-01-04T20:19:34.202571Z
true
helsing-ai/dson
https://github.com/helsing-ai/dson/blob/eef903f2120ed8415e5f9d1792d10c72c387f533/src/transaction/array_transaction.rs
src/transaction/array_transaction.rs
use crate::crdts::Value; use crate::crdts::mvreg::MvRegValue; use crate::dotstores::DotStoreJoin; use crate::sentinel::DummySentinel; use crate::transaction::{CrdtValue, Delta, MapTransaction}; use crate::{CausalDotStore, ExtensionType, Identifier, OrArray, OrMap}; use std::fmt; /// Transaction for mutating an [`OrArr...
rust
Apache-2.0
eef903f2120ed8415e5f9d1792d10c72c387f533
2026-01-04T20:19:34.202571Z
false
helsing-ai/dson
https://github.com/helsing-ai/dson/blob/eef903f2120ed8415e5f9d1792d10c72c387f533/src/transaction/mod.rs
src/transaction/mod.rs
//! Transaction-based API for ergonomic CRDT mutations. //! //! This module provides a transaction-based API for making changes to DSON stores. //! Unlike the callback-based `api` module, transactions provide: //! //! - **Method chaining** - No nested callbacks //! - **Explicit conflict handling** - Enums force handlin...
rust
Apache-2.0
eef903f2120ed8415e5f9d1792d10c72c387f533
2026-01-04T20:19:34.202571Z
false
helsing-ai/dson
https://github.com/helsing-ai/dson/blob/eef903f2120ed8415e5f9d1792d10c72c387f533/src/transaction/crdt_value.rs
src/transaction/crdt_value.rs
use super::ConflictedValue; use crate::crdts::TypeVariantValue; use crate::{ExtensionType, MvReg, OrArray, OrMap}; use std::{fmt, hash::Hash}; /// Result of reading a value from a transaction. /// /// DSON preserves type conflicts, so reads must handle multiple possibilities. /// This enum forces explicit handling of:...
rust
Apache-2.0
eef903f2120ed8415e5f9d1792d10c72c387f533
2026-01-04T20:19:34.202571Z
false
helsing-ai/dson
https://github.com/helsing-ai/dson/blob/eef903f2120ed8415e5f9d1792d10c72c387f533/src/api/array.rs
src/api/array.rs
// (c) Copyright 2025 Helsing GmbH. All rights reserved. use crate::{ CausalContext, CausalDotStore, ExtensionType, Identifier, MvReg, OrArray, OrMap, crdts::{ TypeVariantValue, Value, orarray::{Position, Uid}, snapshot::{self, ToValue}, }, }; use std::{convert::Infallible, fmt}; /*...
rust
Apache-2.0
eef903f2120ed8415e5f9d1792d10c72c387f533
2026-01-04T20:19:34.202571Z
false
helsing-ai/dson
https://github.com/helsing-ai/dson/blob/eef903f2120ed8415e5f9d1792d10c72c387f533/src/api/register.rs
src/api/register.rs
// (c) Copyright 2025 Helsing GmbH. All rights reserved. use crate::{ CausalContext, CausalDotStore, Identifier, MvReg, crdts::{ mvreg::MvRegValue, snapshot::{SingleValueError, ToValue}, }, }; /// Returns the values of this register without collapsing conflicts. pub fn values(m: &MvReg) -> ...
rust
Apache-2.0
eef903f2120ed8415e5f9d1792d10c72c387f533
2026-01-04T20:19:34.202571Z
false
helsing-ai/dson
https://github.com/helsing-ai/dson/blob/eef903f2120ed8415e5f9d1792d10c72c387f533/src/api/timestamp.rs
src/api/timestamp.rs
// (c) Copyright 2025 Helsing GmbH. All rights reserved. //! This module provides a `Timestamp` type for efficient encoding of UTC datetimes. //! //! The `Timestamp` is represented as a 64-bit integer of milliseconds since the //! UNIX epoch, but is constrained to a range of years from 0 to 9999. //! This allows for co...
rust
Apache-2.0
eef903f2120ed8415e5f9d1792d10c72c387f533
2026-01-04T20:19:34.202571Z
false
helsing-ai/dson
https://github.com/helsing-ai/dson/blob/eef903f2120ed8415e5f9d1792d10c72c387f533/src/api/map.rs
src/api/map.rs
// (c) Copyright 2025 Helsing GmbH. All rights reserved. use crate::{ CausalContext, CausalDotStore, ExtensionType, Identifier, MvReg, OrArray, OrMap, crdts::{ TypeVariantValue, Value, snapshot::{self, ToValue}, }, }; use std::{borrow::Borrow, fmt, hash::Hash}; /// Returns the values of thi...
rust
Apache-2.0
eef903f2120ed8415e5f9d1792d10c72c387f533
2026-01-04T20:19:34.202571Z
false
helsing-ai/dson
https://github.com/helsing-ai/dson/blob/eef903f2120ed8415e5f9d1792d10c72c387f533/src/dotstores/recording_sentinel.rs
src/dotstores/recording_sentinel.rs
// (c) Copyright 2025 Helsing GmbH. All rights reserved. //! This module contains an implementation of Sentinel that simply records //! all calls in a human readable form. This is mostly useful for tests. use crate::{ crdts::ValueType, sentinel::{KeySentinel, Sentinel, TypeSentinel, ValueSentinel, Visit}, }; u...
rust
Apache-2.0
eef903f2120ed8415e5f9d1792d10c72c387f533
2026-01-04T20:19:34.202571Z
false
helsing-ai/dson
https://github.com/helsing-ai/dson/blob/eef903f2120ed8415e5f9d1792d10c72c387f533/src/causal_context/interval.rs
src/causal_context/interval.rs
// (c) Copyright 2025 Helsing GmbH. All rights reserved. //! # Interval and IntervalSet //! //! This module provides the `Interval` and `IntervalSet` data structures, which are //! used to efficiently represent sets of sequence numbers in a `CausalContext`. //! //! ## `Interval` //! //! An `Interval` represents a conti...
rust
Apache-2.0
eef903f2120ed8415e5f9d1792d10c72c387f533
2026-01-04T20:19:34.202571Z
true
helsing-ai/dson
https://github.com/helsing-ai/dson/blob/eef903f2120ed8415e5f9d1792d10c72c387f533/tests/transaction_rollback.rs
tests/transaction_rollback.rs
//! Tests for transaction rollback behavior. //! //! When a transaction is dropped without calling commit(), all changes //! should be rolled back, leaving the original store unchanged. use dson::{ CausalDotStore, Identifier, OrArray, OrMap, crdts::mvreg::MvRegValue, transaction::{ArrayTransaction, CrdtVal...
rust
Apache-2.0
eef903f2120ed8415e5f9d1792d10c72c387f533
2026-01-04T20:19:34.202571Z
false
helsing-ai/dson
https://github.com/helsing-ai/dson/blob/eef903f2120ed8415e5f9d1792d10c72c387f533/tests/nested_transactions.rs
tests/nested_transactions.rs
//! Integration tests for nested transaction API. use dson::{ CausalDotStore, Identifier, OrMap, crdts::mvreg::MvRegValue, transaction::MapTransaction, }; #[test] fn deeply_nested_map_array_map() { // Structure: map -> array -> map // Like: { "projects": [{ "name": "DSON", "tasks": [...] }] } let mut...
rust
Apache-2.0
eef903f2120ed8415e5f9d1792d10c72c387f533
2026-01-04T20:19:34.202571Z
false
helsing-ai/dson
https://github.com/helsing-ai/dson/blob/eef903f2120ed8415e5f9d1792d10c72c387f533/tests/transaction_api.rs
tests/transaction_api.rs
use dson::{CausalDotStore, Identifier, OrMap, crdts::mvreg::MvRegValue, transaction::CrdtValue}; #[test] fn simple_register_write_and_read() { let mut store = CausalDotStore::<OrMap<String>>::default(); let id = Identifier::new(0, 0); // Write using transaction { let mut tx = store.transact(id...
rust
Apache-2.0
eef903f2120ed8415e5f9d1792d10c72c387f533
2026-01-04T20:19:34.202571Z
false
helsing-ai/dson
https://github.com/helsing-ai/dson/blob/eef903f2120ed8415e5f9d1792d10c72c387f533/benches/iai.rs
benches/iai.rs
// (c) Copyright 2025 Helsing GmbH. All rights reserved. #![cfg_attr(not(target_os = "linux"), allow(dead_code, unused_imports))] use dson::{ CausalContext, CausalDotStore, Dot, Identifier, MvReg, OrArray, OrMap, api, crdts::{NoExtensionTypes, mvreg::MvRegValue}, sentinel::DummySentinel, }; use iai_callgri...
rust
Apache-2.0
eef903f2120ed8415e5f9d1792d10c72c387f533
2026-01-04T20:19:34.202571Z
false
helsing-ai/dson
https://github.com/helsing-ai/dson/blob/eef903f2120ed8415e5f9d1792d10c72c387f533/benches/nested_transactions.rs
benches/nested_transactions.rs
use dson::{ CausalDotStore, Identifier, OrMap, crdts::mvreg::MvRegValue, transaction::MapTransaction, }; use iai_callgrind::{library_benchmark, library_benchmark_group, main}; #[library_benchmark] fn nested_transaction_3_levels() { let mut store = CausalDotStore::<OrMap<String>>::default(); let id = Identi...
rust
Apache-2.0
eef903f2120ed8415e5f9d1792d10c72c387f533
2026-01-04T20:19:34.202571Z
false
helsing-ai/dson
https://github.com/helsing-ai/dson/blob/eef903f2120ed8415e5f9d1792d10c72c387f533/benches/tango.rs
benches/tango.rs
// (c) Copyright 2025 Helsing GmbH. All rights reserved. // because we need this below to retain 'static on the borrows of omni #![allow(clippy::borrow_deref_ref)] use dson::{ CausalContext, CausalDotStore, Dot, Identifier, MvReg, OrArray, OrMap, api, crdts::{NoExtensionTypes, mvreg::MvRegValue}, sentinel:...
rust
Apache-2.0
eef903f2120ed8415e5f9d1792d10c72c387f533
2026-01-04T20:19:34.202571Z
false
helsing-ai/dson
https://github.com/helsing-ai/dson/blob/eef903f2120ed8415e5f9d1792d10c72c387f533/examples/simple.rs
examples/simple.rs
// (c) Copyright 2025 Helsing GmbH. All rights reserved. //! The example simulates a scenario where two replicas modify the same data and //! then synchronize their states, arriving at a consistent final result. use dson::{CausalDotStore, Identifier, OrMap, crdts::NoExtensionTypes}; use std::error::Error; fn main() -...
rust
Apache-2.0
eef903f2120ed8415e5f9d1792d10c72c387f533
2026-01-04T20:19:34.202571Z
false
helsing-ai/dson
https://github.com/helsing-ai/dson/blob/eef903f2120ed8415e5f9d1792d10c72c387f533/examples/nested_transactions.rs
examples/nested_transactions.rs
use dson::{ CausalDotStore, Identifier, OrMap, crdts::mvreg::MvRegValue, transaction::MapTransaction, }; fn main() { println!("Nested Transaction API Demo\n"); let mut store = CausalDotStore::<OrMap<String>>::default(); let id = Identifier::new(0, 0); // Create deeply nested structure { ...
rust
Apache-2.0
eef903f2120ed8415e5f9d1792d10c72c387f533
2026-01-04T20:19:34.202571Z
false
helsing-ai/dson
https://github.com/helsing-ai/dson/blob/eef903f2120ed8415e5f9d1792d10c72c387f533/examples/transaction_conflicts.rs
examples/transaction_conflicts.rs
use dson::{ CausalDotStore, Identifier, OrMap, crdts::{mvreg::MvRegValue, snapshot::ToValue}, transaction::CrdtValue, }; fn main() { // Create two replicas let mut replica_a = CausalDotStore::<OrMap<String>>::default(); let mut replica_b = CausalDotStore::<OrMap<String>>::default(); let id...
rust
Apache-2.0
eef903f2120ed8415e5f9d1792d10c72c387f533
2026-01-04T20:19:34.202571Z
false
helsing-ai/dson
https://github.com/helsing-ai/dson/blob/eef903f2120ed8415e5f9d1792d10c72c387f533/examples/conflicts.rs
examples/conflicts.rs
// (c) Copyright 2025 Helsing GmbH. All rights reserved. //! This example demonstrates how dson handles concurrent edits and resolves conflicts. //! We simulate two replicas of a user profile, make conflicting changes to the same fields, //! and then merge them to observe the final, converged state. use dson::{ Cau...
rust
Apache-2.0
eef903f2120ed8415e5f9d1792d10c72c387f533
2026-01-04T20:19:34.202571Z
false