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
sidit77/rusty-twinkle-tray
https://github.com/sidit77/rusty-twinkle-tray/blob/4c28fca78561979829fd2c88b2f02cc162a2ae41/lib/windows-ext/src/Windows/Win32/mod.rs
lib/windows-ext/src/Windows/Win32/mod.rs
pub mod System; pub mod Foundation;
rust
MIT
4c28fca78561979829fd2c88b2f02cc162a2ae41
2026-01-04T20:20:01.545651Z
false
sidit77/rusty-twinkle-tray
https://github.com/sidit77/rusty-twinkle-tray/blob/4c28fca78561979829fd2c88b2f02cc162a2ae41/lib/windows-ext/src/Windows/Win32/Foundation/mod.rs
lib/windows-ext/src/Windows/Win32/Foundation/mod.rs
pub use windows::Win32::Foundation::*;
rust
MIT
4c28fca78561979829fd2c88b2f02cc162a2ae41
2026-01-04T20:20:01.545651Z
false
sidit77/rusty-twinkle-tray
https://github.com/sidit77/rusty-twinkle-tray/blob/4c28fca78561979829fd2c88b2f02cc162a2ae41/lib/windows-ext/src/Windows/Win32/System/mod.rs
lib/windows-ext/src/Windows/Win32/System/mod.rs
pub mod WinRT;
rust
MIT
4c28fca78561979829fd2c88b2f02cc162a2ae41
2026-01-04T20:20:01.545651Z
false
sidit77/rusty-twinkle-tray
https://github.com/sidit77/rusty-twinkle-tray/blob/4c28fca78561979829fd2c88b2f02cc162a2ae41/lib/windows-ext/src/Windows/Win32/System/WinRT/mod.rs
lib/windows-ext/src/Windows/Win32/System/WinRT/mod.rs
pub mod Xaml;
rust
MIT
4c28fca78561979829fd2c88b2f02cc162a2ae41
2026-01-04T20:20:01.545651Z
false
sidit77/rusty-twinkle-tray
https://github.com/sidit77/rusty-twinkle-tray/blob/4c28fca78561979829fd2c88b2f02cc162a2ae41/lib/windows-ext/src/Windows/Win32/System/WinRT/Xaml/mod.rs
lib/windows-ext/src/Windows/Win32/System/WinRT/Xaml/mod.rs
#[repr(transparent)] #[derive( ::core::cmp::PartialEq, ::core::cmp::Eq, ::core::fmt::Debug, ::core::clone::Clone )] pub struct IDesktopWindowXamlSourceNative(::windows_core::IUnknown); impl IDesktopWindowXamlSourceNative { pub unsafe fn AttachToWindow<P0>(&self, parentwnd: P0) -> ::windows_core::Res...
rust
MIT
4c28fca78561979829fd2c88b2f02cc162a2ae41
2026-01-04T20:20:01.545651Z
false
sidit77/rusty-twinkle-tray
https://github.com/sidit77/rusty-twinkle-tray/blob/4c28fca78561979829fd2c88b2f02cc162a2ae41/lib/windows-ext/src/Windows/System/mod.rs
lib/windows-ext/src/Windows/System/mod.rs
pub use windows::System::*;
rust
MIT
4c28fca78561979829fd2c88b2f02cc162a2ae41
2026-01-04T20:20:01.545651Z
false
sidit77/rusty-twinkle-tray
https://github.com/sidit77/rusty-twinkle-tray/blob/4c28fca78561979829fd2c88b2f02cc162a2ae41/lib/codegen/src/constructors.rs
lib/codegen/src/constructors.rs
use std::collections::HashSet; use quote::format_ident; use syn::{parse_quote, Item}; use crate::utils::get_indent; pub fn generate_constructors(items: &mut Vec<Item>, classes: &HashSet<String>) { items.iter_mut().for_each(|item| match item { Item::Impl(item) if item.trait_.is_none() => { let...
rust
MIT
4c28fca78561979829fd2c88b2f02cc162a2ae41
2026-01-04T20:20:01.545651Z
false
sidit77/rusty-twinkle-tray
https://github.com/sidit77/rusty-twinkle-tray/blob/4c28fca78561979829fd2c88b2f02cc162a2ae41/lib/codegen/src/exporter.rs
lib/codegen/src/exporter.rs
use std::fs::OpenOptions; use std::io::Write; use std::path::Path; pub fn generate_export<P: AsRef<Path>>(module: &str, base: P) { let mut export = String::from("pub use windows::"); let mut path = base.as_ref().join("Windows"); for comp in module.split("_") { export.push_str(comp); export....
rust
MIT
4c28fca78561979829fd2c88b2f02cc162a2ae41
2026-01-04T20:20:01.545651Z
false
sidit77/rusty-twinkle-tray
https://github.com/sidit77/rusty-twinkle-tray/blob/4c28fca78561979829fd2c88b2f02cc162a2ae41/lib/codegen/src/filter.rs
lib/codegen/src/filter.rs
use std::collections::HashSet; use std::path::Path; pub fn should_process_file(file: &Path, enabled: &HashSet<String>) -> bool { match file.file_name().unwrap() { name if name == "mod.rs" => { let package = generate_package_name(file); package.is_empty() || enabled.contains(&package...
rust
MIT
4c28fca78561979829fd2c88b2f02cc162a2ae41
2026-01-04T20:20:01.545651Z
false
sidit77/rusty-twinkle-tray
https://github.com/sidit77/rusty-twinkle-tray/blob/4c28fca78561979829fd2c88b2f02cc162a2ae41/lib/codegen/src/utils.rs
lib/codegen/src/utils.rs
use proc_macro2::Ident; use syn::{Path, Type}; pub trait IterExpect<T> { fn continue_if(self, func: impl FnOnce(T) -> bool) -> Option<Self> where Self: Sized; } impl<T, I: Iterator<Item = T>> IterExpect<T> for I { fn continue_if(mut self, func: impl FnOnce(T) -> bool) -> Option<Self> where ...
rust
MIT
4c28fca78561979829fd2c88b2f02cc162a2ae41
2026-01-04T20:20:01.545651Z
false
sidit77/rusty-twinkle-tray
https://github.com/sidit77/rusty-twinkle-tray/blob/4c28fca78561979829fd2c88b2f02cc162a2ae41/lib/codegen/src/attributes.rs
lib/codegen/src/attributes.rs
use std::collections::HashSet; use syn::punctuated::Punctuated; use syn::{Attribute, Expr, ExprLit, Fields, ImplItem, Item, Lit, Meta, Token}; pub fn strip_attributes(items: &mut Vec<Item>, enabled: &HashSet<String>, encountered: &mut HashSet<String>) { items.retain_mut(|item| match item { Item::Struct(it...
rust
MIT
4c28fca78561979829fd2c88b2f02cc162a2ae41
2026-01-04T20:20:01.545651Z
false
sidit77/rusty-twinkle-tray
https://github.com/sidit77/rusty-twinkle-tray/blob/4c28fca78561979829fd2c88b2f02cc162a2ae41/lib/codegen/src/main.rs
lib/codegen/src/main.rs
mod attributes; mod constructors; mod exporter; mod filter; mod utils; mod whitelist; use std::collections::{HashMap, HashSet}; use std::ops::Sub; use std::path::{Path, PathBuf}; use rayon::iter::{ParallelBridge, ParallelIterator}; use serde::{Deserialize, Serialize}; use walkdir::WalkDir; use windows_bindgen::bindge...
rust
MIT
4c28fca78561979829fd2c88b2f02cc162a2ae41
2026-01-04T20:20:01.545651Z
false
sidit77/rusty-twinkle-tray
https://github.com/sidit77/rusty-twinkle-tray/blob/4c28fca78561979829fd2c88b2f02cc162a2ae41/lib/codegen/src/whitelist.rs
lib/codegen/src/whitelist.rs
use std::collections::{HashMap, HashSet}; use syn::{parse_quote, Expr, ImplItem, Item}; use crate::utils::get_indent; use crate::WhiteList; pub fn apply_whitelist(items: &mut Vec<Item>, white_list: &HashMap<String, WhiteList>) { items.iter_mut().for_each(|item| match item { Item::Impl(item) if item.trait...
rust
MIT
4c28fca78561979829fd2c88b2f02cc162a2ae41
2026-01-04T20:20:01.545651Z
false
swindon-rs/tk-http
https://github.com/swindon-rs/tk-http/blob/ffd17e670b448c09e11d295261bc58832961e51a/src/chunked.rs
src/chunked.rs
use httparse::{InvalidChunkSize, parse_chunk_size}; use tk_bufstream::Buf; // TODO(tailhook) review usizes here, probaby we may accept u64 #[derive(Debug, Clone, PartialEq)] pub struct State { buffered: usize, pending: usize, done: bool, } impl State { pub fn new() -> State { State { ...
rust
Apache-2.0
ffd17e670b448c09e11d295261bc58832961e51a
2026-01-04T20:20:02.650005Z
false
swindon-rs/tk-http
https://github.com/swindon-rs/tk-http/blob/ffd17e670b448c09e11d295261bc58832961e51a/src/headers.rs
src/headers.rs
#[allow(unused_imports)] use std::ascii::AsciiExt; // header value is byte sequence // we need case insensitive comparison and strip out of the whitespace pub fn is_close(val: &[u8]) -> bool { if val.len() < "close".len() { return false; } let mut iter = val.iter(); for (idx, &ch) in iter.by_re...
rust
Apache-2.0
ffd17e670b448c09e11d295261bc58832961e51a
2026-01-04T20:20:02.650005Z
false
swindon-rs/tk-http
https://github.com/swindon-rs/tk-http/blob/ffd17e670b448c09e11d295261bc58832961e51a/src/body_parser.rs
src/body_parser.rs
use httparse::InvalidChunkSize; use tk_bufstream::ReadBuf; use chunked; // TODO(tailhook) review usizes here, probaby we may accept u64 #[derive(Debug, Clone)] pub enum BodyProgress { Fixed(usize), // bytes left Eof, // only for client implemementation Chunked(chunked::State), } impl BodyProgress { ...
rust
Apache-2.0
ffd17e670b448c09e11d295261bc58832961e51a
2026-01-04T20:20:02.650005Z
false
swindon-rs/tk-http
https://github.com/swindon-rs/tk-http/blob/ffd17e670b448c09e11d295261bc58832961e51a/src/lib.rs
src/lib.rs
//! This crate contains implementation of HTTP/1.0 and HTTP/1.1 with //! websockets support. (HTTP/2 support is planned) //! //! See [examples](https://github.com/swindon-rs/tk-http/tree/master/examples) //! for usage examples. //! //! For client implementation it's recommended to use the library //! together with [tk-...
rust
Apache-2.0
ffd17e670b448c09e11d295261bc58832961e51a
2026-01-04T20:20:02.650005Z
false
swindon-rs/tk-http
https://github.com/swindon-rs/tk-http/blob/ffd17e670b448c09e11d295261bc58832961e51a/src/base_serializer.rs
src/base_serializer.rs
//! This contains common part of serializer between client and server //! implementation use std::fmt::Display; use std::io::Write; #[allow(unused_imports)] use std::ascii::AsciiExt; use tk_bufstream::Buf; use enums::Version; quick_error! { #[derive(Debug)] pub enum HeaderError { DuplicateContentLe...
rust
Apache-2.0
ffd17e670b448c09e11d295261bc58832961e51a
2026-01-04T20:20:02.650005Z
false
swindon-rs/tk-http
https://github.com/swindon-rs/tk-http/blob/ffd17e670b448c09e11d295261bc58832961e51a/src/server/config.rs
src/server/config.rs
use std::time::Duration; use std::sync::Arc; use server::{Config}; impl Config { /// Create a config with defaults pub fn new() -> Config { Config { inflight_request_limit: 2, inflight_request_prealloc: 0, first_byte_timeout: Duration::new(5, 0), keep_al...
rust
Apache-2.0
ffd17e670b448c09e11d295261bc58832961e51a
2026-01-04T20:20:02.650005Z
false
swindon-rs/tk-http
https://github.com/swindon-rs/tk-http/blob/ffd17e670b448c09e11d295261bc58832961e51a/src/server/headers.rs
src/server/headers.rs
use std::str::from_utf8; use std::slice::Iter as SliceIter; #[allow(unused_imports)] use std::ascii::AsciiExt; use std::borrow::Cow; use httparse::{self, EMPTY_HEADER, Request, Header}; use tk_bufstream::Buf; use server::error::{Error, ErrorEnum}; use super::{RequestTarget, Dispatcher}; use super::codec::BodyKind; us...
rust
Apache-2.0
ffd17e670b448c09e11d295261bc58832961e51a
2026-01-04T20:20:02.650005Z
false
swindon-rs/tk-http
https://github.com/swindon-rs/tk-http/blob/ffd17e670b448c09e11d295261bc58832961e51a/src/server/encoder.rs
src/server/encoder.rs
use std::io; use std::fmt::Display; use futures::{Future, Poll, Async}; use tk_bufstream::{WriteBuf, WriteRaw, FutureWriteRaw}; use tokio_io::AsyncWrite; use base_serializer::{MessageState, HeaderError}; use enums::{Version, Status}; use super::headers::Head; /// This a response writer that you receive in `Codec` /...
rust
Apache-2.0
ffd17e670b448c09e11d295261bc58832961e51a
2026-01-04T20:20:02.650005Z
false
swindon-rs/tk-http
https://github.com/swindon-rs/tk-http/blob/ffd17e670b448c09e11d295261bc58832961e51a/src/server/websocket.rs
src/server/websocket.rs
#[allow(unused_imports)] use std::ascii::AsciiExt; use std::str::{from_utf8}; use super::{Head}; use websocket::Accept; /// Contains all the imporant parts of a websocket handshake #[derive(Debug)] pub struct WebsocketHandshake { /// The destination value of `Sec-WebSocket-Accept` pub accept: Accept, ///...
rust
Apache-2.0
ffd17e670b448c09e11d295261bc58832961e51a
2026-01-04T20:20:02.650005Z
false
swindon-rs/tk-http
https://github.com/swindon-rs/tk-http/blob/ffd17e670b448c09e11d295261bc58832961e51a/src/server/codec.rs
src/server/codec.rs
use futures::{Async, Future}; use tk_bufstream::{ReadBuf, WriteBuf}; use super::{Error, Encoder, EncoderDone, Head}; use super::RecvMode; #[derive(Debug, Copy, Clone, PartialEq, Eq)] pub enum BodyKind { Fixed(u64), Chunked, Unsupported, } /// This is a low-level interface to the http server pub trait Di...
rust
Apache-2.0
ffd17e670b448c09e11d295261bc58832961e51a
2026-01-04T20:20:02.650005Z
false
swindon-rs/tk-http
https://github.com/swindon-rs/tk-http/blob/ffd17e670b448c09e11d295261bc58832961e51a/src/server/request_target.rs
src/server/request_target.rs
/// A middle part of the request line /// /// Most people get used to having path there or maybe asterisk. But in the /// real protocol there are all four options. /// /// You don't have to implement all of them though. Using `Head::path()` /// provides good shortcut for handling `Origin` and `Absolute` in uniform /// ...
rust
Apache-2.0
ffd17e670b448c09e11d295261bc58832961e51a
2026-01-04T20:20:02.650005Z
false
swindon-rs/tk-http
https://github.com/swindon-rs/tk-http/blob/ffd17e670b448c09e11d295261bc58832961e51a/src/server/buffered.rs
src/server/buffered.rs
//! Higher-level interface for serving fully buffered requests //! use std::net::SocketAddr; use std::sync::Arc; use std::marker::PhantomData; use futures::{Async, Future, IntoFuture}; use futures::future::FutureResult; use tokio_core::reactor::Handle; use tk_bufstream::{ReadBuf, WriteBuf, ReadFramed, WriteFramed}; u...
rust
Apache-2.0
ffd17e670b448c09e11d295261bc58832961e51a
2026-01-04T20:20:02.650005Z
false
swindon-rs/tk-http
https://github.com/swindon-rs/tk-http/blob/ffd17e670b448c09e11d295261bc58832961e51a/src/server/error.rs
src/server/error.rs
use std::io; use std::convert::From; use httparse; quick_error! { /// HTTP server error #[derive(Debug)] pub enum Error wraps pub ErrorEnum { /// Socket IO error Io(err: io::Error) { description("I/O error") display("I/O error: {}", err) from() ...
rust
Apache-2.0
ffd17e670b448c09e11d295261bc58832961e51a
2026-01-04T20:20:02.650005Z
false
swindon-rs/tk-http
https://github.com/swindon-rs/tk-http/blob/ffd17e670b448c09e11d295261bc58832961e51a/src/server/mod.rs
src/server/mod.rs
//! HTTP server protocol implementation //! mod config; mod error; mod codec; mod proto; mod encoder; mod request_target; mod headers; mod websocket; mod recv_mode; pub mod buffered; pub use self::error::Error; pub use self::encoder::{Encoder, EncoderDone}; pub use self::encoder::{WaitFlush, FutureRawBody, RawBody}; p...
rust
Apache-2.0
ffd17e670b448c09e11d295261bc58832961e51a
2026-01-04T20:20:02.650005Z
false
swindon-rs/tk-http
https://github.com/swindon-rs/tk-http/blob/ffd17e670b448c09e11d295261bc58832961e51a/src/server/recv_mode.rs
src/server/recv_mode.rs
use std::time::Duration; use server::RecvMode; #[derive(Debug, Clone, Copy, PartialEq, Eq)] pub enum Mode { BufferedUpfront(usize), Progressive(usize), Hijack, } impl RecvMode { /// Download whole message body (request or response) into the memory /// before starting response /// /// The...
rust
Apache-2.0
ffd17e670b448c09e11d295261bc58832961e51a
2026-01-04T20:20:02.650005Z
false
swindon-rs/tk-http
https://github.com/swindon-rs/tk-http/blob/ffd17e670b448c09e11d295261bc58832961e51a/src/server/proto.rs
src/server/proto.rs
use std::mem; use std::sync::Arc; use std::collections::VecDeque; use std::time::Instant; use futures::{Future, Poll, Async}; use tk_bufstream::{IoBuf, WriteBuf, ReadBuf}; use tokio_io::{AsyncRead, AsyncWrite}; use tokio_core::reactor::{Handle, Timeout}; use super::encoder::{self, get_inner, ResponseConfig}; use supe...
rust
Apache-2.0
ffd17e670b448c09e11d295261bc58832961e51a
2026-01-04T20:20:02.650005Z
false
swindon-rs/tk-http
https://github.com/swindon-rs/tk-http/blob/ffd17e670b448c09e11d295261bc58832961e51a/src/client/config.rs
src/client/config.rs
use std::sync::Arc; use std::time::Duration; use client::{Config}; impl Config { /// Create a config with defaults pub fn new() -> Config { Config { inflight_request_limit: 1, inflight_request_prealloc: 1, keep_alive_timeout: Duration::new(4, 0), safe_pi...
rust
Apache-2.0
ffd17e670b448c09e11d295261bc58832961e51a
2026-01-04T20:20:02.650005Z
false
swindon-rs/tk-http
https://github.com/swindon-rs/tk-http/blob/ffd17e670b448c09e11d295261bc58832961e51a/src/client/errors.rs
src/client/errors.rs
use std::io; use std::convert::From; use futures::sync::mpsc::SendError; use httparse::Error as HttpError; use httparse::InvalidChunkSize; quick_error! { #[derive(Debug)] /// HTTP client error pub enum Error wraps pub ErrorEnum { /// I/O (basically networking) error occured during request ...
rust
Apache-2.0
ffd17e670b448c09e11d295261bc58832961e51a
2026-01-04T20:20:02.650005Z
false
swindon-rs/tk-http
https://github.com/swindon-rs/tk-http/blob/ffd17e670b448c09e11d295261bc58832961e51a/src/client/encoder.rs
src/client/encoder.rs
use std::io; use std::fmt::Display; #[allow(unused_imports)] use std::ascii::AsciiExt; use std::sync::Arc; use std::sync::atomic::{AtomicUsize, AtomicBool, Ordering}; use tk_bufstream::WriteBuf; use futures::{Future, Async}; use tokio_io::AsyncWrite; use enums::Version; use headers::is_close; use base_serializer::{Me...
rust
Apache-2.0
ffd17e670b448c09e11d295261bc58832961e51a
2026-01-04T20:20:02.650005Z
false
swindon-rs/tk-http
https://github.com/swindon-rs/tk-http/blob/ffd17e670b448c09e11d295261bc58832961e51a/src/client/parser.rs
src/client/parser.rs
use std::sync::Arc; use std::borrow::Cow; use std::sync::atomic::{AtomicUsize, AtomicBool, Ordering}; use std::str::from_utf8; #[allow(unused_imports)] use std::ascii::AsciiExt; use futures::{Future, Async, Poll}; use httparse; use tk_bufstream::{ReadBuf, Buf}; use tokio_io::AsyncRead; use enums::Version; use client:...
rust
Apache-2.0
ffd17e670b448c09e11d295261bc58832961e51a
2026-01-04T20:20:02.650005Z
false
swindon-rs/tk-http
https://github.com/swindon-rs/tk-http/blob/ffd17e670b448c09e11d295261bc58832961e51a/src/client/client.rs
src/client/client.rs
use futures::sink::Sink; use futures::future::FutureResult; use futures::{Async, AsyncSink, Future, IntoFuture}; use client::{Error, Encoder, EncoderDone, Head, RecvMode}; use client::errors::ErrorEnum; use client::buffered; #[derive(Debug, Copy, Clone, PartialEq, Eq)] pub enum BodyKind { Fixed(u64), Chunked...
rust
Apache-2.0
ffd17e670b448c09e11d295261bc58832961e51a
2026-01-04T20:20:02.650005Z
false
swindon-rs/tk-http
https://github.com/swindon-rs/tk-http/blob/ffd17e670b448c09e11d295261bc58832961e51a/src/client/buffered.rs
src/client/buffered.rs
//! Simple to use wrappers for dealing with fully buffered requests //! //! By "fully buffered" I mean two things: //! //! * No request or response streaming //! * All headers and body are allocated on the heap //! //! Raw interface allows more granular control to make things more efficient, //! but requires more boile...
rust
Apache-2.0
ffd17e670b448c09e11d295261bc58832961e51a
2026-01-04T20:20:02.650005Z
false
swindon-rs/tk-http
https://github.com/swindon-rs/tk-http/blob/ffd17e670b448c09e11d295261bc58832961e51a/src/client/mod.rs
src/client/mod.rs
//! The HTTP/1.x client protocol implementation //! mod client; mod config; mod encoder; mod errors; mod head; mod parser; mod proto; mod recv_mode; pub mod buffered; pub use self::errors::Error; pub use self::client::{Client, Codec}; pub use self::encoder::{Encoder, EncoderDone, WaitFlush}; pub use self::proto::{Prot...
rust
Apache-2.0
ffd17e670b448c09e11d295261bc58832961e51a
2026-01-04T20:20:02.650005Z
false
swindon-rs/tk-http
https://github.com/swindon-rs/tk-http/blob/ffd17e670b448c09e11d295261bc58832961e51a/src/client/head.rs
src/client/head.rs
#[allow(unused_imports)] use std::ascii::AsciiExt; use std::slice::Iter as SliceIter; use httparse::Header; use enums::{Status}; use client::Head; /// Iterator over all meaningful headers for the response /// /// This iterator is created by `Head::headers`. And iterates over all /// headers except hop-by-hop ones. ...
rust
Apache-2.0
ffd17e670b448c09e11d295261bc58832961e51a
2026-01-04T20:20:02.650005Z
false
swindon-rs/tk-http
https://github.com/swindon-rs/tk-http/blob/ffd17e670b448c09e11d295261bc58832961e51a/src/client/recv_mode.rs
src/client/recv_mode.rs
use client::RecvMode; #[derive(Debug, Clone, Copy, PartialEq, Eq)] pub enum Mode { Buffered(usize), Progressive(usize), } impl RecvMode { /// Download whole message body (request or response) into the memory. /// /// The argument is maximum size of the body. The Buffered variant /// works eq...
rust
Apache-2.0
ffd17e670b448c09e11d295261bc58832961e51a
2026-01-04T20:20:02.650005Z
false
swindon-rs/tk-http
https://github.com/swindon-rs/tk-http/blob/ffd17e670b448c09e11d295261bc58832961e51a/src/client/proto.rs
src/client/proto.rs
use std::collections::VecDeque; use std::cmp::max; use std::mem; use std::net::SocketAddr; use std::sync::Arc; use std::sync::atomic::{AtomicUsize, AtomicBool, Ordering}; use std::time::Instant; use tk_bufstream::{IoBuf, WriteBuf, ReadBuf}; use tokio_core::net::TcpStream; use tokio_core::reactor::{Handle, Timeout}; us...
rust
Apache-2.0
ffd17e670b448c09e11d295261bc58832961e51a
2026-01-04T20:20:02.650005Z
false
swindon-rs/tk-http
https://github.com/swindon-rs/tk-http/blob/ffd17e670b448c09e11d295261bc58832961e51a/src/enums/version.rs
src/enums/version.rs
use std::fmt; /// Enum reprsenting HTTP version. #[derive(Debug, Clone, PartialEq, Eq, Copy)] pub enum Version { /// Version 1.0 of the HTTP protocol Http10, /// Version 1.1 of the HTTP protocol Http11, } impl fmt::Display for Version { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { ...
rust
Apache-2.0
ffd17e670b448c09e11d295261bc58832961e51a
2026-01-04T20:20:02.650005Z
false
swindon-rs/tk-http
https://github.com/swindon-rs/tk-http/blob/ffd17e670b448c09e11d295261bc58832961e51a/src/enums/status.rs
src/enums/status.rs
//! Http status codes helpers //! /// Enum with some HTTP Status codes. #[derive(Debug, PartialEq, Copy, Clone)] #[allow(missing_docs)] pub enum Status { // 1xx status codes Continue, // 100 SwitchingProtocol, // 101 // 2xx status codes Ok, ...
rust
Apache-2.0
ffd17e670b448c09e11d295261bc58832961e51a
2026-01-04T20:20:02.650005Z
false
swindon-rs/tk-http
https://github.com/swindon-rs/tk-http/blob/ffd17e670b448c09e11d295261bc58832961e51a/src/enums/mod.rs
src/enums/mod.rs
mod status; mod version; pub use self::status::*; pub use self::version::*;
rust
Apache-2.0
ffd17e670b448c09e11d295261bc58832961e51a
2026-01-04T20:20:02.650005Z
false
swindon-rs/tk-http
https://github.com/swindon-rs/tk-http/blob/ffd17e670b448c09e11d295261bc58832961e51a/src/websocket/config.rs
src/websocket/config.rs
use std::time::Duration; use std::sync::Arc; use websocket::{Config}; impl Config { /// Create a config with defaults pub fn new() -> Config { Config { ping_interval: Duration::new(10, 0), message_timeout: Duration::new(30, 0), byte_timeout: Duration::new(30, 0), ...
rust
Apache-2.0
ffd17e670b448c09e11d295261bc58832961e51a
2026-01-04T20:20:02.650005Z
false
swindon-rs/tk-http
https://github.com/swindon-rs/tk-http/blob/ffd17e670b448c09e11d295261bc58832961e51a/src/websocket/codec.rs
src/websocket/codec.rs
use std::io; use tk_bufstream::{Buf, Encode, Decode}; use websocket::{Packet, Frame}; use websocket::error::Error; const MAX_PACKET_SIZE: usize = 10 << 20; /// Websocket codec for use with tk-bufstream in `Codec::hijack()` /// /// This codec is used out of the box in /// `BufferedDispatcher::new_with_websockets` pu...
rust
Apache-2.0
ffd17e670b448c09e11d295261bc58832961e51a
2026-01-04T20:20:02.650005Z
false
swindon-rs/tk-http
https://github.com/swindon-rs/tk-http/blob/ffd17e670b448c09e11d295261bc58832961e51a/src/websocket/alloc.rs
src/websocket/alloc.rs
use websocket::zero_copy::Frame; /// A websocket packet /// /// Note: unlike `Frame` this has data allocated on the heap so has static /// lifetime #[derive(Debug, Clone)] pub enum Packet { /// Ping packet (with data) Ping(Vec<u8>), /// Pong packet (with data) Pong(Vec<u8>), /// Text (utf-8) messsa...
rust
Apache-2.0
ffd17e670b448c09e11d295261bc58832961e51a
2026-01-04T20:20:02.650005Z
false
swindon-rs/tk-http
https://github.com/swindon-rs/tk-http/blob/ffd17e670b448c09e11d295261bc58832961e51a/src/websocket/dispatcher.rs
src/websocket/dispatcher.rs
use std::cmp::min; use std::fmt; use std::sync::Arc; use std::time::Instant; use futures::{Future, Async, Stream}; use futures::future::{FutureResult, ok}; use futures::stream; use tk_bufstream::{ReadFramed, WriteFramed, ReadBuf, WriteBuf}; use tk_bufstream::{Encode}; use tokio_io::{AsyncRead, AsyncWrite}; use tokio_c...
rust
Apache-2.0
ffd17e670b448c09e11d295261bc58832961e51a
2026-01-04T20:20:02.650005Z
false
swindon-rs/tk-http
https://github.com/swindon-rs/tk-http/blob/ffd17e670b448c09e11d295261bc58832961e51a/src/websocket/client.rs
src/websocket/client.rs
//! Websocket client implementation //! #[allow(unused_imports)] use std::ascii::AsciiExt; use std::fmt::Display; use futures::{Future, Async}; use httparse::{self, Header}; use tk_bufstream::{IoBuf, ReadBuf, WriteBuf, WriteFramed, ReadFramed}; use tokio_io::{AsyncRead, AsyncWrite}; use base_serializer::{MessageState...
rust
Apache-2.0
ffd17e670b448c09e11d295261bc58832961e51a
2026-01-04T20:20:02.650005Z
false
swindon-rs/tk-http
https://github.com/swindon-rs/tk-http/blob/ffd17e670b448c09e11d295261bc58832961e51a/src/websocket/error.rs
src/websocket/error.rs
use std::io; use std::str::{Utf8Error}; use httparse; quick_error! { /// Websocket Error works both for client and server connections #[derive(Debug)] pub enum Error wraps pub ErrorEnum { /// Socket IO error Io(err: io::Error) { description("IO error") display("IO e...
rust
Apache-2.0
ffd17e670b448c09e11d295261bc58832961e51a
2026-01-04T20:20:02.650005Z
false
swindon-rs/tk-http
https://github.com/swindon-rs/tk-http/blob/ffd17e670b448c09e11d295261bc58832961e51a/src/websocket/mod.rs
src/websocket/mod.rs
//! Websocket support stuff //! //! Websockets are initiated by server implementation, this module only //! contains websocket message types and similar stuff. use std::time::Duration; mod alloc; mod codec; mod config; mod dispatcher; mod error; mod keys; mod zero_copy; pub mod client; pub use self::alloc::Packet; pu...
rust
Apache-2.0
ffd17e670b448c09e11d295261bc58832961e51a
2026-01-04T20:20:02.650005Z
false
swindon-rs/tk-http
https://github.com/swindon-rs/tk-http/blob/ffd17e670b448c09e11d295261bc58832961e51a/src/websocket/zero_copy.rs
src/websocket/zero_copy.rs
use std::str::from_utf8; use rand::{thread_rng, Rng}; use tk_bufstream::Buf; use byteorder::{BigEndian, ByteOrder}; use super::{Packet}; use websocket::error::ErrorEnum; /// A borrowed frame of websocket data #[derive(Debug, Clone, PartialEq)] pub enum Frame<'a> { /// Ping mesage Ping(&'a [u8]), /// Pon...
rust
Apache-2.0
ffd17e670b448c09e11d295261bc58832961e51a
2026-01-04T20:20:02.650005Z
false
swindon-rs/tk-http
https://github.com/swindon-rs/tk-http/blob/ffd17e670b448c09e11d295261bc58832961e51a/src/websocket/keys.rs
src/websocket/keys.rs
use rand::{Rng, thread_rng}; use std::fmt; use std::str::{from_utf8_unchecked}; use sha1::Sha1; /// WebSocket GUID constant (provided by spec) pub const GUID: &'static str = "258EAFA5-E914-47DA-95CA-C5AB0DC85B11"; /// The `Sec-WebSocket-Accept` header value /// /// You can add it using `enc.format_header("Sec-WebSo...
rust
Apache-2.0
ffd17e670b448c09e11d295261bc58832961e51a
2026-01-04T20:20:02.650005Z
false
swindon-rs/tk-http
https://github.com/swindon-rs/tk-http/blob/ffd17e670b448c09e11d295261bc58832961e51a/tests/server_simple.rs
tests/server_simple.rs
rust
Apache-2.0
ffd17e670b448c09e11d295261bc58832961e51a
2026-01-04T20:20:02.650005Z
false
swindon-rs/tk-http
https://github.com/swindon-rs/tk-http/blob/ffd17e670b448c09e11d295261bc58832961e51a/examples/chunked.rs
examples/chunked.rs
extern crate tokio_core; extern crate futures; extern crate tk_bufstream; extern crate netbuf; extern crate tk_http; extern crate tk_listen; extern crate env_logger; use std::env; use std::time::Duration; use tokio_core::reactor::Core; use tokio_core::net::{TcpListener}; use futures::{Stream, Future}; use futures::fu...
rust
Apache-2.0
ffd17e670b448c09e11d295261bc58832961e51a
2026-01-04T20:20:02.650005Z
false
swindon-rs/tk-http
https://github.com/swindon-rs/tk-http/blob/ffd17e670b448c09e11d295261bc58832961e51a/examples/websockets.rs
examples/websockets.rs
extern crate time; extern crate tokio_core; extern crate futures; extern crate tk_bufstream; extern crate netbuf; extern crate tk_http; extern crate tk_listen; #[macro_use] extern crate log; extern crate env_logger; use std::env; use std::time::Duration; use tokio_core::reactor::Core; use tokio_core::net::{TcpListene...
rust
Apache-2.0
ffd17e670b448c09e11d295261bc58832961e51a
2026-01-04T20:20:02.650005Z
false
swindon-rs/tk-http
https://github.com/swindon-rs/tk-http/blob/ffd17e670b448c09e11d295261bc58832961e51a/examples/hello_world.rs
examples/hello_world.rs
extern crate time; extern crate tokio_core; extern crate futures; extern crate tk_bufstream; extern crate netbuf; extern crate tk_http; extern crate tk_listen; extern crate env_logger; use std::env; use std::time::Duration; use tokio_core::reactor::Core; use tokio_core::net::{TcpListener}; use futures::{Stream, Futur...
rust
Apache-2.0
ffd17e670b448c09e11d295261bc58832961e51a
2026-01-04T20:20:02.650005Z
false
swindon-rs/tk-http
https://github.com/swindon-rs/tk-http/blob/ffd17e670b448c09e11d295261bc58832961e51a/examples/native_tls_client.rs
examples/native_tls_client.rs
extern crate argparse; extern crate env_logger; extern crate futures; extern crate tk_http; extern crate tokio_core; extern crate url; extern crate native_tls; extern crate tokio_tls; #[macro_use] extern crate log; use std::io::{self, Write}; use std::env; use std::net::ToSocketAddrs; use std::sync::Arc; use futures...
rust
Apache-2.0
ffd17e670b448c09e11d295261bc58832961e51a
2026-01-04T20:20:02.650005Z
false
swindon-rs/tk-http
https://github.com/swindon-rs/tk-http/blob/ffd17e670b448c09e11d295261bc58832961e51a/examples/tls_client.rs
examples/tls_client.rs
extern crate argparse; extern crate env_logger; extern crate futures; extern crate tk_http; extern crate tokio_core; extern crate url; extern crate rustls; extern crate tokio_rustls; extern crate webpki; #[macro_use] extern crate log; use std::io::{self, Write, BufReader}; use std::env; use std::fs::File; use std::ne...
rust
Apache-2.0
ffd17e670b448c09e11d295261bc58832961e51a
2026-01-04T20:20:02.650005Z
false
swindon-rs/tk-http
https://github.com/swindon-rs/tk-http/blob/ffd17e670b448c09e11d295261bc58832961e51a/examples/counter.rs
examples/counter.rs
extern crate time; extern crate tokio_core; extern crate futures; extern crate tk_bufstream; extern crate netbuf; extern crate tk_http; extern crate tk_listen; extern crate env_logger; use std::env; use std::sync::Arc; use std::sync::atomic::{Ordering, AtomicUsize}; use std::time::Duration; use tokio_core::reactor::C...
rust
Apache-2.0
ffd17e670b448c09e11d295261bc58832961e51a
2026-01-04T20:20:02.650005Z
false
swindon-rs/tk-http
https://github.com/swindon-rs/tk-http/blob/ffd17e670b448c09e11d295261bc58832961e51a/examples/ws_cli.rs
examples/ws_cli.rs
extern crate futures; extern crate tk_http; extern crate argparse; extern crate env_logger; extern crate tokio_core; #[macro_use] extern crate log; use std::env; use std::time::Duration; use std::net::ToSocketAddrs; use futures::{Future, Stream}; use futures::future::{FutureResult, ok}; use futures::sync::mpsc::unbou...
rust
Apache-2.0
ffd17e670b448c09e11d295261bc58832961e51a
2026-01-04T20:20:02.650005Z
false
swindon-rs/tk-http
https://github.com/swindon-rs/tk-http/blob/ffd17e670b448c09e11d295261bc58832961e51a/examples/generate_on_the_fly.rs
examples/generate_on_the_fly.rs
extern crate env_logger; extern crate futures; extern crate netbuf; extern crate tk_bufstream; extern crate tk_http; extern crate tk_listen; extern crate tokio_core; extern crate tokio_io; use std::env; use std::time::Duration; use tokio_core::reactor::Core; use tokio_core::net::{TcpListener}; use tokio_io::AsyncWrit...
rust
Apache-2.0
ffd17e670b448c09e11d295261bc58832961e51a
2026-01-04T20:20:02.650005Z
false
swindon-rs/tk-http
https://github.com/swindon-rs/tk-http/blob/ffd17e670b448c09e11d295261bc58832961e51a/examples/sendfile.rs
examples/sendfile.rs
extern crate tokio_core; extern crate futures; extern crate futures_cpupool; extern crate netbuf; extern crate argparse; extern crate tk_http; extern crate tk_sendfile; extern crate tk_bufstream; extern crate tk_listen; extern crate log; extern crate env_logger; use std::env; use std::net::SocketAddr; use std::path::P...
rust
Apache-2.0
ffd17e670b448c09e11d295261bc58832961e51a
2026-01-04T20:20:02.650005Z
false
swindon-rs/tk-http
https://github.com/swindon-rs/tk-http/blob/ffd17e670b448c09e11d295261bc58832961e51a/examples/websocket2.rs
examples/websocket2.rs
extern crate time; extern crate tokio_core; extern crate futures; extern crate tk_bufstream; extern crate netbuf; extern crate tk_http; extern crate tk_listen; extern crate env_logger; use std::env; use std::time::Duration; use tokio_core::reactor::{Core, Timeout}; use tokio_core::net::{TcpListener}; use futures::{St...
rust
Apache-2.0
ffd17e670b448c09e11d295261bc58832961e51a
2026-01-04T20:20:02.650005Z
false
Rahix/shared-bus
https://github.com/Rahix/shared-bus/blob/7ee581be3ea32fcc8eff7af97e15d993683c549b/src/lib.rs
src/lib.rs
//! **shared-bus** is a crate to allow sharing bus peripherals safely between multiple devices. //! //! In the `embedded-hal` ecosystem, it is convention for drivers to "own" the bus peripheral they //! are operating on. This implies that only _one_ driver can have access to a certain bus. That, //! of course, poses ...
rust
Apache-2.0
7ee581be3ea32fcc8eff7af97e15d993683c549b
2026-01-04T20:20:06.411723Z
false
Rahix/shared-bus
https://github.com/Rahix/shared-bus/blob/7ee581be3ea32fcc8eff7af97e15d993683c549b/src/mutex.rs
src/mutex.rs
use core::cell; /// Common interface for mutex implementations. /// /// `shared-bus` needs a mutex to ensure only a single device can access the bus at the same time /// in concurrent situations. `shared-bus` already implements this trait for a number of existing /// mutex types. Most of them are guarded by a featur...
rust
Apache-2.0
7ee581be3ea32fcc8eff7af97e15d993683c549b
2026-01-04T20:20:06.411723Z
false
Rahix/shared-bus
https://github.com/Rahix/shared-bus/blob/7ee581be3ea32fcc8eff7af97e15d993683c549b/src/manager.rs
src/manager.rs
/// "Manager" for a shared bus. /// /// The manager owns the original bus peripheral (wrapped inside a mutex) and hands out proxies /// which can be used by device drivers for accessing the bus. Certain bus proxies can only be /// created with restrictions (see the individual methods for details). /// /// Usually the ...
rust
Apache-2.0
7ee581be3ea32fcc8eff7af97e15d993683c549b
2026-01-04T20:20:06.411723Z
false
Rahix/shared-bus
https://github.com/Rahix/shared-bus/blob/7ee581be3ea32fcc8eff7af97e15d993683c549b/src/proxies.rs
src/proxies.rs
#[cfg(feature = "eh-alpha")] use embedded_hal_alpha::i2c as i2c_alpha; use embedded_hal::adc; use embedded_hal::blocking::i2c; use embedded_hal::blocking::spi; /// Proxy type for I2C bus sharing. /// /// The `I2cProxy` implements all (blocking) I2C traits so it can be passed to drivers instead of /// the bus instance...
rust
Apache-2.0
7ee581be3ea32fcc8eff7af97e15d993683c549b
2026-01-04T20:20:06.411723Z
false
Rahix/shared-bus
https://github.com/Rahix/shared-bus/blob/7ee581be3ea32fcc8eff7af97e15d993683c549b/src/macros.rs
src/macros.rs
/// Macro for creating a `std`-based bus manager with `'static` lifetime. /// /// This macro is a convenience helper for creating a bus manager that lives for the `'static` /// lifetime an thus can be safely shared across threads. /// /// This macro is only available with the `std` feature. /// /// # Syntax /// ```igno...
rust
Apache-2.0
7ee581be3ea32fcc8eff7af97e15d993683c549b
2026-01-04T20:20:06.411723Z
false
Rahix/shared-bus
https://github.com/Rahix/shared-bus/blob/7ee581be3ea32fcc8eff7af97e15d993683c549b/tests/i2c.rs
tests/i2c.rs
use embedded_hal::prelude::*; use embedded_hal_mock::i2c; use std::thread; #[test] fn fake_i2c_device() { let expect = vec![i2c::Transaction::write(0xc0, vec![0xff, 0xee])]; let mut device = i2c::Mock::new(&expect); device.write(0xc0, &[0xff, 0xee]).unwrap(); device.done() } #[test] fn i2c_manager_man...
rust
Apache-2.0
7ee581be3ea32fcc8eff7af97e15d993683c549b
2026-01-04T20:20:06.411723Z
false
Rahix/shared-bus
https://github.com/Rahix/shared-bus/blob/7ee581be3ea32fcc8eff7af97e15d993683c549b/tests/spi.rs
tests/spi.rs
use embedded_hal::prelude::*; use embedded_hal_mock::spi; #[test] fn fake_spi_device() { let expect = vec![spi::Transaction::write(vec![0xff, 0xee])]; let mut device = spi::Mock::new(&expect); device.write(&[0xff, 0xee]).unwrap(); device.done() } #[test] fn spi_manager_manual() { let expect = vec!...
rust
Apache-2.0
7ee581be3ea32fcc8eff7af97e15d993683c549b
2026-01-04T20:20:06.411723Z
false
Rahix/shared-bus
https://github.com/Rahix/shared-bus/blob/7ee581be3ea32fcc8eff7af97e15d993683c549b/tests/adc.rs
tests/adc.rs
use embedded_hal::prelude::*; use embedded_hal_mock::adc; use std::thread; #[test] fn adc_mock_device() { let expectations = [ adc::Transaction::read(0, 0xabcd), adc::Transaction::read(1, 0xabba), adc::Transaction::read(2, 0xbaab), ]; let mut device = adc::Mock::new(&expectations);...
rust
Apache-2.0
7ee581be3ea32fcc8eff7af97e15d993683c549b
2026-01-04T20:20:06.411723Z
false
sean3z/rocket-diesel-rest-api-example
https://github.com/sean3z/rocket-diesel-rest-api-example/blob/9cc36e44a4829a1f9324e2b134c0ec621148f8de/src/db.rs
src/db.rs
use std::ops::Deref; use rocket::http::Status; use rocket::request::{self, FromRequest}; use rocket::{Request, State, Outcome}; use diesel::mysql::MysqlConnection; use diesel::r2d2::{ConnectionManager, Pool, PooledConnection}; // An alias to the type for a pool of Diesel Mysql Connection pub type MysqlPool = Pool<Conn...
rust
MIT
9cc36e44a4829a1f9324e2b134c0ec621148f8de
2026-01-04T20:20:05.712825Z
false
sean3z/rocket-diesel-rest-api-example
https://github.com/sean3z/rocket-diesel-rest-api-example/blob/9cc36e44a4829a1f9324e2b134c0ec621148f8de/src/hero.rs
src/hero.rs
use diesel; use diesel::prelude::*; use diesel::mysql::MysqlConnection; use schema::heroes; #[table_name = "heroes"] #[derive(AsChangeset, Serialize, Deserialize, Queryable, Insertable)] pub struct Hero { pub id: Option<i32>, pub name: String, pub identity: String, pub hometown: String, pub age: i3...
rust
MIT
9cc36e44a4829a1f9324e2b134c0ec621148f8de
2026-01-04T20:20:05.712825Z
false
sean3z/rocket-diesel-rest-api-example
https://github.com/sean3z/rocket-diesel-rest-api-example/blob/9cc36e44a4829a1f9324e2b134c0ec621148f8de/src/schema.rs
src/schema.rs
table! { heroes { id -> Nullable<Integer>, name -> Varchar, identity -> Varchar, hometown -> Varchar, age -> Integer, } }
rust
MIT
9cc36e44a4829a1f9324e2b134c0ec621148f8de
2026-01-04T20:20:05.712825Z
false
sean3z/rocket-diesel-rest-api-example
https://github.com/sean3z/rocket-diesel-rest-api-example/blob/9cc36e44a4829a1f9324e2b134c0ec621148f8de/src/main.rs
src/main.rs
#![feature(plugin)] #![plugin(rocket_codegen)] extern crate rocket; #[macro_use] extern crate rocket_contrib; #[macro_use] extern crate serde_derive; #[macro_use] extern crate diesel; use rocket_contrib::{Json, Value}; mod db; mod schema; mod hero; use hero::Hero; #[post("/", data = "<hero>")] fn create(hero: Json...
rust
MIT
9cc36e44a4829a1f9324e2b134c0ec621148f8de
2026-01-04T20:20:05.712825Z
false
tauri-apps/tauri-plugin-window-state
https://github.com/tauri-apps/tauri-plugin-window-state/blob/dd4c37f73ffd4b497da32c5c58333b5e896d35bc/src/lib.rs
src/lib.rs
// Copyright 2021 Tauri Programme within The Commons Conservancy // SPDX-License-Identifier: Apache-2.0 // SPDX-License-Identifier: MIT use bitflags::bitflags; use serde::{Deserialize, Serialize}; use tauri::{ plugin::{Builder as PluginBuilder, TauriPlugin}, LogicalSize, Manager, Monitor, PhysicalPosition, Phy...
rust
Apache-2.0
dd4c37f73ffd4b497da32c5c58333b5e896d35bc
2026-01-04T20:20:08.111445Z
false
tauri-apps/tauri-plugin-window-state
https://github.com/tauri-apps/tauri-plugin-window-state/blob/dd4c37f73ffd4b497da32c5c58333b5e896d35bc/src/cmd.rs
src/cmd.rs
use crate::{AppHandleExt, StateFlags, WindowExt}; use tauri::{command, AppHandle, Manager, Runtime}; #[command] pub async fn save_window_state<R: Runtime>( app: AppHandle<R>, flags: u32, ) -> std::result::Result<(), String> { let flags = StateFlags::from_bits(flags) .ok_or_else(|| format!("Invalid ...
rust
Apache-2.0
dd4c37f73ffd4b497da32c5c58333b5e896d35bc
2026-01-04T20:20:08.111445Z
false
wgmath/wgmath
https://github.com/wgmath/wgmath/blob/ac89dceb8a33778e895303cd606da38afb015192/crates/wgparry/src/lib.rs
crates/wgparry/src/lib.rs
#![doc = include_str!("../README.md")] #![warn(missing_docs)] #![allow(clippy::result_large_err)] #![allow(clippy::too_many_arguments)] pub extern crate nalgebra as na; #[cfg(feature = "dim2")] pub extern crate parry2d as parry; #[cfg(feature = "dim3")] pub extern crate parry3d as parry; use naga_oil::compose::Shader...
rust
Apache-2.0
ac89dceb8a33778e895303cd606da38afb015192
2026-01-04T20:20:10.684006Z
false
wgmath/wgmath
https://github.com/wgmath/wgmath/blob/ac89dceb8a33778e895303cd606da38afb015192/crates/wgparry/src/broad_phase/brute_force_broad_phase.rs
crates/wgparry/src/broad_phase/brute_force_broad_phase.rs
//! Brute-force broad-phase collision detection. //! //! Tests all pairs of colliders for AABB overlap (O(n²) complexity). While not scalable //! for large scenes, the algorithm is highly parallelizable on GPU and can outperform more //! sophisticated algorithms for small to medium-sized simulations (< 1000 objects). /...
rust
Apache-2.0
ac89dceb8a33778e895303cd606da38afb015192
2026-01-04T20:20:10.684006Z
false
wgmath/wgmath
https://github.com/wgmath/wgmath/blob/ac89dceb8a33778e895303cd606da38afb015192/crates/wgparry/src/broad_phase/lbvh.rs
crates/wgparry/src/broad_phase/lbvh.rs
use crate::bounding_volumes::WgAabb; use crate::math::{GpuSim, Point}; use crate::shapes::{GpuShape, WgShape}; use crate::utils::{RadixSort, RadixSortWorkspace}; use crate::{dim_shader_defs, substitute_aliases}; use naga_oil::compose::ComposerError; use parry::bounding_volume::Aabb; use wgcore::indirect::{DispatchIndir...
rust
Apache-2.0
ac89dceb8a33778e895303cd606da38afb015192
2026-01-04T20:20:10.684006Z
false
wgmath/wgmath
https://github.com/wgmath/wgmath/blob/ac89dceb8a33778e895303cd606da38afb015192/crates/wgparry/src/broad_phase/mod.rs
crates/wgparry/src/broad_phase/mod.rs
//! Broad-phase collision detection algorithms for identifying potentially colliding pairs. //! //! Broad-phase collision detection quickly filters out non-colliding object pairs before //! running expensive narrow-phase tests. This module provides GPU-accelerated implementations //! of various broad-phase algorithms. ...
rust
Apache-2.0
ac89dceb8a33778e895303cd606da38afb015192
2026-01-04T20:20:10.684006Z
false
wgmath/wgmath
https://github.com/wgmath/wgmath/blob/ac89dceb8a33778e895303cd606da38afb015192/crates/wgparry/src/broad_phase/narrow_phase.rs
crates/wgparry/src/broad_phase/narrow_phase.rs
//! Narrow-phase collision detection for generating contact manifolds. //! //! After the broad-phase identifies potentially colliding pairs using AABBs, the narrow-phase //! performs detailed collision tests to generate contact manifolds. These manifolds contain //! precise contact point information needed for physics ...
rust
Apache-2.0
ac89dceb8a33778e895303cd606da38afb015192
2026-01-04T20:20:10.684006Z
false
wgmath/wgmath
https://github.com/wgmath/wgmath/blob/ac89dceb8a33778e895303cd606da38afb015192/crates/wgparry/src/utils/mod.rs
crates/wgparry/src/utils/mod.rs
//! Utility functions and data structures for GPU-accelerated algorithms. //! //! This module provides general-purpose GPU algorithms that support the collision //! detection and physics simulation pipelines. pub use radix_sort::{RadixSort, RadixSortWorkspace}; mod radix_sort;
rust
Apache-2.0
ac89dceb8a33778e895303cd606da38afb015192
2026-01-04T20:20:10.684006Z
false
wgmath/wgmath
https://github.com/wgmath/wgmath/blob/ac89dceb8a33778e895303cd606da38afb015192/crates/wgparry/src/utils/radix_sort/mod.rs
crates/wgparry/src/utils/radix_sort/mod.rs
//! Radix sort implementation, ported from `brush-sort`: <https://github.com/ArthurBrussee/brush/tree/main/crates/brush-sort> use naga_oil::compose::ComposerError; use wgcore::kernel::KernelDispatch; use wgcore::tensor::{GpuScalar, GpuVector}; use wgcore::Shader; use wgpu::{BufferUsages, ComputePass, ComputePipeline, ...
rust
Apache-2.0
ac89dceb8a33778e895303cd606da38afb015192
2026-01-04T20:20:10.684006Z
false
wgmath/wgmath
https://github.com/wgmath/wgmath/blob/ac89dceb8a33778e895303cd606da38afb015192/crates/wgparry/src/queries/sat.rs
crates/wgparry/src/queries/sat.rs
//! Separating Axis Theorem (SAT) collision detection. //! //! SAT is an efficient algorithm for detecting collisions between convex polyhedra //! (like cuboids). It works by testing potential separating axes: if any axis exists //! along which the shapes' projections don't overlap, the shapes don't collide. use crate...
rust
Apache-2.0
ac89dceb8a33778e895303cd606da38afb015192
2026-01-04T20:20:10.684006Z
false
wgmath/wgmath
https://github.com/wgmath/wgmath/blob/ac89dceb8a33778e895303cd606da38afb015192/crates/wgparry/src/queries/contact.rs
crates/wgparry/src/queries/contact.rs
//! Contact generation for collision response. //! //! This module implements contact manifold generation between pairs of colliding shapes. //! Contact manifolds contain multiple contact points with normals and penetration depths, //! which are essential for physics simulation and collision response. //! //! # Contact...
rust
Apache-2.0
ac89dceb8a33778e895303cd606da38afb015192
2026-01-04T20:20:10.684006Z
false
wgmath/wgmath
https://github.com/wgmath/wgmath/blob/ac89dceb8a33778e895303cd606da38afb015192/crates/wgparry/src/queries/projection.rs
crates/wgparry/src/queries/projection.rs
//! Point projection queries for distance and closest point calculations. //! //! Point projection finds the closest point on a shape's surface to a given query point. //! This is fundamental for: //! - Distance queries between shapes //! - Penetration depth calculations //! - Closest point computations //! - Contact p...
rust
Apache-2.0
ac89dceb8a33778e895303cd606da38afb015192
2026-01-04T20:20:10.684006Z
false
wgmath/wgmath
https://github.com/wgmath/wgmath/blob/ac89dceb8a33778e895303cd606da38afb015192/crates/wgparry/src/queries/ray.rs
crates/wgparry/src/queries/ray.rs
//! Ray data structure and shader for ray-casting queries. use wgcore::Shader; #[derive(Shader)] #[shader(src = "ray.wgsl")] /// GPU shader defining the ray data structure for ray-casting queries. /// /// This shader provides the WGSL definition of a ray, which consists of: /// - **Origin**: The starting point of the ...
rust
Apache-2.0
ac89dceb8a33778e895303cd606da38afb015192
2026-01-04T20:20:10.684006Z
false
wgmath/wgmath
https://github.com/wgmath/wgmath/blob/ac89dceb8a33778e895303cd606da38afb015192/crates/wgparry/src/queries/mod.rs
crates/wgparry/src/queries/mod.rs
//! Geometric query operations for collision detection and physics simulation. //! //! This module provides GPU-accelerated geometric algorithms for: //! - **Ray-casting**: Finding intersections between rays and shapes //! - **Point projection**: Finding the closest point on a shape's surface //! - **Contact generation...
rust
Apache-2.0
ac89dceb8a33778e895303cd606da38afb015192
2026-01-04T20:20:10.684006Z
false
wgmath/wgmath
https://github.com/wgmath/wgmath/blob/ac89dceb8a33778e895303cd606da38afb015192/crates/wgparry/src/queries/polygonal_feature.rs
crates/wgparry/src/queries/polygonal_feature.rs
//! Polygonal feature extraction and contact manifold generation. //! //! Polygonal features (faces, edges, vertices) are geometric primitives extracted from //! shapes like cuboids for contact manifold generation. This module implements the //! feature-clipping algorithm for generating multi-point contact manifolds in...
rust
Apache-2.0
ac89dceb8a33778e895303cd606da38afb015192
2026-01-04T20:20:10.684006Z
false
wgmath/wgmath
https://github.com/wgmath/wgmath/blob/ac89dceb8a33778e895303cd606da38afb015192/crates/wgparry/src/queries/gjk/mod.rs
crates/wgparry/src/queries/gjk/mod.rs
use crate::queries::WgProjection; use crate::shapes::{WgSegment, WgShape, WgTriangle}; use crate::{dim_shader_defs, substitute_aliases}; use wgcore::Shader; #[cfg(feature = "dim3")] use crate::shapes::WgTetrahedron; #[derive(Shader)] #[shader( src = "cso_point.wgsl", shader_defs = "dim_shader_defs", src_f...
rust
Apache-2.0
ac89dceb8a33778e895303cd606da38afb015192
2026-01-04T20:20:10.684006Z
false
wgmath/wgmath
https://github.com/wgmath/wgmath/blob/ac89dceb8a33778e895303cd606da38afb015192/crates/wgparry/src/bounding_volumes/aabb.rs
crates/wgparry/src/bounding_volumes/aabb.rs
//! Axis-Aligned Bounding Box (AABB) implementation. //! //! An AABB is the simplest and most widely used bounding volume, defined by its //! minimum and maximum corner points along each coordinate axis. AABBs are not //! rotated with the objects they bound; instead, they expand to accommodate rotation. //! //! # Prope...
rust
Apache-2.0
ac89dceb8a33778e895303cd606da38afb015192
2026-01-04T20:20:10.684006Z
false
wgmath/wgmath
https://github.com/wgmath/wgmath/blob/ac89dceb8a33778e895303cd606da38afb015192/crates/wgparry/src/bounding_volumes/mod.rs
crates/wgparry/src/bounding_volumes/mod.rs
//! Bounding volume data structures for collision detection acceleration. //! //! Bounding volumes are simple geometric shapes that enclose more complex objects. //! They enable fast broad-phase collision detection by providing cheap overlap tests //! before performing expensive narrow-phase collision detection. //! //...
rust
Apache-2.0
ac89dceb8a33778e895303cd606da38afb015192
2026-01-04T20:20:10.684006Z
false
wgmath/wgmath
https://github.com/wgmath/wgmath/blob/ac89dceb8a33778e895303cd606da38afb015192/crates/wgparry/src/shapes/convex_polyhedron.rs
crates/wgparry/src/shapes/convex_polyhedron.rs
//! Convex polyhedron shape. use crate::bounding_volumes::WgAabb; use crate::queries::{WgPolygonalFeature, WgProjection, WgRay}; use crate::shapes::WgVtxIdx; use crate::{dim_shader_defs, substitute_aliases}; use wgcore::Shader; use wgebra::{WgSim2, WgSim3}; #[derive(Shader)] #[shader( derive( WgSim3, ...
rust
Apache-2.0
ac89dceb8a33778e895303cd606da38afb015192
2026-01-04T20:20:10.684006Z
false
wgmath/wgmath
https://github.com/wgmath/wgmath/blob/ac89dceb8a33778e895303cd606da38afb015192/crates/wgparry/src/shapes/shape.rs
crates/wgparry/src/shapes/shape.rs
//! Unified shape representation for GPU-accelerated collision detection. //! //! This module provides [`GpuShape`], a compact, GPU-friendly representation that can //! encode any supported geometric primitive. It uses a tagged union approach where //! shape data is packed into two `Vector4<f32>` values, with the shape...
rust
Apache-2.0
ac89dceb8a33778e895303cd606da38afb015192
2026-01-04T20:20:10.684006Z
false
wgmath/wgmath
https://github.com/wgmath/wgmath/blob/ac89dceb8a33778e895303cd606da38afb015192/crates/wgparry/src/shapes/cone.rs
crates/wgparry/src/shapes/cone.rs
//! Cone shape (3D only). //! //! A cone is defined by a half-height (distance from base to apex) and a base radius. //! The cone is centered at the origin with its axis aligned along the Y-axis, with the //! apex pointing in the positive Y direction. //! //! **Note:** This shape is only available with the `dim3` featu...
rust
Apache-2.0
ac89dceb8a33778e895303cd606da38afb015192
2026-01-04T20:20:10.684006Z
false
wgmath/wgmath
https://github.com/wgmath/wgmath/blob/ac89dceb8a33778e895303cd606da38afb015192/crates/wgparry/src/shapes/polyline.rs
crates/wgparry/src/shapes/polyline.rs
//! Triangle mesh shape. use crate::bounding_volumes::WgAabb; use crate::queries::{WgPolygonalFeature, WgProjection, WgRay}; use crate::shapes::{WgConvexPolyhedron, WgSegment, WgVtxIdx}; use crate::{dim_shader_defs, substitute_aliases}; use wgcore::Shader; use wgebra::{WgSim2, WgSim3}; #[derive(Shader)] #[shader( ...
rust
Apache-2.0
ac89dceb8a33778e895303cd606da38afb015192
2026-01-04T20:20:10.684006Z
false
wgmath/wgmath
https://github.com/wgmath/wgmath/blob/ac89dceb8a33778e895303cd606da38afb015192/crates/wgparry/src/shapes/cuboid.rs
crates/wgparry/src/shapes/cuboid.rs
//! Cuboid shape - box (3D) or rectangle (2D). //! //! A cuboid is an axis-aligned box defined by its half-extents (half-widths along each axis). //! In 2D, this represents a rectangle; in 3D, a rectangular prism. The cuboid is centered //! at the origin in local space. use crate::queries::{WgPolygonalFeature, WgProje...
rust
Apache-2.0
ac89dceb8a33778e895303cd606da38afb015192
2026-01-04T20:20:10.684006Z
false
wgmath/wgmath
https://github.com/wgmath/wgmath/blob/ac89dceb8a33778e895303cd606da38afb015192/crates/wgparry/src/shapes/tetrahedron.rs
crates/wgparry/src/shapes/tetrahedron.rs
//! Tetrahedron shape. //! //! A tetrahedron is defined by three vertices (A, B, C). use crate::queries::WgProjection; use crate::substitute_aliases; use wgcore::Shader; #[derive(Shader)] #[shader( derive(WgProjection), src = "tetrahedron.wgsl", src_fn = "substitute_aliases" )] /// GPU shader for the tetr...
rust
Apache-2.0
ac89dceb8a33778e895303cd606da38afb015192
2026-01-04T20:20:10.684006Z
false
wgmath/wgmath
https://github.com/wgmath/wgmath/blob/ac89dceb8a33778e895303cd606da38afb015192/crates/wgparry/src/shapes/vtx_idx.rs
crates/wgparry/src/shapes/vtx_idx.rs
//! Buffer bindings for all the complex shapes requiring an index and vertex buffer //! (trimesh, convex polyhedrons, etc.) use crate::{dim_shader_defs, substitute_aliases}; use wgcore::Shader; #[derive(Shader)] #[shader( src = "vtx_idx.wgsl", src_fn = "substitute_aliases", shader_defs = "dim_shader_defs"...
rust
Apache-2.0
ac89dceb8a33778e895303cd606da38afb015192
2026-01-04T20:20:10.684006Z
false
wgmath/wgmath
https://github.com/wgmath/wgmath/blob/ac89dceb8a33778e895303cd606da38afb015192/crates/wgparry/src/shapes/cylinder.rs
crates/wgparry/src/shapes/cylinder.rs
//! Cylinder shape (3D only). //! //! A cylinder is defined by a half-height and a radius. The cylinder is centered at //! the origin with its axis aligned along the Y-axis. //! //! **Note:** This shape is only available with the `dim3` feature. use crate::queries::{WgPolygonalFeature, WgProjection, WgRay}; use crate:...
rust
Apache-2.0
ac89dceb8a33778e895303cd606da38afb015192
2026-01-04T20:20:10.684006Z
false