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
altunenes/cuneus
https://github.com/altunenes/cuneus/blob/4ab4a90169f70265c17a065d0db53bc168aeecc2/examples/tree.rs
examples/tree.rs
use cuneus::compute::*; use cuneus::prelude::*; use winit::event::WindowEvent; #[repr(C)] #[derive(Copy, Clone, Debug, bytemuck::Pod, bytemuck::Zeroable)] struct TreeParams { pixel_offset: f32, pixel_offset2: f32, lights: f32, exp: f32, frame: f32, col1: f32, col2: f32, decay: f32, } i...
rust
MIT
4ab4a90169f70265c17a065d0db53bc168aeecc2
2026-01-04T20:21:00.414612Z
false
altunenes/cuneus
https://github.com/altunenes/cuneus/blob/4ab4a90169f70265c17a065d0db53bc168aeecc2/examples/particles.rs
examples/particles.rs
use cuneus::compute::*; use cuneus::prelude::*; use winit::event::WindowEvent; #[repr(C)] #[derive(Copy, Clone, Debug, bytemuck::Pod, bytemuck::Zeroable)] struct ParticleParams { a: f32, b: f32, c: f32, d: f32, num_circles: f32, num_points: f32, particle_intensity: f32, gamma: f32, ...
rust
MIT
4ab4a90169f70265c17a065d0db53bc168aeecc2
2026-01-04T20:21:00.414612Z
false
altunenes/cuneus
https://github.com/altunenes/cuneus/blob/4ab4a90169f70265c17a065d0db53bc168aeecc2/examples/cnn.rs
examples/cnn.rs
use cuneus::compute::*; use cuneus::prelude::*; use winit::event::WindowEvent; #[repr(C)] #[derive(Copy, Clone, Debug, bytemuck::Pod, bytemuck::Zeroable)] struct CNNParams { brush_size: f32, input_resolution: f32, clear_canvas: i32, show_debug: i32, feature_maps_1: f32, feature_maps_2: f32, ...
rust
MIT
4ab4a90169f70265c17a065d0db53bc168aeecc2
2026-01-04T20:21:00.414612Z
false
altunenes/cuneus
https://github.com/altunenes/cuneus/blob/4ab4a90169f70265c17a065d0db53bc168aeecc2/examples/fluid.rs
examples/fluid.rs
use cuneus::compute::*; use cuneus::prelude::*; use winit::event::WindowEvent; #[repr(C, align(16))] #[derive(Copy, Clone, Debug, bytemuck::Pod, bytemuck::Zeroable)] struct FluidParams { rotation_speed: f32, motor_strength: f32, distortion: f32, feedback: f32, particle_size: f32, _padding: [f32...
rust
MIT
4ab4a90169f70265c17a065d0db53bc168aeecc2
2026-01-04T20:21:00.414612Z
false
altunenes/cuneus
https://github.com/altunenes/cuneus/blob/4ab4a90169f70265c17a065d0db53bc168aeecc2/examples/system.rs
examples/system.rs
use cuneus::compute::*; use cuneus::prelude::*; use winit::event::WindowEvent; #[repr(C)] #[derive(Copy, Clone, Debug, bytemuck::Pod, bytemuck::Zeroable)] struct SystemParams { a: f32, b: f32, c: f32, dof_amount: f32, dof_focal_dist: f32, brightness: f32, color1_r: f32, color1_g: f32, ...
rust
MIT
4ab4a90169f70265c17a065d0db53bc168aeecc2
2026-01-04T20:21:00.414612Z
false
altunenes/cuneus
https://github.com/altunenes/cuneus/blob/4ab4a90169f70265c17a065d0db53bc168aeecc2/examples/galaxy.rs
examples/galaxy.rs
use cuneus::prelude::*; use cuneus::{Core, RenderKit, ShaderApp, ShaderManager, UniformProvider}; use winit::event::WindowEvent; #[repr(C)] #[derive(Copy, Clone, Debug, bytemuck::Pod, bytemuck::Zeroable)] struct ShaderParams { max_iterations: i32, max_sub_iterations: i32, point_intensity: f32, center_sc...
rust
MIT
4ab4a90169f70265c17a065d0db53bc168aeecc2
2026-01-04T20:21:00.414612Z
false
altunenes/cuneus
https://github.com/altunenes/cuneus/blob/4ab4a90169f70265c17a065d0db53bc168aeecc2/examples/synth.rs
examples/synth.rs
use cuneus::audio::{EnvelopeConfig, SynthesisManager}; use cuneus::compute::*; use cuneus::prelude::*; use winit::event::WindowEvent; #[repr(C)] #[derive(Copy, Clone, Debug, bytemuck::Pod, bytemuck::Zeroable)] struct SynthParams { tempo: f32, waveform_type: u32, octave: f32, volume: f32, beat_enabl...
rust
MIT
4ab4a90169f70265c17a065d0db53bc168aeecc2
2026-01-04T20:21:00.414612Z
false
altunenes/cuneus
https://github.com/altunenes/cuneus/blob/4ab4a90169f70265c17a065d0db53bc168aeecc2/examples/plasma.rs
examples/plasma.rs
use cuneus::compute::*; use cuneus::prelude::*; use winit::event::WindowEvent; #[repr(C)] #[derive(Copy, Clone, Debug, bytemuck::Pod, bytemuck::Zeroable)] struct NeuralParams { detail: f32, animation_speed: f32, pattern: f32, structure_smoothness: f32, saturation: f32, base_rotation: f32, r...
rust
MIT
4ab4a90169f70265c17a065d0db53bc168aeecc2
2026-01-04T20:21:00.414612Z
false
altunenes/cuneus
https://github.com/altunenes/cuneus/blob/4ab4a90169f70265c17a065d0db53bc168aeecc2/examples/mandelbulb.rs
examples/mandelbulb.rs
use cuneus::compute::ComputeShader; use cuneus::{ Core, ExportManager, RenderKit, ShaderControls, ShaderManager, UniformProvider, }; use winit::event::WindowEvent; #[repr(C)] #[derive(Copy, Clone, Debug, bytemuck::Pod, bytemuck::Zeroable)] struct MandelbulbParams { power: f32, max_bounces: u32, samples...
rust
MIT
4ab4a90169f70265c17a065d0db53bc168aeecc2
2026-01-04T20:21:00.414612Z
false
altunenes/cuneus
https://github.com/altunenes/cuneus/blob/4ab4a90169f70265c17a065d0db53bc168aeecc2/examples/lego.rs
examples/lego.rs
use cuneus::compute::*; use cuneus::prelude::*; use winit::event::WindowEvent; #[repr(C, align(16))] #[derive(Copy, Clone, Debug, bytemuck::Pod, bytemuck::Zeroable)] struct LegoParams { brick_scale: f32, lightdir_x: f32, lightdir_y: f32, grain: f32, gamma: f32, shadow_str: f32, shadow_dist:...
rust
MIT
4ab4a90169f70265c17a065d0db53bc168aeecc2
2026-01-04T20:21:00.414612Z
false
altunenes/cuneus
https://github.com/altunenes/cuneus/blob/4ab4a90169f70265c17a065d0db53bc168aeecc2/examples/currents.rs
examples/currents.rs
// Photon tracing: currents // Very complex example demonstrating multi-buffer ping-pong computation // I hope this example is useful for those who came from the Shadertoy, I tried to use same terminology (bufferA, ichannels etc) // I used the all buffers (buffera,b,c,d,mainimage) and complex ping-pong logic use cuneus...
rust
MIT
4ab4a90169f70265c17a065d0db53bc168aeecc2
2026-01-04T20:21:00.414612Z
false
altunenes/cuneus
https://github.com/altunenes/cuneus/blob/4ab4a90169f70265c17a065d0db53bc168aeecc2/examples/debugscreen.rs
examples/debugscreen.rs
use cuneus::audio::SynthesisManager; use cuneus::compute::{ComputeShader, COMPUTE_TEXTURE_FORMAT_RGBA16}; use cuneus::{Core, RenderKit, ShaderApp, ShaderControls, ShaderManager}; use winit::event::*; struct DebugScreen { base: RenderKit, compute_shader: ComputeShader, audio_synthesis: Option<SynthesisManag...
rust
MIT
4ab4a90169f70265c17a065d0db53bc168aeecc2
2026-01-04T20:21:00.414612Z
false
altunenes/cuneus
https://github.com/altunenes/cuneus/blob/4ab4a90169f70265c17a065d0db53bc168aeecc2/examples/vortex.rs
examples/vortex.rs
use cuneus::compute::*; use cuneus::prelude::*; use winit::event::WindowEvent; #[repr(C)] #[derive(Copy, Clone, Debug, bytemuck::Pod, bytemuck::Zeroable)] struct VortexParams { a: f32, b: f32, c: f32, dof_amount: f32, dof_focal_dist: f32, brightness: f32, color1_r: f32, color1_g: f32, ...
rust
MIT
4ab4a90169f70265c17a065d0db53bc168aeecc2
2026-01-04T20:21:00.414612Z
false
altunenes/cuneus
https://github.com/altunenes/cuneus/blob/4ab4a90169f70265c17a065d0db53bc168aeecc2/examples/circuits.rs
examples/circuits.rs
use cuneus::compute::*; use cuneus::prelude::*; use winit::event::WindowEvent; #[repr(C)] #[derive(Copy, Clone, Debug, bytemuck::Pod, bytemuck::Zeroable)] struct CircuitParams { rotation_speed: f32, distance_offset: f32, gamma: f32, color1_r: f32, color1_g: f32, color1_b: f32, color2_r: f32...
rust
MIT
4ab4a90169f70265c17a065d0db53bc168aeecc2
2026-01-04T20:21:00.414612Z
false
altunenes/cuneus
https://github.com/altunenes/cuneus/blob/4ab4a90169f70265c17a065d0db53bc168aeecc2/examples/sdvert.rs
examples/sdvert.rs
use cuneus::prelude::ComputeShader; use cuneus::{Core, RenderKit, ShaderApp, ShaderManager, UniformProvider}; use winit::event::*; #[repr(C)] #[derive(Copy, Clone, Debug, bytemuck::Pod, bytemuck::Zeroable)] struct ShaderParams { lambda: f32, theta: f32, alpha: f32, sigma: f32, gamma: f32, blue: ...
rust
MIT
4ab4a90169f70265c17a065d0db53bc168aeecc2
2026-01-04T20:21:00.414612Z
false
altunenes/cuneus
https://github.com/altunenes/cuneus/blob/4ab4a90169f70265c17a065d0db53bc168aeecc2/examples/buddhabrot.rs
examples/buddhabrot.rs
use cuneus::compute::*; use cuneus::prelude::*; use winit::event::WindowEvent; #[repr(C)] #[derive(Copy, Clone, Debug, bytemuck::Pod, bytemuck::Zeroable)] struct BuddhabrotParams { max_iterations: u32, escape_radius: f32, zoom: f32, offset_x: f32, offset_y: f32, rotation: f32, exposure: f32...
rust
MIT
4ab4a90169f70265c17a065d0db53bc168aeecc2
2026-01-04T20:21:00.414612Z
false
altunenes/cuneus
https://github.com/altunenes/cuneus/blob/4ab4a90169f70265c17a065d0db53bc168aeecc2/examples/cuneus.rs
examples/cuneus.rs
use cuneus::compute::{ComputeShader, COMPUTE_TEXTURE_FORMAT_RGBA16}; use cuneus::{Core, RenderKit, ShaderApp, ShaderControls, ShaderManager}; use cuneus::{ExportManager, UniformProvider}; use winit::event::*; #[repr(C)] #[derive(Copy, Clone, Debug, bytemuck::Pod, bytemuck::Zeroable)] struct ShaderParams { backgrou...
rust
MIT
4ab4a90169f70265c17a065d0db53bc168aeecc2
2026-01-04T20:21:00.414612Z
false
altunenes/cuneus
https://github.com/altunenes/cuneus/blob/4ab4a90169f70265c17a065d0db53bc168aeecc2/examples/matrix.rs
examples/matrix.rs
use cuneus::prelude::ComputeShader; use cuneus::{ Core, ExportManager, RenderKit, ShaderApp, ShaderControls, ShaderManager, UniformProvider, }; use winit::event::*; #[repr(C)] #[derive(Copy, Clone, Debug, bytemuck::Pod, bytemuck::Zeroable)] struct ShaderParams { red_power: f32, green_power: f32, blue_p...
rust
MIT
4ab4a90169f70265c17a065d0db53bc168aeecc2
2026-01-04T20:21:00.414612Z
false
altunenes/cuneus
https://github.com/altunenes/cuneus/blob/4ab4a90169f70265c17a065d0db53bc168aeecc2/examples/spiralchaos.rs
examples/spiralchaos.rs
use cuneus::compute::*; use cuneus::prelude::*; use winit::event::WindowEvent; #[repr(C)] #[derive(Copy, Clone, Debug, bytemuck::Pod, bytemuck::Zeroable)] struct SpiralParams { a: f32, b: f32, c: f32, dof_amount: f32, dof_focal_dist: f32, rotation_x: f32, rotation_y: f32, click_state: i...
rust
MIT
4ab4a90169f70265c17a065d0db53bc168aeecc2
2026-01-04T20:21:00.414612Z
false
altunenes/cuneus
https://github.com/altunenes/cuneus/blob/4ab4a90169f70265c17a065d0db53bc168aeecc2/examples/audiovis.rs
examples/audiovis.rs
use cuneus::compute::{ComputeShader, COMPUTE_TEXTURE_FORMAT_RGBA16}; use cuneus::{ Core, ExportManager, RenderKit, ShaderApp, ShaderControls, ShaderManager, UniformProvider, }; use winit::event::WindowEvent; #[repr(C)] #[derive(Copy, Clone, Debug, bytemuck::Pod, bytemuck::Zeroable)] struct AudioVisParams { red...
rust
MIT
4ab4a90169f70265c17a065d0db53bc168aeecc2
2026-01-04T20:21:00.414612Z
false
altunenes/cuneus
https://github.com/altunenes/cuneus/blob/4ab4a90169f70265c17a065d0db53bc168aeecc2/examples/volumepassage.rs
examples/volumepassage.rs
use cuneus::compute::*; use cuneus::prelude::*; use winit::event::WindowEvent; #[repr(C)] #[derive(Copy, Clone, Debug, bytemuck::Pod, bytemuck::Zeroable)] struct VolumeParams { speed: f32, intensity: f32, color1_r: f32, color1_g: f32, color1_b: f32, color2_r: f32, color2_g: f32, color2_...
rust
MIT
4ab4a90169f70265c17a065d0db53bc168aeecc2
2026-01-04T20:21:00.414612Z
false
altunenes/cuneus
https://github.com/altunenes/cuneus/blob/4ab4a90169f70265c17a065d0db53bc168aeecc2/examples/fft.rs
examples/fft.rs
use cuneus::compute::{ ComputeShader, PassDescription, StorageBufferSpec, COMPUTE_TEXTURE_FORMAT_RGBA16, }; use cuneus::{Core, ExportManager, RenderKit, ShaderControls, ShaderManager, UniformProvider}; use winit::event::WindowEvent; #[repr(C)] #[derive(Copy, Clone, Debug, bytemuck::Pod, bytemuck::Zeroable)] struct...
rust
MIT
4ab4a90169f70265c17a065d0db53bc168aeecc2
2026-01-04T20:21:00.414612Z
false
altunenes/cuneus
https://github.com/altunenes/cuneus/blob/4ab4a90169f70265c17a065d0db53bc168aeecc2/examples/nebula.rs
examples/nebula.rs
use cuneus::compute::*; use cuneus::prelude::*; use winit::event::WindowEvent; #[repr(C)] #[derive(Copy, Clone, Debug, bytemuck::Pod, bytemuck::Zeroable)] struct NebulaParams { iterations: i32, formuparam: f32, volsteps: i32, stepsize: f32, zoom: f32, tile: f32, speed: f32, brightness: ...
rust
MIT
4ab4a90169f70265c17a065d0db53bc168aeecc2
2026-01-04T20:21:00.414612Z
false
vionya/discord-rich-presence
https://github.com/vionya/discord-rich-presence/blob/d83d26062bf8ea072b5774bdca584d9ae423915f/src/ipc_windows.rs
src/ipc_windows.rs
use crate::{discord_ipc::DiscordIpc, error::Error}; use serde_json::json; use std::{ fs::{File, OpenOptions}, io::{Read, Write}, os::windows::fs::OpenOptionsExt, path::PathBuf, }; type Result<T> = std::result::Result<T, Error>; #[allow(dead_code)] #[derive(Debug)] /// A wrapper struct for the function...
rust
MIT
d83d26062bf8ea072b5774bdca584d9ae423915f
2026-01-04T20:21:07.642725Z
false
vionya/discord-rich-presence
https://github.com/vionya/discord-rich-presence/blob/d83d26062bf8ea072b5774bdca584d9ae423915f/src/ipc_unix.rs
src/ipc_unix.rs
use crate::{discord_ipc::DiscordIpc, error::Error}; use serde_json::json; use std::{ env::var, io::{Read, Write}, net::Shutdown, os::unix::net::UnixStream, path::PathBuf, }; // Environment keys to search for the Discord pipe const ENV_KEYS: [&str; 4] = ["XDG_RUNTIME_DIR", "TMPDIR", "TMP", "TEMP"]; ...
rust
MIT
d83d26062bf8ea072b5774bdca584d9ae423915f
2026-01-04T20:21:07.642725Z
false
vionya/discord-rich-presence
https://github.com/vionya/discord-rich-presence/blob/d83d26062bf8ea072b5774bdca584d9ae423915f/src/lib.rs
src/lib.rs
//! This library provides easy access to the Discord IPC. //! //! It provides implementations for both Unix and Windows //! operating systems, with both implementations using the //! same API. Thus, this crate can be used in a platform-agnostic //! manner. //! //! # Hello world //! ``` //! use discord_rich_presence::{a...
rust
MIT
d83d26062bf8ea072b5774bdca584d9ae423915f
2026-01-04T20:21:07.642725Z
false
vionya/discord-rich-presence
https://github.com/vionya/discord-rich-presence/blob/d83d26062bf8ea072b5774bdca584d9ae423915f/src/pack_unpack.rs
src/pack_unpack.rs
use std::convert::TryInto; use crate::error::Error; // Re-implement some packing methods in Rust pub fn pack(opcode: u32, data_len: u32) -> Vec<u8> { let mut bytes = Vec::new(); for byte_array in &[opcode.to_le_bytes(), data_len.to_le_bytes()] { bytes.extend_from_slice(byte_array); } bytes }...
rust
MIT
d83d26062bf8ea072b5774bdca584d9ae423915f
2026-01-04T20:21:07.642725Z
false
vionya/discord-rich-presence
https://github.com/vionya/discord-rich-presence/blob/d83d26062bf8ea072b5774bdca584d9ae423915f/src/discord_ipc.rs
src/discord_ipc.rs
use crate::{ activity::Activity, error::Error, pack_unpack::{pack, unpack}, }; use serde_json::{json, Value}; use uuid::Uuid; type Result<T> = std::result::Result<T, Error>; /// A client that connects to and communicates with the Discord IPC. /// /// Implemented via the [`DiscordIpcClient`](struct@crate::...
rust
MIT
d83d26062bf8ea072b5774bdca584d9ae423915f
2026-01-04T20:21:07.642725Z
false
vionya/discord-rich-presence
https://github.com/vionya/discord-rich-presence/blob/d83d26062bf8ea072b5774bdca584d9ae423915f/src/error.rs
src/error.rs
//! Error types for this crate. use thiserror::Error; /// Error type for this crate. #[derive(Error, Debug)] pub enum Error { /// Failed to decode opcode. #[error("failed to decode opcode")] DecodeOpcode, /// Failed to decode header. #[error("failed to decode header")] DecodeHeader, /// Fa...
rust
MIT
d83d26062bf8ea072b5774bdca584d9ae423915f
2026-01-04T20:21:07.642725Z
false
vionya/discord-rich-presence
https://github.com/vionya/discord-rich-presence/blob/d83d26062bf8ea072b5774bdca584d9ae423915f/src/activity.rs
src/activity.rs
//! Provides an interface for building activities to send //! to Discord via [`DiscordIpc::set_activity`](crate::DiscordIpc::set_activity). use serde_derive::Serialize; use serde_repr::Serialize_repr; use std::borrow::Cow; /// A struct representing a Discord rich presence activity /// /// Note that all methods return ...
rust
MIT
d83d26062bf8ea072b5774bdca584d9ae423915f
2026-01-04T20:21:07.642725Z
false
vionya/discord-rich-presence
https://github.com/vionya/discord-rich-presence/blob/d83d26062bf8ea072b5774bdca584d9ae423915f/tests/models_test.rs
tests/models_test.rs
use discord_rich_presence::{activity, DiscordIpc, DiscordIpcClient}; use std::error::Error; #[test] fn test_models() -> Result<(), Box<dyn Error>> { let mut client = DiscordIpcClient::new("771124766517755954"); client.connect()?; let activity = activity::Activity::new() .state("A test") .d...
rust
MIT
d83d26062bf8ea072b5774bdca584d9ae423915f
2026-01-04T20:21:07.642725Z
false
vionya/discord-rich-presence
https://github.com/vionya/discord-rich-presence/blob/d83d26062bf8ea072b5774bdca584d9ae423915f/tests/update_test.rs
tests/update_test.rs
use discord_rich_presence::{activity, DiscordIpc, DiscordIpcClient}; use std::error::Error; #[test] fn test_updating() -> Result<(), Box<dyn Error>> { let mut client = DiscordIpcClient::new("771124766517755954"); client.connect()?; client.set_activity( activity::Activity::new() .state(...
rust
MIT
d83d26062bf8ea072b5774bdca584d9ae423915f
2026-01-04T20:21:07.642725Z
false
vionya/discord-rich-presence
https://github.com/vionya/discord-rich-presence/blob/d83d26062bf8ea072b5774bdca584d9ae423915f/tests/reconnect_test.rs
tests/reconnect_test.rs
use discord_rich_presence::{activity, DiscordIpc, DiscordIpcClient}; use std::error::Error; #[test] fn test_reconnect() -> Result<(), Box<dyn Error>> { let mut client = DiscordIpcClient::new("771124766517755954"); loop { if client.connect().is_ok() { break; } } loop { ...
rust
MIT
d83d26062bf8ea072b5774bdca584d9ae423915f
2026-01-04T20:21:07.642725Z
false
vionya/discord-rich-presence
https://github.com/vionya/discord-rich-presence/blob/d83d26062bf8ea072b5774bdca584d9ae423915f/examples/presence.rs
examples/presence.rs
use discord_rich_presence::{activity, DiscordIpc, DiscordIpcClient}; fn main() -> Result<(), Box<dyn std::error::Error>> { let mut client = DiscordIpcClient::new(&std::env::args().collect::<Vec<String>>()[1]); client.connect()?; client.set_activity(activity::Activity::new().state("foo").details("bar"))?; ...
rust
MIT
d83d26062bf8ea072b5774bdca584d9ae423915f
2026-01-04T20:21:07.642725Z
false
BeechatNetworkSystemsLtd/Reticulum-rs
https://github.com/BeechatNetworkSystemsLtd/Reticulum-rs/blob/5012cf2c48044034775207ab7ee2c67d285276bb/build.rs
build.rs
use std::io::Result; fn main() -> Result<()> { println!("cargo:rerun-if-changed=proto/"); // Generate proto files for Kaonic tonic_build::configure() .type_attribute( "ConfigurationRequest", "#[derive(serde::Deserialize, serde::Serialize)]", ) .type_attribut...
rust
MIT
5012cf2c48044034775207ab7ee2c67d285276bb
2026-01-04T20:21:06.485960Z
false
BeechatNetworkSystemsLtd/Reticulum-rs
https://github.com/BeechatNetworkSystemsLtd/Reticulum-rs/blob/5012cf2c48044034775207ab7ee2c67d285276bb/src/serde.rs
src/serde.rs
use crate::{ buffer::{InputBuffer, OutputBuffer, StaticBuffer}, error::RnsError, hash::AddressHash, packet::{Header, HeaderType, Packet, PacketContext}, }; pub trait Serialize { fn serialize(&self, buffer: &mut OutputBuffer) -> Result<usize, RnsError>; } impl Serialize for AddressHash { fn ser...
rust
MIT
5012cf2c48044034775207ab7ee2c67d285276bb
2026-01-04T20:21:06.485960Z
false
BeechatNetworkSystemsLtd/Reticulum-rs
https://github.com/BeechatNetworkSystemsLtd/Reticulum-rs/blob/5012cf2c48044034775207ab7ee2c67d285276bb/src/packet.rs
src/packet.rs
use core::fmt; use sha2::Digest; use crate::buffer::StaticBuffer; use crate::hash::AddressHash; use crate::hash::Hash; pub const PACKET_MDU: usize = 2048usize; pub const PACKET_IFAC_MAX_LENGTH: usize = 64usize; #[derive(Debug, PartialEq, Eq, Copy, Clone)] pub enum IfacFlag { Open = 0b0, Authenticated = 0b1,...
rust
MIT
5012cf2c48044034775207ab7ee2c67d285276bb
2026-01-04T20:21:06.485960Z
false
BeechatNetworkSystemsLtd/Reticulum-rs
https://github.com/BeechatNetworkSystemsLtd/Reticulum-rs/blob/5012cf2c48044034775207ab7ee2c67d285276bb/src/lib.rs
src/lib.rs
#[cfg(feature = "alloc")] extern crate alloc; pub mod buffer; pub mod crypt; pub mod destination; pub mod error; pub mod hash; pub mod identity; pub mod iface; pub mod packet; pub mod transport; mod utils; mod serde;
rust
MIT
5012cf2c48044034775207ab7ee2c67d285276bb
2026-01-04T20:21:06.485960Z
false
BeechatNetworkSystemsLtd/Reticulum-rs
https://github.com/BeechatNetworkSystemsLtd/Reticulum-rs/blob/5012cf2c48044034775207ab7ee2c67d285276bb/src/crypt.rs
src/crypt.rs
pub mod fernet;
rust
MIT
5012cf2c48044034775207ab7ee2c67d285276bb
2026-01-04T20:21:06.485960Z
false
BeechatNetworkSystemsLtd/Reticulum-rs
https://github.com/BeechatNetworkSystemsLtd/Reticulum-rs/blob/5012cf2c48044034775207ab7ee2c67d285276bb/src/destination.rs
src/destination.rs
pub mod link; pub mod link_map; use ed25519_dalek::{Signature, SigningKey, VerifyingKey, SIGNATURE_LENGTH}; use rand_core::CryptoRngCore; use x25519_dalek::PublicKey; use core::{fmt, marker::PhantomData}; use crate::{ error::RnsError, hash::{AddressHash, Hash}, identity::{EmptyIdentity, HashIdentity, Ide...
rust
MIT
5012cf2c48044034775207ab7ee2c67d285276bb
2026-01-04T20:21:06.485960Z
false
BeechatNetworkSystemsLtd/Reticulum-rs
https://github.com/BeechatNetworkSystemsLtd/Reticulum-rs/blob/5012cf2c48044034775207ab7ee2c67d285276bb/src/error.rs
src/error.rs
#[derive(Debug)] pub enum RnsError { OutOfMemory, InvalidArgument, IncorrectSignature, IncorrectHash, CryptoError, PacketError, ConnectionError, }
rust
MIT
5012cf2c48044034775207ab7ee2c67d285276bb
2026-01-04T20:21:06.485960Z
false
BeechatNetworkSystemsLtd/Reticulum-rs
https://github.com/BeechatNetworkSystemsLtd/Reticulum-rs/blob/5012cf2c48044034775207ab7ee2c67d285276bb/src/iface.rs
src/iface.rs
pub mod hdlc; pub mod kaonic; pub mod tcp_client; pub mod tcp_server; pub mod udp; use std::sync::Arc; use std::sync::Mutex; use tokio::sync::mpsc; use tokio::task; use tokio_util::sync::CancellationToken; use crate::hash::AddressHash; use crate::hash::Hash; use crate::packet::Packet; pub type InterfaceTxSender = ...
rust
MIT
5012cf2c48044034775207ab7ee2c67d285276bb
2026-01-04T20:21:06.485960Z
false
BeechatNetworkSystemsLtd/Reticulum-rs
https://github.com/BeechatNetworkSystemsLtd/Reticulum-rs/blob/5012cf2c48044034775207ab7ee2c67d285276bb/src/utils.rs
src/utils.rs
pub mod cache_set;
rust
MIT
5012cf2c48044034775207ab7ee2c67d285276bb
2026-01-04T20:21:06.485960Z
false
BeechatNetworkSystemsLtd/Reticulum-rs
https://github.com/BeechatNetworkSystemsLtd/Reticulum-rs/blob/5012cf2c48044034775207ab7ee2c67d285276bb/src/hash.rs
src/hash.rs
use alloc::fmt::Write; use core::cmp; use core::fmt; use crypto_common::typenum::Unsigned; use crypto_common::OutputSizeUser; use rand_core::CryptoRngCore; use sha2::{Digest, Sha256}; use crate::error::RnsError; pub const HASH_SIZE: usize = <<Sha256 as OutputSizeUser>::OutputSize as Unsigned>::USIZE; pub const ADDRE...
rust
MIT
5012cf2c48044034775207ab7ee2c67d285276bb
2026-01-04T20:21:06.485960Z
false
BeechatNetworkSystemsLtd/Reticulum-rs
https://github.com/BeechatNetworkSystemsLtd/Reticulum-rs/blob/5012cf2c48044034775207ab7ee2c67d285276bb/src/transport.rs
src/transport.rs
use alloc::sync::Arc; use announce_limits::AnnounceLimits; use announce_table::AnnounceTable; use link_table::LinkTable; use packet_cache::PacketCache; use path_table::PathTable; use rand_core::OsRng; use std::collections::HashMap; use std::time::Duration; use tokio::time; use tokio_util::sync::CancellationToken; use ...
rust
MIT
5012cf2c48044034775207ab7ee2c67d285276bb
2026-01-04T20:21:06.485960Z
true
BeechatNetworkSystemsLtd/Reticulum-rs
https://github.com/BeechatNetworkSystemsLtd/Reticulum-rs/blob/5012cf2c48044034775207ab7ee2c67d285276bb/src/identity.rs
src/identity.rs
use alloc::fmt::Write; use hkdf::Hkdf; use rand_core::CryptoRngCore; use ed25519_dalek::{ed25519::signature::Signer, Signature, SigningKey, VerifyingKey}; use sha2::{Digest, Sha256}; use x25519_dalek::{EphemeralSecret, PublicKey, SharedSecret, StaticSecret}; use crate::{ crypt::fernet::{Fernet, PlainText, Token},...
rust
MIT
5012cf2c48044034775207ab7ee2c67d285276bb
2026-01-04T20:21:06.485960Z
false
BeechatNetworkSystemsLtd/Reticulum-rs
https://github.com/BeechatNetworkSystemsLtd/Reticulum-rs/blob/5012cf2c48044034775207ab7ee2c67d285276bb/src/buffer.rs
src/buffer.rs
use core::cmp::min; use core::fmt; use crate::error::RnsError; #[derive(Debug, PartialEq, Eq, Copy, Clone)] pub struct StaticBuffer<const N: usize> { buffer: [u8; N], len: usize, } impl<const N: usize> StaticBuffer<N> { pub const fn new() -> Self { Self { buffer: [0u8; N], ...
rust
MIT
5012cf2c48044034775207ab7ee2c67d285276bb
2026-01-04T20:21:06.485960Z
false
BeechatNetworkSystemsLtd/Reticulum-rs
https://github.com/BeechatNetworkSystemsLtd/Reticulum-rs/blob/5012cf2c48044034775207ab7ee2c67d285276bb/src/utils/cache_set.rs
src/utils/cache_set.rs
use std::collections::{HashSet, VecDeque}; pub struct CacheSet<T: std::hash::Hash + Eq + Clone> { capacity: usize, set: HashSet<T>, queue: VecDeque<T>, } impl<T: std::hash::Hash + Eq + Clone> CacheSet<T> { pub fn new(capacity: usize) -> Self { Self { capacity, set: Hash...
rust
MIT
5012cf2c48044034775207ab7ee2c67d285276bb
2026-01-04T20:21:06.485960Z
false
BeechatNetworkSystemsLtd/Reticulum-rs
https://github.com/BeechatNetworkSystemsLtd/Reticulum-rs/blob/5012cf2c48044034775207ab7ee2c67d285276bb/src/crypt/fernet.rs
src/crypt/fernet.rs
use core::cmp; use core::convert::From; use aes::cipher::block_padding::Pkcs7; use aes::cipher::BlockDecryptMut; use aes::cipher::Key; use aes::cipher::Unsigned; use cbc::cipher::BlockEncryptMut; use cbc::cipher::KeyIvInit; use crypto_common::{IvSizeUser, KeySizeUser, OutputSizeUser}; use hmac::{Hmac, Mac}; use rand_c...
rust
MIT
5012cf2c48044034775207ab7ee2c67d285276bb
2026-01-04T20:21:06.485960Z
false
BeechatNetworkSystemsLtd/Reticulum-rs
https://github.com/BeechatNetworkSystemsLtd/Reticulum-rs/blob/5012cf2c48044034775207ab7ee2c67d285276bb/src/transport/announce_table.rs
src/transport/announce_table.rs
use alloc::vec::Vec; use std::collections::HashMap; use tokio::time::{Duration, Instant}; use crate::hash::AddressHash; use crate::packet::{ DestinationType, Header, HeaderType, IfacFlag, Packet, PacketContext, PacketType, PropagationType }; pub struct AnnounceEntry { pub packet: Packet, pub timestamp...
rust
MIT
5012cf2c48044034775207ab7ee2c67d285276bb
2026-01-04T20:21:06.485960Z
false
BeechatNetworkSystemsLtd/Reticulum-rs
https://github.com/BeechatNetworkSystemsLtd/Reticulum-rs/blob/5012cf2c48044034775207ab7ee2c67d285276bb/src/transport/link_table.rs
src/transport/link_table.rs
use std::collections::HashMap; use tokio::time::{Duration, Instant}; use crate::destination::link::LinkId; use crate::hash::AddressHash; use crate::packet::{Header, HeaderType, IfacFlag, Packet}; pub struct LinkEntry { pub timestamp: Instant, pub proof_timeout: Instant, pub next_hop: AddressHash, pub ...
rust
MIT
5012cf2c48044034775207ab7ee2c67d285276bb
2026-01-04T20:21:06.485960Z
false
BeechatNetworkSystemsLtd/Reticulum-rs
https://github.com/BeechatNetworkSystemsLtd/Reticulum-rs/blob/5012cf2c48044034775207ab7ee2c67d285276bb/src/transport/announce_limits.rs
src/transport/announce_limits.rs
use alloc::collections::BTreeMap; use tokio::time::Duration; use tokio::time::Instant; use crate::hash::AddressHash; pub struct AnnounceRateLimit { pub target: Duration, pub grace: u32, pub penalty: Option<Duration> } impl Default for AnnounceRateLimit { fn default() -> Self { Self { t...
rust
MIT
5012cf2c48044034775207ab7ee2c67d285276bb
2026-01-04T20:21:06.485960Z
false
BeechatNetworkSystemsLtd/Reticulum-rs
https://github.com/BeechatNetworkSystemsLtd/Reticulum-rs/blob/5012cf2c48044034775207ab7ee2c67d285276bb/src/transport/path_table.rs
src/transport/path_table.rs
use std::{collections::HashMap, time::Instant}; use crate::{ hash::{AddressHash, Hash}, packet::{DestinationType, Header, HeaderType, IfacFlag, Packet, PacketType}, }; pub struct PathEntry { pub timestamp: Instant, pub received_from: AddressHash, pub hops: u8, pub iface: AddressHash, pub p...
rust
MIT
5012cf2c48044034775207ab7ee2c67d285276bb
2026-01-04T20:21:06.485960Z
false
BeechatNetworkSystemsLtd/Reticulum-rs
https://github.com/BeechatNetworkSystemsLtd/Reticulum-rs/blob/5012cf2c48044034775207ab7ee2c67d285276bb/src/transport/packet_cache.rs
src/transport/packet_cache.rs
use std::{ cmp::min, collections::HashMap, time::{Duration, Instant}, }; use crate::{hash::Hash, packet::Packet}; pub struct PacketTrack { pub time: Instant, pub min_hops: u8, } pub struct PacketCache { map: HashMap<Hash, PacketTrack>, remove_cache: Vec<Hash>, } impl PacketCache { pu...
rust
MIT
5012cf2c48044034775207ab7ee2c67d285276bb
2026-01-04T20:21:06.485960Z
false
BeechatNetworkSystemsLtd/Reticulum-rs
https://github.com/BeechatNetworkSystemsLtd/Reticulum-rs/blob/5012cf2c48044034775207ab7ee2c67d285276bb/src/iface/hdlc.rs
src/iface/hdlc.rs
use crate::{buffer::OutputBuffer, error::RnsError}; const HDLC_FRAME_FLAG: u8 = 0x7e; const HDLC_ESCAPE_BYTE: u8 = 0x7d; const HDLC_ESCAPE_MASK: u8 = 0b00100000; pub struct Hdlc {} impl Hdlc { pub fn encode(data: &[u8], buffer: &mut OutputBuffer) -> Result<usize, RnsError> { buffer.write_byte(HDLC_FRAME_...
rust
MIT
5012cf2c48044034775207ab7ee2c67d285276bb
2026-01-04T20:21:06.485960Z
false
BeechatNetworkSystemsLtd/Reticulum-rs
https://github.com/BeechatNetworkSystemsLtd/Reticulum-rs/blob/5012cf2c48044034775207ab7ee2c67d285276bb/src/iface/kaonic.rs
src/iface/kaonic.rs
use kaonic_grpc::proto::ConfigurationRequest; pub mod kaonic_grpc; pub const RADIO_FRAME_MAX_SIZE: usize = 2048usize; #[derive(Debug, PartialEq, Eq, Copy, Clone)] pub enum RadioModule { RadioA = 0x00, RadioB = 0x01, } pub type RadioConfig = ConfigurationRequest; impl RadioConfig { pub fn new_for_module...
rust
MIT
5012cf2c48044034775207ab7ee2c67d285276bb
2026-01-04T20:21:06.485960Z
false
BeechatNetworkSystemsLtd/Reticulum-rs
https://github.com/BeechatNetworkSystemsLtd/Reticulum-rs/blob/5012cf2c48044034775207ab7ee2c67d285276bb/src/iface/tcp_client.rs
src/iface/tcp_client.rs
use std::sync::Arc; use tokio::io::AsyncWriteExt; use tokio::net::TcpStream; use tokio_util::sync::CancellationToken; use crate::buffer::{InputBuffer, OutputBuffer}; use crate::error::RnsError; use crate::iface::RxMessage; use crate::packet::Packet; use crate::serde::Serialize; use tokio::io::AsyncReadExt; use allo...
rust
MIT
5012cf2c48044034775207ab7ee2c67d285276bb
2026-01-04T20:21:06.485960Z
false
BeechatNetworkSystemsLtd/Reticulum-rs
https://github.com/BeechatNetworkSystemsLtd/Reticulum-rs/blob/5012cf2c48044034775207ab7ee2c67d285276bb/src/iface/udp.rs
src/iface/udp.rs
use std::sync::Arc; use tokio::net::UdpSocket; use tokio_util::sync::CancellationToken; use crate::buffer::{InputBuffer, OutputBuffer}; use crate::error::RnsError; use crate::iface::RxMessage; use crate::packet::Packet; use crate::serde::Serialize; use super::{Interface, InterfaceContext}; // TODO: Configure via fe...
rust
MIT
5012cf2c48044034775207ab7ee2c67d285276bb
2026-01-04T20:21:06.485960Z
false
BeechatNetworkSystemsLtd/Reticulum-rs
https://github.com/BeechatNetworkSystemsLtd/Reticulum-rs/blob/5012cf2c48044034775207ab7ee2c67d285276bb/src/iface/tcp_server.rs
src/iface/tcp_server.rs
use alloc::string::String; use std::sync::Arc; use tokio::net::TcpListener; use crate::error::RnsError; use super::tcp_client::TcpClient; use super::{Interface, InterfaceContext, InterfaceManager}; pub struct TcpServer { addr: String, iface_manager: Arc<tokio::sync::Mutex<InterfaceManager>>, } impl TcpServ...
rust
MIT
5012cf2c48044034775207ab7ee2c67d285276bb
2026-01-04T20:21:06.485960Z
false
BeechatNetworkSystemsLtd/Reticulum-rs
https://github.com/BeechatNetworkSystemsLtd/Reticulum-rs/blob/5012cf2c48044034775207ab7ee2c67d285276bb/src/iface/kaonic/kaonic_grpc.rs
src/iface/kaonic/kaonic_grpc.rs
pub mod proto { tonic::include_proto!("kaonic"); } use std::sync::Arc; use std::time::Duration; use proto::device_client::DeviceClient; use proto::radio_client::RadioClient; use proto::RadioFrame; use tokio::sync::mpsc::Receiver; use tokio::sync::Mutex; use tokio_stream::StreamExt; use tokio_util::sync::Cancellat...
rust
MIT
5012cf2c48044034775207ab7ee2c67d285276bb
2026-01-04T20:21:06.485960Z
false
BeechatNetworkSystemsLtd/Reticulum-rs
https://github.com/BeechatNetworkSystemsLtd/Reticulum-rs/blob/5012cf2c48044034775207ab7ee2c67d285276bb/src/destination/link.rs
src/destination/link.rs
use std::{ cmp::min, time::{Duration, Instant}, }; use ed25519_dalek::{Signature, SigningKey, PUBLIC_KEY_LENGTH, SIGNATURE_LENGTH}; use rand_core::OsRng; use sha2::Digest; use x25519_dalek::StaticSecret; use crate::{ buffer::OutputBuffer, error::RnsError, hash::{AddressHash, Hash, ADDRESS_HASH_SIZ...
rust
MIT
5012cf2c48044034775207ab7ee2c67d285276bb
2026-01-04T20:21:06.485960Z
false
BeechatNetworkSystemsLtd/Reticulum-rs
https://github.com/BeechatNetworkSystemsLtd/Reticulum-rs/blob/5012cf2c48044034775207ab7ee2c67d285276bb/src/destination/link_map.rs
src/destination/link_map.rs
use std::collections::HashMap; use crate::hash::AddressHash; use super::link::LinkId; pub struct LinkMap { map: HashMap<AddressHash, LinkId>, } impl LinkMap { pub fn new() -> Self { Self { map: HashMap::new(), } } pub fn resolve(&self, address: &AddressHash) -> Option<Li...
rust
MIT
5012cf2c48044034775207ab7ee2c67d285276bb
2026-01-04T20:21:06.485960Z
false
BeechatNetworkSystemsLtd/Reticulum-rs
https://github.com/BeechatNetworkSystemsLtd/Reticulum-rs/blob/5012cf2c48044034775207ab7ee2c67d285276bb/tests/hop_test.rs
tests/hop_test.rs
use std::time::Duration; use rand_core::OsRng; use reticulum::{ destination::DestinationName, identity::PrivateIdentity, iface::{tcp_client::TcpClient, tcp_server::TcpServer}, transport::{Transport, TransportConfig}, }; use tokio::time; async fn build_transport(name: &str, server_addr: &str, client_ad...
rust
MIT
5012cf2c48044034775207ab7ee2c67d285276bb
2026-01-04T20:21:06.485960Z
false
BeechatNetworkSystemsLtd/Reticulum-rs
https://github.com/BeechatNetworkSystemsLtd/Reticulum-rs/blob/5012cf2c48044034775207ab7ee2c67d285276bb/tests/tcp_hdlc_test.rs
tests/tcp_hdlc_test.rs
use rand_core::OsRng; use reticulum::{ identity::PrivateIdentity, iface::{tcp_client::TcpClient, tcp_server::TcpServer}, packet::Packet, transport::{Transport, TransportConfig}, }; use tokio_util::sync::CancellationToken; async fn build_transport(name: &str, server_addr: &str, client_addr: &[&str]) -> ...
rust
MIT
5012cf2c48044034775207ab7ee2c67d285276bb
2026-01-04T20:21:06.485960Z
false
BeechatNetworkSystemsLtd/Reticulum-rs
https://github.com/BeechatNetworkSystemsLtd/Reticulum-rs/blob/5012cf2c48044034775207ab7ee2c67d285276bb/examples/kaonic_client.rs
examples/kaonic_client.rs
use std::env; use std::sync::Arc; use std::time::Duration; use rand_core::OsRng; use reticulum::destination::DestinationName; use reticulum::identity::PrivateIdentity; use reticulum::iface::kaonic::kaonic_grpc::KaonicGrpc; use reticulum::iface::kaonic::{RadioConfig, RadioModule}; use reticulum::transport::{Transport, ...
rust
MIT
5012cf2c48044034775207ab7ee2c67d285276bb
2026-01-04T20:21:06.485960Z
false
BeechatNetworkSystemsLtd/Reticulum-rs
https://github.com/BeechatNetworkSystemsLtd/Reticulum-rs/blob/5012cf2c48044034775207ab7ee2c67d285276bb/examples/kaonic_mesh.rs
examples/kaonic_mesh.rs
use std::sync::Arc; use reticulum::iface::kaonic::kaonic_grpc::KaonicGrpc; use reticulum::iface::kaonic::{RadioConfig, RadioModule}; use reticulum::transport::{Transport, TransportConfig}; use tokio::sync::Mutex; #[tokio::main] async fn main() { env_logger::Builder::from_env(env_logger::Env::default().default_fil...
rust
MIT
5012cf2c48044034775207ab7ee2c67d285276bb
2026-01-04T20:21:06.485960Z
false
BeechatNetworkSystemsLtd/Reticulum-rs
https://github.com/BeechatNetworkSystemsLtd/Reticulum-rs/blob/5012cf2c48044034775207ab7ee2c67d285276bb/examples/link_client.rs
examples/link_client.rs
use rand_core::OsRng; use reticulum::destination::link::LinkEvent; use reticulum::destination::{DestinationAnnounce, DestinationName}; use reticulum::identity::PrivateIdentity; use reticulum::iface::tcp_client::TcpClient; use reticulum::transport::{Transport, TransportConfig}; #[tokio::main] async fn main() { env...
rust
MIT
5012cf2c48044034775207ab7ee2c67d285276bb
2026-01-04T20:21:06.485960Z
false
BeechatNetworkSystemsLtd/Reticulum-rs
https://github.com/BeechatNetworkSystemsLtd/Reticulum-rs/blob/5012cf2c48044034775207ab7ee2c67d285276bb/examples/tcp_client.rs
examples/tcp_client.rs
use std::time::Duration; use rand_core::OsRng; use reticulum::destination::{DestinationName, SingleInputDestination}; use reticulum::identity::PrivateIdentity; use reticulum::iface::tcp_client::TcpClient; use reticulum::transport::{Transport, TransportConfig}; #[tokio::main] async fn main() { env_logger::Builder:...
rust
MIT
5012cf2c48044034775207ab7ee2c67d285276bb
2026-01-04T20:21:06.485960Z
false
BeechatNetworkSystemsLtd/Reticulum-rs
https://github.com/BeechatNetworkSystemsLtd/Reticulum-rs/blob/5012cf2c48044034775207ab7ee2c67d285276bb/examples/testnet_client.rs
examples/testnet_client.rs
use std::sync::Arc; use reticulum::iface::tcp_client::TcpClient; use reticulum::transport::{Transport, TransportConfig}; use tokio::select; use tokio::sync::Mutex; use tokio_util::sync::CancellationToken; #[tokio::main] async fn main() { env_logger::Builder::from_env(env_logger::Env::default().default_filter_or("...
rust
MIT
5012cf2c48044034775207ab7ee2c67d285276bb
2026-01-04T20:21:06.485960Z
false
BeechatNetworkSystemsLtd/Reticulum-rs
https://github.com/BeechatNetworkSystemsLtd/Reticulum-rs/blob/5012cf2c48044034775207ab7ee2c67d285276bb/examples/tcp_server.rs
examples/tcp_server.rs
use rand_core::OsRng; use reticulum::identity::PrivateIdentity; use reticulum::iface::tcp_server::TcpServer; use reticulum::transport::{Transport, TransportConfig}; #[tokio::main] async fn main() { env_logger::Builder::from_env(env_logger::Env::default().default_filter_or("trace")).init(); log::info!(">>> TCP...
rust
MIT
5012cf2c48044034775207ab7ee2c67d285276bb
2026-01-04T20:21:06.485960Z
false
BeechatNetworkSystemsLtd/Reticulum-rs
https://github.com/BeechatNetworkSystemsLtd/Reticulum-rs/blob/5012cf2c48044034775207ab7ee2c67d285276bb/examples/udp_link.rs
examples/udp_link.rs
//! To communicate with a local instance of Python RNS should use a config like: //! //! ```text //! [[UDP Interface]] //! type = UDPInterface //! enabled = yes //! listen_ip = 0.0.0.0 //! listen_port = 4242 //! forward_ip = 127.0.0.1 //! forward_port = 4243 //! ``` use std::collections::HashMap; use std::sync::Arc; u...
rust
MIT
5012cf2c48044034775207ab7ee2c67d285276bb
2026-01-04T20:21:06.485960Z
false
BeechatNetworkSystemsLtd/Reticulum-rs
https://github.com/BeechatNetworkSystemsLtd/Reticulum-rs/blob/5012cf2c48044034775207ab7ee2c67d285276bb/examples/kaonic_tcp_mesh.rs
examples/kaonic_tcp_mesh.rs
use std::env; use std::sync::Arc; use reticulum::iface::kaonic::kaonic_grpc::KaonicGrpc; use reticulum::iface::kaonic::{RadioConfig, RadioModule}; use reticulum::iface::tcp_client::TcpClient; use reticulum::transport::{Transport, TransportConfig}; use tokio::sync::Mutex; #[tokio::main] async fn main() { env_logge...
rust
MIT
5012cf2c48044034775207ab7ee2c67d285276bb
2026-01-04T20:21:06.485960Z
false
BeechatNetworkSystemsLtd/Reticulum-rs
https://github.com/BeechatNetworkSystemsLtd/Reticulum-rs/blob/5012cf2c48044034775207ab7ee2c67d285276bb/examples/multihop.rs
examples/multihop.rs
use std::env::args; use std::str::from_utf8; use tokio::io::AsyncBufReadExt; use rand_core::OsRng; use reticulum::destination::{DestinationName, SingleInputDestination}; use reticulum::destination::link::{LinkEvent, LinkStatus}; use reticulum::hash::AddressHash; use reticulum::identity::PrivateIdentity; use reticulu...
rust
MIT
5012cf2c48044034775207ab7ee2c67d285276bb
2026-01-04T20:21:06.485960Z
false
Mirror-Protocol/mirror-contracts
https://github.com/Mirror-Protocol/mirror-contracts/blob/56cc6946b9457293ede6aa0feb296ee1d16f6974/contracts/mirror_staking/src/contract.rs
contracts/mirror_staking/src/contract.rs
use crate::rewards::{adjust_premium, deposit_reward, query_reward_info, withdraw_reward}; use crate::staking::{ auto_stake, auto_stake_hook, bond, decrease_short_token, increase_short_token, unbond, }; use crate::state::{ read_config, read_pool_info, store_config, store_pool_info, Config, MigrationParams, PoolI...
rust
Apache-2.0
56cc6946b9457293ede6aa0feb296ee1d16f6974
2026-01-04T20:21:07.037869Z
false
Mirror-Protocol/mirror-contracts
https://github.com/Mirror-Protocol/mirror-contracts/blob/56cc6946b9457293ede6aa0feb296ee1d16f6974/contracts/mirror_staking/src/lib.rs
contracts/mirror_staking/src/lib.rs
pub mod contract; mod math; mod querier; mod rewards; mod staking; mod state; #[cfg(test)] mod testing;
rust
Apache-2.0
56cc6946b9457293ede6aa0feb296ee1d16f6974
2026-01-04T20:21:07.037869Z
false
Mirror-Protocol/mirror-contracts
https://github.com/Mirror-Protocol/mirror-contracts/blob/56cc6946b9457293ede6aa0feb296ee1d16f6974/contracts/mirror_staking/src/math.rs
contracts/mirror_staking/src/math.rs
use cosmwasm_std::{Decimal, Uint128}; const DECIMAL_FRACTIONAL: Uint128 = Uint128::new(1_000_000_000u128); /// return a / b pub fn decimal_division(a: Decimal, b: Decimal) -> Decimal { Decimal::from_ratio(DECIMAL_FRACTIONAL * a, b * DECIMAL_FRACTIONAL) } pub fn decimal_subtraction(a: Decimal, b: Decimal) -> Deci...
rust
Apache-2.0
56cc6946b9457293ede6aa0feb296ee1d16f6974
2026-01-04T20:21:07.037869Z
false
Mirror-Protocol/mirror-contracts
https://github.com/Mirror-Protocol/mirror-contracts/blob/56cc6946b9457293ede6aa0feb296ee1d16f6974/contracts/mirror_staking/src/state.rs
contracts/mirror_staking/src/state.rs
use schemars::JsonSchema; use serde::{Deserialize, Serialize}; use cosmwasm_std::{CanonicalAddr, Decimal, StdResult, Storage, Uint128}; use cosmwasm_storage::{singleton, singleton_read, Bucket, ReadonlyBucket}; pub static KEY_CONFIG: &[u8] = b"config"; pub static PREFIX_POOL_INFO: &[u8] = b"pool_info"; static PREFIX...
rust
Apache-2.0
56cc6946b9457293ede6aa0feb296ee1d16f6974
2026-01-04T20:21:07.037869Z
false
Mirror-Protocol/mirror-contracts
https://github.com/Mirror-Protocol/mirror-contracts/blob/56cc6946b9457293ede6aa0feb296ee1d16f6974/contracts/mirror_staking/src/staking.rs
contracts/mirror_staking/src/staking.rs
use cosmwasm_std::{ attr, to_binary, Addr, CanonicalAddr, Coin, CosmosMsg, Decimal, DepsMut, Env, MessageInfo, Response, StdError, StdResult, Storage, Uint128, WasmMsg, }; use crate::rewards::before_share_change; use crate::state::{ read_config, read_is_migrated, read_pool_info, rewards_read, rewards_store...
rust
Apache-2.0
56cc6946b9457293ede6aa0feb296ee1d16f6974
2026-01-04T20:21:07.037869Z
false
Mirror-Protocol/mirror-contracts
https://github.com/Mirror-Protocol/mirror-contracts/blob/56cc6946b9457293ede6aa0feb296ee1d16f6974/contracts/mirror_staking/src/querier.rs
contracts/mirror_staking/src/querier.rs
use crate::math::{decimal_division, decimal_subtraction}; use cosmwasm_std::{ to_binary, Addr, Decimal, Deps, QuerierWrapper, QueryRequest, StdResult, Uint128, WasmQuery, }; use mirror_protocol::short_reward::{QueryMsg as ShortRewardQueryMsg, ShortRewardWeightResponse}; use tefi_oracle::hub::{HubQueryMsg as OracleQ...
rust
Apache-2.0
56cc6946b9457293ede6aa0feb296ee1d16f6974
2026-01-04T20:21:07.037869Z
false
Mirror-Protocol/mirror-contracts
https://github.com/Mirror-Protocol/mirror-contracts/blob/56cc6946b9457293ede6aa0feb296ee1d16f6974/contracts/mirror_staking/src/rewards.rs
contracts/mirror_staking/src/rewards.rs
use cosmwasm_std::{ attr, to_binary, Addr, Api, CanonicalAddr, CosmosMsg, Decimal, Deps, DepsMut, Env, MessageInfo, Order, Response, StdError, StdResult, Storage, Uint128, WasmMsg, }; use crate::querier::{compute_premium_rate, compute_short_reward_weight}; use crate::state::{ read_config, read_is_migrated,...
rust
Apache-2.0
56cc6946b9457293ede6aa0feb296ee1d16f6974
2026-01-04T20:21:07.037869Z
false
Mirror-Protocol/mirror-contracts
https://github.com/Mirror-Protocol/mirror-contracts/blob/56cc6946b9457293ede6aa0feb296ee1d16f6974/contracts/mirror_staking/src/testing/deprecate_test.rs
contracts/mirror_staking/src/testing/deprecate_test.rs
use crate::contract::{execute, instantiate, query}; use crate::state::{read_pool_info, store_pool_info, PoolInfo}; use cosmwasm_std::testing::{mock_dependencies, mock_env, mock_info}; use cosmwasm_std::{ from_binary, to_binary, Api, CosmosMsg, Decimal, StdError, SubMsg, Uint128, WasmMsg, }; use cw20::{Cw20ExecuteMs...
rust
Apache-2.0
56cc6946b9457293ede6aa0feb296ee1d16f6974
2026-01-04T20:21:07.037869Z
false
Mirror-Protocol/mirror-contracts
https://github.com/Mirror-Protocol/mirror-contracts/blob/56cc6946b9457293ede6aa0feb296ee1d16f6974/contracts/mirror_staking/src/testing/staking_test.rs
contracts/mirror_staking/src/testing/staking_test.rs
use crate::contract::{execute, instantiate, query}; use crate::testing::mock_querier::mock_dependencies_with_querier; use cosmwasm_std::testing::{mock_dependencies, mock_env, mock_info, MOCK_CONTRACT_ADDR}; use cosmwasm_std::{ attr, from_binary, to_binary, Addr, Coin, CosmosMsg, Decimal, StdError, SubMsg, Uint128, ...
rust
Apache-2.0
56cc6946b9457293ede6aa0feb296ee1d16f6974
2026-01-04T20:21:07.037869Z
false
Mirror-Protocol/mirror-contracts
https://github.com/Mirror-Protocol/mirror-contracts/blob/56cc6946b9457293ede6aa0feb296ee1d16f6974/contracts/mirror_staking/src/testing/mock_querier.rs
contracts/mirror_staking/src/testing/mock_querier.rs
use cosmwasm_std::testing::{MockApi, MockQuerier, MockStorage, MOCK_CONTRACT_ADDR}; use cosmwasm_std::{ from_binary, from_slice, to_binary, Addr, Coin, ContractResult, Decimal, OwnedDeps, Querier, QuerierResult, QueryRequest, SystemError, SystemResult, Uint128, WasmQuery, }; use cosmwasm_storage::to_length_pref...
rust
Apache-2.0
56cc6946b9457293ede6aa0feb296ee1d16f6974
2026-01-04T20:21:07.037869Z
false
Mirror-Protocol/mirror-contracts
https://github.com/Mirror-Protocol/mirror-contracts/blob/56cc6946b9457293ede6aa0feb296ee1d16f6974/contracts/mirror_staking/src/testing/reward_test.rs
contracts/mirror_staking/src/testing/reward_test.rs
use crate::contract::{execute, instantiate, query}; use crate::state::{read_pool_info, rewards_read, store_pool_info, PoolInfo, RewardInfo}; use crate::testing::mock_querier::mock_dependencies_with_querier; use cosmwasm_std::testing::{mock_dependencies, mock_env, mock_info}; use cosmwasm_std::{ from_binary, to_bina...
rust
Apache-2.0
56cc6946b9457293ede6aa0feb296ee1d16f6974
2026-01-04T20:21:07.037869Z
false
Mirror-Protocol/mirror-contracts
https://github.com/Mirror-Protocol/mirror-contracts/blob/56cc6946b9457293ede6aa0feb296ee1d16f6974/contracts/mirror_staking/src/testing/mod.rs
contracts/mirror_staking/src/testing/mod.rs
mod contract_test; mod deprecate_test; mod mock_querier; mod reward_test; mod staking_test;
rust
Apache-2.0
56cc6946b9457293ede6aa0feb296ee1d16f6974
2026-01-04T20:21:07.037869Z
false
Mirror-Protocol/mirror-contracts
https://github.com/Mirror-Protocol/mirror-contracts/blob/56cc6946b9457293ede6aa0feb296ee1d16f6974/contracts/mirror_staking/src/testing/contract_test.rs
contracts/mirror_staking/src/testing/contract_test.rs
use crate::contract::{execute, instantiate, query}; use cosmwasm_std::testing::{mock_dependencies, mock_env, mock_info}; use cosmwasm_std::{attr, from_binary, Addr, Decimal, StdError, Uint128}; use mirror_protocol::staking::{ ConfigResponse, ExecuteMsg, InstantiateMsg, PoolInfoResponse, QueryMsg, }; #[test] fn pro...
rust
Apache-2.0
56cc6946b9457293ede6aa0feb296ee1d16f6974
2026-01-04T20:21:07.037869Z
false
Mirror-Protocol/mirror-contracts
https://github.com/Mirror-Protocol/mirror-contracts/blob/56cc6946b9457293ede6aa0feb296ee1d16f6974/contracts/mirror_staking/examples/schema.rs
contracts/mirror_staking/examples/schema.rs
use std::env::current_dir; use std::fs::create_dir_all; use cosmwasm_schema::{export_schema, remove_schemas, schema_for}; use mirror_protocol::staking::{ ConfigResponse, Cw20HookMsg, ExecuteMsg, InstantiateMsg, MigrateMsg, PoolInfoResponse, QueryMsg, RewardInfoResponse, }; fn main() { let mut out_dir = cu...
rust
Apache-2.0
56cc6946b9457293ede6aa0feb296ee1d16f6974
2026-01-04T20:21:07.037869Z
false
Mirror-Protocol/mirror-contracts
https://github.com/Mirror-Protocol/mirror-contracts/blob/56cc6946b9457293ede6aa0feb296ee1d16f6974/contracts/mirror_oracle/src/contract.rs
contracts/mirror_oracle/src/contract.rs
#[cfg(not(feature = "library"))] use cosmwasm_std::entry_point; use cosmwasm_std::{ attr, to_binary, Binary, Decimal, Deps, DepsMut, Env, MessageInfo, Response, StdError, StdResult, }; use crate::math::decimal_division; use crate::state::{ read_config, read_feeder, read_price, read_prices, store_config, s...
rust
Apache-2.0
56cc6946b9457293ede6aa0feb296ee1d16f6974
2026-01-04T20:21:07.037869Z
false
Mirror-Protocol/mirror-contracts
https://github.com/Mirror-Protocol/mirror-contracts/blob/56cc6946b9457293ede6aa0feb296ee1d16f6974/contracts/mirror_oracle/src/lib.rs
contracts/mirror_oracle/src/lib.rs
pub mod contract; pub mod math; pub mod state; #[cfg(test)] mod tests;
rust
Apache-2.0
56cc6946b9457293ede6aa0feb296ee1d16f6974
2026-01-04T20:21:07.037869Z
false
Mirror-Protocol/mirror-contracts
https://github.com/Mirror-Protocol/mirror-contracts/blob/56cc6946b9457293ede6aa0feb296ee1d16f6974/contracts/mirror_oracle/src/tests.rs
contracts/mirror_oracle/src/tests.rs
use crate::contract::{execute, instantiate, query}; use cosmwasm_std::testing::{mock_dependencies, mock_env, mock_info}; use cosmwasm_std::{from_binary, Decimal, StdError}; use mirror_protocol::common::OrderBy; use mirror_protocol::oracle::{ ConfigResponse, ExecuteMsg, FeederResponse, InstantiateMsg, PriceResponse,...
rust
Apache-2.0
56cc6946b9457293ede6aa0feb296ee1d16f6974
2026-01-04T20:21:07.037869Z
false
Mirror-Protocol/mirror-contracts
https://github.com/Mirror-Protocol/mirror-contracts/blob/56cc6946b9457293ede6aa0feb296ee1d16f6974/contracts/mirror_oracle/src/math.rs
contracts/mirror_oracle/src/math.rs
use cosmwasm_std::{Decimal, Uint128}; const DECIMAL_FRACTIONAL: Uint128 = Uint128::new(1_000_000_000u128); /// return a / b pub fn decimal_division(a: Decimal, b: Decimal) -> Decimal { Decimal::from_ratio(DECIMAL_FRACTIONAL * a, b * DECIMAL_FRACTIONAL) }
rust
Apache-2.0
56cc6946b9457293ede6aa0feb296ee1d16f6974
2026-01-04T20:21:07.037869Z
false
Mirror-Protocol/mirror-contracts
https://github.com/Mirror-Protocol/mirror-contracts/blob/56cc6946b9457293ede6aa0feb296ee1d16f6974/contracts/mirror_oracle/src/state.rs
contracts/mirror_oracle/src/state.rs
use schemars::JsonSchema; use serde::{Deserialize, Serialize}; use cosmwasm_std::{CanonicalAddr, Decimal, Deps, StdResult, Storage}; use cosmwasm_storage::{singleton, singleton_read, Bucket, ReadonlyBucket}; use mirror_protocol::common::OrderBy; use mirror_protocol::oracle::PricesResponseElem; static PREFIX_FEEDER: ...
rust
Apache-2.0
56cc6946b9457293ede6aa0feb296ee1d16f6974
2026-01-04T20:21:07.037869Z
false
Mirror-Protocol/mirror-contracts
https://github.com/Mirror-Protocol/mirror-contracts/blob/56cc6946b9457293ede6aa0feb296ee1d16f6974/contracts/mirror_oracle/examples/schema.rs
contracts/mirror_oracle/examples/schema.rs
use std::env::current_dir; use std::fs::create_dir_all; use cosmwasm_schema::{export_schema, remove_schemas, schema_for}; use mirror_protocol::oracle::{ ConfigResponse, ExecuteMsg, FeederResponse, InstantiateMsg, MigrateMsg, PriceResponse, PricesResponse, QueryMsg, }; fn main() { let mut out_dir = current...
rust
Apache-2.0
56cc6946b9457293ede6aa0feb296ee1d16f6974
2026-01-04T20:21:07.037869Z
false
Mirror-Protocol/mirror-contracts
https://github.com/Mirror-Protocol/mirror-contracts/blob/56cc6946b9457293ede6aa0feb296ee1d16f6974/contracts/mirror_factory/src/contract.rs
contracts/mirror_factory/src/contract.rs
#[cfg(not(feature = "library"))] use cosmwasm_std::entry_point; use cosmwasm_std::{ attr, to_binary, Addr, Attribute, Binary, CanonicalAddr, CosmosMsg, Decimal, Deps, DepsMut, Env, MessageInfo, Reply, ReplyOn, Response, StdError, StdResult, SubMsg, Uint128, WasmMsg, }; use crate::querier::{load_mint_asset_con...
rust
Apache-2.0
56cc6946b9457293ede6aa0feb296ee1d16f6974
2026-01-04T20:21:07.037869Z
false
Mirror-Protocol/mirror-contracts
https://github.com/Mirror-Protocol/mirror-contracts/blob/56cc6946b9457293ede6aa0feb296ee1d16f6974/contracts/mirror_factory/src/lib.rs
contracts/mirror_factory/src/lib.rs
pub mod contract; pub mod math; pub mod querier; mod response; pub mod state; #[cfg(test)] mod testing;
rust
Apache-2.0
56cc6946b9457293ede6aa0feb296ee1d16f6974
2026-01-04T20:21:07.037869Z
false
Mirror-Protocol/mirror-contracts
https://github.com/Mirror-Protocol/mirror-contracts/blob/56cc6946b9457293ede6aa0feb296ee1d16f6974/contracts/mirror_factory/src/response.rs
contracts/mirror_factory/src/response.rs
// This file is generated by rust-protobuf 2.23.0. Do not edit // @generated // https://github.com/rust-lang/rust-clippy/issues/702 #![allow(unknown_lints)] #![allow(clippy::all)] #![allow(unused_attributes)] #![cfg_attr(rustfmt, rustfmt::skip)] #![allow(box_pointers)] #![allow(dead_code)] #![allow(missing_docs)] #!...
rust
Apache-2.0
56cc6946b9457293ede6aa0feb296ee1d16f6974
2026-01-04T20:21:07.037869Z
false
Mirror-Protocol/mirror-contracts
https://github.com/Mirror-Protocol/mirror-contracts/blob/56cc6946b9457293ede6aa0feb296ee1d16f6974/contracts/mirror_factory/src/math.rs
contracts/mirror_factory/src/math.rs
use cosmwasm_std::{Decimal, Uint128}; const DECIMAL_FRACTIONAL: Uint128 = Uint128::new(1_000_000_000u128); pub fn reverse_decimal(decimal: Decimal) -> Decimal { Decimal::from_ratio(DECIMAL_FRACTIONAL, decimal * DECIMAL_FRACTIONAL) } pub fn decimal_multiplication(a: Decimal, b: Decimal) -> Decimal { Decimal::...
rust
Apache-2.0
56cc6946b9457293ede6aa0feb296ee1d16f6974
2026-01-04T20:21:07.037869Z
false
Mirror-Protocol/mirror-contracts
https://github.com/Mirror-Protocol/mirror-contracts/blob/56cc6946b9457293ede6aa0feb296ee1d16f6974/contracts/mirror_factory/src/state.rs
contracts/mirror_factory/src/state.rs
use schemars::JsonSchema; use serde::{Deserialize, Serialize}; use cosmwasm_std::{Addr, CanonicalAddr, Order, StdError, StdResult, Storage, Uint128}; use cosmwasm_storage::{singleton, singleton_read, Bucket, ReadonlyBucket, Singleton}; use mirror_protocol::factory::Params; static KEY_CONFIG: &[u8] = b"config"; stati...
rust
Apache-2.0
56cc6946b9457293ede6aa0feb296ee1d16f6974
2026-01-04T20:21:07.037869Z
false
Mirror-Protocol/mirror-contracts
https://github.com/Mirror-Protocol/mirror-contracts/blob/56cc6946b9457293ede6aa0feb296ee1d16f6974/contracts/mirror_factory/src/querier.rs
contracts/mirror_factory/src/querier.rs
use cosmwasm_std::{ to_binary, Addr, Binary, CanonicalAddr, Decimal, QuerierWrapper, QueryRequest, StdError, StdResult, WasmQuery, }; use cosmwasm_storage::to_length_prefixed; use mirror_protocol::mint::IPOParams; use serde::{Deserialize, Serialize}; use tefi_oracle::hub::{HubQueryMsg as OracleQueryMsg, PriceR...
rust
Apache-2.0
56cc6946b9457293ede6aa0feb296ee1d16f6974
2026-01-04T20:21:07.037869Z
false
Mirror-Protocol/mirror-contracts
https://github.com/Mirror-Protocol/mirror-contracts/blob/56cc6946b9457293ede6aa0feb296ee1d16f6974/contracts/mirror_factory/src/testing/tests.rs
contracts/mirror_factory/src/testing/tests.rs
use crate::contract::{execute, instantiate, query, reply}; use crate::response::MsgInstantiateContractResponse; use crate::testing::mock_querier::{mock_dependencies, WasmMockQuerier}; use crate::state::{ read_tmp_asset, read_tmp_whitelist_info, read_total_weight, read_weight, store_total_weight, store_weight, ...
rust
Apache-2.0
56cc6946b9457293ede6aa0feb296ee1d16f6974
2026-01-04T20:21:07.037869Z
true