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 |
|---|---|---|---|---|---|---|---|---|
biandratti/huginn-net | https://github.com/biandratti/huginn-net/blob/ef479d3357bc040b4dcdacffbb4ab8db07051f1b/huginn-net-http/tests/http2_fingerprint_extractor.rs | huginn-net-http/tests/http2_fingerprint_extractor.rs | use huginn_net_http::http2_fingerprint_extractor::Http2FingerprintExtractor;
use huginn_net_http::http2_parser::{Http2ParseError, HTTP2_CONNECTION_PREFACE};
/// Helper function to create an HTTP/2 frame
///
/// Creates a valid HTTP/2 frame with the specified type, stream ID, and payload.
/// Frame format: [length:24][... | rust | Apache-2.0 | ef479d3357bc040b4dcdacffbb4ab8db07051f1b | 2026-01-04T20:21:12.648216Z | false |
biandratti/huginn-net | https://github.com/biandratti/huginn-net/blob/ef479d3357bc040b4dcdacffbb4ab8db07051f1b/huginn-net-http/tests/packet_parser.rs | huginn-net-http/tests/packet_parser.rs | use huginn_net_http::packet_parser::{
detect_datalink_format, parse_packet, DatalinkFormat, IpPacket,
};
use pnet::packet::Packet;
#[test]
fn test_detect_null_datalink() {
// NULL datalink: 4-byte header + IPv6 packet
let null_packet = vec![
0x1e, 0x00, 0x00, 0x00, // NULL header
0x60, 0x00... | rust | Apache-2.0 | ef479d3357bc040b4dcdacffbb4ab8db07051f1b | 2026-01-04T20:21:12.648216Z | false |
wiomoc/whatsappweb-rs | https://github.com/wiomoc/whatsappweb-rs/blob/dacf1ef4d9879c3ca2346620ebd94ed449bab654/build.rs | build.rs | extern crate protobuf_codegen_pure;
fn main() {
protobuf_codegen_pure::run(protobuf_codegen_pure::Args {
out_dir: "src",
input: &["proto/message_wire.proto"],
includes: &["proto"],
customize: protobuf_codegen_pure::Customize {
..Default::default()
}
}).expec... | rust | MIT | dacf1ef4d9879c3ca2346620ebd94ed449bab654 | 2026-01-04T20:21:21.071998Z | false |
wiomoc/whatsappweb-rs | https://github.com/wiomoc/whatsappweb-rs/blob/dacf1ef4d9879c3ca2346620ebd94ed449bab654/src/errors.rs | src/errors.rs | use std::io;
use ws;
use ring;
#[cfg(feature = "media")]
use reqwest;
use json;
use base64;
use protobuf;
error_chain! {
foreign_links {
Io(io::Error);
Websocket(ws::Error);
Crypto(ring::error::Unspecified);
Reqwest(reqwest::Error) #[cfg(feature = "media")];
... | rust | MIT | dacf1ef4d9879c3ca2346620ebd94ed449bab654 | 2026-01-04T20:21:21.071998Z | false |
wiomoc/whatsappweb-rs | https://github.com/wiomoc/whatsappweb-rs/blob/dacf1ef4d9879c3ca2346620ebd94ed449bab654/src/lib.rs | src/lib.rs | extern crate ws;
extern crate simple_logger;
#[macro_use]
extern crate log;
extern crate url;
#[macro_use]
extern crate json;
extern crate ring;
extern crate base64;
extern crate qrcode;
extern crate image;
extern crate untrusted;
#[macro_use]
extern crate serde_derive;
extern crate bincode;
extern crate protobuf;
exte... | rust | MIT | dacf1ef4d9879c3ca2346620ebd94ed449bab654 | 2026-01-04T20:21:21.071998Z | false |
wiomoc/whatsappweb-rs | https://github.com/wiomoc/whatsappweb-rs/blob/dacf1ef4d9879c3ca2346620ebd94ed449bab654/src/timeout.rs | src/timeout.rs | #![allow(deprecated)]
use std::time::{SystemTime, UNIX_EPOCH};
use ws::Sender;
use ws::util::{Token, Timeout};
pub const RESPONSE_TIMEOUT: TimeoutWindow = TimeoutWindow { min: 3000, max: 5500 };
pub const PING_TIMEOUT: TimeoutWindow = TimeoutWindow { min: 12000, max: 16000 };
#[derive(Copy, Clone)]
pub struct Timeout... | rust | MIT | dacf1ef4d9879c3ca2346620ebd94ed449bab654 | 2026-01-04T20:21:21.071998Z | false |
wiomoc/whatsappweb-rs | https://github.com/wiomoc/whatsappweb-rs/blob/dacf1ef4d9879c3ca2346620ebd94ed449bab654/src/node_protocol.rs | src/node_protocol.rs | use std::collections::HashMap;
use Contact;
use Jid;
use Chat;
use ChatAction;
use PresenceStatus;
use GroupParticipantsChange;
use node_wire::{Node, NodeContent, IntoCow};
use message::{ChatMessage, MessageAck, MessageAckLevel, Peer, MessageId};
use errors::*;
#[derive(Debug, Copy, Clone, PartialEq)]
pub enum Messag... | rust | MIT | dacf1ef4d9879c3ca2346620ebd94ed449bab654 | 2026-01-04T20:21:21.071998Z | false |
wiomoc/whatsappweb-rs | https://github.com/wiomoc/whatsappweb-rs/blob/dacf1ef4d9879c3ca2346620ebd94ed449bab654/src/media.rs | src/media.rs | extern crate base64;
extern crate json;
extern crate image;
use std::io::Cursor;
use std::thread;
use std::sync::Arc;
use json_protocol::JsonNonNull;
use image::{GenericImage, RGB};
use image::jpeg::JPEGEncoder;
use reqwest;
use MediaType;
use crypto;
use message::FileInfo;
use connection::{WhatsappWebConnection, Wh... | rust | MIT | dacf1ef4d9879c3ca2346620ebd94ed449bab654 | 2026-01-04T20:21:21.071998Z | false |
wiomoc/whatsappweb-rs | https://github.com/wiomoc/whatsappweb-rs/blob/dacf1ef4d9879c3ca2346620ebd94ed449bab654/src/websocket_protocol.rs | src/websocket_protocol.rs | use std::str;
use std::borrow::Cow;
use std::borrow::Borrow;
use std::ops::Deref;
use ws::Message;
use json;
use json::JsonValue;
#[derive(Copy, Clone, PartialEq)]
#[allow(dead_code)]
pub enum WebsocketMessageMetric {
None = 0,
DebugLog = 1,
QueryResume = 2,
QueryReceipt = 3,
QueryMedia = 4,
Q... | rust | MIT | dacf1ef4d9879c3ca2346620ebd94ed449bab654 | 2026-01-04T20:21:21.071998Z | false |
wiomoc/whatsappweb-rs | https://github.com/wiomoc/whatsappweb-rs/blob/dacf1ef4d9879c3ca2346620ebd94ed449bab654/src/connection.rs | src/connection.rs | use std::sync::Mutex;
use std::collections::HashMap;
use std::thread;
use std::thread::JoinHandle;
use std::marker::Send;
use std::sync::Arc;
use std::clone::Clone;
use std::ops::Deref;
use ws;
use ws::{CloseCode, Handler, Request, Sender, Message};
use ring::agreement;
use ring::rand::{SystemRandom, SecureRandom};
us... | rust | MIT | dacf1ef4d9879c3ca2346620ebd94ed449bab654 | 2026-01-04T20:21:21.071998Z | true |
wiomoc/whatsappweb-rs | https://github.com/wiomoc/whatsappweb-rs/blob/dacf1ef4d9879c3ca2346620ebd94ed449bab654/src/node_wire.rs | src/node_wire.rs | use std::collections::HashMap;
use std::io::{Read, Write, Cursor};
use std::char;
use std::borrow::Cow;
use std::ops::Deref;
use byteorder::{BigEndian, ReadBytesExt, WriteBytesExt};
use Jid;
use errors::*;
const LIST_EMPTY: u8 = 0;
#[allow(dead_code)]
const STREAM_END: u8 = 2;
const DICTIONARY_0: u8 = 236;
const DIC... | rust | MIT | dacf1ef4d9879c3ca2346620ebd94ed449bab654 | 2026-01-04T20:21:21.071998Z | false |
wiomoc/whatsappweb-rs | https://github.com/wiomoc/whatsappweb-rs/blob/dacf1ef4d9879c3ca2346620ebd94ed449bab654/src/json_protocol.rs | src/json_protocol.rs | use std::str::FromStr;
use json::JsonValue;
use base64;
use super::{Jid, PresenceStatus, GroupMetadata, GroupParticipantsChange, MediaType};
use message::MessageAckLevel;
use errors::*;
#[derive(Debug)]
pub enum ServerMessage<'a> {
ConnectionAck { user_jid: Jid, client_token: &'a str, server_token: &'a str, sec... | rust | MIT | dacf1ef4d9879c3ca2346620ebd94ed449bab654 | 2026-01-04T20:21:21.071998Z | false |
wiomoc/whatsappweb-rs | https://github.com/wiomoc/whatsappweb-rs/blob/dacf1ef4d9879c3ca2346620ebd94ed449bab654/src/crypto.rs | src/crypto.rs | extern crate crypto;
use ring;
use ring::{agreement, rand, hkdf, hmac, digest};
use ring::rand::{SystemRandom, SecureRandom};
use self::crypto::{aes, blockmodes};
use self::crypto::buffer::{RefWriteBuffer, RefReadBuffer, WriteBuffer};
use untrusted;
use MediaType;
use errors::*;
pub(crate) fn generate_keypair() -> (... | rust | MIT | dacf1ef4d9879c3ca2346620ebd94ed449bab654 | 2026-01-04T20:21:21.071998Z | false |
wiomoc/whatsappweb-rs | https://github.com/wiomoc/whatsappweb-rs/blob/dacf1ef4d9879c3ca2346620ebd94ed449bab654/src/message.rs | src/message.rs | use std::time::Duration;
use std::str::FromStr;
use protobuf;
use chrono::NaiveDateTime;
use protobuf::Message;
use ring::rand::{SystemRandom, SecureRandom};
use super::message_wire;
use super::Jid;
use errors::*;
#[derive(Debug, Clone, PartialOrd, PartialEq)]
pub struct MessageId(pub String);
impl MessageId {
... | rust | MIT | dacf1ef4d9879c3ca2346620ebd94ed449bab654 | 2026-01-04T20:21:21.071998Z | false |
wiomoc/whatsappweb-rs | https://github.com/wiomoc/whatsappweb-rs/blob/dacf1ef4d9879c3ca2346620ebd94ed449bab654/examples/presence.rs | examples/presence.rs | extern crate simple_logger;
#[macro_use]
extern crate log;
extern crate qrcode;
extern crate image;
extern crate bincode;
extern crate whatsappweb;
extern crate reqwest;
extern crate base64;
use std::fs::{File, OpenOptions};
use image::Luma;
use whatsappweb::connection;
use whatsappweb::connection::{DisconnectReason... | rust | MIT | dacf1ef4d9879c3ca2346620ebd94ed449bab654 | 2026-01-04T20:21:21.071998Z | false |
wiomoc/whatsappweb-rs | https://github.com/wiomoc/whatsappweb-rs/blob/dacf1ef4d9879c3ca2346620ebd94ed449bab654/examples/media.rs | examples/media.rs | extern crate simple_logger;
#[macro_use]
extern crate log;
extern crate qrcode;
extern crate image;
extern crate bincode;
extern crate whatsappweb;
extern crate reqwest;
extern crate base64;
use std::fs::{File, OpenOptions, remove_file};
use std::io::Read;
use std::sync::Arc;
use image::Luma;
use whatsappweb::connec... | rust | MIT | dacf1ef4d9879c3ca2346620ebd94ed449bab654 | 2026-01-04T20:21:21.071998Z | false |
wiomoc/whatsappweb-rs | https://github.com/wiomoc/whatsappweb-rs/blob/dacf1ef4d9879c3ca2346620ebd94ed449bab654/examples/echo.rs | examples/echo.rs | extern crate simple_logger;
#[macro_use]
extern crate log;
extern crate qrcode;
extern crate image;
extern crate bincode;
extern crate whatsappweb;
extern crate reqwest;
extern crate base64;
use std::fs::{File, OpenOptions, remove_file};
use std::io::{Read, Write, Cursor};
use std::sync::{RwLock, Arc};
use std::str::F... | rust | MIT | dacf1ef4d9879c3ca2346620ebd94ed449bab654 | 2026-01-04T20:21:21.071998Z | false |
STRRL/dejavu | https://github.com/STRRL/dejavu/blob/7c1d1870e0fc4a5bca9863b97d95584814dcb2ea/src/markup.rs | src/markup.rs | use crate::ocr::MarkupBox;
use colorsys::{Hsl, Rgb};
use image::{DynamicImage, GenericImage};
use imageproc::rect::Rect;
fn safe_put_pixel(
origin_image: &mut DynamicImage,
x: u32,
y: u32,
color: image::Rgba<u8>,
) -> anyhow::Result<()> {
if x < origin_image.width() && y < origin_image.height() {
... | rust | MIT | 7c1d1870e0fc4a5bca9863b97d95584814dcb2ea | 2026-01-04T20:21:29.042566Z | false |
STRRL/dejavu | https://github.com/STRRL/dejavu/blob/7c1d1870e0fc4a5bca9863b97d95584814dcb2ea/src/analysis.rs | src/analysis.rs | use std::sync::Arc;
use anyhow::Result;
use itertools::Itertools;
use serde::{Deserialize, Serialize};
use crate::{
image_archive::{ImageArchiver},
ocr::{CharacterRecognizer, RecognizeItem},
repository::{EntityImage, EntityText, Repository},
screenshot::Screenshot,
};
pub struct Analysis {
ocr: A... | rust | MIT | 7c1d1870e0fc4a5bca9863b97d95584814dcb2ea | 2026-01-04T20:21:29.042566Z | false |
STRRL/dejavu | https://github.com/STRRL/dejavu/blob/7c1d1870e0fc4a5bca9863b97d95584814dcb2ea/src/ocr.rs | src/ocr.rs | use anyhow::Ok;
use async_trait::async_trait;
#[derive(Debug, Clone)]
pub struct RecognizeItem {
pub text: String,
pub markup: MarkupBox,
pub level: u32,
}
impl RecognizeItem {
pub fn new(text: String, markup: MarkupBox, level: u32) -> Self {
Self {
text,
markup,
... | rust | MIT | 7c1d1870e0fc4a5bca9863b97d95584814dcb2ea | 2026-01-04T20:21:29.042566Z | false |
STRRL/dejavu | https://github.com/STRRL/dejavu/blob/7c1d1870e0fc4a5bca9863b97d95584814dcb2ea/src/screenshot.rs | src/screenshot.rs | use std::sync::{Arc, Mutex};
use anyhow::anyhow;
use async_trait::async_trait;
use image::DynamicImage;
use screenshots::{Image, Screen};
#[async_trait]
pub trait Capturer {
/// Capture the contents of all the screens, returning a vector of images.
async fn capture(&self) -> anyhow::Result<Vec<Screenshot>>;
... | rust | MIT | 7c1d1870e0fc4a5bca9863b97d95584814dcb2ea | 2026-01-04T20:21:29.042566Z | false |
STRRL/dejavu | https://github.com/STRRL/dejavu/blob/7c1d1870e0fc4a5bca9863b97d95584814dcb2ea/src/main.rs | src/main.rs |
use anyhow::Ok;
use anyhow::Result;
use axum::extract::MatchedPath;
use axum::http::Request;
use axum::routing::get;
use axum::{Extension, Router};
use crate::screenshot::Capturer;
use tokio::task::JoinHandle;
use core::panic;
use markup::ImageMarkupDecorator;
use sqlx_sqlite::SqlitePoolOptions;
use std::sync::Arc;
u... | rust | MIT | 7c1d1870e0fc4a5bca9863b97d95584814dcb2ea | 2026-01-04T20:21:29.042566Z | false |
STRRL/dejavu | https://github.com/STRRL/dejavu/blob/7c1d1870e0fc4a5bca9863b97d95584814dcb2ea/src/repository/sqlite.rs | src/repository/sqlite.rs | use super::{EntityImage, EntityText, Repository};
use anyhow::Result;
use async_trait::async_trait;
use futures::TryStreamExt;
use sqlx::Row;
pub struct SqliteRepository {
pool: sqlx::Pool<sqlx_sqlite::Sqlite>,
}
impl SqliteRepository {
pub fn new(pool: sqlx::Pool<sqlx_sqlite::Sqlite>) -> Self {
Self ... | rust | MIT | 7c1d1870e0fc4a5bca9863b97d95584814dcb2ea | 2026-01-04T20:21:29.042566Z | false |
STRRL/dejavu | https://github.com/STRRL/dejavu/blob/7c1d1870e0fc4a5bca9863b97d95584814dcb2ea/src/repository/mod.rs | src/repository/mod.rs | use async_trait::async_trait;
use serde::{Deserialize, Serialize};
pub mod in_memory;
pub mod sqlite;
#[derive(Debug, Clone)]
pub struct EntityImage {
pub id: u32,
pub archive_type: String,
pub archive_info: String,
pub captured_at_epoch: u64,
}
impl EntityImage {
pub fn new(
id: u32,
... | rust | MIT | 7c1d1870e0fc4a5bca9863b97d95584814dcb2ea | 2026-01-04T20:21:29.042566Z | false |
STRRL/dejavu | https://github.com/STRRL/dejavu/blob/7c1d1870e0fc4a5bca9863b97d95584814dcb2ea/src/repository/in_memory.rs | src/repository/in_memory.rs | #[cfg(feature = "in-memory")]
use {async_trait::async_trait, tokio::sync::Mutex, super::{EntityImage, EntityText, Repository}};
#[cfg(feature = "in-memory")]
pub struct InMemoryRepository {
images: Mutex<Vec<EntityImage>>,
texts: Mutex<Vec<EntityText>>,
}
#[cfg(feature = "in-memory")]
impl InMemoryRepository ... | rust | MIT | 7c1d1870e0fc4a5bca9863b97d95584814dcb2ea | 2026-01-04T20:21:29.042566Z | false |
STRRL/dejavu | https://github.com/STRRL/dejavu/blob/7c1d1870e0fc4a5bca9863b97d95584814dcb2ea/src/image_archive/fs.rs | src/image_archive/fs.rs | use async_trait::async_trait;
use std::io::Cursor;
use crate::screenshot::Screenshot;
use super::{ImageArchive, ImageArchiver};
pub struct FileSystemImageArchiver {
storage_path: String,
}
impl FileSystemImageArchiver {
pub fn new(storage_path: String) -> Self {
Self { storage_path }
}
}
#[async_... | rust | MIT | 7c1d1870e0fc4a5bca9863b97d95584814dcb2ea | 2026-01-04T20:21:29.042566Z | false |
STRRL/dejavu | https://github.com/STRRL/dejavu/blob/7c1d1870e0fc4a5bca9863b97d95584814dcb2ea/src/image_archive/mod.rs | src/image_archive/mod.rs | use async_trait::async_trait;
use crate::screenshot::Screenshot;
pub mod fs;
pub mod in_memory;
pub struct ImageArchive {
pub archive_type: String,
pub archive_detail: String,
}
impl ImageArchive {
pub fn new(archive_type: String, archive_detail: String) -> Self { Self { archive_type, archive_detail } }... | rust | MIT | 7c1d1870e0fc4a5bca9863b97d95584814dcb2ea | 2026-01-04T20:21:29.042566Z | false |
STRRL/dejavu | https://github.com/STRRL/dejavu/blob/7c1d1870e0fc4a5bca9863b97d95584814dcb2ea/src/image_archive/in_memory.rs | src/image_archive/in_memory.rs | #[cfg(feature = "in-memory")]
use {
super::{ImageArchive, ImageArchiver},
crate::screenshot::Screenshot,
async_trait::async_trait,
std::collections::HashMap,
tokio::sync::Mutex,
uuid::Uuid,
};
#[cfg(feature = "in-memory")]
pub struct InMemoryImageArchiver {
// storage: HashMap<UUID, image::... | rust | MIT | 7c1d1870e0fc4a5bca9863b97d95584814dcb2ea | 2026-01-04T20:21:29.042566Z | false |
STRRL/dejavu | https://github.com/STRRL/dejavu/blob/7c1d1870e0fc4a5bca9863b97d95584814dcb2ea/src/http/error.rs | src/http/error.rs | use axum::{
http::StatusCode,
response::{IntoResponse, Response},
};
pub struct HttpError(anyhow::Error);
impl IntoResponse for HttpError {
fn into_response(self) -> Response {
(
StatusCode::INTERNAL_SERVER_ERROR,
format!("Something went wrong: {}", self.0),
)
... | rust | MIT | 7c1d1870e0fc4a5bca9863b97d95584814dcb2ea | 2026-01-04T20:21:29.042566Z | false |
STRRL/dejavu | https://github.com/STRRL/dejavu/blob/7c1d1870e0fc4a5bca9863b97d95584814dcb2ea/src/http/service.rs | src/http/service.rs | use std::sync::Arc;
use image::DynamicImage;
use crate::{
analysis::{Analysis, SearchResult},
http::error::HttpError,
image_archive::{ImageArchive, ImageArchiver},
markup::ImageMarkupDecorator,
ocr::MarkupBox,
repository::Repository,
};
/// Adhoc service layer for web server
pub struct Servic... | rust | MIT | 7c1d1870e0fc4a5bca9863b97d95584814dcb2ea | 2026-01-04T20:21:29.042566Z | false |
STRRL/dejavu | https://github.com/STRRL/dejavu/blob/7c1d1870e0fc4a5bca9863b97d95584814dcb2ea/src/http/mod.rs | src/http/mod.rs | use self::{error::HttpError, service::Service};
use crate::analysis::SearchResult;
use axum::{extract::Query, http::header, response::IntoResponse, Extension, Json};
use image::{ImageOutputFormat};
use serde::{Deserialize, Serialize};
use std::sync::Arc;
pub mod error;
pub mod service;
pub mod frontend;
#[derive(Deseri... | rust | MIT | 7c1d1870e0fc4a5bca9863b97d95584814dcb2ea | 2026-01-04T20:21:29.042566Z | false |
STRRL/dejavu | https://github.com/STRRL/dejavu/blob/7c1d1870e0fc4a5bca9863b97d95584814dcb2ea/src/http/frontend.rs | src/http/frontend.rs | use axum::{
http::{header, StatusCode, Uri},
response::{Html, IntoResponse, Response},
};
use rust_embed::RustEmbed;
#[derive(RustEmbed)]
#[folder = "webui/out/"]
struct Assets;
static INDEX_HTML: &str = "index.html";
pub async fn static_handler(uri: Uri) -> impl IntoResponse {
let path = uri.path().trim_... | rust | MIT | 7c1d1870e0fc4a5bca9863b97d95584814dcb2ea | 2026-01-04T20:21:29.042566Z | false |
ardaku/pasts | https://github.com/ardaku/pasts/blob/948494403c9a96d7d8ac59ac838cbc4fbb390b9f/src/park.rs | src/park.rs | use crate::os::{Os, Target};
/// Trait for implementing the parking / unparking threads.
pub trait Park: Default + Send + Sync + 'static {
/// The park routine; should put the processor or thread to sleep in order
/// to save CPU cycles and power, until the hardware tells it to wake up.
fn park(&self);
... | rust | Apache-2.0 | 948494403c9a96d7d8ac59ac838cbc4fbb390b9f | 2026-01-04T20:21:29.518692Z | false |
ardaku/pasts | https://github.com/ardaku/pasts/blob/948494403c9a96d7d8ac59ac838cbc4fbb390b9f/src/lib.rs | src/lib.rs | //! **Minimal asynchronous runtime for Rust**
//!
//! # Optional Features
//! Only the _`std`_ feature is enabled by default
//!
//! - Disable _`std`_ to use pasts without the standard library.
//! - Enable _`web`_ to use pasts within the javascript DOM.
//!
//! # Getting Started
//!
//! Add the following to your **`... | rust | Apache-2.0 | 948494403c9a96d7d8ac59ac838cbc4fbb390b9f | 2026-01-04T20:21:29.518692Z | false |
ardaku/pasts | https://github.com/ardaku/pasts/blob/948494403c9a96d7d8ac59ac838cbc4fbb390b9f/src/future.rs | src/future.rs | use alloc::boxed::Box;
use core::pin::Pin;
/// An owned dynamically typed [`Future`] for use in cases where you can’t
/// statically type your result or need to add some indirection.
pub type BoxFuture<'a, T = ()> = Pin<Box<dyn Future<Output = T> + Send + 'a>>;
/// [`BoxFuture`] without the [`Send`] requirement.
pub ... | rust | Apache-2.0 | 948494403c9a96d7d8ac59ac838cbc4fbb390b9f | 2026-01-04T20:21:29.518692Z | false |
ardaku/pasts | https://github.com/ardaku/pasts/blob/948494403c9a96d7d8ac59ac838cbc4fbb390b9f/src/os.rs | src/os.rs | // Daku
#[cfg_attr(all(target_arch = "wasm32", daku), path = "os/daku.rs")]
// Std
#[cfg_attr(
all(
feature = "std",
not(all(target_arch = "wasm32", any(daku, feature = "web")))
),
path = "os/std.rs"
)]
// Web
#[cfg_attr(all(target_arch = "wasm32", feature = "web"), path = "os/web.rs")]
mod ... | rust | Apache-2.0 | 948494403c9a96d7d8ac59ac838cbc4fbb390b9f | 2026-01-04T20:21:29.518692Z | false |
ardaku/pasts | https://github.com/ardaku/pasts/blob/948494403c9a96d7d8ac59ac838cbc4fbb390b9f/src/executor.rs | src/executor.rs | use alloc::sync::Arc;
use core::fmt;
use crate::{
LocalBoxFuture,
os::{Os, Target},
pool::{DefaultPool, Pool},
};
/// Pasts' executor.
///
/// # Run a Future
///
/// It's relatively simple to block on a future, and run it to completion:
///
/// ```rust
#[doc = include_str!("../examples/executor.rs")]
/// ... | rust | Apache-2.0 | 948494403c9a96d7d8ac59ac838cbc4fbb390b9f | 2026-01-04T20:21:29.518692Z | false |
ardaku/pasts | https://github.com/ardaku/pasts/blob/948494403c9a96d7d8ac59ac838cbc4fbb390b9f/src/pool.rs | src/pool.rs | use alloc::vec::Vec;
use core::{cell::Cell, fmt};
use crate::{LocalBoxFuture, Park, park::DefaultPark};
/// Storage for a task pool.
///
/// # Implementing `Pool` For A Custom Executor
///
/// This example shows how to create a custom single-threaded executor using
/// [`Executor::new()`](crate::Executor::new).
///
/... | rust | Apache-2.0 | 948494403c9a96d7d8ac59ac838cbc4fbb390b9f | 2026-01-04T20:21:29.518692Z | false |
ardaku/pasts | https://github.com/ardaku/pasts/blob/948494403c9a96d7d8ac59ac838cbc4fbb390b9f/src/os/daku.rs | src/os/daku.rs | use super::{Os, Target};
#[derive(Debug, Default)]
pub(crate) struct ParkCx;
impl Target for Os {
type ParkCx = ParkCx;
}
| rust | Apache-2.0 | 948494403c9a96d7d8ac59ac838cbc4fbb390b9f | 2026-01-04T20:21:29.518692Z | false |
ardaku/pasts | https://github.com/ardaku/pasts/blob/948494403c9a96d7d8ac59ac838cbc4fbb390b9f/src/os/target.rs | src/os/target.rs | //! Unknown target, fake implementation.
//!
//! This can be used as a template when adding new target support.
use super::{Os, Target};
/// Default parking implementation doesn't need any state
#[derive(Debug, Default)]
pub(crate) struct ParkCx;
impl Target for Os {
type ParkCx = ParkCx;
}
| rust | Apache-2.0 | 948494403c9a96d7d8ac59ac838cbc4fbb390b9f | 2026-01-04T20:21:29.518692Z | false |
ardaku/pasts | https://github.com/ardaku/pasts/blob/948494403c9a96d7d8ac59ac838cbc4fbb390b9f/src/os/web.rs | src/os/web.rs | use super::{Os, Target};
use crate::{LocalBoxFuture, Pool};
#[derive(Debug, Default)]
pub(crate) struct ParkCx;
impl Target for Os {
type ParkCx = ParkCx;
#[inline(always)]
fn park(self, _park_cx: &Self::ParkCx) {
// Spin loop hints aren't useful on the web since nothing blocks, so do
// ... | rust | Apache-2.0 | 948494403c9a96d7d8ac59ac838cbc4fbb390b9f | 2026-01-04T20:21:29.518692Z | false |
ardaku/pasts | https://github.com/ardaku/pasts/blob/948494403c9a96d7d8ac59ac838cbc4fbb390b9f/src/os/std.rs | src/os/std.rs | use std::{
sync::atomic::{AtomicBool, Ordering},
thread::{self, Thread},
};
use super::{Os, Target};
#[derive(Debug)]
pub(crate) struct ParkCx {
is_parked: AtomicBool,
thread: Thread,
}
impl Default for ParkCx {
fn default() -> Self {
Self {
is_parked: AtomicBool::new(true),
... | rust | Apache-2.0 | 948494403c9a96d7d8ac59ac838cbc4fbb390b9f | 2026-01-04T20:21:29.518692Z | false |
ardaku/pasts | https://github.com/ardaku/pasts/blob/948494403c9a96d7d8ac59ac838cbc4fbb390b9f/tests/spawn.rs | tests/spawn.rs | use pasts::Executor;
use whisk::Channel;
#[test]
fn spawn_inside_block_on() {
let executor = Executor::default();
let channel = Channel::new();
let sender = channel.clone();
executor.clone().block_on(async move {
executor.spawn_boxed(async move {
sender.send(0xDEADBEEFu32).await;
... | rust | Apache-2.0 | 948494403c9a96d7d8ac59ac838cbc4fbb390b9f | 2026-01-04T20:21:29.518692Z | false |
ardaku/pasts | https://github.com/ardaku/pasts/blob/948494403c9a96d7d8ac59ac838cbc4fbb390b9f/docs/src/main.rs | docs/src/main.rs | use std::fs;
fn main() -> std::io::Result<()> {
fs::remove_dir_all("./gen-docs/")?;
fs::create_dir_all("./gen-docs/")?;
fs::copy("./examples/counter/build.rs", "./gen-docs/build.rs")?;
fs::copy("./examples/counter/src/main.rs", "./gen-docs/counter.rs")?;
fs::copy("./examples/spawn.rs", "./gen-docs/... | rust | Apache-2.0 | 948494403c9a96d7d8ac59ac838cbc4fbb390b9f | 2026-01-04T20:21:29.518692Z | false |
ardaku/pasts | https://github.com/ardaku/pasts/blob/948494403c9a96d7d8ac59ac838cbc4fbb390b9f/examples/spawn.rs | examples/spawn.rs | use core::time::Duration;
use pasts::Executor;
async fn sleep(seconds: f64) {
async_std::task::sleep(Duration::from_secs_f64(seconds)).await;
}
fn main() {
let executor = Executor::default();
// Spawn before blocking puts the task on a queue.
executor.spawn_boxed(async {
sleep(3.0).await;
... | rust | Apache-2.0 | 948494403c9a96d7d8ac59ac838cbc4fbb390b9f | 2026-01-04T20:21:29.518692Z | false |
ardaku/pasts | https://github.com/ardaku/pasts/blob/948494403c9a96d7d8ac59ac838cbc4fbb390b9f/examples/timer.rs | examples/timer.rs | use core::time::Duration;
use async_std::task;
fn main() {
pasts::Executor::default().block_on(async {
println!("Waiting 2 seconds…");
task::sleep(Duration::new(2, 0)).await;
println!("Waited 2 seconds.");
});
}
| rust | Apache-2.0 | 948494403c9a96d7d8ac59ac838cbc4fbb390b9f | 2026-01-04T20:21:29.518692Z | false |
ardaku/pasts | https://github.com/ardaku/pasts/blob/948494403c9a96d7d8ac59ac838cbc4fbb390b9f/examples/executor.rs | examples/executor.rs | use pasts::Executor;
fn main() {
Executor::default().block_on(async {
println!("Hello from a future!");
});
}
| rust | Apache-2.0 | 948494403c9a96d7d8ac59ac838cbc4fbb390b9f | 2026-01-04T20:21:29.518692Z | false |
ardaku/pasts | https://github.com/ardaku/pasts/blob/948494403c9a96d7d8ac59ac838cbc4fbb390b9f/examples/recursive.rs | examples/recursive.rs | use pasts::Executor;
fn main() {
Executor::default().block_on(async {
Executor::default().block_on(async {
println!("Hello from the future running on the inner executor!");
});
println!("Hello from the future running on the outer executor!");
});
}
| rust | Apache-2.0 | 948494403c9a96d7d8ac59ac838cbc4fbb390b9f | 2026-01-04T20:21:29.518692Z | false |
ardaku/pasts | https://github.com/ardaku/pasts/blob/948494403c9a96d7d8ac59ac838cbc4fbb390b9f/examples/resume.rs | examples/resume.rs | use pasts::Executor;
fn main() {
let executor = Executor::default();
executor.clone().block_on(async move {
println!("Hello from a future!");
executor.block_on(async {
println!("Resuming execution from within the executor context!");
});
});
}
| rust | Apache-2.0 | 948494403c9a96d7d8ac59ac838cbc4fbb390b9f | 2026-01-04T20:21:29.518692Z | false |
ardaku/pasts | https://github.com/ardaku/pasts/blob/948494403c9a96d7d8ac59ac838cbc4fbb390b9f/examples/pool.rs | examples/pool.rs | use std::{
cell::Cell,
thread::{self, Thread},
};
use pasts::{Executor, LocalBoxFuture, Park, Pool};
#[derive(Default)]
struct SingleThreadedPool {
spawning_queue: Cell<Vec<LocalBoxFuture<'static>>>,
}
impl Pool for SingleThreadedPool {
type Park = ThreadPark;
fn push(&self, task: LocalBoxFuture... | rust | Apache-2.0 | 948494403c9a96d7d8ac59ac838cbc4fbb390b9f | 2026-01-04T20:21:29.518692Z | false |
ardaku/pasts | https://github.com/ardaku/pasts/blob/948494403c9a96d7d8ac59ac838cbc4fbb390b9f/examples/no-std/src/main.rs | examples/no-std/src/main.rs | //! Use pasts on no-std, specifically targeting x86_64-unknown-linux-gnu (may
//! work on others). Requires nightly for `eh_personality` lang item (tested
//! with `rustc 1.72.0-nightly (871b59520 2023-05-31)`).
//!
//! ```shell
//!
//! cargo... | rust | Apache-2.0 | 948494403c9a96d7d8ac59ac838cbc4fbb390b9f | 2026-01-04T20:21:29.518692Z | false |
XDSEC/WebSocketReflectorX | https://github.com/XDSEC/WebSocketReflectorX/blob/144a9fc01c1e65192b331753d26d043f147f0ecb/crates/wsrx/src/lib.rs | crates/wsrx/src/lib.rs | //! WebSocket Reflector X
//!
//! A simple crate that proxies pure TCP connections to WebSocket connections
//! and vice versa.
pub mod proxy;
#[cfg(feature = "client")]
pub mod utils;
#[cfg(feature = "client")]
pub mod tunnel;
pub use proxy::{Error, Message, WrappedWsStream, proxy};
| rust | MIT | 144a9fc01c1e65192b331753d26d043f147f0ecb | 2026-01-04T20:21:00.884028Z | false |
XDSEC/WebSocketReflectorX | https://github.com/XDSEC/WebSocketReflectorX/blob/144a9fc01c1e65192b331753d26d043f147f0ecb/crates/wsrx/src/utils.rs | crates/wsrx/src/utils.rs | use std::net::ToSocketAddrs;
use axum::http::StatusCode;
use tokio::net::TcpListener;
#[cfg(feature = "log")]
use tracing::error;
/// Creates a TCP listener on the specified local address.
///
/// @param local The local address to bind the TCP listener to.
///
/// @returns A `Result` containing the `TcpListener` if s... | rust | MIT | 144a9fc01c1e65192b331753d26d043f147f0ecb | 2026-01-04T20:21:00.884028Z | false |
XDSEC/WebSocketReflectorX | https://github.com/XDSEC/WebSocketReflectorX/blob/144a9fc01c1e65192b331753d26d043f147f0ecb/crates/wsrx/src/main.rs | crates/wsrx/src/main.rs | use std::process;
use clap::Parser;
use rustls::crypto;
use tracing::{error, info, warn};
#[cfg(feature = "client")]
mod cli;
/// wsrx is a controlled WS-TCP tunnel for CTF platforms like ret2shell, GZCTF and CDSCTF etc..
#[derive(Parser)]
#[command(name = "wsrx", bin_name = "wsrx", version, about)]
enum WsrxCli {
... | rust | MIT | 144a9fc01c1e65192b331753d26d043f147f0ecb | 2026-01-04T20:21:00.884028Z | false |
XDSEC/WebSocketReflectorX | https://github.com/XDSEC/WebSocketReflectorX/blob/144a9fc01c1e65192b331753d26d043f147f0ecb/crates/wsrx/src/proxy.rs | crates/wsrx/src/proxy.rs | //! The main proxy module for WebSocket Reflector X.
use std::{
pin::Pin,
task::{Context, Poll},
};
#[cfg(feature = "server")]
use axum::extract::ws::{Message as AxMessage, WebSocket};
use futures_util::{StreamExt, sink::Sink, stream::Stream};
use thiserror::Error;
use tokio::net::TcpStream;
#[cfg(feature = "... | rust | MIT | 144a9fc01c1e65192b331753d26d043f147f0ecb | 2026-01-04T20:21:00.884028Z | false |
XDSEC/WebSocketReflectorX | https://github.com/XDSEC/WebSocketReflectorX/blob/144a9fc01c1e65192b331753d26d043f147f0ecb/crates/wsrx/src/tunnel.rs | crates/wsrx/src/tunnel.rs | use std::sync::Arc;
use serde::{Deserialize, Serialize};
use tokio::{net::TcpListener, task::JoinHandle};
use tokio_util::sync::CancellationToken;
use tracing::{error, info};
use super::proxy;
/// Configuration for a tunnel, contains the local and remote addresses.
#[derive(Debug, Clone, Serialize, Deserialize)]
pub... | rust | MIT | 144a9fc01c1e65192b331753d26d043f147f0ecb | 2026-01-04T20:21:00.884028Z | false |
XDSEC/WebSocketReflectorX | https://github.com/XDSEC/WebSocketReflectorX/blob/144a9fc01c1e65192b331753d26d043f147f0ecb/crates/wsrx/src/cli/serve.rs | crates/wsrx/src/cli/serve.rs | use std::{collections::HashMap, sync::Arc, time::Duration};
use axum::{
body::Body,
extract::{FromRef, Path, Request as ExtractRequest, State, WebSocketUpgrade},
http::{Request, StatusCode, header::CONTENT_TYPE},
middleware::Next,
response::{IntoResponse, Response},
routing::get,
};
use serde::... | rust | MIT | 144a9fc01c1e65192b331753d26d043f147f0ecb | 2026-01-04T20:21:00.884028Z | false |
XDSEC/WebSocketReflectorX | https://github.com/XDSEC/WebSocketReflectorX/blob/144a9fc01c1e65192b331753d26d043f147f0ecb/crates/wsrx/src/cli/logger.rs | crates/wsrx/src/cli/logger.rs | use tracing_subscriber::{layer::SubscriberExt, util::SubscriberInitExt};
/// Initialize the logger.
pub fn init_logger(json: bool) {
if json {
tracing_subscriber::registry()
.with(
tracing_subscriber::EnvFilter::try_from_default_env()
.unwrap_or_else(|_| "wsr... | rust | MIT | 144a9fc01c1e65192b331753d26d043f147f0ecb | 2026-01-04T20:21:00.884028Z | false |
XDSEC/WebSocketReflectorX | https://github.com/XDSEC/WebSocketReflectorX/blob/144a9fc01c1e65192b331753d26d043f147f0ecb/crates/wsrx/src/cli/connect.rs | crates/wsrx/src/cli/connect.rs | use std::sync::Arc;
use tokio::net::{TcpListener, TcpStream};
use tokio_util::sync::CancellationToken;
use tracing::{debug, error, info, warn};
use url::Url;
use wsrx::proxy;
use crate::cli::logger::init_logger;
pub async fn launch(
address: String, host: Option<String>, port: Option<u16>, log_json: Option<bool>... | rust | MIT | 144a9fc01c1e65192b331753d26d043f147f0ecb | 2026-01-04T20:21:00.884028Z | false |
XDSEC/WebSocketReflectorX | https://github.com/XDSEC/WebSocketReflectorX/blob/144a9fc01c1e65192b331753d26d043f147f0ecb/crates/wsrx/src/cli/mod.rs | crates/wsrx/src/cli/mod.rs | pub mod connect;
pub mod daemon;
pub mod logger;
pub mod serve;
| rust | MIT | 144a9fc01c1e65192b331753d26d043f147f0ecb | 2026-01-04T20:21:00.884028Z | false |
XDSEC/WebSocketReflectorX | https://github.com/XDSEC/WebSocketReflectorX/blob/144a9fc01c1e65192b331753d26d043f147f0ecb/crates/wsrx/src/cli/daemon.rs | crates/wsrx/src/cli/daemon.rs | use std::{
collections::HashMap,
ops::Deref,
sync::{Arc, RwLock as SyncRwLock},
time::Duration,
};
use axum::{
Json,
body::Body,
extract::{FromRef, Request as ExtractRequest, State},
http::{HeaderMap, HeaderValue, Method, Request, StatusCode, header::CONTENT_TYPE},
middleware::Next,... | rust | MIT | 144a9fc01c1e65192b331753d26d043f147f0ecb | 2026-01-04T20:21:00.884028Z | false |
XDSEC/WebSocketReflectorX | https://github.com/XDSEC/WebSocketReflectorX/blob/144a9fc01c1e65192b331753d26d043f147f0ecb/crates/desktop/build.rs | crates/desktop/build.rs | use std::{env, fs, path::Path};
fn main() {
let config = slint_build::CompilerConfiguration::new()
.with_bundled_translations("ui/i18n")
.embed_resources(slint_build::EmbedResourcesKind::EmbedFiles);
slint_build::compile_with_config("ui/main.slint", config).expect("Slint build failed");
pr... | rust | MIT | 144a9fc01c1e65192b331753d26d043f147f0ecb | 2026-01-04T20:21:00.884028Z | false |
XDSEC/WebSocketReflectorX | https://github.com/XDSEC/WebSocketReflectorX/blob/144a9fc01c1e65192b331753d26d043f147f0ecb/crates/desktop/src/lib.rs | crates/desktop/src/lib.rs | pub mod bridges;
pub mod daemon;
pub mod launcher;
pub mod logging;
include!(concat!(env!("OUT_DIR"), "/constants.rs"));
pub mod ui {
slint::include_modules!();
}
| rust | MIT | 144a9fc01c1e65192b331753d26d043f147f0ecb | 2026-01-04T20:21:00.884028Z | false |
XDSEC/WebSocketReflectorX | https://github.com/XDSEC/WebSocketReflectorX/blob/144a9fc01c1e65192b331753d26d043f147f0ecb/crates/desktop/src/main.rs | crates/desktop/src/main.rs | // Prevent console window in addition to Slint window in Windows release builds
// when, e.g., starting the app via file manager. Ignored on other platforms.
#![cfg_attr(not(debug_assertions), windows_subsystem = "windows")]
use std::error::Error;
use slint::ComponentHandle;
use wsrx_desktop::{launcher, logging};
fn... | rust | MIT | 144a9fc01c1e65192b331753d26d043f147f0ecb | 2026-01-04T20:21:00.884028Z | false |
XDSEC/WebSocketReflectorX | https://github.com/XDSEC/WebSocketReflectorX/blob/144a9fc01c1e65192b331753d26d043f147f0ecb/crates/desktop/src/logging.rs | crates/desktop/src/logging.rs | use directories::ProjectDirs;
use tracing_appender::{non_blocking, rolling};
use tracing_subscriber::{EnvFilter, fmt::Layer, layer::SubscriberExt, util::SubscriberInitExt};
/// Initialize the logger.
pub fn setup()
-> Result<(non_blocking::WorkerGuard, non_blocking::WorkerGuard), Box<dyn std::error::Error>> {
let ... | rust | MIT | 144a9fc01c1e65192b331753d26d043f147f0ecb | 2026-01-04T20:21:00.884028Z | false |
XDSEC/WebSocketReflectorX | https://github.com/XDSEC/WebSocketReflectorX/blob/144a9fc01c1e65192b331753d26d043f147f0ecb/crates/desktop/src/launcher.rs | crates/desktop/src/launcher.rs | use async_compat::Compat;
use directories::ProjectDirs;
use slint::PlatformError;
use tracing::info;
use crate::{bridges, daemon, ui::MainWindow};
pub fn setup() -> Result<MainWindow, PlatformError> {
let proj_dirs = match ProjectDirs::from("org", "xdsec", "wsrx") {
Some(dirs) => dirs,
None => {
... | rust | MIT | 144a9fc01c1e65192b331753d26d043f147f0ecb | 2026-01-04T20:21:00.884028Z | false |
XDSEC/WebSocketReflectorX | https://github.com/XDSEC/WebSocketReflectorX/blob/144a9fc01c1e65192b331753d26d043f147f0ecb/crates/desktop/src/bridges/settings.rs | crates/desktop/src/bridges/settings.rs | use directories::ProjectDirs;
use serde::{Deserialize, Serialize};
use slint::ComponentHandle;
use tracing::{debug, error, warn};
use crate::ui::{MainWindow, SettingsBridge};
#[derive(Clone, Debug, Serialize, Deserialize)]
pub struct WsrxDesktopConfig {
#[serde(default = "default_theme")]
pub theme: String,
... | rust | MIT | 144a9fc01c1e65192b331753d26d043f147f0ecb | 2026-01-04T20:21:00.884028Z | false |
XDSEC/WebSocketReflectorX | https://github.com/XDSEC/WebSocketReflectorX/blob/144a9fc01c1e65192b331753d26d043f147f0ecb/crates/desktop/src/bridges/ui_state.rs | crates/desktop/src/bridges/ui_state.rs | use slint::{ComponentHandle, Model, SharedString, VecModel};
use tracing::debug;
use crate::ui::{Instance, InstanceBridge, MainWindow, Scope, ScopeBridge, UiState};
pub fn setup(window: &MainWindow) {
let bridge = window.global::<UiState>();
let window_weak = window.as_weak();
bridge.on_change_scope(move... | rust | MIT | 144a9fc01c1e65192b331753d26d043f147f0ecb | 2026-01-04T20:21:00.884028Z | false |
XDSEC/WebSocketReflectorX | https://github.com/XDSEC/WebSocketReflectorX/blob/144a9fc01c1e65192b331753d26d043f147f0ecb/crates/desktop/src/bridges/mod.rs | crates/desktop/src/bridges/mod.rs | pub mod settings;
pub mod system_info;
pub mod ui_state;
pub mod window_control;
use crate::ui::MainWindow;
pub fn setup(window: &MainWindow) {
window_control::setup(window);
system_info::setup(window);
ui_state::setup(window);
}
| rust | MIT | 144a9fc01c1e65192b331753d26d043f147f0ecb | 2026-01-04T20:21:00.884028Z | false |
XDSEC/WebSocketReflectorX | https://github.com/XDSEC/WebSocketReflectorX/blob/144a9fc01c1e65192b331753d26d043f147f0ecb/crates/desktop/src/bridges/system_info.rs | crates/desktop/src/bridges/system_info.rs | use std::rc::Rc;
use async_compat::Compat;
use chrono::{DateTime, Utc};
use directories::ProjectDirs;
use local_ip_address::list_afinet_netifas;
use serde::Deserialize;
use slint::{ComponentHandle, Model, ModelRc, SharedString, VecModel};
use sysinfo::System;
use tokio::{fs, io::AsyncBufReadExt, time::timeout};
use tr... | rust | MIT | 144a9fc01c1e65192b331753d26d043f147f0ecb | 2026-01-04T20:21:00.884028Z | false |
XDSEC/WebSocketReflectorX | https://github.com/XDSEC/WebSocketReflectorX/blob/144a9fc01c1e65192b331753d26d043f147f0ecb/crates/desktop/src/bridges/window_control.rs | crates/desktop/src/bridges/window_control.rs | use std::collections::HashMap;
use i_slint_backend_winit::{EventResult, WinitWindowAccessor};
use slint::ComponentHandle;
use winit::window::ResizeDirection;
use crate::{
launcher,
ui::{MainWindow, WindowControlBridge},
};
pub fn setup(window: &MainWindow) {
let mut resize_map = HashMap::new();
resiz... | rust | MIT | 144a9fc01c1e65192b331753d26d043f147f0ecb | 2026-01-04T20:21:00.884028Z | false |
XDSEC/WebSocketReflectorX | https://github.com/XDSEC/WebSocketReflectorX/blob/144a9fc01c1e65192b331753d26d043f147f0ecb/crates/desktop/src/daemon/api_controller.rs | crates/desktop/src/daemon/api_controller.rs | use std::time::Duration;
use axum::{
Json,
body::Body,
extract::{FromRequest, Request, State},
http::{HeaderMap, Method, StatusCode},
response::{IntoResponse, Response},
routing::{get, post},
};
use i_slint_backend_winit::WinitWindowAccessor;
use serde::{Deserialize, Serialize};
use slint::{Com... | rust | MIT | 144a9fc01c1e65192b331753d26d043f147f0ecb | 2026-01-04T20:21:00.884028Z | false |
XDSEC/WebSocketReflectorX | https://github.com/XDSEC/WebSocketReflectorX/blob/144a9fc01c1e65192b331753d26d043f147f0ecb/crates/desktop/src/daemon/ui_controller.rs | crates/desktop/src/daemon/ui_controller.rs | use slint::{ComponentHandle, Model, ToSharedString, VecModel};
use tracing::{debug, info, warn};
use wsrx::utils::create_tcp_listener;
use super::latency_worker::update_instance_latency;
use crate::{
bridges::ui_state::sync_scoped_instance,
daemon::{
default_label,
latency_worker::update_instan... | rust | MIT | 144a9fc01c1e65192b331753d26d043f147f0ecb | 2026-01-04T20:21:00.884028Z | false |
XDSEC/WebSocketReflectorX | https://github.com/XDSEC/WebSocketReflectorX/blob/144a9fc01c1e65192b331753d26d043f147f0ecb/crates/desktop/src/daemon/latency_worker.rs | crates/desktop/src/daemon/latency_worker.rs | use reqwest::Method;
use slint::{ComponentHandle, Model, VecModel};
use thiserror::Error;
use tracing::{debug, warn};
use super::{
model::{FeatureFlags, InstanceData, ServerState},
ui_controller::on_instance_del,
};
use crate::{
bridges::ui_state::sync_scoped_instance,
ui::{Instance, InstanceBridge},
}... | rust | MIT | 144a9fc01c1e65192b331753d26d043f147f0ecb | 2026-01-04T20:21:00.884028Z | false |
XDSEC/WebSocketReflectorX | https://github.com/XDSEC/WebSocketReflectorX/blob/144a9fc01c1e65192b331753d26d043f147f0ecb/crates/desktop/src/daemon/model.rs | crates/desktop/src/daemon/model.rs | use std::{collections::HashMap, fmt::Display, sync::Arc};
use bitflags::bitflags;
use serde::{Deserialize, Serialize};
use serde_json::Value;
use tokio::{net::TcpListener, sync::RwLock};
use wsrx::tunnel::Tunnel;
use super::default_label;
use crate::ui::{Instance, MainWindow};
#[derive(Debug, Clone, Serialize, Deser... | rust | MIT | 144a9fc01c1e65192b331753d26d043f147f0ecb | 2026-01-04T20:21:00.884028Z | false |
XDSEC/WebSocketReflectorX | https://github.com/XDSEC/WebSocketReflectorX/blob/144a9fc01c1e65192b331753d26d043f147f0ecb/crates/desktop/src/daemon/mod.rs | crates/desktop/src/daemon/mod.rs | use std::{process, rc::Rc, sync::Arc};
use api_controller::router;
use directories::ProjectDirs;
use model::{ScopeData, ServerState};
use serde::{Deserialize, Serialize};
use slint::{ComponentHandle, Model, ToSharedString, VecModel};
use tokio::{net::TcpListener, sync::RwLock};
use tracing::{debug, error, info, warn};... | rust | MIT | 144a9fc01c1e65192b331753d26d043f147f0ecb | 2026-01-04T20:21:00.884028Z | false |
tbillington/rust_serverless_runtime | https://github.com/tbillington/rust_serverless_runtime/blob/98eea1e4408a296b263982ce1f10eb25ad119857/src/main.rs | src/main.rs | use std::{
collections::HashMap,
sync::{Arc, Mutex},
};
use axum::{
async_trait,
extract::{FromRequestParts, Path, State},
http::{request::Parts, StatusCode},
response::IntoResponse,
routing::get,
Router,
};
use deno_core::{
error::{AnyError, JsError},
op, serde_json, serde_v8, ... | rust | MIT | 98eea1e4408a296b263982ce1f10eb25ad119857 | 2026-01-04T20:21:36.565387Z | false |
frostsnap/frostsnap | https://github.com/frostsnap/frostsnap/blob/961deb080a81c754f402aaea24286bd141178e9d/device/src/stack_guard.rs | device/src/stack_guard.rs | #![allow(dead_code)]
use esp_hal::{
assist_debug::DebugAssist, macros::handler, peripherals::ASSIST_DEBUG,
InterruptConfigurable as _,
};
extern "C" {
static _stack_start: u32;
static _stack_end: u32;
}
pub fn enable_stack_guard(assist_debug: &mut ASSIST_DEBUG) {
let mut da = DebugAssist::new(assi... | rust | MIT | 961deb080a81c754f402aaea24286bd141178e9d | 2026-01-04T20:21:09.467677Z | false |
frostsnap/frostsnap | https://github.com/frostsnap/frostsnap/blob/961deb080a81c754f402aaea24286bd141178e9d/device/src/flash.rs | device/src/flash.rs | mod header;
pub use header::*;
// mod share;
// pub use share::*;
mod log;
pub use log::*;
mod genuine_certificate;
pub use genuine_certificate::*;
| rust | MIT | 961deb080a81c754f402aaea24286bd141178e9d | 2026-01-04T20:21:09.467677Z | false |
frostsnap/frostsnap | https://github.com/frostsnap/frostsnap/blob/961deb080a81c754f402aaea24286bd141178e9d/device/src/uart_interrupt.rs | device/src/uart_interrupt.rs | use core::cell::RefCell;
/// UART interrupt handling module
use critical_section::Mutex;
use esp_hal::macros::{handler, ram};
use esp_hal::uart::{self, AnyUart, Uart, UartInterrupt};
use esp_hal::{Blocking, InterruptConfigurable};
use heapless::spsc::{Consumer, Producer, Queue};
use nb;
/// Queue capacity for UART rec... | rust | MIT | 961deb080a81c754f402aaea24286bd141178e9d | 2026-01-04T20:21:09.467677Z | false |
frostsnap/frostsnap | https://github.com/frostsnap/frostsnap/blob/961deb080a81c754f402aaea24286bd141178e9d/device/src/partitions.rs | device/src/partitions.rs | use crate::ota::OtaPartitions;
use core::cell::RefCell;
use embedded_storage::nor_flash::NorFlash;
use esp_hal::sha::Sha;
use esp_storage::FlashStorage;
use frostsnap_comms::firmware_reader::FirmwareSizeError;
use frostsnap_comms::Sha256Digest;
use frostsnap_embedded::FlashPartition;
pub type EspFlashPartition<'a> = F... | rust | MIT | 961deb080a81c754f402aaea24286bd141178e9d | 2026-01-04T20:21:09.467677Z | false |
frostsnap/frostsnap | https://github.com/frostsnap/frostsnap/blob/961deb080a81c754f402aaea24286bd141178e9d/device/src/screen_test.rs | device/src/screen_test.rs | use alloc::rc::Rc;
use core::cell::RefCell;
use embedded_graphics::prelude::*;
use esp_hal::timer::Timer;
use frostsnap_cst816s::interrupt::TouchReceiver;
use frostsnap_widgets::{
palette::PALETTE, DynWidget, Instant as WidgetInstant, ScreenTest, SuperDrawTarget, Widget,
};
use crate::touch_calibration::adjust_tou... | rust | MIT | 961deb080a81c754f402aaea24286bd141178e9d | 2026-01-04T20:21:09.467677Z | false |
frostsnap/frostsnap | https://github.com/frostsnap/frostsnap/blob/961deb080a81c754f402aaea24286bd141178e9d/device/src/lib.rs | device/src/lib.rs | #![no_std]
use alloc::{collections::VecDeque, string::ToString};
use frostsnap_comms::{DeviceSendBody, DeviceSendMessage, WireDeviceSendBody};
use frostsnap_core::DeviceId;
use ui::UserInteraction;
#[macro_use]
extern crate alloc;
/// Display refresh frequency in milliseconds (25ms = 40 FPS)
pub const DISPLAY_REFRES... | rust | MIT | 961deb080a81c754f402aaea24286bd141178e9d | 2026-01-04T20:21:09.467677Z | false |
frostsnap/frostsnap | https://github.com/frostsnap/frostsnap/blob/961deb080a81c754f402aaea24286bd141178e9d/device/src/root_widget.rs | device/src/root_widget.rs | use crate::widget_tree::WidgetTree;
use embedded_graphics::{
draw_target::DrawTarget,
geometry::{Point, Size},
pixelcolor::Rgb565,
};
use frostsnap_widgets::{DynWidget, FadeSwitcher, Widget};
/// Root widget that contains the main widget tree
pub struct RootWidget {
pub page_switcher: FadeSwitcher<Widg... | rust | MIT | 961deb080a81c754f402aaea24286bd141178e9d | 2026-01-04T20:21:09.467677Z | false |
frostsnap/frostsnap | https://github.com/frostsnap/frostsnap/blob/961deb080a81c754f402aaea24286bd141178e9d/device/src/efuse.rs | device/src/efuse.rs | use alloc::rc::Rc;
use alloc::vec::Vec;
use core::cell::RefCell;
use esp_hal::efuse::{self as hal_efuse, Efuse};
use esp_hal::peripherals::EFUSE;
use frostsnap_core::AccessStructureRef;
use rand_chacha::rand_core::RngCore;
use rand_core::SeedableRng;
use reed_solomon;
// See table Table 4.3-1 and Table 4.3-2 from esp3... | rust | MIT | 961deb080a81c754f402aaea24286bd141178e9d | 2026-01-04T20:21:09.467677Z | false |
frostsnap/frostsnap | https://github.com/frostsnap/frostsnap/blob/961deb080a81c754f402aaea24286bd141178e9d/device/src/device_config.rs | device/src/device_config.rs | // Set to false if we are debugging on UART0
pub const SILENCE_PRINTS: bool = true;
#[macro_export]
macro_rules! println {
($($arg:tt)*) => {
{
if !$crate::device_config::SILENCE_PRINTS {
esp_println::println!($($arg)*);
}
}
}
}
| rust | MIT | 961deb080a81c754f402aaea24286bd141178e9d | 2026-01-04T20:21:09.467677Z | false |
frostsnap/frostsnap | https://github.com/frostsnap/frostsnap/blob/961deb080a81c754f402aaea24286bd141178e9d/device/src/io.rs | device/src/io.rs | use alloc::format;
use bincode::de::read::Reader;
use bincode::enc::write::Writer;
use bincode::error::DecodeError;
use bincode::error::EncodeError;
use core::convert::Infallible;
use core::marker::PhantomData;
use esp_hal::uart::{AnyUart, Uart};
use esp_hal::Blocking;
use esp_hal::{prelude::*, timer, uart, usb_serial_... | rust | MIT | 961deb080a81c754f402aaea24286bd141178e9d | 2026-01-04T20:21:09.467677Z | false |
frostsnap/frostsnap | https://github.com/frostsnap/frostsnap/blob/961deb080a81c754f402aaea24286bd141178e9d/device/src/touch_handler.rs | device/src/touch_handler.rs | use embedded_graphics::pixelcolor::Rgb565;
use embedded_graphics::prelude::Point;
use frostsnap_cst816s::{interrupt::TouchReceiver, TouchGesture};
use frostsnap_widgets::{debug::OverlayDebug, DynWidget, Widget};
use crate::touch_calibration::adjust_touch_point;
/// Process all pending touch events from the receiver
p... | rust | MIT | 961deb080a81c754f402aaea24286bd141178e9d | 2026-01-04T20:21:09.467677Z | false |
frostsnap/frostsnap | https://github.com/frostsnap/frostsnap/blob/961deb080a81c754f402aaea24286bd141178e9d/device/src/panic.rs | device/src/panic.rs | use crate::init_display;
use crate::peripherals::NoCs;
use embedded_graphics::{prelude::*, text::Alignment};
use frostsnap_widgets::string_ext::StringFixed;
const FONT_WIDTH: u32 = 6;
/// Unified panic handler for Frostsnap devices
///
/// This function handles panics by displaying the panic information on the screen... | rust | MIT | 961deb080a81c754f402aaea24286bd141178e9d | 2026-01-04T20:21:09.467677Z | false |
frostsnap/frostsnap | https://github.com/frostsnap/frostsnap/blob/961deb080a81c754f402aaea24286bd141178e9d/device/src/widget_tree.rs | device/src/widget_tree.rs | use alloc::boxed::Box;
use frostsnap_core::{
device::{restoration::EnterBackupPhase, KeyGenPhase3, SignPhase1},
AccessStructureRef,
};
use frostsnap_widgets::{
backup::{BackupDisplay, EnterShareScreen},
keygen_check::KeygenCheck,
layout::*,
sign_prompt::SignTxPrompt,
DeviceNameScreen, Firmwa... | rust | MIT | 961deb080a81c754f402aaea24286bd141178e9d | 2026-01-04T20:21:09.467677Z | false |
frostsnap/frostsnap | https://github.com/frostsnap/frostsnap/blob/961deb080a81c754f402aaea24286bd141178e9d/device/src/resources.rs | device/src/resources.rs | //! Device resources including provisioned crypto state and partitions
use alloc::boxed::Box;
use core::cell::RefCell;
use esp_storage::FlashStorage;
use frostsnap_comms::{Downstream, Upstream};
use rand_chacha::ChaCha20Rng;
use crate::{
ds::HardwareDs,
efuse::EfuseHmacKeys,
flash::VersionedFactoryData,
... | rust | MIT | 961deb080a81c754f402aaea24286bd141178e9d | 2026-01-04T20:21:09.467677Z | false |
frostsnap/frostsnap | https://github.com/frostsnap/frostsnap/blob/961deb080a81c754f402aaea24286bd141178e9d/device/src/firmware_size.rs | device/src/firmware_size.rs | //! # ESP32 Firmware Size Calculation
//!
//! This module implements an algorithm to determine the actual size of ESP32 firmware
//! stored in a flash partition. This is necessary because ESP32 firmware partitions
//! are fixed-size containers filled with 0xFF padding, but we need to know where the
//! actual firmware ... | rust | MIT | 961deb080a81c754f402aaea24286bd141178e9d | 2026-01-04T20:21:09.467677Z | false |
frostsnap/frostsnap | https://github.com/frostsnap/frostsnap/blob/961deb080a81c754f402aaea24286bd141178e9d/device/src/peripherals.rs | device/src/peripherals.rs | //! Device peripheral initialization and management
use alloc::{boxed::Box, rc::Rc};
use core::cell::RefCell;
use display_interface_spi::SPIInterface;
use embedded_graphics::{pixelcolor::Rgb565, prelude::*};
use esp_hal::{
delay::Delay,
gpio::{AnyPin, Input, Io, Output, Pull},
hmac::Hmac,
i2c::master::... | rust | MIT | 961deb080a81c754f402aaea24286bd141178e9d | 2026-01-04T20:21:09.467677Z | false |
frostsnap/frostsnap | https://github.com/frostsnap/frostsnap/blob/961deb080a81c754f402aaea24286bd141178e9d/device/src/ui.rs | device/src/ui.rs | // Imports removed - legacy screens are not used in stateless Workflow
use alloc::{boxed::Box, string::String};
use frost_backup::ShareBackup;
use frostsnap_comms::{DeviceName, Sha256Digest};
use frostsnap_core::{
device::{restoration::EnterBackupPhase, KeyGenPhase3, SignPhase1},
message::HeldShare2,
tweak:... | rust | MIT | 961deb080a81c754f402aaea24286bd141178e9d | 2026-01-04T20:21:09.467677Z | false |
frostsnap/frostsnap | https://github.com/frostsnap/frostsnap/blob/961deb080a81c754f402aaea24286bd141178e9d/device/src/ota.rs | device/src/ota.rs | use crate::{
io::SerialIo,
partitions::{EspFlashPartition, PartitionExt},
secure_boot,
ui::{self, UserInteraction},
};
use alloc::boxed::Box;
use bincode::config::{Fixint, LittleEndian};
use esp_hal::rsa::Rsa;
use esp_hal::sha::Sha;
use esp_hal::time::Duration;
use esp_hal::timer;
use esp_hal::Blocking;... | rust | MIT | 961deb080a81c754f402aaea24286bd141178e9d | 2026-01-04T20:21:09.467677Z | false |
frostsnap/frostsnap | https://github.com/frostsnap/frostsnap/blob/961deb080a81c754f402aaea24286bd141178e9d/device/src/ds.rs | device/src/ds.rs | use alloc::vec::Vec;
use esp_hal::{peripherals::DS, sha::Sha};
use frostsnap_comms::factory::pad_message_for_rsa;
use frostsnap_comms::factory::DS_KEY_SIZE_BITS;
use nb::block;
/// Hardware DS signing implementation using ESP32's Digital Signature peripheral
pub struct HardwareDs<'a> {
ds: &'a DS,
encrypted_pa... | rust | MIT | 961deb080a81c754f402aaea24286bd141178e9d | 2026-01-04T20:21:09.467677Z | false |
frostsnap/frostsnap | https://github.com/frostsnap/frostsnap/blob/961deb080a81c754f402aaea24286bd141178e9d/device/src/esp32_run.rs | device/src/esp32_run.rs | //! Main event loop for the device
use crate::partitions::PartitionExt;
use crate::{
flash::{Mutation, MutationLog},
io::SerialInterface,
ota,
resources::Resources,
ui::{self, UiEvent, UserInteraction},
DownstreamConnectionState, Duration, Instant, UpstreamConnection, UpstreamConnectionState,
}... | rust | MIT | 961deb080a81c754f402aaea24286bd141178e9d | 2026-01-04T20:21:09.467677Z | false |
frostsnap/frostsnap | https://github.com/frostsnap/frostsnap/blob/961deb080a81c754f402aaea24286bd141178e9d/device/src/touch_calibration.rs | device/src/touch_calibration.rs | //! Touch calibration functions for adjusting touch coordinates on the device
//! These polynomial functions correct for touch sensor inaccuracies
use embedded_graphics::prelude::Point;
use micromath::F32Ext;
/// Applies x-axis based adjustment to correct touch coordinates
pub fn x_based_adjustment(x: i32) -> i32 {
... | rust | MIT | 961deb080a81c754f402aaea24286bd141178e9d | 2026-01-04T20:21:09.467677Z | false |
frostsnap/frostsnap | https://github.com/frostsnap/frostsnap/blob/961deb080a81c754f402aaea24286bd141178e9d/device/src/secure_boot.rs | device/src/secure_boot.rs | extern crate alloc;
use crate::partitions::EspFlashPartition;
use alloc::boxed::Box;
use alloc::{vec, vec::Vec};
use crc::Crc;
use embedded_storage::nor_flash::NorFlashErrorKind;
use esp_hal::efuse::Efuse;
use esp_hal::rsa::{operand_sizes::Op3072, Rsa, RsaModularExponentiation};
use esp_hal::sha::{Sha, Sha256};
use esp... | rust | MIT | 961deb080a81c754f402aaea24286bd141178e9d | 2026-01-04T20:21:09.467677Z | false |
frostsnap/frostsnap | https://github.com/frostsnap/frostsnap/blob/961deb080a81c754f402aaea24286bd141178e9d/device/src/frosty_ui.rs | device/src/frosty_ui.rs | use crate::DISPLAY_REFRESH_MS;
use alloc::{boxed::Box, string::ToString};
use embedded_graphics::prelude::*;
use esp_hal::prelude::*;
use frostsnap_cst816s::interrupt::TouchReceiver;
use frostsnap_widgets::palette::PALETTE;
use frostsnap_widgets::{
backup::{BackupDisplay, EnterShareScreen},
debug::OverlayDebug,... | rust | MIT | 961deb080a81c754f402aaea24286bd141178e9d | 2026-01-04T20:21:09.467677Z | false |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.