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 |
|---|---|---|---|---|---|---|---|---|
lumeohq/onvif-rs | https://github.com/lumeohq/onvif-rs/blob/8f1490e2ce5e2ddd29dbd3ab2586d7a90da0b6d6/xsd_rs/xop/src/include.rs | xsd_rs/xop/src/include.rs | use validate::Validate;
use yaserde_derive::{YaDeserialize, YaSerialize};
// pub type Include = Include;
#[derive(Default, PartialEq, Debug, YaSerialize, YaDeserialize)]
#[yaserde(
prefix = "tns",
namespace = "tns: http://www.w3.org/2004/08/xop/include"
)]
pub struct Include {
#[yaserde(attribute, rename =... | rust | MIT | 8f1490e2ce5e2ddd29dbd3ab2586d7a90da0b6d6 | 2026-01-04T20:20:57.434821Z | false |
lumeohq/onvif-rs | https://github.com/lumeohq/onvif-rs/blob/8f1490e2ce5e2ddd29dbd3ab2586d7a90da0b6d6/xsd_rs/soap_envelope/src/lib.rs | xsd_rs/soap_envelope/src/lib.rs | #![allow(clippy::derive_partial_eq_without_eq)]
use std::str::FromStr;
use validate::Validate;
use xsd_macro_utils::*;
use yaserde_derive::{YaDeserialize, YaSerialize};
#[derive(Default, PartialEq, Debug, YaSerialize, YaDeserialize)]
#[yaserde(
prefix = "tns",
namespace = "tns: http://www.w3.org/2003/05/soap-... | rust | MIT | 8f1490e2ce5e2ddd29dbd3ab2586d7a90da0b6d6 | 2026-01-04T20:20:57.434821Z | false |
lumeohq/onvif-rs | https://github.com/lumeohq/onvif-rs/blob/8f1490e2ce5e2ddd29dbd3ab2586d7a90da0b6d6/transport/src/lib.rs | transport/src/lib.rs | use async_trait::async_trait;
use thiserror::Error;
use yaserde::{YaDeserialize, YaSerialize};
#[derive(Debug, Error)]
pub enum Error {
#[error("Serialization failed: {0}")]
Serialization(String),
#[error("Deserialization failed: {0}")]
Deserialization(String),
#[error("Authorization failed: {0}")]... | rust | MIT | 8f1490e2ce5e2ddd29dbd3ab2586d7a90da0b6d6 | 2026-01-04T20:20:57.434821Z | false |
lumeohq/onvif-rs | https://github.com/lumeohq/onvif-rs/blob/8f1490e2ce5e2ddd29dbd3ab2586d7a90da0b6d6/schema/src/lib.rs | schema/src/lib.rs | // Generated code contains upper-case acronyms. Ideally it shouldn't, but changing the codegen
// is not trivial (in addition to changing the casing being a breaking change, of course).
// This issue is being tracked at <https://github.com/lumeohq/xsd-parser-rs/issues/123>.
#![allow(clippy::upper_case_acronyms)]
pub u... | rust | MIT | 8f1490e2ce5e2ddd29dbd3ab2586d7a90da0b6d6 | 2026-01-04T20:20:57.434821Z | false |
lumeohq/onvif-rs | https://github.com/lumeohq/onvif-rs/blob/8f1490e2ce5e2ddd29dbd3ab2586d7a90da0b6d6/schema/src/tests.rs | schema/src/tests.rs | use super::*;
use assert_approx_eq::assert_approx_eq;
use async_trait::async_trait;
use onvif as tt;
use utils::assert_xml_eq;
use xsd_types::types as xs;
mod utils;
pub struct FakeTransport {
pub response: String,
}
#[async_trait]
impl transport::Transport for FakeTransport {
async fn request(&self, _messa... | rust | MIT | 8f1490e2ce5e2ddd29dbd3ab2586d7a90da0b6d6 | 2026-01-04T20:20:57.434821Z | false |
lumeohq/onvif-rs | https://github.com/lumeohq/onvif-rs/blob/8f1490e2ce5e2ddd29dbd3ab2586d7a90da0b6d6/schema/src/tests/utils.rs | schema/src/tests/utils.rs | use xml::reader::XmlEvent;
pub fn assert_xml_eq(actual: &str, expected: &str) {
for (a, e) in without_whitespaces(actual).zip(without_whitespaces(expected)) {
match (a, e) {
(
Ok(XmlEvent::StartDocument {
version,
encoding,
... | rust | MIT | 8f1490e2ce5e2ddd29dbd3ab2586d7a90da0b6d6 | 2026-01-04T20:20:57.434821Z | false |
lumeohq/onvif-rs | https://github.com/lumeohq/onvif-rs/blob/8f1490e2ce5e2ddd29dbd3ab2586d7a90da0b6d6/onvif/src/lib.rs | onvif/src/lib.rs | #[cfg(test)]
#[macro_use]
extern crate yaserde_derive;
pub mod discovery;
pub mod soap;
mod utils;
| rust | MIT | 8f1490e2ce5e2ddd29dbd3ab2586d7a90da0b6d6 | 2026-01-04T20:20:57.434821Z | false |
lumeohq/onvif-rs | https://github.com/lumeohq/onvif-rs/blob/8f1490e2ce5e2ddd29dbd3ab2586d7a90da0b6d6/onvif/src/discovery/mod.rs | onvif/src/discovery/mod.rs | mod network_enumeration;
use crate::discovery::network_enumeration::enumerate_network_v4;
use futures::stream::{self, StreamExt};
use futures_core::stream::Stream;
use schema::ws_discovery::{probe, probe_matches};
use std::iter::Iterator;
use std::{
collections::HashSet,
fmt::{Debug, Formatter},
net::{IpAd... | rust | MIT | 8f1490e2ce5e2ddd29dbd3ab2586d7a90da0b6d6 | 2026-01-04T20:20:57.434821Z | false |
lumeohq/onvif-rs | https://github.com/lumeohq/onvif-rs/blob/8f1490e2ce5e2ddd29dbd3ab2586d7a90da0b6d6/onvif/src/discovery/network_enumeration.rs | onvif/src/discovery/network_enumeration.rs | use std::net::Ipv4Addr;
#[inline]
fn octets_to_u32(octets: [u8; 4]) -> u32 {
(octets[0] as u32) << (3 * 8)
| (octets[1] as u32) << (2 * 8)
| (octets[2] as u32) << 8
| (octets[3] as u32)
}
/// Enumerate the list of IPs on the network given the network address and the mask.
pub fn enumerate_... | rust | MIT | 8f1490e2ce5e2ddd29dbd3ab2586d7a90da0b6d6 | 2026-01-04T20:20:57.434821Z | false |
lumeohq/onvif-rs | https://github.com/lumeohq/onvif-rs/blob/8f1490e2ce5e2ddd29dbd3ab2586d7a90da0b6d6/onvif/src/soap/tests.rs | onvif/src/soap/tests.rs | use super::*;
use crate::utils::xml_eq::assert_xml_eq;
use schema::soap_envelope::{FaultcodeEnum, Reasontext, Subcode};
#[test]
fn test_soap() {
let app_data = r#"
<my:Book xmlns:my="http://www.example.my/schema">
<my:Title>Such book</my:Title>
<my:Pages>42</my:Pages>
</my:B... | rust | MIT | 8f1490e2ce5e2ddd29dbd3ab2586d7a90da0b6d6 | 2026-01-04T20:20:57.434821Z | false |
lumeohq/onvif-rs | https://github.com/lumeohq/onvif-rs/blob/8f1490e2ce5e2ddd29dbd3ab2586d7a90da0b6d6/onvif/src/soap/client.rs | onvif/src/soap/client.rs | #![allow(clippy::large_enum_variant)]
use crate::soap::{
self,
auth::{digest::Digest, username_token::UsernameToken},
};
use async_recursion::async_recursion;
use async_trait::async_trait;
use futures_util::lock::Mutex;
use schema::transport::{Error, Transport};
use std::ops::DerefMut;
use std::{
fmt::{Deb... | rust | MIT | 8f1490e2ce5e2ddd29dbd3ab2586d7a90da0b6d6 | 2026-01-04T20:20:57.434821Z | false |
lumeohq/onvif-rs | https://github.com/lumeohq/onvif-rs/blob/8f1490e2ce5e2ddd29dbd3ab2586d7a90da0b6d6/onvif/src/soap/auth.rs | onvif/src/soap/auth.rs | pub mod digest;
pub mod username_token;
| rust | MIT | 8f1490e2ce5e2ddd29dbd3ab2586d7a90da0b6d6 | 2026-01-04T20:20:57.434821Z | false |
lumeohq/onvif-rs | https://github.com/lumeohq/onvif-rs/blob/8f1490e2ce5e2ddd29dbd3ab2586d7a90da0b6d6/onvif/src/soap/mod.rs | onvif/src/soap/mod.rs | pub mod auth;
pub mod client;
#[cfg(test)]
mod tests;
use auth::username_token::UsernameToken;
use schema::soap_envelope;
use xmltree::{Element, Namespace, XMLNode};
const SOAP_URI: &str = "http://www.w3.org/2003/05/soap-envelope";
#[derive(Debug)]
pub enum Error {
ParseError,
EnvelopeNotFound,
BodyNotFo... | rust | MIT | 8f1490e2ce5e2ddd29dbd3ab2586d7a90da0b6d6 | 2026-01-04T20:20:57.434821Z | false |
lumeohq/onvif-rs | https://github.com/lumeohq/onvif-rs/blob/8f1490e2ce5e2ddd29dbd3ab2586d7a90da0b6d6/onvif/src/soap/auth/digest.rs | onvif/src/soap/auth/digest.rs | use crate::soap::client::Credentials;
use nonzero_ext::nonzero;
use reqwest::{RequestBuilder, Response};
use std::fmt::{Debug, Formatter};
use std::num::NonZeroU8;
use thiserror::Error;
use url::Url;
#[derive(Debug, Error)]
pub enum Error {
#[error("Invalid state")]
InvalidState,
#[error("No credentials")]... | rust | MIT | 8f1490e2ce5e2ddd29dbd3ab2586d7a90da0b6d6 | 2026-01-04T20:20:57.434821Z | false |
lumeohq/onvif-rs | https://github.com/lumeohq/onvif-rs/blob/8f1490e2ce5e2ddd29dbd3ab2586d7a90da0b6d6/onvif/src/soap/auth/username_token.rs | onvif/src/soap/auth/username_token.rs | #[derive(Default, Debug, Clone)]
pub struct UsernameToken {
pub username: String,
pub nonce: String,
pub digest: String,
pub created: String,
}
impl UsernameToken {
pub fn new(
username: &str,
password: &str,
fix_time_gap: Option<chrono::Duration>,
) -> UsernameToken {
... | rust | MIT | 8f1490e2ce5e2ddd29dbd3ab2586d7a90da0b6d6 | 2026-01-04T20:20:57.434821Z | false |
lumeohq/onvif-rs | https://github.com/lumeohq/onvif-rs/blob/8f1490e2ce5e2ddd29dbd3ab2586d7a90da0b6d6/onvif/src/utils/display_list.rs | onvif/src/utils/display_list.rs | use std::fmt::{Debug, Display, Formatter, Write};
pub struct DisplayList<'a, T>(pub &'a [T]);
impl<T: Display> Debug for DisplayList<'_, T> {
fn fmt(&self, formatter: &mut Formatter<'_>) -> std::fmt::Result {
formatter.write_char('[')?;
let mut peekable = self.0.iter().peekable();
while ... | rust | MIT | 8f1490e2ce5e2ddd29dbd3ab2586d7a90da0b6d6 | 2026-01-04T20:20:57.434821Z | false |
lumeohq/onvif-rs | https://github.com/lumeohq/onvif-rs/blob/8f1490e2ce5e2ddd29dbd3ab2586d7a90da0b6d6/onvif/src/utils/xml_eq.rs | onvif/src/utils/xml_eq.rs | pub fn assert_xml_eq(actual: &str, expected: &str) {
for (a, e) in without_whitespaces(actual).zip(without_whitespaces(expected)) {
assert_eq!(a, e);
}
}
fn without_whitespaces(
expected: &str,
) -> impl Iterator<Item = Result<xml::reader::XmlEvent, xml::reader::Error>> + '_ {
xml::EventReader:... | rust | MIT | 8f1490e2ce5e2ddd29dbd3ab2586d7a90da0b6d6 | 2026-01-04T20:20:57.434821Z | false |
lumeohq/onvif-rs | https://github.com/lumeohq/onvif-rs/blob/8f1490e2ce5e2ddd29dbd3ab2586d7a90da0b6d6/onvif/src/utils/mod.rs | onvif/src/utils/mod.rs | pub mod display_list;
pub mod hash;
#[cfg(test)]
pub mod xml_eq;
| rust | MIT | 8f1490e2ce5e2ddd29dbd3ab2586d7a90da0b6d6 | 2026-01-04T20:20:57.434821Z | false |
lumeohq/onvif-rs | https://github.com/lumeohq/onvif-rs/blob/8f1490e2ce5e2ddd29dbd3ab2586d7a90da0b6d6/onvif/src/utils/hash.rs | onvif/src/utils/hash.rs | use std::{
collections::hash_map::DefaultHasher,
hash::{Hash, Hasher},
};
pub fn calculate_hash<T: Hash>(t: &T) -> u64 {
let mut s = DefaultHasher::new();
t.hash(&mut s);
s.finish()
}
| rust | MIT | 8f1490e2ce5e2ddd29dbd3ab2586d7a90da0b6d6 | 2026-01-04T20:20:57.434821Z | false |
lumeohq/onvif-rs | https://github.com/lumeohq/onvif-rs/blob/8f1490e2ce5e2ddd29dbd3ab2586d7a90da0b6d6/onvif/examples/event.rs | onvif/examples/event.rs | // This example pulls messages related to the RuleEngine topic.
// RuleEngine topic consists of events related to motion detection.
// Tested on Dahua, uniview, reolink and axis ip cameras.
// Don't forget to set the camera's IP address, username and password.
use onvif::soap::client::{ClientBuilder, Credentials};
use... | rust | MIT | 8f1490e2ce5e2ddd29dbd3ab2586d7a90da0b6d6 | 2026-01-04T20:20:57.434821Z | false |
lumeohq/onvif-rs | https://github.com/lumeohq/onvif-rs/blob/8f1490e2ce5e2ddd29dbd3ab2586d7a90da0b6d6/onvif/examples/discovery.rs | onvif/examples/discovery.rs | extern crate onvif;
use onvif::discovery;
#[tokio::main]
async fn main() {
dotenv::dotenv().ok();
tracing_subscriber::fmt::init();
use futures_util::stream::StreamExt;
const MAX_CONCURRENT_JUMPERS: usize = 100;
discovery::DiscoveryBuilder::default()
.run()
.await
.unwrap()... | rust | MIT | 8f1490e2ce5e2ddd29dbd3ab2586d7a90da0b6d6 | 2026-01-04T20:20:57.434821Z | false |
lumeohq/onvif-rs | https://github.com/lumeohq/onvif-rs/blob/8f1490e2ce5e2ddd29dbd3ab2586d7a90da0b6d6/onvif/examples/camera.rs | onvif/examples/camera.rs | use chrono::{NaiveDate, Utc};
use onvif::soap::{self, client::AuthType};
use schema::{self, transport};
use structopt::StructOpt;
use tracing::{debug, warn};
use url::Url;
#[derive(StructOpt)]
#[structopt(name = "camera", about = "ONVIF camera control tool")]
struct Args {
#[structopt(global = true, long, requires... | rust | MIT | 8f1490e2ce5e2ddd29dbd3ab2586d7a90da0b6d6 | 2026-01-04T20:20:57.434821Z | false |
lumeohq/onvif-rs | https://github.com/lumeohq/onvif-rs/blob/8f1490e2ce5e2ddd29dbd3ab2586d7a90da0b6d6/validate/src/lib.rs | validate/src/lib.rs | pub trait Validate {
fn validate(&self) -> Result<(), String> {
Ok(())
}
}
| rust | MIT | 8f1490e2ce5e2ddd29dbd3ab2586d7a90da0b6d6 | 2026-01-04T20:20:57.434821Z | false |
Shizcow/hotpatch | https://github.com/Shizcow/hotpatch/blob/ce6a71d2e7188b7ed2af425a2ffce9b148a87034/hotpatch_macros/src/lib.rs | hotpatch_macros/src/lib.rs | #![feature(proc_macro_diagnostic)]
//! You probably want documentation for the [`hotpatch`](https://docs.rs/hotpatch) crate.
use proc_macro::TokenStream;
use std::sync::RwLock;
use syn::{parse::Nothing, ItemFn, ItemImpl, Path};
mod item_fn;
mod item_impl;
lazy_static::lazy_static! {
static ref EXPORTNUM: RwLock... | rust | Apache-2.0 | ce6a71d2e7188b7ed2af425a2ffce9b148a87034 | 2026-01-04T20:21:03.153459Z | false |
Shizcow/hotpatch | https://github.com/Shizcow/hotpatch/blob/ce6a71d2e7188b7ed2af425a2ffce9b148a87034/hotpatch_macros/src/item_impl.rs | hotpatch_macros/src/item_impl.rs | use proc_macro::TokenStream;
use proc_macro2::Span;
use quote::quote;
use quote::ToTokens;
use syn::{FnArg::Typed, Ident, ImplItemConst, ImplItemMethod, ItemImpl, ReturnType::Type};
use std::sync::RwLock;
use syn::spanned::Spanned;
use crate::EXPORTNUM;
lazy_static::lazy_static! {
static ref WRAPPER_NUM: RwLock<us... | rust | Apache-2.0 | ce6a71d2e7188b7ed2af425a2ffce9b148a87034 | 2026-01-04T20:21:03.153459Z | false |
Shizcow/hotpatch | https://github.com/Shizcow/hotpatch/blob/ce6a71d2e7188b7ed2af425a2ffce9b148a87034/hotpatch_macros/src/item_fn.rs | hotpatch_macros/src/item_fn.rs | use proc_macro::TokenStream;
use proc_macro2::Span;
use quote::quote;
use quote::ToTokens;
use syn::{FnArg::Typed, Ident, ItemFn, ReturnType::Type};
use crate::EXPORTNUM;
pub fn patchable(fn_item: ItemFn, modpath: Option<String>) -> TokenStream {
let (fargs, output_type, mut fn_name, sigtext, mut item) = gather_i... | rust | Apache-2.0 | ce6a71d2e7188b7ed2af425a2ffce9b148a87034 | 2026-01-04T20:21:03.153459Z | false |
Shizcow/hotpatch | https://github.com/Shizcow/hotpatch/blob/ce6a71d2e7188b7ed2af425a2ffce9b148a87034/hotpatch/src/lib.rs | hotpatch/src/lib.rs | #![feature(unboxed_closures)]
#![feature(fn_traits)]
#![feature(const_fn)]
#![feature(const_fn_fn_ptr_basics)]
//! Changing function definitions at runtime.
//!
//! This crate is primarily used to load new function definitions from shared
//! object files in an exceedingly easy way.
//!
//! ## Short Example
//! The fo... | rust | Apache-2.0 | ce6a71d2e7188b7ed2af425a2ffce9b148a87034 | 2026-01-04T20:21:03.153459Z | false |
Shizcow/hotpatch | https://github.com/Shizcow/hotpatch/blob/ce6a71d2e7188b7ed2af425a2ffce9b148a87034/hotpatch/src/export.rs | hotpatch/src/export.rs | /// Created by [`#[patch]`](crate::patch). Internal use only.
///
/// Creates a `#[no_mangle] pub static` instance to be imported in another
/// binary by [`Patchable`](crate::Patchable) methods.
pub struct HotpatchExport<T: 'static> {
pub symbol: &'static str,
pub sig: &'static str,
pub ptr: T,
}
#[doc(hi... | rust | Apache-2.0 | ce6a71d2e7188b7ed2af425a2ffce9b148a87034 | 2026-01-04T20:21:03.153459Z | false |
Shizcow/hotpatch | https://github.com/Shizcow/hotpatch/blob/ce6a71d2e7188b7ed2af425a2ffce9b148a87034/hotpatch/src/docs.rs | hotpatch/src/docs.rs | //! A significant amount of source code uses variadic generics, which clutter
//! documentation. This module holds documentation for those, in a format
//! which is much easier to read.
#[cfg(doc)]
impl<RealType: ?Sized + Send + Sync + 'static, VaGen, Ret> crate::Patchable<RealType>
where
RealType: Fn(VaGen) -> Re... | rust | Apache-2.0 | ce6a71d2e7188b7ed2af425a2ffce9b148a87034 | 2026-01-04T20:21:03.153459Z | false |
Shizcow/hotpatch | https://github.com/Shizcow/hotpatch/blob/ce6a71d2e7188b7ed2af425a2ffce9b148a87034/examples/unsafe/unsafe_bin/src/main.rs | examples/unsafe/unsafe_bin/src/main.rs | #![feature(main)]
use hotpatch::*;
#[patchable]
fn main() -> Result<(), Box<dyn std::error::Error>> {
println!("You'll only see me once.");
unsafe { // because we're patching the current function, this will
// let multiple function definitions exist at the same time.
// That's unsafe, so the unsafe block is... | rust | Apache-2.0 | ce6a71d2e7188b7ed2af425a2ffce9b148a87034 | 2026-01-04T20:21:03.153459Z | false |
Shizcow/hotpatch | https://github.com/Shizcow/hotpatch/blob/ce6a71d2e7188b7ed2af425a2ffce9b148a87034/examples/unsafe/unsafe_obj/src/lib.rs | examples/unsafe/unsafe_obj/src/lib.rs | use hotpatch::patch;
#[patch]
pub fn main() -> Result<(), Box<dyn std::error::Error>> {
println!("I'm from somewhere else!");
Ok(())
}
| rust | Apache-2.0 | ce6a71d2e7188b7ed2af425a2ffce9b148a87034 | 2026-01-04T20:21:03.153459Z | false |
Shizcow/hotpatch | https://github.com/Shizcow/hotpatch/blob/ce6a71d2e7188b7ed2af425a2ffce9b148a87034/examples/threads/threads_obj/src/lib.rs | examples/threads/threads_obj/src/lib.rs | use hotpatch::patch;
#[patch]
pub fn foo() -> &'static str {
"Foo: Patched"
}
#[patch]
pub fn bar() -> &'static str {
"Bar: Patched"
}
| rust | Apache-2.0 | ce6a71d2e7188b7ed2af425a2ffce9b148a87034 | 2026-01-04T20:21:03.153459Z | false |
Shizcow/hotpatch | https://github.com/Shizcow/hotpatch/blob/ce6a71d2e7188b7ed2af425a2ffce9b148a87034/examples/threads/threads_bin/src/main.rs | examples/threads/threads_bin/src/main.rs | use hotpatch::*;
use std::{thread, time};
#[patchable]
fn foo() -> &'static str {
// The patched version does not sleep. This shows that
// no two threads can execute different definitions at
// the same time. Threads themselves may be out of order
// but after patching the first definition will n... | rust | Apache-2.0 | ce6a71d2e7188b7ed2af425a2ffce9b148a87034 | 2026-01-04T20:21:03.153459Z | false |
Shizcow/hotpatch | https://github.com/Shizcow/hotpatch/blob/ce6a71d2e7188b7ed2af425a2ffce9b148a87034/examples/multiple/multiple_obj1/src/lib.rs | examples/multiple/multiple_obj1/src/lib.rs | use hotpatch::patch;
#[patch]
pub fn foo() {
println!("Multiple 1");
}
| rust | Apache-2.0 | ce6a71d2e7188b7ed2af425a2ffce9b148a87034 | 2026-01-04T20:21:03.153459Z | false |
Shizcow/hotpatch | https://github.com/Shizcow/hotpatch/blob/ce6a71d2e7188b7ed2af425a2ffce9b148a87034/examples/multiple/multiple_obj2/src/lib.rs | examples/multiple/multiple_obj2/src/lib.rs | use hotpatch::patch;
#[patch]
pub fn foo() {
println!("Multiple 2");
}
| rust | Apache-2.0 | ce6a71d2e7188b7ed2af425a2ffce9b148a87034 | 2026-01-04T20:21:03.153459Z | false |
Shizcow/hotpatch | https://github.com/Shizcow/hotpatch/blob/ce6a71d2e7188b7ed2af425a2ffce9b148a87034/examples/multiple/multiple_bin/src/main.rs | examples/multiple/multiple_bin/src/main.rs | use hotpatch::*;
#[patchable]
fn foo() {
println!("Source");
}
fn main() -> Result<(), Box<dyn std::error::Error>> {
foo();
foo.hotpatch_lib("target/debug/libmultiple_obj1.so")?;
foo();
foo.hotpatch_lib("target/debug/libmultiple_obj2.so")?;
foo();
foo.restore_default()?;
foo();
Ok(... | rust | Apache-2.0 | ce6a71d2e7188b7ed2af425a2ffce9b148a87034 | 2026-01-04T20:21:03.153459Z | false |
Shizcow/hotpatch | https://github.com/Shizcow/hotpatch/blob/ce6a71d2e7188b7ed2af425a2ffce9b148a87034/examples/methods/src/main.rs | examples/methods/src/main.rs | use hotpatch::*;
/// This is a struct
struct Foo {
description: &'static str,
}
/// And this is where free associated items can be defined
#[patchable]
impl Foo {
/// Here's one of them!
fn new() -> Self {
Self {
description: "This object was created with the original definition",
... | rust | Apache-2.0 | ce6a71d2e7188b7ed2af425a2ffce9b148a87034 | 2026-01-04T20:21:03.153459Z | false |
Shizcow/hotpatch | https://github.com/Shizcow/hotpatch/blob/ce6a71d2e7188b7ed2af425a2ffce9b148a87034/examples/methods_extra_obj/src/lib.rs | examples/methods_extra_obj/src/lib.rs | use hotpatch::*;
/// There is a system of trust here
/// Foo is assumed to be the same struct everywhere
/// This may be possible to lock down even more with typeid, but that's WIP upstream
pub struct Foo {
pub description: &'static str,
}
#[patch]
impl Foo {
/// remember, #[patch] is top-level
pub fn new... | rust | Apache-2.0 | ce6a71d2e7188b7ed2af425a2ffce9b148a87034 | 2026-01-04T20:21:03.153459Z | false |
Shizcow/hotpatch | https://github.com/Shizcow/hotpatch/blob/ce6a71d2e7188b7ed2af425a2ffce9b148a87034/examples/hello_world/hw_obj/src/lib.rs | examples/hello_world/hw_obj/src/lib.rs | use hotpatch::patch;
#[patch]
/// This is what a patch looks like. It's a normal function that can still be executed locally
pub fn foo() {
println!("I am from patched foo.");
}
mod a {
use hotpatch::patch;
#[patch]
pub fn bar(a: i32) {
println!(
"I am from patched bar. I have {} a... | rust | Apache-2.0 | ce6a71d2e7188b7ed2af425a2ffce9b148a87034 | 2026-01-04T20:21:03.153459Z | false |
Shizcow/hotpatch | https://github.com/Shizcow/hotpatch/blob/ce6a71d2e7188b7ed2af425a2ffce9b148a87034/examples/hello_world/hw_bin/src/main.rs | examples/hello_world/hw_bin/src/main.rs | use hotpatch::*;
mod a {
use hotpatch::patchable;
#[patchable]
pub fn bar(a: i32) {
println!(
"I am from source bar. I have {} as an arg. I am module aware.",
a
);
}
}
#[patchable]
/// This is what a patchable item looks like. Just like a function!
fn foo() {
... | rust | Apache-2.0 | ce6a71d2e7188b7ed2af425a2ffce9b148a87034 | 2026-01-04T20:21:03.153459Z | false |
Shizcow/hotpatch | https://github.com/Shizcow/hotpatch/blob/ce6a71d2e7188b7ed2af425a2ffce9b148a87034/examples/local/src/main.rs | examples/local/src/main.rs | use hotpatch::*;
/// I'm a functor
#[patchable]
fn foo(_: i32) {
println!("I am Foo");
}
/// I'm a function with extra bits
#[patch]
fn tmp(_: i32) {}
fn bar(_: i32) {
println!("Foo Becomes Bar");
}
fn main() -> Result<(), Box<dyn std::error::Error>> {
foo(1);
foo.hotpatch_fn(bar)?;
foo(1);
... | rust | Apache-2.0 | ce6a71d2e7188b7ed2af425a2ffce9b148a87034 | 2026-01-04T20:21:03.153459Z | false |
nintha/river | https://github.com/nintha/river/blob/56a63312dd7fef48f73dbd3985022604c739ba40/src/ws_fmp4.rs | src/ws_fmp4.rs | use async_tungstenite::tungstenite::handshake::server::{ErrorResponse, Request, Response};
use async_tungstenite::tungstenite::Message;
use crossbeam_utils::atomic::AtomicCell;
use futures::sink::SinkExt;
use futures::StreamExt;
use smol::net::{SocketAddr, TcpListener, TcpStream};
use crate::protocol::h264::Nalu;
use ... | rust | Apache-2.0 | 56a63312dd7fef48f73dbd3985022604c739ba40 | 2026-01-04T20:21:06.830703Z | false |
nintha/river | https://github.com/nintha/river/blob/56a63312dd7fef48f73dbd3985022604c739ba40/src/lib.rs | src/lib.rs | #[macro_use]
extern crate num_derive;
mod eventbus;
pub mod http_flv;
pub mod http_player;
pub mod protocol;
pub mod rtmp_server;
pub mod util;
pub mod ws_h264;
pub mod ws_fmp4; | rust | Apache-2.0 | 56a63312dd7fef48f73dbd3985022604c739ba40 | 2026-01-04T20:21:06.830703Z | false |
nintha/river | https://github.com/nintha/river/blob/56a63312dd7fef48f73dbd3985022604c739ba40/src/ws_h264.rs | src/ws_h264.rs | use async_tungstenite::tungstenite::handshake::server::{ErrorResponse, Request, Response};
use async_tungstenite::tungstenite::Message;
use crossbeam_utils::atomic::AtomicCell;
use futures::sink::SinkExt;
use futures::StreamExt;
use smol::net::{SocketAddr, TcpListener, TcpStream};
use crate::protocol::h264::Nalu;
use ... | rust | Apache-2.0 | 56a63312dd7fef48f73dbd3985022604c739ba40 | 2026-01-04T20:21:06.830703Z | false |
nintha/river | https://github.com/nintha/river/blob/56a63312dd7fef48f73dbd3985022604c739ba40/src/eventbus.rs | src/eventbus.rs | use crossbeam_utils::atomic::AtomicCell;
use dashmap::DashMap;
use smol::channel::{Receiver, Sender};
pub struct EventBus<E> {
label: String,
incr_val: AtomicCell<u64>,
tx_map: DashMap<u64, Sender<E>>,
}
impl<E: 'static + Clone> EventBus<E> {
pub fn with_label(label: String) -> Self {
Self {
... | rust | Apache-2.0 | 56a63312dd7fef48f73dbd3985022604c739ba40 | 2026-01-04T20:21:06.830703Z | false |
nintha/river | https://github.com/nintha/river/blob/56a63312dd7fef48f73dbd3985022604c739ba40/src/util.rs | src/util.rs | use chrono::Local;
use rand::Rng;
use std::fmt::Debug;
use std::future::Future;
use std::io::Write;
pub fn init_logger() {
let env = env_logger::Env::default().filter_or(env_logger::DEFAULT_FILTER_ENV, "info");
// 设置日志打印格式
env_logger::Builder::from_env(env)
.format(|buf, record| {
write... | rust | Apache-2.0 | 56a63312dd7fef48f73dbd3985022604c739ba40 | 2026-01-04T20:21:06.830703Z | false |
nintha/river | https://github.com/nintha/river/blob/56a63312dd7fef48f73dbd3985022604c739ba40/src/http_flv.rs | src/http_flv.rs | use crate::util::spawn_and_log_error;
use smol::io::{AsyncReadExt, AsyncWriteExt};
use smol::net::{TcpListener, TcpStream};
use smol::stream::StreamExt;
use crate::rtmp_server::{eventbus_map, video_header_map};
use crate::protocol::flv::{FLV_HEADER_ONLY_VIDEO_WITH_TAG0};
use crate::protocol::flv::FlvTag;
use chrono::Lo... | rust | Apache-2.0 | 56a63312dd7fef48f73dbd3985022604c739ba40 | 2026-01-04T20:21:06.830703Z | false |
nintha/river | https://github.com/nintha/river/blob/56a63312dd7fef48f73dbd3985022604c739ba40/src/rtmp_server.rs | src/rtmp_server.rs | use amf::amf0::Value;
use amf::Pair;
use byteorder::{BigEndian, ByteOrder};
use chrono::Local;
use dashmap::DashMap;
use once_cell::sync::OnceCell;
use smol::net::{TcpListener, TcpStream};
use smol::prelude::*;
use crate::eventbus::EventBus;
use crate::protocol::rtmp::{
ChunkMessageType, Handshake0, Handshake1, Ha... | rust | Apache-2.0 | 56a63312dd7fef48f73dbd3985022604c739ba40 | 2026-01-04T20:21:06.830703Z | false |
nintha/river | https://github.com/nintha/river/blob/56a63312dd7fef48f73dbd3985022604c739ba40/src/main.rs | src/main.rs | use clap::crate_version;
use clap::Clap;
use river::{ws_h264, ws_fmp4, util, http_flv, http_player};
use river::rtmp_server::accept_loop;
use river::util::spawn_and_log_error;
#[derive(Clap, Debug)]
#[clap(version = crate_version ! (), author = "Ninthakeey <ninthakeey@hotmail.com>")]
struct Opts {
#[clap(long, de... | rust | Apache-2.0 | 56a63312dd7fef48f73dbd3985022604c739ba40 | 2026-01-04T20:21:06.830703Z | false |
nintha/river | https://github.com/nintha/river/blob/56a63312dd7fef48f73dbd3985022604c739ba40/src/http_player.rs | src/http_player.rs | use smol::io::{AsyncWriteExt, AsyncReadExt};
use smol::net::{TcpListener, TcpStream};
use smol::stream::StreamExt;
use crate::util::spawn_and_log_error;
pub async fn run_server(addr: String, player_html: String) -> anyhow::Result<()> {
// Open up a TCP connection and create a URL.
let listener = TcpListener::... | rust | Apache-2.0 | 56a63312dd7fef48f73dbd3985022604c739ba40 | 2026-01-04T20:21:06.830703Z | false |
nintha/river | https://github.com/nintha/river/blob/56a63312dd7fef48f73dbd3985022604c739ba40/src/protocol/aac.rs | src/protocol/aac.rs | use crate::protocol::rtmp::{RtmpMessage, ChunkMessageType};
/// # AAC rtmp头部信息封装
/// AAC音频文件的每一帧都由一个ADTS头和AAC ES(AAC音频数据)组成。
///
/// 以下是AAC音频数据格式
/// 第一个byte包含音频的编码参数:
/// ```
/// 1-4bit: audioCodeId
/// 5-6bit: 采样率 00 5.5KHZ, 01 11KHZ, 10 22KHZ, 11 44KHZ
/// 7 bit: 采样长度 0 8bit, 1 16bit
/// 8 bit: 立体声 0 单声道, 1 双声道
///... | rust | Apache-2.0 | 56a63312dd7fef48f73dbd3985022604c739ba40 | 2026-01-04T20:21:06.830703Z | false |
nintha/river | https://github.com/nintha/river/blob/56a63312dd7fef48f73dbd3985022604c739ba40/src/protocol/fmp4.rs | src/protocol/fmp4.rs | use std::{u32, vec};
use crate::rtmp_server::{eventbus_map, meta_data_map, video_header_map};
use crate::util::spawn_and_log_error;
use smol::channel::Receiver;
use crate::protocol::rtmp::RtmpMessage;
use crate::protocol::h264::Nalu;
use smol::io::AsyncWriteExt;
/// fps = timescale / duration
#[derive(Clone)]
pub stru... | rust | Apache-2.0 | 56a63312dd7fef48f73dbd3985022604c739ba40 | 2026-01-04T20:21:06.830703Z | false |
nintha/river | https://github.com/nintha/river/blob/56a63312dd7fef48f73dbd3985022604c739ba40/src/protocol/mod.rs | src/protocol/mod.rs | pub mod flv;
pub mod rtmp;
pub mod h264;
pub mod aac;
pub mod fmp4;
| rust | Apache-2.0 | 56a63312dd7fef48f73dbd3985022604c739ba40 | 2026-01-04T20:21:06.830703Z | false |
nintha/river | https://github.com/nintha/river/blob/56a63312dd7fef48f73dbd3985022604c739ba40/src/protocol/flv.rs | src/protocol/flv.rs | use byteorder::{BigEndian, ByteOrder};
use crate::protocol::rtmp::{ChunkMessageType, RtmpMessage};
use crate::util::spawn_and_log_error;
use smol::channel::Receiver;
use std::convert::TryFrom;
use crate::rtmp_server::eventbus_map;
use chrono::Local;
use smol::io::AsyncWriteExt;
use std::time::{Duration, Instant};
pu... | rust | Apache-2.0 | 56a63312dd7fef48f73dbd3985022604c739ba40 | 2026-01-04T20:21:06.830703Z | false |
nintha/river | https://github.com/nintha/river/blob/56a63312dd7fef48f73dbd3985022604c739ba40/src/protocol/h264.rs | src/protocol/h264.rs | use byteorder::{BigEndian, ByteOrder};
use crate::protocol::rtmp::{RtmpContext, RtmpMessage, ChunkMessageType};
/// H264编码数据存储或传输的基本单元
pub struct Nalu {
inner: Vec<u8>,
pub is_key_frame: bool,
}
impl Nalu {
pub const UNIT_TYPE_SPS: u8 = 7;
pub const UNIT_TYPE_PPS: u8 = 8;
/// RtmpMessage to Nalu... | rust | Apache-2.0 | 56a63312dd7fef48f73dbd3985022604c739ba40 | 2026-01-04T20:21:06.830703Z | false |
nintha/river | https://github.com/nintha/river/blob/56a63312dd7fef48f73dbd3985022604c739ba40/src/protocol/rtmp.rs | src/protocol/rtmp.rs | use std::fmt::{Debug, Formatter};
use amf::amf0;
use amf::amf0::Value;
use byteorder::{BigEndian, ByteOrder, WriteBytesExt};
use chrono::Local;
use num::FromPrimitive;
use smol::io::{AsyncReadExt, AsyncWriteExt};
use smol::net::TcpStream;
use crate::rtmp_server::eventbus_map;
use crate::util::bytes_hex_format;
use st... | rust | Apache-2.0 | 56a63312dd7fef48f73dbd3985022604c739ba40 | 2026-01-04T20:21:06.830703Z | false |
altunenes/cuneus | https://github.com/altunenes/cuneus/blob/4ab4a90169f70265c17a065d0db53bc168aeecc2/build.rs | build.rs | // Purpose: This build script configures the build environment for GStreamer integration.
//
// What this does:
// - Sets up necessary paths, environment variables and linker flags for GStreamer
// - Currently handles macOS-specific configuration for the GStreamer framework
//
// Customization for different environment... | rust | MIT | 4ab4a90169f70265c17a065d0db53bc168aeecc2 | 2026-01-04T20:21:00.414612Z | false |
altunenes/cuneus | https://github.com/altunenes/cuneus/blob/4ab4a90169f70265c17a065d0db53bc168aeecc2/src/app.rs | src/app.rs | use crate::{Core, ShaderManager};
use winit::{
application::ApplicationHandler,
dpi::LogicalSize,
event::*,
event_loop::{ActiveEventLoop, EventLoop},
window::WindowAttributes,
};
pub struct ShaderApp {
window_title: String,
window_size: (u32, u32),
core: Option<Core>,
}
impl ShaderApp ... | rust | MIT | 4ab4a90169f70265c17a065d0db53bc168aeecc2 | 2026-01-04T20:21:00.414612Z | false |
altunenes/cuneus | https://github.com/altunenes/cuneus/blob/4ab4a90169f70265c17a065d0db53bc168aeecc2/src/controls.rs | src/controls.rs | #[cfg(feature = "media")]
use crate::gst::video::VideoTextureManager;
use crate::hdri::HdriMetadata;
use std::path::PathBuf;
#[derive(Clone)]
pub struct ControlsRequest {
pub is_paused: bool,
pub should_reset: bool,
pub should_clear_buffers: bool,
pub current_time: Option<f32>,
pub window_size: Opti... | rust | MIT | 4ab4a90169f70265c17a065d0db53bc168aeecc2 | 2026-01-04T20:21:00.414612Z | false |
altunenes/cuneus | https://github.com/altunenes/cuneus/blob/4ab4a90169f70265c17a065d0db53bc168aeecc2/src/lib.rs | src/lib.rs | use std::sync::Arc;
use winit::window::Window;
pub use anyhow;
pub use bytemuck;
pub use egui;
pub use env_logger;
pub use wgpu;
pub use winit;
pub use bytemuck::{Pod, Zeroable};
pub use wgpu::SurfaceError;
pub use winit::event::WindowEvent;
mod app;
mod atomic;
pub mod compute;
mod controls;
mod export;
mod font;
m... | rust | MIT | 4ab4a90169f70265c17a065d0db53bc168aeecc2 | 2026-01-04T20:21:00.414612Z | false |
altunenes/cuneus | https://github.com/altunenes/cuneus/blob/4ab4a90169f70265c17a065d0db53bc168aeecc2/src/renderer.rs | src/renderer.rs | use wgpu::util::DeviceExt;
#[repr(C)]
#[derive(Copy, Clone, Debug, bytemuck::Pod, bytemuck::Zeroable)]
pub struct Vertex {
pub position: [f32; 2],
}
impl Vertex {
const ATTRIBS: [wgpu::VertexAttribute; 1] = wgpu::vertex_attr_array![0 => Float32x2];
pub fn desc() -> wgpu::VertexBufferLayout<'static> {
... | rust | MIT | 4ab4a90169f70265c17a065d0db53bc168aeecc2 | 2026-01-04T20:21:00.414612Z | false |
altunenes/cuneus | https://github.com/altunenes/cuneus/blob/4ab4a90169f70265c17a065d0db53bc168aeecc2/src/texture.rs | src/texture.rs | pub struct TextureManager {
pub texture: wgpu::Texture,
pub view: wgpu::TextureView,
pub sampler: wgpu::Sampler,
pub bind_group: wgpu::BindGroup,
}
impl TextureManager {
pub fn new(
device: &wgpu::Device,
queue: &wgpu::Queue,
image: &image::RgbaImage,
layout: &wgpu::B... | rust | MIT | 4ab4a90169f70265c17a065d0db53bc168aeecc2 | 2026-01-04T20:21:00.414612Z | false |
altunenes/cuneus | https://github.com/altunenes/cuneus/blob/4ab4a90169f70265c17a065d0db53bc168aeecc2/src/hot.rs | src/hot.rs | use notify::{Event, EventKind, RecursiveMode, Watcher};
use std::collections::HashMap;
use std::fs;
use std::path::{Path, PathBuf};
use std::sync::mpsc::{channel, Receiver};
use std::sync::Arc;
use std::time::{Duration, Instant};
pub enum ShaderType {
RenderPair, // Vertex + Fragment
Compute, // Compute
}
... | rust | MIT | 4ab4a90169f70265c17a065d0db53bc168aeecc2 | 2026-01-04T20:21:00.414612Z | false |
altunenes/cuneus | https://github.com/altunenes/cuneus/blob/4ab4a90169f70265c17a065d0db53bc168aeecc2/src/mouse.rs | src/mouse.rs | use crate::UniformProvider;
use winit::event::WindowEvent;
#[repr(C)]
#[derive(Copy, Clone, Debug, bytemuck::Pod, bytemuck::Zeroable)]
pub struct MouseUniform {
pub position: [f32; 2],
pub click_position: [f32; 2],
pub wheel: [f32; 2],
pub buttons: [u32; 2],
}
impl Default for MouseUniform {
fn de... | rust | MIT | 4ab4a90169f70265c17a065d0db53bc168aeecc2 | 2026-01-04T20:21:00.414612Z | false |
altunenes/cuneus | https://github.com/altunenes/cuneus/blob/4ab4a90169f70265c17a065d0db53bc168aeecc2/src/keyinputs.rs | src/keyinputs.rs | use winit::event::{ElementState, KeyEvent};
use winit::keyboard::Key;
use winit::window::Window;
pub struct KeyInputHandler {
is_fullscreen: bool,
pub show_ui: bool,
}
impl Default for KeyInputHandler {
fn default() -> Self {
Self::new()
}
}
impl KeyInputHandler {
pub fn new() -> Self {
... | rust | MIT | 4ab4a90169f70265c17a065d0db53bc168aeecc2 | 2026-01-04T20:21:00.414612Z | false |
altunenes/cuneus | https://github.com/altunenes/cuneus/blob/4ab4a90169f70265c17a065d0db53bc168aeecc2/src/font.rs | src/font.rs | use crate::{Core, TextureManager, UniformBinding, UniformProvider};
use bytemuck::{Pod, Zeroable};
use std::collections::HashMap;
// font system using texture atlas
#[repr(C)]
#[derive(Copy, Clone, Debug, Pod, Zeroable)]
pub struct FontUniforms {
pub atlas_size: [f32; 2],
pub char_size: [f32; 2],
pub scre... | rust | MIT | 4ab4a90169f70265c17a065d0db53bc168aeecc2 | 2026-01-04T20:21:00.414612Z | false |
altunenes/cuneus | https://github.com/altunenes/cuneus/blob/4ab4a90169f70265c17a065d0db53bc168aeecc2/src/uniforms.rs | src/uniforms.rs | use wgpu::util::DeviceExt;
pub trait UniformProvider {
fn as_bytes(&self) -> &[u8];
}
#[repr(C)]
#[derive(Copy, Clone, Debug, bytemuck::Pod, bytemuck::Zeroable)]
pub struct ResolutionUniform {
pub dimensions: [f32; 2],
pub _padding: [f32; 2],
pub audio_data: [[f32; 4]; 32],
pub bpm: f32,
pub bas... | rust | MIT | 4ab4a90169f70265c17a065d0db53bc168aeecc2 | 2026-01-04T20:21:00.414612Z | false |
altunenes/cuneus | https://github.com/altunenes/cuneus/blob/4ab4a90169f70265c17a065d0db53bc168aeecc2/src/fps.rs | src/fps.rs | use std::collections::VecDeque;
use std::time::Instant;
pub struct FpsTracker {
last_frame_time: Instant,
frame_times: VecDeque<f32>,
current_fps: f32,
}
impl Default for FpsTracker {
fn default() -> Self {
Self::new()
}
}
impl FpsTracker {
pub fn new() -> Self {
Self {
... | rust | MIT | 4ab4a90169f70265c17a065d0db53bc168aeecc2 | 2026-01-04T20:21:00.414612Z | false |
altunenes/cuneus | https://github.com/altunenes/cuneus/blob/4ab4a90169f70265c17a065d0db53bc168aeecc2/src/hdri.rs | src/hdri.rs | use crate::TextureManager;
use image::codecs::hdr::HdrDecoder;
use image::{ImageDecoder, RgbaImage};
use std::io::Cursor;
#[derive(Clone, Debug, Copy)]
pub struct HdriMetadata {
pub width: u32,
pub height: u32,
pub exposure: f32,
pub gamma: f32,
}
impl Default for HdriMetadata {
fn default() -> Se... | rust | MIT | 4ab4a90169f70265c17a065d0db53bc168aeecc2 | 2026-01-04T20:21:00.414612Z | false |
altunenes/cuneus | https://github.com/altunenes/cuneus/blob/4ab4a90169f70265c17a065d0db53bc168aeecc2/src/export.rs | src/export.rs | use image::ImageError;
use std::path::PathBuf;
use std::sync::mpsc;
#[derive(Debug)]
pub enum ExportError {
IoError(std::io::Error),
ImageError(ImageError),
}
impl From<std::io::Error> for ExportError {
fn from(err: std::io::Error) -> Self {
ExportError::IoError(err)
}
}
impl From<ImageError>... | rust | MIT | 4ab4a90169f70265c17a065d0db53bc168aeecc2 | 2026-01-04T20:21:00.414612Z | false |
altunenes/cuneus | https://github.com/altunenes/cuneus/blob/4ab4a90169f70265c17a065d0db53bc168aeecc2/src/atomic.rs | src/atomic.rs | pub struct AtomicBuffer {
pub buffer: wgpu::Buffer,
pub bind_group: wgpu::BindGroup,
pub size: u32,
}
impl AtomicBuffer {
pub fn new(device: &wgpu::Device, size: u32, layout: &wgpu::BindGroupLayout) -> Self {
let buffer_size = (size * 4 * 4) as u64;
let max_binding_size = device.limits(... | rust | MIT | 4ab4a90169f70265c17a065d0db53bc168aeecc2 | 2026-01-04T20:21:00.414612Z | false |
altunenes/cuneus | https://github.com/altunenes/cuneus/blob/4ab4a90169f70265c17a065d0db53bc168aeecc2/src/spectrum.rs | src/spectrum.rs | // This file is part of the gstreamer, and its inits the spectrum analyzer and bpm.
// I also did some smoothing related to audio data for the spectrum analyzer.
#[cfg(feature = "media")]
use crate::gst::video::VideoTextureManager;
#[cfg(feature = "media")]
use crate::ResolutionUniform;
#[cfg(feature = "media")]
use cr... | rust | MIT | 4ab4a90169f70265c17a065d0db53bc168aeecc2 | 2026-01-04T20:21:00.414612Z | false |
altunenes/cuneus | https://github.com/altunenes/cuneus/blob/4ab4a90169f70265c17a065d0db53bc168aeecc2/src/shader.rs | src/shader.rs | use crate::Core;
use winit::event::WindowEvent;
pub trait ShaderManager {
fn init(core: &Core) -> Self
where
Self: Sized;
fn resize(&mut self, _core: &Core) {}
fn update(&mut self, _core: &Core) {}
fn render(&mut self, core: &Core) -> Result<(), wgpu::SurfaceError>;
fn handle_input(&mut... | rust | MIT | 4ab4a90169f70265c17a065d0db53bc168aeecc2 | 2026-01-04T20:21:00.414612Z | false |
altunenes/cuneus | https://github.com/altunenes/cuneus/blob/4ab4a90169f70265c17a065d0db53bc168aeecc2/src/renderkit.rs | src/renderkit.rs | use crate::compute::ComputeShader;
#[cfg(feature = "media")]
use crate::gst::video::VideoTextureManager;
#[cfg(feature = "media")]
use crate::gst::webcam::WebcamTextureManager;
use crate::load_hdri_texture;
use crate::mouse::MouseTracker;
use crate::mouse::MouseUniform;
use crate::spectrum::SpectrumAnalyzer;
use crate:... | rust | MIT | 4ab4a90169f70265c17a065d0db53bc168aeecc2 | 2026-01-04T20:21:00.414612Z | true |
altunenes/cuneus | https://github.com/altunenes/cuneus/blob/4ab4a90169f70265c17a065d0db53bc168aeecc2/src/gst/video.rs | src/gst/video.rs | use crate::texture::TextureManager;
use anyhow::{anyhow, Result};
use gst::glib::ControlFlow;
use gst::prelude::*;
use gstreamer as gst;
use gstreamer_app as gst_app;
use gstreamer_video as gst_video;
use log::{debug, error, info, warn};
use std::path::Path;
use std::sync::{Arc, Mutex};
use std::time::{Duration, Instan... | rust | MIT | 4ab4a90169f70265c17a065d0db53bc168aeecc2 | 2026-01-04T20:21:00.414612Z | true |
altunenes/cuneus | https://github.com/altunenes/cuneus/blob/4ab4a90169f70265c17a065d0db53bc168aeecc2/src/gst/webcam.rs | src/gst/webcam.rs | use crate::texture::TextureManager;
use anyhow::{anyhow, Result};
use gst::prelude::*;
use gstreamer as gst;
use gstreamer_app as gst_app;
use gstreamer_video as gst_video;
use log::{debug, info};
use std::sync::{Arc, Mutex};
use std::time::Instant;
use wgpu;
/// Manages a webcam texture that can be updated frame by f... | rust | MIT | 4ab4a90169f70265c17a065d0db53bc168aeecc2 | 2026-01-04T20:21:00.414612Z | false |
altunenes/cuneus | https://github.com/altunenes/cuneus/blob/4ab4a90169f70265c17a065d0db53bc168aeecc2/src/gst/mod.rs | src/gst/mod.rs | #[cfg(feature = "media")]
pub mod audio;
#[cfg(feature = "media")]
pub mod video;
#[cfg(feature = "media")]
pub mod webcam;
use log::info;
#[cfg(feature = "media")]
pub fn init() -> anyhow::Result<()> {
// These are active untill I merge the PR
//std::env::set_var("GST_DEBUG", "bpmdetect:5,pitch:5,soundtouch:5... | rust | MIT | 4ab4a90169f70265c17a065d0db53bc168aeecc2 | 2026-01-04T20:21:00.414612Z | false |
altunenes/cuneus | https://github.com/altunenes/cuneus/blob/4ab4a90169f70265c17a065d0db53bc168aeecc2/src/gst/audio.rs | src/gst/audio.rs | use anyhow::{anyhow, Result};
use gst::glib::ControlFlow;
use gst::prelude::*;
use gstreamer as gst;
use log::{debug, info, warn};
use std::sync::{Arc, Mutex};
use std::time::Instant;
/// Envelope phase for ADSR
#[derive(Debug, Clone, Copy, PartialEq)]
enum EnvelopePhase {
Idle,
Attack,
Decay,
Sustain,... | rust | MIT | 4ab4a90169f70265c17a065d0db53bc168aeecc2 | 2026-01-04T20:21:00.414612Z | true |
altunenes/cuneus | https://github.com/altunenes/cuneus/blob/4ab4a90169f70265c17a065d0db53bc168aeecc2/src/compute/resource.rs | src/compute/resource.rs | use std::collections::HashMap;
use wgpu;
#[derive(Debug, Clone)]
pub enum ResourceType {
UniformBuffer {
size: u64,
},
StorageBuffer {
size: u64,
read_only: bool,
},
StorageTexture {
format: wgpu::TextureFormat,
access: wgpu::StorageTextureAccess,
},
... | rust | MIT | 4ab4a90169f70265c17a065d0db53bc168aeecc2 | 2026-01-04T20:21:00.414612Z | false |
altunenes/cuneus | https://github.com/altunenes/cuneus/blob/4ab4a90169f70265c17a065d0db53bc168aeecc2/src/compute/builder.rs | src/compute/builder.rs | use crate::UniformProvider;
use wgpu;
/// Pass description for multi-pass shaders
#[derive(Debug, Clone)]
pub struct PassDescription {
pub name: String,
pub inputs: Vec<String>,
pub workgroup_size: Option<[u32; 3]>,
}
impl PassDescription {
pub fn new(name: &str, inputs: &[&str]) -> Self {
Sel... | rust | MIT | 4ab4a90169f70265c17a065d0db53bc168aeecc2 | 2026-01-04T20:21:00.414612Z | false |
altunenes/cuneus | https://github.com/altunenes/cuneus/blob/4ab4a90169f70265c17a065d0db53bc168aeecc2/src/compute/core.rs | src/compute/core.rs | use log::info;
use std::collections::HashMap;
use std::path::PathBuf;
use std::sync::Arc;
use wgpu;
use super::builder::ComputeConfiguration;
use super::multipass::MultiPassManager;
use super::resource::ResourceLayout;
use crate::{Core, FontSystem, ShaderHotReload, TextureManager, UniformBinding, UniformProvider};
#[... | rust | MIT | 4ab4a90169f70265c17a065d0db53bc168aeecc2 | 2026-01-04T20:21:00.414612Z | true |
altunenes/cuneus | https://github.com/altunenes/cuneus/blob/4ab4a90169f70265c17a065d0db53bc168aeecc2/src/compute/multipass.rs | src/compute/multipass.rs | use crate::Core;
use std::collections::HashMap;
use wgpu;
/// Manages ping-pong buffers for multi-pass compute shaders
pub struct MultiPassManager {
buffers: HashMap<String, (wgpu::Texture, wgpu::Texture)>,
bind_groups: HashMap<String, (wgpu::BindGroup, wgpu::BindGroup)>,
output_texture: wgpu::Texture,
... | rust | MIT | 4ab4a90169f70265c17a065d0db53bc168aeecc2 | 2026-01-04T20:21:00.414612Z | false |
altunenes/cuneus | https://github.com/altunenes/cuneus/blob/4ab4a90169f70265c17a065d0db53bc168aeecc2/src/compute/mod.rs | src/compute/mod.rs | // @group(0): Per-Frame Resources (TimeUniform)
// @group(1): Primary Pass I/O & Parameters (output texture, shader params, input textures)
// @group(2): Global Engine Resources (fonts, audio, atomics, mouse)
// @group(3): User-Defined Data Buffers (custom storage buffers)
pub mod builder;
pub mod core;
pub mod multip... | rust | MIT | 4ab4a90169f70265c17a065d0db53bc168aeecc2 | 2026-01-04T20:21:00.414612Z | false |
altunenes/cuneus | https://github.com/altunenes/cuneus/blob/4ab4a90169f70265c17a065d0db53bc168aeecc2/examples/blockgame.rs | examples/blockgame.rs | // Block Game, Enes Altun, 2025, MIT License
use cuneus::compute::*;
use cuneus::prelude::*;
use winit::event::*;
#[repr(C)]
#[derive(Copy, Clone, Debug, bytemuck::Pod, bytemuck::Zeroable)]
struct BlockGameParams {
// 0=menu, 1=playing, 2=game_over
game_state: i32,
score: u32,
current_block: u32,
... | rust | MIT | 4ab4a90169f70265c17a065d0db53bc168aeecc2 | 2026-01-04T20:21:00.414612Z | false |
altunenes/cuneus | https://github.com/altunenes/cuneus/blob/4ab4a90169f70265c17a065d0db53bc168aeecc2/examples/gabor.rs | examples/gabor.rs | use cuneus::compute::*;
use cuneus::prelude::*;
use winit::event::WindowEvent;
#[repr(C)]
#[derive(Copy, Clone, Debug, bytemuck::Pod, bytemuck::Zeroable)]
struct GaborParams {
frequency: f32,
orientation: f32,
phase: f32,
speed: f32,
sigma_x: f32,
sigma_y: f32,
amplitude: f32,
aspect_ra... | rust | MIT | 4ab4a90169f70265c17a065d0db53bc168aeecc2 | 2026-01-04T20:21:00.414612Z | false |
altunenes/cuneus | https://github.com/altunenes/cuneus/blob/4ab4a90169f70265c17a065d0db53bc168aeecc2/examples/scenecolor.rs | examples/scenecolor.rs | use cuneus::compute::*;
use cuneus::prelude::*;
use winit::event::WindowEvent;
#[repr(C)]
#[derive(Copy, Clone, Debug, bytemuck::Pod, bytemuck::Zeroable)]
struct SceneColorParams {
num_segments: f32,
palette_height: f32,
samples_x: i32,
samples_y: i32,
_pad1: f32,
_pad2: f32,
_pad3: f32,
... | rust | MIT | 4ab4a90169f70265c17a065d0db53bc168aeecc2 | 2026-01-04T20:21:00.414612Z | false |
altunenes/cuneus | https://github.com/altunenes/cuneus/blob/4ab4a90169f70265c17a065d0db53bc168aeecc2/examples/veridisquo.rs | examples/veridisquo.rs | use cuneus::audio::{EnvelopeConfig, SynthesisManager};
use cuneus::compute::*;
use cuneus::prelude::*;
use winit::event::WindowEvent;
#[repr(C)]
#[derive(Copy, Clone, Debug, bytemuck::Pod, bytemuck::Zeroable)]
struct SongParams {
volume: f32,
octave_shift: f32,
tempo_multiplier: f32,
waveform_type: u32... | rust | MIT | 4ab4a90169f70265c17a065d0db53bc168aeecc2 | 2026-01-04T20:21:00.414612Z | false |
altunenes/cuneus | https://github.com/altunenes/cuneus/blob/4ab4a90169f70265c17a065d0db53bc168aeecc2/examples/pathtracing.rs | examples/pathtracing.rs | use cuneus::compute::*;
use cuneus::prelude::*;
use winit::event::WindowEvent;
struct CameraMovement {
forward: bool,
backward: bool,
left: bool,
right: bool,
up: bool,
down: bool,
speed: f32,
last_update: std::time::Instant,
yaw: f32,
pitch: f32,
mouse_sensitivity: f32,
... | rust | MIT | 4ab4a90169f70265c17a065d0db53bc168aeecc2 | 2026-01-04T20:21:00.414612Z | false |
altunenes/cuneus | https://github.com/altunenes/cuneus/blob/4ab4a90169f70265c17a065d0db53bc168aeecc2/examples/cliffordcompute.rs | examples/cliffordcompute.rs | use cuneus::compute::*;
use cuneus::prelude::*;
use winit::event::WindowEvent;
#[repr(C)]
#[derive(Copy, Clone, Debug, bytemuck::Pod, bytemuck::Zeroable)]
struct CliffordParams {
a: f32,
b: f32,
c: f32,
d: f32,
motion_speed: f32,
rotation_x: f32,
rotation_y: f32,
click_state: i32,
b... | rust | MIT | 4ab4a90169f70265c17a065d0db53bc168aeecc2 | 2026-01-04T20:21:00.414612Z | false |
altunenes/cuneus | https://github.com/altunenes/cuneus/blob/4ab4a90169f70265c17a065d0db53bc168aeecc2/examples/2dneuron.rs | examples/2dneuron.rs | use cuneus::compute::*;
use cuneus::prelude::*;
use winit::event::WindowEvent;
#[repr(C)]
#[derive(Copy, Clone, Debug, bytemuck::Pod, bytemuck::Zeroable)]
struct NeuronParams {
pixel_offset: f32,
pixel_offset2: f32,
lights: f32,
exp: f32,
frame: f32,
col1: f32,
col2: f32,
decay: f32,
}
... | rust | MIT | 4ab4a90169f70265c17a065d0db53bc168aeecc2 | 2026-01-04T20:21:00.414612Z | false |
altunenes/cuneus | https://github.com/altunenes/cuneus/blob/4ab4a90169f70265c17a065d0db53bc168aeecc2/examples/sinh.rs | examples/sinh.rs | use cuneus::compute::*;
use cuneus::prelude::*;
use winit::event::WindowEvent;
#[repr(C)]
#[derive(Copy, Clone, Debug, bytemuck::Pod, bytemuck::Zeroable)]
struct SinhParams {
aa: i32,
camera_x: f32,
camera_y: f32,
camera_z: f32,
orbit_speed: f32,
magic_number: f32,
cv_min: f32,
cv_max: ... | rust | MIT | 4ab4a90169f70265c17a065d0db53bc168aeecc2 | 2026-01-04T20:21:00.414612Z | false |
altunenes/cuneus | https://github.com/altunenes/cuneus/blob/4ab4a90169f70265c17a065d0db53bc168aeecc2/examples/orbits.rs | examples/orbits.rs | use cuneus::prelude::ComputeShader;
use cuneus::{Core, RenderKit, ShaderApp, ShaderManager, UniformProvider};
use winit::event::*;
#[repr(C)]
#[derive(Copy, Clone, Debug, bytemuck::Pod, bytemuck::Zeroable)]
pub struct ShaderParams {
base_color: [f32; 3],
x: f32,
rim_color: [f32; 3],
y: f32,
accent_c... | rust | MIT | 4ab4a90169f70265c17a065d0db53bc168aeecc2 | 2026-01-04T20:21:00.414612Z | false |
altunenes/cuneus | https://github.com/altunenes/cuneus/blob/4ab4a90169f70265c17a065d0db53bc168aeecc2/examples/jfa.rs | examples/jfa.rs | use cuneus::compute::*;
use cuneus::prelude::*;
use winit::event::WindowEvent;
#[repr(C)]
#[derive(Copy, Clone, Debug, bytemuck::Pod, bytemuck::Zeroable)]
struct JfaParams {
a: f32,
b: f32,
c: f32,
d: f32,
scale: f32,
n: f32,
gamma: f32,
color_intensity: f32,
color_r: f32,
color... | rust | MIT | 4ab4a90169f70265c17a065d0db53bc168aeecc2 | 2026-01-04T20:21:00.414612Z | false |
altunenes/cuneus | https://github.com/altunenes/cuneus/blob/4ab4a90169f70265c17a065d0db53bc168aeecc2/examples/computecolors.rs | examples/computecolors.rs | use cuneus::compute::*;
use cuneus::prelude::*;
use winit::event::WindowEvent;
#[repr(C)]
#[derive(Copy, Clone, Debug, bytemuck::Pod, bytemuck::Zeroable)]
struct SplattingParams {
animation_speed: f32,
splat_size: f32,
particle_spread: f32,
intensity: f32,
particle_density: f32,
brightness: f32... | rust | MIT | 4ab4a90169f70265c17a065d0db53bc168aeecc2 | 2026-01-04T20:21:00.414612Z | false |
altunenes/cuneus | https://github.com/altunenes/cuneus/blob/4ab4a90169f70265c17a065d0db53bc168aeecc2/examples/rorschach.rs | examples/rorschach.rs | use cuneus::compute::*;
use cuneus::prelude::*;
use winit::event::WindowEvent;
#[repr(C)]
#[derive(Copy, Clone, Debug, bytemuck::Pod, bytemuck::Zeroable)]
struct RorschachParams {
// Matrix 1
m1_scale: f32,
m1_y_scale: f32,
// Matrix 2
m2_scale: f32,
m2_shear: f32,
m2_shift: f32,
// Mat... | rust | MIT | 4ab4a90169f70265c17a065d0db53bc168aeecc2 | 2026-01-04T20:21:00.414612Z | false |
altunenes/cuneus | https://github.com/altunenes/cuneus/blob/4ab4a90169f70265c17a065d0db53bc168aeecc2/examples/lich.rs | examples/lich.rs | use cuneus::compute::*;
use cuneus::prelude::*;
use winit::event::WindowEvent;
#[repr(C)]
#[derive(Copy, Clone, Debug, bytemuck::Pod, bytemuck::Zeroable)]
struct LichParams {
cloud_density: f32,
lightning_intensity: f32,
branch_count: f32,
feedback_decay: f32,
base_color: [f32; 3],
_pad1: f32,
... | rust | MIT | 4ab4a90169f70265c17a065d0db53bc168aeecc2 | 2026-01-04T20:21:00.414612Z | false |
altunenes/cuneus | https://github.com/altunenes/cuneus/blob/4ab4a90169f70265c17a065d0db53bc168aeecc2/examples/voronoi.rs | examples/voronoi.rs | use cuneus::prelude::ComputeShader;
use cuneus::{Core, RenderKit, ShaderApp, ShaderManager, UniformProvider};
use winit::event::*;
#[repr(C)]
#[derive(Copy, Clone, Debug, bytemuck::Pod, bytemuck::Zeroable)]
struct ShaderParams {
scale: f32,
offset_value: f32,
cell_index: f32,
edge_width: f32,
highli... | rust | MIT | 4ab4a90169f70265c17a065d0db53bc168aeecc2 | 2026-01-04T20:21:00.414612Z | false |
altunenes/cuneus | https://github.com/altunenes/cuneus/blob/4ab4a90169f70265c17a065d0db53bc168aeecc2/examples/lorenz.rs | examples/lorenz.rs | use cuneus::compute::*;
use cuneus::prelude::*;
use winit::event::WindowEvent;
#[repr(C)]
#[derive(Copy, Clone, Debug, bytemuck::Pod, bytemuck::Zeroable)]
struct LorenzParams {
sigma: f32,
rho: f32,
beta: f32,
step_size: f32,
motion_speed: f32,
rotation_x: f32,
rotation_y: f32,
rotation... | rust | MIT | 4ab4a90169f70265c17a065d0db53bc168aeecc2 | 2026-01-04T20:21:00.414612Z | false |
altunenes/cuneus | https://github.com/altunenes/cuneus/blob/4ab4a90169f70265c17a065d0db53bc168aeecc2/examples/kuwahara.rs | examples/kuwahara.rs | use cuneus::compute::*;
use cuneus::prelude::*;
use winit::event::WindowEvent;
#[repr(C)]
#[derive(Copy, Clone, Debug, bytemuck::Pod, bytemuck::Zeroable)]
struct KuwaharaParams {
radius: f32,
q: f32,
alpha: f32,
filter_strength: f32,
sigma_d: f32,
sigma_r: f32,
edge_threshold: f32,
co... | rust | MIT | 4ab4a90169f70265c17a065d0db53bc168aeecc2 | 2026-01-04T20:21:00.414612Z | false |
altunenes/cuneus | https://github.com/altunenes/cuneus/blob/4ab4a90169f70265c17a065d0db53bc168aeecc2/examples/gaussian.rs | examples/gaussian.rs | use cuneus::compute::{ComputeShader, ComputeShaderBuilder, PassDescription, StorageBufferSpec, COMPUTE_TEXTURE_FORMAT_RGBA16};
use cuneus::{Core, RenderKit, ShaderApp, ShaderControls, ShaderManager};
use cuneus::{ExportManager, UniformProvider};
use winit::event::*;
#[repr(C)]
#[derive(Copy, Clone, Debug, bytemuck::Po... | rust | MIT | 4ab4a90169f70265c17a065d0db53bc168aeecc2 | 2026-01-04T20:21:00.414612Z | false |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.