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 |
|---|---|---|---|---|---|---|---|---|
achanda/ipnetwork | https://github.com/achanda/ipnetwork/blob/f01575cbf2fc596c0a1761c122aa92525cbb7974/benches/parse_bench.rs | benches/parse_bench.rs | use criterion::{criterion_group, criterion_main, Criterion};
use ipnetwork::{Ipv4Network, Ipv6Network};
use std::net::{Ipv4Addr, Ipv6Addr};
fn parse_ipv4_prefix_benchmark(c: &mut Criterion) {
c.bench_function("parse ipv4 prefix", |b| {
b.iter(|| "127.1.0.0/24".parse::<Ipv4Network>().unwrap())
});
}
fn... | rust | Apache-2.0 | f01575cbf2fc596c0a1761c122aa92525cbb7974 | 2026-01-04T20:19:08.816812Z | false |
dtzxporter/hydra | https://github.com/dtzxporter/hydra/blob/37c630fc77316049a186907d87dfc47109777433/hydra-test-client/src/main.rs | hydra-test-client/src/main.rs | use std::net::SocketAddr;
use std::time::Duration;
use hydra::Message;
use hydra::Node;
use hydra::NodeOptions;
use hydra::Pid;
use hydra::Process;
#[hydra::main]
async fn main() {
Node::start(
"hydra-test-client",
NodeOptions::new()
.listen_address("127.0.0.1:1338".parse::<SocketAddr>... | rust | MIT | 37c630fc77316049a186907d87dfc47109777433 | 2026-01-04T20:19:03.102117Z | false |
dtzxporter/hydra | https://github.com/dtzxporter/hydra/blob/37c630fc77316049a186907d87dfc47109777433/hydra-test-main/src/main.rs | hydra-test-main/src/main.rs | use std::net::SocketAddr;
use std::sync::atomic::AtomicU64;
use std::sync::atomic::Ordering;
use std::time::Duration;
use std::time::Instant;
use hydra::Message;
use hydra::Node;
use hydra::NodeOptions;
use hydra::Pid;
use hydra::Process;
static COUNTER: AtomicU64 = AtomicU64::new(0);
#[hydra::main]
async fn main() ... | rust | MIT | 37c630fc77316049a186907d87dfc47109777433 | 2026-01-04T20:19:03.102117Z | false |
dtzxporter/hydra | https://github.com/dtzxporter/hydra/blob/37c630fc77316049a186907d87dfc47109777433/hydra/src/reference.rs | hydra/src/reference.rs | use std::fmt::Debug;
use std::net::SocketAddr;
use std::num::NonZeroU64;
use std::sync::atomic::AtomicU64;
use std::sync::atomic::Ordering;
use serde::Deserialize;
use serde::Serialize;
use crate::INVALID_NODE_ID;
use crate::LOCAL_NODE_ID;
use crate::Node;
use crate::node_lookup_local;
use crate::node_lookup_remote;... | rust | MIT | 37c630fc77316049a186907d87dfc47109777433 | 2026-01-04T20:19:03.102117Z | false |
dtzxporter/hydra | https://github.com/dtzxporter/hydra/blob/37c630fc77316049a186907d87dfc47109777433/hydra/src/process_item.rs | hydra/src/process_item.rs | use std::fmt::Debug;
use crate::Dest;
use crate::ExitReason;
use crate::Message;
use crate::Node;
use crate::Pid;
use crate::Reference;
use crate::SystemMessage;
/// Represents a single unit of computation or a message for the process.
pub enum ProcessItem {
/// Sent from a remote process in a different userspace... | rust | MIT | 37c630fc77316049a186907d87dfc47109777433 | 2026-01-04T20:19:03.102117Z | false |
dtzxporter/hydra | https://github.com/dtzxporter/hydra/blob/37c630fc77316049a186907d87dfc47109777433/hydra/src/catch_unwind.rs | hydra/src/catch_unwind.rs | use std::future::Future;
use std::panic::AssertUnwindSafe;
use std::panic::UnwindSafe;
use std::panic::catch_unwind;
use std::pin::Pin;
use std::task::Context;
use std::task::Poll;
use pin_project_lite::pin_project;
pin_project! {
/// A future that will catch panics and unwind them.
pub struct AsyncCatchUnwin... | rust | MIT | 37c630fc77316049a186907d87dfc47109777433 | 2026-01-04T20:19:03.102117Z | false |
dtzxporter/hydra | https://github.com/dtzxporter/hydra/blob/37c630fc77316049a186907d87dfc47109777433/hydra/src/restart.rs | hydra/src/restart.rs | /// Controls what a supervisor should consider to be a successful termination or not.
#[derive(Debug, Clone, Copy, PartialEq, Eq, PartialOrd, Ord)]
pub enum Restart {
/// The child process is always restarted.
Permanent,
/// The child process is never restarted, regardless of the supervision strategy: any
... | rust | MIT | 37c630fc77316049a186907d87dfc47109777433 | 2026-01-04T20:19:03.102117Z | false |
dtzxporter/hydra | https://github.com/dtzxporter/hydra/blob/37c630fc77316049a186907d87dfc47109777433/hydra/src/node_remote.rs | hydra/src/node_remote.rs | use std::sync::Arc;
use serde::Deserialize;
use serde::Serialize;
use tokio::net::TcpStream;
use tokio_util::codec::Framed;
use futures_util::SinkExt;
use futures_util::StreamExt;
use futures_util::stream;
use futures_util::stream::SplitSink;
use futures_util::stream::SplitStream;
use crate::frame::Codec;
use crat... | rust | MIT | 37c630fc77316049a186907d87dfc47109777433 | 2026-01-04T20:19:03.102117Z | false |
dtzxporter/hydra | https://github.com/dtzxporter/hydra/blob/37c630fc77316049a186907d87dfc47109777433/hydra/src/node_kernel.rs | hydra/src/node_kernel.rs | use crate::frame::Exit;
use crate::frame::Frame;
use crate::frame::Send;
use crate::frame::SendTarget;
use crate::ExitReason;
use crate::Node;
use crate::Pid;
use crate::ProcessItem;
use crate::Receivable;
use crate::Reference;
use crate::alias_retrieve;
use crate::node_register;
use crate::node_send_frame;
use crate:... | rust | MIT | 37c630fc77316049a186907d87dfc47109777433 | 2026-01-04T20:19:03.102117Z | false |
dtzxporter/hydra | https://github.com/dtzxporter/hydra/blob/37c630fc77316049a186907d87dfc47109777433/hydra/src/node.rs | hydra/src/node.rs | use std::fmt::Debug;
use std::net::SocketAddr;
use serde::Deserialize;
use serde::Serialize;
use crate::NodeOptions;
use crate::NodeState;
use crate::PROCESS;
use crate::Pid;
use crate::Process;
use crate::ProcessMonitor;
use crate::Reference;
use crate::node_alive;
use crate::node_disconnect;
use crate::node_forget;... | rust | MIT | 37c630fc77316049a186907d87dfc47109777433 | 2026-01-04T20:19:03.102117Z | false |
dtzxporter/hydra | https://github.com/dtzxporter/hydra/blob/37c630fc77316049a186907d87dfc47109777433/hydra/src/link.rs | hydra/src/link.rs | use std::collections::BTreeMap;
use std::collections::BTreeSet;
use dashmap::DashMap;
use once_cell::sync::Lazy;
use crate::frame::Link;
use crate::frame::LinkDown;
use crate::ExitReason;
use crate::Node;
use crate::Pid;
use crate::ProcessInfo;
use crate::node_lookup_remote;
use crate::node_process_link_create;
use... | rust | MIT | 37c630fc77316049a186907d87dfc47109777433 | 2026-01-04T20:19:03.102117Z | false |
dtzxporter/hydra | https://github.com/dtzxporter/hydra/blob/37c630fc77316049a186907d87dfc47109777433/hydra/src/registry_options.rs | hydra/src/registry_options.rs | use crate::GenServerOptions;
/// Options used to configure a Registry.
#[derive(Debug, Default, Clone)]
pub struct RegistryOptions {
pub(crate) name: Option<String>,
}
impl RegistryOptions {
/// Constructs a new instance of [RegistryOptions] with the default values.
pub const fn new() -> Self {
Se... | rust | MIT | 37c630fc77316049a186907d87dfc47109777433 | 2026-01-04T20:19:03.102117Z | false |
dtzxporter/hydra | https://github.com/dtzxporter/hydra/blob/37c630fc77316049a186907d87dfc47109777433/hydra/src/from.rs | hydra/src/from.rs | use serde::Deserialize;
use serde::Serialize;
use crate::Pid;
use crate::Reference;
/// Information about a GenServer call request.
#[derive(Debug, Clone, Copy, Serialize, Deserialize)]
pub struct From {
pid: Pid,
tag: Reference,
alias: bool,
}
impl From {
/// Constructs a new instance of [From].
... | rust | MIT | 37c630fc77316049a186907d87dfc47109777433 | 2026-01-04T20:19:03.102117Z | false |
dtzxporter/hydra | https://github.com/dtzxporter/hydra/blob/37c630fc77316049a186907d87dfc47109777433/hydra/src/local.rs | hydra/src/local.rs | use serde::Deserialize;
use serde::Serialize;
use std::ops::Deref;
use std::ops::DerefMut;
/// Represents a local object in the current process userspace.
///
/// A [Local] can be used to send any `T: Send + 'static` type to another local process.
#[repr(transparent)]
#[derive(Debug, Clone, Copy)]
pub struct Local<T:... | rust | MIT | 37c630fc77316049a186907d87dfc47109777433 | 2026-01-04T20:19:03.102117Z | false |
dtzxporter/hydra | https://github.com/dtzxporter/hydra/blob/37c630fc77316049a186907d87dfc47109777433/hydra/src/pid.rs | hydra/src/pid.rs | use std::fmt::Debug;
use std::net::SocketAddr;
use std::num::NonZeroU64;
use serde::Deserialize;
use serde::Serialize;
use crate::INVALID_NODE_ID;
use crate::LOCAL_NODE_ID;
use crate::Node;
use crate::node_lookup_local;
use crate::node_lookup_remote;
use crate::node_register;
/// The representation of a [Pid] serial... | rust | MIT | 37c630fc77316049a186907d87dfc47109777433 | 2026-01-04T20:19:03.102117Z | false |
dtzxporter/hydra | https://github.com/dtzxporter/hydra/blob/37c630fc77316049a186907d87dfc47109777433/hydra/src/lib.rs | hydra/src/lib.rs | mod alias;
mod application;
mod application_config;
mod argument_error;
mod call_error;
mod catch_unwind;
mod child_spec;
mod dest;
mod exit_reason;
mod frame;
mod from;
mod gen_server;
mod gen_server_options;
mod hash_ring;
mod link;
mod local;
mod message;
mod monitor;
mod node;
mod node_kernel;
mod node_local;
mod n... | rust | MIT | 37c630fc77316049a186907d87dfc47109777433 | 2026-01-04T20:19:03.102117Z | false |
dtzxporter/hydra | https://github.com/dtzxporter/hydra/blob/37c630fc77316049a186907d87dfc47109777433/hydra/src/shutdown.rs | hydra/src/shutdown.rs | use std::time::Duration;
use crate::ExitReason;
use crate::Message;
use crate::Pid;
use crate::Process;
use crate::Reference;
use crate::SystemMessage;
/// Defines how a child process should be terminated.
#[derive(Debug, Clone, Copy, PartialEq, Eq, PartialOrd, Ord)]
pub enum Shutdown {
/// The child process is u... | rust | MIT | 37c630fc77316049a186907d87dfc47109777433 | 2026-01-04T20:19:03.102117Z | false |
dtzxporter/hydra | https://github.com/dtzxporter/hydra/blob/37c630fc77316049a186907d87dfc47109777433/hydra/src/timeout.rs | hydra/src/timeout.rs | use serde::Deserialize;
use serde::Serialize;
/// Occurs when an operation has timed out.
#[derive(Debug, Serialize, Deserialize)]
pub struct Timeout;
| rust | MIT | 37c630fc77316049a186907d87dfc47109777433 | 2026-01-04T20:19:03.102117Z | false |
dtzxporter/hydra | https://github.com/dtzxporter/hydra/blob/37c630fc77316049a186907d87dfc47109777433/hydra/src/process.rs | hydra/src/process.rs | use std::cell::RefCell;
use std::collections::BTreeMap;
use std::collections::BTreeSet;
use std::future::Future;
use std::panic::AssertUnwindSafe;
use std::sync::atomic::AtomicU64;
use std::sync::atomic::Ordering;
use std::time::Duration;
use flume::Receiver;
use flume::Sender;
use crate::ArgumentError;
use crate::As... | rust | MIT | 37c630fc77316049a186907d87dfc47109777433 | 2026-01-04T20:19:03.102117Z | false |
dtzxporter/hydra | https://github.com/dtzxporter/hydra/blob/37c630fc77316049a186907d87dfc47109777433/hydra/src/argument_error.rs | hydra/src/argument_error.rs | /// Occurs when an argument to a function was incorrect or not valid at the given time.
#[derive(Debug)]
pub struct ArgumentError(pub String);
impl<T> From<T> for ArgumentError
where
T: Into<String>,
{
fn from(value: T) -> Self {
Self(value.into())
}
}
| rust | MIT | 37c630fc77316049a186907d87dfc47109777433 | 2026-01-04T20:19:03.102117Z | false |
dtzxporter/hydra | https://github.com/dtzxporter/hydra/blob/37c630fc77316049a186907d87dfc47109777433/hydra/src/dest.rs | hydra/src/dest.rs | use std::borrow::Cow;
use serde::Deserialize;
use serde::Serialize;
use crate::Node;
use crate::Pid;
use crate::Reference;
/// A process destination.
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq)]
pub enum Dest {
/// A process id.
Pid(Pid),
/// A registered process name.
Named(Cow<'st... | rust | MIT | 37c630fc77316049a186907d87dfc47109777433 | 2026-01-04T20:19:03.102117Z | false |
dtzxporter/hydra | https://github.com/dtzxporter/hydra/blob/37c630fc77316049a186907d87dfc47109777433/hydra/src/hash_ring.rs | hydra/src/hash_ring.rs | use std::hash::BuildHasher;
use std::hash::Hash;
use std::hash::RandomState;
use std::sync::Arc;
use std::sync::Mutex;
use arc_swap::ArcSwap;
use dashmap::DashMap;
/// Internal key, node pair.
#[derive(Clone)]
struct Node<T: Clone> {
key: u64,
node: T,
}
impl<T> Node<T>
where
T: Clone,
{
/// Constru... | rust | MIT | 37c630fc77316049a186907d87dfc47109777433 | 2026-01-04T20:19:03.102117Z | false |
dtzxporter/hydra | https://github.com/dtzxporter/hydra/blob/37c630fc77316049a186907d87dfc47109777433/hydra/src/node_state.rs | hydra/src/node_state.rs | use serde::Deserialize;
use serde::Serialize;
/// The different states a node can be in.
#[derive(Debug, Serialize, Deserialize, Clone, Copy, PartialEq, Eq)]
pub enum NodeState {
/// This node is the local node.
Current,
/// This node information was given to us, but no attempt to connect has been made.
... | rust | MIT | 37c630fc77316049a186907d87dfc47109777433 | 2026-01-04T20:19:03.102117Z | false |
dtzxporter/hydra | https://github.com/dtzxporter/hydra/blob/37c630fc77316049a186907d87dfc47109777433/hydra/src/exit_reason.rs | hydra/src/exit_reason.rs | use bincode::Decode;
use bincode::Encode;
use serde::Deserialize;
use serde::Serialize;
/// Represents the reason a process exits.
#[derive(Debug, Default, Clone, PartialEq, Eq, Serialize, Deserialize, Encode, Decode)]
pub enum ExitReason {
/// Exited due to normal reasons, function ended, or manually stopped.
... | rust | MIT | 37c630fc77316049a186907d87dfc47109777433 | 2026-01-04T20:19:03.102117Z | false |
dtzxporter/hydra | https://github.com/dtzxporter/hydra/blob/37c630fc77316049a186907d87dfc47109777433/hydra/src/node_options.rs | hydra/src/node_options.rs | use std::net::IpAddr;
use std::net::Ipv4Addr;
use std::net::SocketAddr;
use std::time::Duration;
/// Options used to configure this node as a distributed node.
#[derive(Clone, Copy)]
pub struct NodeOptions {
pub(crate) listen_address: SocketAddr,
pub(crate) broadcast_address: SocketAddr,
pub(crate) handsha... | rust | MIT | 37c630fc77316049a186907d87dfc47109777433 | 2026-01-04T20:19:03.102117Z | false |
dtzxporter/hydra | https://github.com/dtzxporter/hydra/blob/37c630fc77316049a186907d87dfc47109777433/hydra/src/serialize.rs | hydra/src/serialize.rs | use std::io;
use serde::Serialize;
use serde::de::DeserializeOwned;
/// Serializes a value.
pub fn serialize_value<T: Serialize>(value: &T) -> Vec<u8> {
rmp_serde::to_vec_named(value).unwrap()
}
/// Deserializes a value.
pub fn deserialize_value<T: DeserializeOwned>(value: &[u8]) -> io::Result<T> {
rmp_serde... | rust | MIT | 37c630fc77316049a186907d87dfc47109777433 | 2026-01-04T20:19:03.102117Z | false |
dtzxporter/hydra | https://github.com/dtzxporter/hydra/blob/37c630fc77316049a186907d87dfc47109777433/hydra/src/system_message.rs | hydra/src/system_message.rs | use crate::Dest;
use crate::ExitReason;
use crate::Node;
use crate::Pid;
use crate::Reference;
/// A message sent from the hydra system.
#[derive(Debug, Clone)]
pub enum SystemMessage {
/// A process has exited with the given reason.
Exit(Pid, ExitReason),
/// A monitored process went down.
ProcessDown... | rust | MIT | 37c630fc77316049a186907d87dfc47109777433 | 2026-01-04T20:19:03.102117Z | false |
dtzxporter/hydra | https://github.com/dtzxporter/hydra/blob/37c630fc77316049a186907d87dfc47109777433/hydra/src/application.rs | hydra/src/application.rs | use std::future::Future;
use serde::Deserialize;
use serde::Serialize;
use tokio::runtime::Builder;
use tokio::runtime::Runtime;
use tokio::sync::oneshot;
use crate::ApplicationConfig;
use crate::ExitReason;
use crate::Message;
use crate::Pid;
use crate::Process;
use crate::ProcessFlags;
use crate::SystemMessage;
#... | rust | MIT | 37c630fc77316049a186907d87dfc47109777433 | 2026-01-04T20:19:03.102117Z | false |
dtzxporter/hydra | https://github.com/dtzxporter/hydra/blob/37c630fc77316049a186907d87dfc47109777433/hydra/src/process_monitor.rs | hydra/src/process_monitor.rs | use crate::Node;
use crate::Pid;
/// Represents an installed monitor's data for a process.
pub enum ProcessMonitor {
/// A monitor installed to monitor the given process.
ForProcess(Option<Pid>),
/// A monitor installed to monitor the given node.
ForNode(Node),
}
| rust | MIT | 37c630fc77316049a186907d87dfc47109777433 | 2026-01-04T20:19:03.102117Z | false |
dtzxporter/hydra | https://github.com/dtzxporter/hydra/blob/37c630fc77316049a186907d87dfc47109777433/hydra/src/registry.rs | hydra/src/registry.rs | use std::collections::BTreeMap;
use std::future::Future;
use std::pin::Pin;
use std::sync::Arc;
use std::time::Duration;
use dashmap::DashMap;
use once_cell::sync::Lazy;
use serde::Deserialize;
use serde::Serialize;
use crate::CallError;
use crate::ChildSpec;
use crate::ChildType;
use crate::Dest;
use crate::ExitRe... | rust | MIT | 37c630fc77316049a186907d87dfc47109777433 | 2026-01-04T20:19:03.102117Z | false |
dtzxporter/hydra | https://github.com/dtzxporter/hydra/blob/37c630fc77316049a186907d87dfc47109777433/hydra/src/alias.rs | hydra/src/alias.rs | use dashmap::DashMap;
use once_cell::sync::Lazy;
use crate::ProcessItem;
use crate::ProcessSend;
use crate::Reference;
/// A collection of active aliases.
static ALIASES: Lazy<DashMap<u64, Alias>> = Lazy::new(DashMap::new);
/// The state of an active alias.
#[derive(Clone)]
pub struct Alias {
/// The target pro... | rust | MIT | 37c630fc77316049a186907d87dfc47109777433 | 2026-01-04T20:19:03.102117Z | false |
dtzxporter/hydra | https://github.com/dtzxporter/hydra/blob/37c630fc77316049a186907d87dfc47109777433/hydra/src/process_info.rs | hydra/src/process_info.rs | use serde::Deserialize;
use serde::Serialize;
use crate::Pid;
/// Debug information for a specific process.
#[derive(Debug, Serialize, Deserialize)]
pub struct ProcessInfo {
/// The name, if any, that the process was registered under.
pub registered_name: Option<String>,
/// The number of messages in this... | rust | MIT | 37c630fc77316049a186907d87dfc47109777433 | 2026-01-04T20:19:03.102117Z | false |
dtzxporter/hydra | https://github.com/dtzxporter/hydra/blob/37c630fc77316049a186907d87dfc47109777433/hydra/src/supervisor_options.rs | hydra/src/supervisor_options.rs | use std::time::Duration;
use crate::GenServerOptions;
/// Options used to configure a Supervisor.
#[derive(Debug, Default, Clone)]
pub struct SupervisorOptions {
pub(crate) name: Option<String>,
pub(crate) timeout: Option<Duration>,
}
impl SupervisorOptions {
/// Constructs a new instance of [SupervisorO... | rust | MIT | 37c630fc77316049a186907d87dfc47109777433 | 2026-01-04T20:19:03.102117Z | false |
dtzxporter/hydra | https://github.com/dtzxporter/hydra/blob/37c630fc77316049a186907d87dfc47109777433/hydra/src/task.rs | hydra/src/task.rs | use std::future::Future;
use std::pin::Pin;
use std::task::Context;
use std::task::Poll;
use futures_util::FutureExt;
use tokio::task::JoinHandle;
/// A task is a lightweight thread of execution designed to run one particular action.
///
/// Tasks can not receive messages from other processes, only send.
///
/// Cal... | rust | MIT | 37c630fc77316049a186907d87dfc47109777433 | 2026-01-04T20:19:03.102117Z | false |
dtzxporter/hydra | https://github.com/dtzxporter/hydra/blob/37c630fc77316049a186907d87dfc47109777433/hydra/src/supervisor.rs | hydra/src/supervisor.rs | use std::collections::BTreeSet;
use std::pin::Pin;
use std::time::Duration;
use std::time::Instant;
use serde::Deserialize;
use serde::Serialize;
use crate::AutoShutdown;
use crate::CallError;
use crate::ChildSpec;
use crate::ChildType;
use crate::Dest;
use crate::ExitReason;
use crate::From;
use crate::GenServer;
us... | rust | MIT | 37c630fc77316049a186907d87dfc47109777433 | 2026-01-04T20:19:03.102117Z | false |
dtzxporter/hydra | https://github.com/dtzxporter/hydra/blob/37c630fc77316049a186907d87dfc47109777433/hydra/src/monitor.rs | hydra/src/monitor.rs | use std::collections::BTreeMap;
use dashmap::DashMap;
use once_cell::sync::Lazy;
use crate::frame::Monitor;
use crate::frame::MonitorDown;
use crate::Dest;
use crate::ExitReason;
use crate::Node;
use crate::PROCESS;
use crate::Pid;
use crate::ProcessInfo;
use crate::ProcessItem;
use crate::ProcessMonitor;
use crate... | rust | MIT | 37c630fc77316049a186907d87dfc47109777433 | 2026-01-04T20:19:03.102117Z | false |
dtzxporter/hydra | https://github.com/dtzxporter/hydra/blob/37c630fc77316049a186907d87dfc47109777433/hydra/src/semaphore.rs | hydra/src/semaphore.rs | use std::sync::Arc;
use tokio::sync::OwnedSemaphorePermit as OwnedSemaphoreBasePermit;
use tokio::sync::Semaphore as SemaphoreBase;
use tokio::sync::SemaphorePermit as SemaphoreBasePermit;
/// Represents a permit to a [Semaphore].
pub struct SemaphorePermit<'a> {
_permit: SemaphoreBasePermit<'a>,
}
/// Represent... | rust | MIT | 37c630fc77316049a186907d87dfc47109777433 | 2026-01-04T20:19:03.102117Z | false |
dtzxporter/hydra | https://github.com/dtzxporter/hydra/blob/37c630fc77316049a186907d87dfc47109777433/hydra/src/application_config.rs | hydra/src/application_config.rs | use std::time::Duration;
/// Configuration values for an application.
pub struct ApplicationConfig {
#[cfg(feature = "tracing")]
pub(crate) tracing_subscribe: bool,
#[cfg(feature = "tracing")]
pub(crate) tracing_panics: bool,
pub(crate) graceful_shutdown: bool,
pub(crate) graceful_shutdown_time... | rust | MIT | 37c630fc77316049a186907d87dfc47109777433 | 2026-01-04T20:19:03.102117Z | false |
dtzxporter/hydra | https://github.com/dtzxporter/hydra/blob/37c630fc77316049a186907d87dfc47109777433/hydra/src/runtime_info.rs | hydra/src/runtime_info.rs | use serde::Deserialize;
use serde::Serialize;
use tokio::runtime::Handle;
use crate::process_len;
/// Runtime information for the current hydra instance.
#[derive(Serialize, Deserialize)]
pub struct RuntimeInfo {
/// The crate version of the hydra runtime.
pub system_version: String,
/// The number of lo... | rust | MIT | 37c630fc77316049a186907d87dfc47109777433 | 2026-01-04T20:19:03.102117Z | false |
dtzxporter/hydra | https://github.com/dtzxporter/hydra/blob/37c630fc77316049a186907d87dfc47109777433/hydra/src/process_registration.rs | hydra/src/process_registration.rs | use tokio::task::JoinHandle;
use crate::ExitReason;
use crate::ProcessFlags;
use crate::ProcessSend;
/// Process registration information.
pub struct ProcessRegistration {
/// A handle to the task that this process lives in.
pub handle: JoinHandle<()>,
/// The sender of this process.
pub sender: Proce... | rust | MIT | 37c630fc77316049a186907d87dfc47109777433 | 2026-01-04T20:19:03.102117Z | false |
dtzxporter/hydra | https://github.com/dtzxporter/hydra/blob/37c630fc77316049a186907d87dfc47109777433/hydra/src/console.rs | hydra/src/console.rs | use serde::Deserialize;
use serde::Serialize;
use crate::CallError;
use crate::Dest;
use crate::ExitReason;
use crate::From;
use crate::GenServer;
use crate::GenServerOptions;
use crate::Node;
use crate::NodeState;
use crate::Pid;
use crate::Process;
use crate::ProcessInfo;
use crate::RuntimeInfo;
/// Unique register... | rust | MIT | 37c630fc77316049a186907d87dfc47109777433 | 2026-01-04T20:19:03.102117Z | false |
dtzxporter/hydra | https://github.com/dtzxporter/hydra/blob/37c630fc77316049a186907d87dfc47109777433/hydra/src/gen_server.rs | hydra/src/gen_server.rs | use std::future::Future;
use std::time::Duration;
use tokio::sync::oneshot;
use serde::Deserialize;
use serde::Serialize;
use crate::CallError;
use crate::Dest;
use crate::Dests;
use crate::ExitReason;
use crate::From;
use crate::GenServerOptions;
use crate::Message;
use crate::Pid;
use crate::Process;
use crate::Re... | rust | MIT | 37c630fc77316049a186907d87dfc47109777433 | 2026-01-04T20:19:03.102117Z | false |
dtzxporter/hydra | https://github.com/dtzxporter/hydra/blob/37c630fc77316049a186907d87dfc47109777433/hydra/src/process_kernel.rs | hydra/src/process_kernel.rs | use std::collections::BTreeMap;
use crate::frame::Frame;
use crate::frame::Send;
use crate::frame::SendTarget;
use crate::Dest;
use crate::Dests;
use crate::Message;
use crate::ProcessItem;
use crate::Receivable;
use crate::alias_retrieve;
use crate::node_process_send_with_alias;
use crate::node_process_send_with_nam... | rust | MIT | 37c630fc77316049a186907d87dfc47109777433 | 2026-01-04T20:19:03.102117Z | false |
dtzxporter/hydra | https://github.com/dtzxporter/hydra/blob/37c630fc77316049a186907d87dfc47109777433/hydra/src/message.rs | hydra/src/message.rs | use crate::SystemMessage;
/// A messages sent to a process.
#[derive(Debug)]
pub enum Message<T> {
/// A message that was sent from another process.
User(T),
/// A message that was sent from the system.
System(SystemMessage),
}
| rust | MIT | 37c630fc77316049a186907d87dfc47109777433 | 2026-01-04T20:19:03.102117Z | false |
dtzxporter/hydra | https://github.com/dtzxporter/hydra/blob/37c630fc77316049a186907d87dfc47109777433/hydra/src/node_local.rs | hydra/src/node_local.rs | use std::sync::Arc;
use serde::Deserialize;
use serde::Serialize;
use tokio::net::TcpListener;
use crate::Local;
use crate::Message;
use crate::NodeOptions;
use crate::NodeRemoteConnectorMessage;
use crate::Pid;
use crate::Process;
use crate::ProcessFlags;
use crate::SystemMessage;
use crate::node_local_panic;
use c... | rust | MIT | 37c630fc77316049a186907d87dfc47109777433 | 2026-01-04T20:19:03.102117Z | false |
dtzxporter/hydra | https://github.com/dtzxporter/hydra/blob/37c630fc77316049a186907d87dfc47109777433/hydra/src/call_error.rs | hydra/src/call_error.rs | use serde::Deserialize;
use serde::Serialize;
use crate::ExitReason;
use crate::Timeout;
/// Occurs when a server call fails.
#[derive(Debug, Serialize, Deserialize)]
pub enum CallError {
Timeout(Timeout),
ServerDown(ExitReason),
}
| rust | MIT | 37c630fc77316049a186907d87dfc47109777433 | 2026-01-04T20:19:03.102117Z | false |
dtzxporter/hydra | https://github.com/dtzxporter/hydra/blob/37c630fc77316049a186907d87dfc47109777433/hydra/src/node_registry.rs | hydra/src/node_registry.rs | use std::collections::BTreeMap;
use std::collections::BTreeSet;
use std::net::SocketAddr;
use std::sync::Mutex;
use std::sync::atomic::AtomicU64;
use std::sync::atomic::Ordering;
use dashmap::DashMap;
use dashmap::mapref::entry::Entry;
use once_cell::sync::Lazy;
use crate::frame::Frame;
use crate::Dest;
use crate::... | rust | MIT | 37c630fc77316049a186907d87dfc47109777433 | 2026-01-04T20:19:03.102117Z | false |
dtzxporter/hydra | https://github.com/dtzxporter/hydra/blob/37c630fc77316049a186907d87dfc47109777433/hydra/src/receivable.rs | hydra/src/receivable.rs | use serde::Serialize;
use serde::de::DeserializeOwned;
// TODO: Once specialization lands, we can make a specialization for Receivable that handles types that are `Deserialize` vs not so that
// We can send any T to a local process and panic at runtime if we try to send a non `Deserialize` type.
/// An object that ca... | rust | MIT | 37c630fc77316049a186907d87dfc47109777433 | 2026-01-04T20:19:03.102117Z | false |
dtzxporter/hydra | https://github.com/dtzxporter/hydra/blob/37c630fc77316049a186907d87dfc47109777433/hydra/src/process_registry.rs | hydra/src/process_registry.rs | use std::time::Duration;
use std::time::Instant;
use dashmap::DashMap;
use dashmap::mapref::entry::Entry;
use once_cell::sync::Lazy;
use tokio::task::JoinHandle;
use crate::ArgumentError;
use crate::ExitReason;
use crate::Pid;
use crate::ProcessFlags;
use crate::ProcessInfo;
use crate::ProcessItem;
use crate::Proce... | rust | MIT | 37c630fc77316049a186907d87dfc47109777433 | 2026-01-04T20:19:03.102117Z | false |
dtzxporter/hydra | https://github.com/dtzxporter/hydra/blob/37c630fc77316049a186907d87dfc47109777433/hydra/src/node_registration.rs | hydra/src/node_registration.rs | use std::net::SocketAddr;
use crate::NodeState;
use crate::Pid;
/// Node registration information.
pub struct NodeRegistration {
/// The process responsible for this node.
pub supervisor: Option<Pid>,
/// The process responsible for sending outbound messages for this node.
pub sender: Option<Pid>,
... | rust | MIT | 37c630fc77316049a186907d87dfc47109777433 | 2026-01-04T20:19:03.102117Z | false |
dtzxporter/hydra | https://github.com/dtzxporter/hydra/blob/37c630fc77316049a186907d87dfc47109777433/hydra/src/child_spec.rs | hydra/src/child_spec.rs | use std::future::Future;
use std::sync::Arc;
use serde::Deserialize;
use serde::Serialize;
use crate::ExitReason;
use crate::Pid;
use crate::Restart;
use crate::Shutdown;
/// The type of child process.
#[derive(Debug, Serialize, Deserialize, Clone, Copy)]
pub enum ChildType {
/// The child is a worker process.
... | rust | MIT | 37c630fc77316049a186907d87dfc47109777433 | 2026-01-04T20:19:03.102117Z | false |
dtzxporter/hydra | https://github.com/dtzxporter/hydra/blob/37c630fc77316049a186907d87dfc47109777433/hydra/src/process_flags.rs | hydra/src/process_flags.rs | use bitflags::bitflags;
bitflags! {
/// A collection of configurable flags for a process.
#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)]
pub struct ProcessFlags : u32 {
/// Whether or not the process is trapping exits.
const TRAP_EXIT = 1 << 0;
}
}
| rust | MIT | 37c630fc77316049a186907d87dfc47109777433 | 2026-01-04T20:19:03.102117Z | false |
dtzxporter/hydra | https://github.com/dtzxporter/hydra/blob/37c630fc77316049a186907d87dfc47109777433/hydra/src/gen_server_options.rs | hydra/src/gen_server_options.rs | use std::time::Duration;
/// Options used to configure a GenServer.
#[derive(Debug, Default, Clone)]
pub struct GenServerOptions {
pub(crate) name: Option<String>,
pub(crate) timeout: Option<Duration>,
}
impl GenServerOptions {
/// Constructs a new instance of [GenServerOptions] with the default values.
... | rust | MIT | 37c630fc77316049a186907d87dfc47109777433 | 2026-01-04T20:19:03.102117Z | false |
dtzxporter/hydra | https://github.com/dtzxporter/hydra/blob/37c630fc77316049a186907d87dfc47109777433/hydra/src/process_receiver.rs | hydra/src/process_receiver.rs | use std::marker::PhantomData;
use crate::Message;
use crate::PROCESS;
use crate::ProcessItem;
use crate::ProcessMonitor;
use crate::Receivable;
use crate::SystemMessage;
use crate::deserialize_value;
/// Used to receive messages from processes.
pub struct ProcessReceiver<T: Receivable> {
ignore_type: bool,
_m... | rust | MIT | 37c630fc77316049a186907d87dfc47109777433 | 2026-01-04T20:19:03.102117Z | false |
dtzxporter/hydra | https://github.com/dtzxporter/hydra/blob/37c630fc77316049a186907d87dfc47109777433/hydra/src/frame/link.rs | hydra/src/frame/link.rs | use bincode::Decode;
use bincode::Encode;
/// The frame used to install or destroy a process link.
#[derive(Debug, Encode, Decode)]
pub struct Link {
pub install: bool,
pub process_id: u64,
pub from_id: u64,
}
impl Link {
/// Constructs a new instance of [Link] frame.
pub const fn new(install: boo... | rust | MIT | 37c630fc77316049a186907d87dfc47109777433 | 2026-01-04T20:19:03.102117Z | false |
dtzxporter/hydra | https://github.com/dtzxporter/hydra/blob/37c630fc77316049a186907d87dfc47109777433/hydra/src/frame/send.rs | hydra/src/frame/send.rs | use std::borrow::Cow;
use std::num::NonZeroU64;
use bincode::Decode;
use bincode::Encode;
use crate::Pid;
use crate::Reference;
/// The target process information for a send frame.
#[derive(Debug, Encode, Decode)]
pub enum SendTarget {
Pid(NonZeroU64),
Named(String),
Alias(NonZeroU64),
}
/// The frame u... | rust | MIT | 37c630fc77316049a186907d87dfc47109777433 | 2026-01-04T20:19:03.102117Z | false |
dtzxporter/hydra | https://github.com/dtzxporter/hydra/blob/37c630fc77316049a186907d87dfc47109777433/hydra/src/frame/monitor_update.rs | hydra/src/frame/monitor_update.rs | use bincode::Decode;
use bincode::Encode;
/// The frame used to update an installed process monitor.
#[derive(Debug, Encode, Decode)]
pub struct MonitorUpdate {
pub process_id: u64,
pub from_id: u64,
pub reference_id: u64,
}
impl MonitorUpdate {
/// Constructs a new instance of [MonitorUpdate] frame.
... | rust | MIT | 37c630fc77316049a186907d87dfc47109777433 | 2026-01-04T20:19:03.102117Z | false |
dtzxporter/hydra | https://github.com/dtzxporter/hydra/blob/37c630fc77316049a186907d87dfc47109777433/hydra/src/frame/ping.rs | hydra/src/frame/ping.rs | use bincode::Decode;
use bincode::Encode;
/// The frame used to keep the connection alive.
#[derive(Debug, Encode, Decode)]
pub struct Ping;
| rust | MIT | 37c630fc77316049a186907d87dfc47109777433 | 2026-01-04T20:19:03.102117Z | false |
dtzxporter/hydra | https://github.com/dtzxporter/hydra/blob/37c630fc77316049a186907d87dfc47109777433/hydra/src/frame/link_down.rs | hydra/src/frame/link_down.rs | use bincode::Decode;
use bincode::Encode;
use crate::ExitReason;
/// The frame used to notify processes about down links.
#[derive(Debug, Encode, Decode)]
pub struct LinkDown {
pub links: Vec<u64>,
pub from_id: u64,
pub exit_reason: ExitReason,
}
impl LinkDown {
/// Constructs a new isntance of [Link... | rust | MIT | 37c630fc77316049a186907d87dfc47109777433 | 2026-01-04T20:19:03.102117Z | false |
dtzxporter/hydra | https://github.com/dtzxporter/hydra/blob/37c630fc77316049a186907d87dfc47109777433/hydra/src/frame/hello.rs | hydra/src/frame/hello.rs | use std::net::SocketAddr;
use sha2::Sha256;
use hmac::Hmac;
use hmac::Mac;
use bincode::Decode;
use bincode::Encode;
use crate::node_get_cookie;
/// Hmac using sha256.
type HmacSha256 = Hmac<Sha256>;
/// The frame used to handshake with other nodes.
#[derive(Debug, Encode, Decode)]
pub struct Hello {
pub name... | rust | MIT | 37c630fc77316049a186907d87dfc47109777433 | 2026-01-04T20:19:03.102117Z | false |
dtzxporter/hydra | https://github.com/dtzxporter/hydra/blob/37c630fc77316049a186907d87dfc47109777433/hydra/src/frame/mod.rs | hydra/src/frame/mod.rs | use std::io::Error;
use std::io::ErrorKind;
use bincode::Decode;
use bincode::Encode;
use bincode::config;
use bincode::config::Configuration;
use bincode::config::Fixint;
use bincode::config::LittleEndian;
use bincode::error::DecodeError;
use bytes::Buf;
use bytes::BufMut;
use bytes::BytesMut;
use tokio_util::code... | rust | MIT | 37c630fc77316049a186907d87dfc47109777433 | 2026-01-04T20:19:03.102117Z | false |
dtzxporter/hydra | https://github.com/dtzxporter/hydra/blob/37c630fc77316049a186907d87dfc47109777433/hydra/src/frame/monitor.rs | hydra/src/frame/monitor.rs | use bincode::Decode;
use bincode::Encode;
/// The frame used to install or destroy a process monitor.
#[derive(Debug, Encode, Decode)]
pub struct Monitor {
pub install: bool,
pub process_id: Option<u64>,
pub process_name: Option<String>,
pub from_id: Option<u64>,
pub reference_id: u64,
}
impl Moni... | rust | MIT | 37c630fc77316049a186907d87dfc47109777433 | 2026-01-04T20:19:03.102117Z | false |
dtzxporter/hydra | https://github.com/dtzxporter/hydra/blob/37c630fc77316049a186907d87dfc47109777433/hydra/src/frame/exit.rs | hydra/src/frame/exit.rs | use bincode::Decode;
use bincode::Encode;
use crate::ExitReason;
/// The frame used to send an exit signal to a process.
#[derive(Debug, Encode, Decode)]
pub struct Exit {
pub process_id: u64,
pub from_id: u64,
pub exit_reason: ExitReason,
}
impl Exit {
/// Constructs a new instance of [Exit] frame.
... | rust | MIT | 37c630fc77316049a186907d87dfc47109777433 | 2026-01-04T20:19:03.102117Z | false |
dtzxporter/hydra | https://github.com/dtzxporter/hydra/blob/37c630fc77316049a186907d87dfc47109777433/hydra/src/frame/monitor_down.rs | hydra/src/frame/monitor_down.rs | use bincode::Decode;
use bincode::Encode;
use crate::ExitReason;
/// The frame used to notify processes about down monitors.
#[derive(Debug, Encode, Decode)]
pub struct MonitorDown {
pub monitors: Vec<u64>,
pub exit_reason: ExitReason,
}
impl MonitorDown {
/// Constructs a new instance of [MonitorDown] f... | rust | MIT | 37c630fc77316049a186907d87dfc47109777433 | 2026-01-04T20:19:03.102117Z | false |
dtzxporter/hydra | https://github.com/dtzxporter/hydra/blob/37c630fc77316049a186907d87dfc47109777433/hydra/src/frame/pong.rs | hydra/src/frame/pong.rs | use bincode::Decode;
use bincode::Encode;
/// The frame used to keep the connection alive.
#[derive(Debug, Encode, Decode)]
pub struct Pong;
| rust | MIT | 37c630fc77316049a186907d87dfc47109777433 | 2026-01-04T20:19:03.102117Z | false |
dtzxporter/hydra | https://github.com/dtzxporter/hydra/blob/37c630fc77316049a186907d87dfc47109777433/hydra/tests/link.rs | hydra/tests/link.rs | use std::time::Duration;
use hydra::Message;
use hydra::Process;
use hydra::ProcessFlags;
use hydra::SystemMessage;
#[hydra::test]
async fn link_works() {
let pid = Process::spawn(async {
Process::spawn_link(async {
panic!("we died!");
});
let _ = Process::receive::<()>().await... | rust | MIT | 37c630fc77316049a186907d87dfc47109777433 | 2026-01-04T20:19:03.102117Z | false |
dtzxporter/hydra | https://github.com/dtzxporter/hydra/blob/37c630fc77316049a186907d87dfc47109777433/hydra/tests/hash_ring.rs | hydra/tests/hash_ring.rs | use hydra::HashRing;
#[test]
fn hash_ring_works() {
let ring: HashRing<u64> = HashRing::new();
ring.add_node(0, 0xDEADBEEF);
ring.add_node(1, 0xDEADC0DE);
let node1 = ring.find_node(0);
let node2 = ring.find_node(1);
let node3 = ring.find_node(1337);
assert_eq!(node1.unwrap(), 0xDEADBEEF... | rust | MIT | 37c630fc77316049a186907d87dfc47109777433 | 2026-01-04T20:19:03.102117Z | false |
dtzxporter/hydra | https://github.com/dtzxporter/hydra/blob/37c630fc77316049a186907d87dfc47109777433/hydra/tests/monitor.rs | hydra/tests/monitor.rs | use std::sync::Arc;
use std::sync::atomic::AtomicBool;
use std::sync::atomic::Ordering;
use std::time::Duration;
use hydra::ExitReason;
use hydra::Message;
use hydra::Process;
use hydra::SystemMessage;
#[hydra::test]
async fn monitor_works() {
let pid = Process::spawn(async {
Process::sleep(Duration::from... | rust | MIT | 37c630fc77316049a186907d87dfc47109777433 | 2026-01-04T20:19:03.102117Z | false |
dtzxporter/hydra | https://github.com/dtzxporter/hydra/blob/37c630fc77316049a186907d87dfc47109777433/hydra/examples/benchmark.rs | hydra/examples/benchmark.rs | use std::sync::atomic::AtomicU64;
use std::sync::atomic::Ordering;
use std::time::Duration;
use std::time::Instant;
use hydra::Message;
use hydra::Pid;
use hydra::Process;
static COUNTER: AtomicU64 = AtomicU64::new(0);
#[hydra::main]
async fn main() {
let workers = std::thread::available_parallelism()
.m... | rust | MIT | 37c630fc77316049a186907d87dfc47109777433 | 2026-01-04T20:19:03.102117Z | false |
dtzxporter/hydra | https://github.com/dtzxporter/hydra/blob/37c630fc77316049a186907d87dfc47109777433/hydra/examples/application.rs | hydra/examples/application.rs | use hydra::Application;
use hydra::ExitReason;
use hydra::From;
use hydra::GenServer;
use hydra::GenServerOptions;
use hydra::Pid;
use serde::Deserialize;
use serde::Serialize;
#[derive(Debug, Serialize, Deserialize)]
enum StackMessage {
Pop,
PopResult(String),
Push(String),
}
struct Stack {
stack: V... | rust | MIT | 37c630fc77316049a186907d87dfc47109777433 | 2026-01-04T20:19:03.102117Z | false |
dtzxporter/hydra | https://github.com/dtzxporter/hydra/blob/37c630fc77316049a186907d87dfc47109777433/hydra/examples/registry.rs | hydra/examples/registry.rs | use std::time::Duration;
use serde::Deserialize;
use serde::Serialize;
use hydra::Application;
use hydra::ChildSpec;
use hydra::ExitReason;
use hydra::GenServer;
use hydra::GenServerOptions;
use hydra::Pid;
use hydra::Process;
use hydra::ProcessFlags;
use hydra::Registry;
use hydra::RegistryKey;
use hydra::RegistryOp... | rust | MIT | 37c630fc77316049a186907d87dfc47109777433 | 2026-01-04T20:19:03.102117Z | false |
dtzxporter/hydra | https://github.com/dtzxporter/hydra/blob/37c630fc77316049a186907d87dfc47109777433/hydra/examples/stack.rs | hydra/examples/stack.rs | use hydra::ExitReason;
use hydra::From;
use hydra::GenServer;
use hydra::GenServerOptions;
use serde::Deserialize;
use serde::Serialize;
#[derive(Debug, Serialize, Deserialize)]
enum StackMessage {
Pop,
PopResult(String),
Push(String),
}
struct Stack {
stack: Vec<String>,
}
impl Stack {
pub fn w... | rust | MIT | 37c630fc77316049a186907d87dfc47109777433 | 2026-01-04T20:19:03.102117Z | false |
dtzxporter/hydra | https://github.com/dtzxporter/hydra/blob/37c630fc77316049a186907d87dfc47109777433/hydra/examples/supervisor.rs | hydra/examples/supervisor.rs | use std::time::Duration;
use serde::Deserialize;
use serde::Serialize;
use hydra::Application;
use hydra::CallError;
use hydra::ChildSpec;
use hydra::Dest;
use hydra::ExitReason;
use hydra::From;
use hydra::GenServer;
use hydra::GenServerOptions;
use hydra::Pid;
use hydra::Process;
use hydra::SupervisionStrategy;
use... | rust | MIT | 37c630fc77316049a186907d87dfc47109777433 | 2026-01-04T20:19:03.102117Z | false |
dtzxporter/hydra | https://github.com/dtzxporter/hydra/blob/37c630fc77316049a186907d87dfc47109777433/hydra-websockets/src/lib.rs | hydra-websockets/src/lib.rs | mod websocket_command;
mod websocket_handler;
mod websocket_server;
mod websocket_server_config;
pub use websocket_command::*;
pub use websocket_handler::*;
pub use websocket_server::*;
pub use websocket_server_config::*;
use tokio_tungstenite::tungstenite;
// Re-export for WebSocketHandler::accept.
pub use tungsten... | rust | MIT | 37c630fc77316049a186907d87dfc47109777433 | 2026-01-04T20:19:03.102117Z | false |
dtzxporter/hydra | https://github.com/dtzxporter/hydra/blob/37c630fc77316049a186907d87dfc47109777433/hydra-websockets/src/websocket_handler.rs | hydra-websockets/src/websocket_handler.rs | use std::future::Future;
use std::net::SocketAddr;
use futures_util::SinkExt;
use futures_util::StreamExt;
use futures_util::stream;
use tokio::io::AsyncRead;
use tokio::io::AsyncWrite;
use tokio_tungstenite::WebSocketStream;
use tokio_tungstenite::tungstenite::Error;
use tokio_tungstenite::tungstenite::protocol::Cl... | rust | MIT | 37c630fc77316049a186907d87dfc47109777433 | 2026-01-04T20:19:03.102117Z | false |
dtzxporter/hydra | https://github.com/dtzxporter/hydra/blob/37c630fc77316049a186907d87dfc47109777433/hydra-websockets/src/websocket_server.rs | hydra-websockets/src/websocket_server.rs | use std::io::ErrorKind;
use std::marker::PhantomData;
use std::net::SocketAddr;
#[cfg(feature = "native-tls")]
use std::sync::Arc;
use tokio::io::AsyncRead;
use tokio::io::AsyncWrite;
use tokio::net::TcpListener;
use tokio_tungstenite::accept_hdr_async_with_config;
use tokio_tungstenite::tungstenite;
use tungstenit... | rust | MIT | 37c630fc77316049a186907d87dfc47109777433 | 2026-01-04T20:19:03.102117Z | false |
dtzxporter/hydra | https://github.com/dtzxporter/hydra/blob/37c630fc77316049a186907d87dfc47109777433/hydra-websockets/src/websocket_command.rs | hydra-websockets/src/websocket_command.rs | use smallvec::SmallVec;
use crate::CloseCode;
use crate::WebsocketMessage;
/// Internal websocket command representation.
pub(crate) enum WebsocketCommand {
Send(WebsocketMessage),
Close(CloseCode, String),
}
/// A command buffer returned from a websocket callback.
pub struct WebsocketCommands {
pub(crat... | rust | MIT | 37c630fc77316049a186907d87dfc47109777433 | 2026-01-04T20:19:03.102117Z | false |
dtzxporter/hydra | https://github.com/dtzxporter/hydra/blob/37c630fc77316049a186907d87dfc47109777433/hydra-websockets/src/websocket_server_config.rs | hydra-websockets/src/websocket_server_config.rs | use std::net::SocketAddr;
use std::time::Duration;
/// A set of configuration options for the websocket server.
#[derive(Debug, Clone)]
pub struct WebsocketServerConfig {
pub(crate) address: SocketAddr,
pub(crate) handshake_timeout: Option<Duration>,
pub(crate) max_message_size: Option<usize>,
pub(crat... | rust | MIT | 37c630fc77316049a186907d87dfc47109777433 | 2026-01-04T20:19:03.102117Z | false |
dtzxporter/hydra | https://github.com/dtzxporter/hydra/blob/37c630fc77316049a186907d87dfc47109777433/hydra-websockets/examples/server.rs | hydra-websockets/examples/server.rs | use std::net::SocketAddr;
use hydra::Application;
use hydra::ExitReason;
use hydra::GenServer;
use hydra::GenServerOptions;
use hydra::Pid;
use hydra::Process;
use hydra_websockets::WebsocketCommands;
use hydra_websockets::WebsocketHandler;
use hydra_websockets::WebsocketMessage;
use hydra_websockets::WebsocketReques... | rust | MIT | 37c630fc77316049a186907d87dfc47109777433 | 2026-01-04T20:19:03.102117Z | false |
dtzxporter/hydra | https://github.com/dtzxporter/hydra/blob/37c630fc77316049a186907d87dfc47109777433/hydra-test/src/main.rs | hydra-test/src/main.rs | use std::time::Duration;
use serde::Deserialize;
use serde::Serialize;
use hydra::Application;
use hydra::CallError;
use hydra::ChildSpec;
use hydra::Dest;
use hydra::ExitReason;
use hydra::From;
use hydra::GenServer;
use hydra::GenServerOptions;
use hydra::Pid;
use hydra::Process;
use hydra::SupervisionStrategy;
use... | rust | MIT | 37c630fc77316049a186907d87dfc47109777433 | 2026-01-04T20:19:03.102117Z | false |
dtzxporter/hydra | https://github.com/dtzxporter/hydra/blob/37c630fc77316049a186907d87dfc47109777433/hydra-macros/src/lib.rs | hydra-macros/src/lib.rs | use proc_macro::TokenStream;
mod entry;
/// Marks an async function to be executed as a hydra application.
///
/// Note: This macro is designed to be simplistic, if you wish to customize your application, you should
/// implement the trait yourself and call `run` instead.
///
/// If the feature `tracing` is enabled, ... | rust | MIT | 37c630fc77316049a186907d87dfc47109777433 | 2026-01-04T20:19:03.102117Z | false |
dtzxporter/hydra | https://github.com/dtzxporter/hydra/blob/37c630fc77316049a186907d87dfc47109777433/hydra-macros/src/entry.rs | hydra-macros/src/entry.rs | use proc_macro::TokenStream;
use quote::format_ident;
use quote::quote;
use syn::ItemFn;
use syn::parse_macro_input;
pub(crate) fn main(_: TokenStream, item: TokenStream) -> TokenStream {
let input_fn = parse_macro_input!(item as ItemFn);
let input_name = &input_fn.sig.ident;
let input_block = &input_fn.... | rust | MIT | 37c630fc77316049a186907d87dfc47109777433 | 2026-01-04T20:19:03.102117Z | false |
Bevy-Rust-GPU/bevy-rust-gpu | https://github.com/Bevy-Rust-GPU/bevy-rust-gpu/blob/2d9b667d769f49598f28480cc2704890341837b3/src/rust_gpu_material.rs | src/rust_gpu_material.rs | //! Trait
use crate::prelude::EntryPoint;
/// A [`Material`] type with statically-known `rust-gpu` vertex and fragment entry points.
pub trait RustGpuMaterial {
type Vertex: EntryPoint;
type Fragment: EntryPoint;
}
| rust | Apache-2.0 | 2d9b667d769f49598f28480cc2704890341837b3 | 2026-01-04T20:18:48.623408Z | false |
Bevy-Rust-GPU/bevy-rust-gpu | https://github.com/Bevy-Rust-GPU/bevy-rust-gpu/blob/2d9b667d769f49598f28480cc2704890341837b3/src/prelude.rs | src/prelude.rs | pub use crate::{builder_output::*, entry_point::*, plugin::*, rust_gpu::*, rust_gpu_material::*, *};
#[cfg(feature = "hot-rebuild")]
pub use crate::entry_point_export::*;
| rust | Apache-2.0 | 2d9b667d769f49598f28480cc2704890341837b3 | 2026-01-04T20:18:48.623408Z | false |
Bevy-Rust-GPU/bevy-rust-gpu | https://github.com/Bevy-Rust-GPU/bevy-rust-gpu/blob/2d9b667d769f49598f28480cc2704890341837b3/src/bevy_pbr_rust.rs | src/bevy_pbr_rust.rs | //! `bevy-pbr-rust`-backed `RustGpuMaterial` implementation for `StandardMaterial`.
use bevy::{prelude::StandardMaterial, render::render_resource::ShaderDefVal};
use crate::{
prelude::{EntryPoint, EntryPointName, EntryPointParameters, RustGpuMaterial},
EntryPointConstants,
};
/// `bevy_rust_gpu::mesh::entry_... | rust | Apache-2.0 | 2d9b667d769f49598f28480cc2704890341837b3 | 2026-01-04T20:18:48.623408Z | false |
Bevy-Rust-GPU/bevy-rust-gpu | https://github.com/Bevy-Rust-GPU/bevy-rust-gpu/blob/2d9b667d769f49598f28480cc2704890341837b3/src/lib.rs | src/lib.rs | //! # bevy-rust-gpu
//!
//! A set of `bevy` plugins supporting the use of `rust-gpu` shaders.
//!
//! Features include hot-reloading, metadata-based entry point validation,
//! and active entry point export.
//!
//! Can be used in conjunction with `rust-gpu-builder` and `permutate-macro`
//! to drive a real-time shader... | rust | Apache-2.0 | 2d9b667d769f49598f28480cc2704890341837b3 | 2026-01-04T20:18:48.623408Z | false |
Bevy-Rust-GPU/bevy-rust-gpu | https://github.com/Bevy-Rust-GPU/bevy-rust-gpu/blob/2d9b667d769f49598f28480cc2704890341837b3/src/entry_point_export.rs | src/entry_point_export.rs | //! Adds support for exporting the active entry point set to a `.json` file.
//!
//! This can be used in conjunction with `rust-gpu-builder` and `permutate-macro` to drive hot-recompiles.
use std::{
collections::BTreeMap,
fs::File,
path::PathBuf,
sync::mpsc::{Receiver, SyncSender},
};
use bevy::{
... | rust | Apache-2.0 | 2d9b667d769f49598f28480cc2704890341837b3 | 2026-01-04T20:18:48.623408Z | false |
Bevy-Rust-GPU/bevy-rust-gpu | https://github.com/Bevy-Rust-GPU/bevy-rust-gpu/blob/2d9b667d769f49598f28480cc2704890341837b3/src/rust_gpu.rs | src/rust_gpu.rs | //! Wrapper for extending a `Material` with `rust-gpu` shader functionality.
use std::{any::TypeId, marker::PhantomData, path::PathBuf, sync::RwLock};
use bevy::{
asset::Asset,
pbr::MaterialPipelineKey,
prelude::{
default, info, warn, AssetEvent, Assets, CoreSet, EventReader, Handle, Image,
... | rust | Apache-2.0 | 2d9b667d769f49598f28480cc2704890341837b3 | 2026-01-04T20:18:48.623408Z | false |
Bevy-Rust-GPU/bevy-rust-gpu | https://github.com/Bevy-Rust-GPU/bevy-rust-gpu/blob/2d9b667d769f49598f28480cc2704890341837b3/src/builder_output.rs | src/builder_output.rs | use std::{collections::BTreeMap, sync::RwLock};
use bevy::prelude::{
default, AssetEvent, Assets, CoreSet, Deref, DerefMut, EventReader, Handle, IntoSystemConfig,
Plugin, Res, ResMut, Shader,
};
use once_cell::sync::Lazy;
use rust_gpu_builder_shared::RustGpuBuilderOutput;
/// Static container for `RustGpuArti... | rust | Apache-2.0 | 2d9b667d769f49598f28480cc2704890341837b3 | 2026-01-04T20:18:48.623408Z | false |
Bevy-Rust-GPU/bevy-rust-gpu | https://github.com/Bevy-Rust-GPU/bevy-rust-gpu/blob/2d9b667d769f49598f28480cc2704890341837b3/src/entry_point.rs | src/entry_point.rs | //! Trait representation of a `rust-gpu` entry point.
use std::collections::BTreeMap;
use bevy::render::render_resource::ShaderDefVal;
/// An entry point name for use with the [`EntryPoint`] trait.
pub type EntryPointName = &'static str;
/// A set of entry point compile parameters for use with the [`EntryPoint`] tr... | rust | Apache-2.0 | 2d9b667d769f49598f28480cc2704890341837b3 | 2026-01-04T20:18:48.623408Z | false |
Bevy-Rust-GPU/bevy-rust-gpu | https://github.com/Bevy-Rust-GPU/bevy-rust-gpu/blob/2d9b667d769f49598f28480cc2704890341837b3/src/plugin.rs | src/plugin.rs | //! Main Rust-GPU plugin.
use std::path::PathBuf;
use bevy::prelude::Plugin;
use crate::prelude::{file_writer, BuilderOutputPlugin, EntryPoints};
/// Main Rust-GPU plugin.
///
/// Adds support for `RustGpuBuilderOutput` assets,
/// and configures entry point export if the `hot-reload` feature is enabled.
#[derive(D... | rust | Apache-2.0 | 2d9b667d769f49598f28480cc2704890341837b3 | 2026-01-04T20:18:48.623408Z | false |
chaosprint/dattorro-vst-rs | https://github.com/chaosprint/dattorro-vst-rs/blob/4623ad8e38e3df149bc78b5c749fc0db26124554/src/lib.rs | src/lib.rs | //! Barebones baseview egui plugin
#[macro_use]
extern crate vst;
use egui::CtxRef;
use baseview::{Size, WindowHandle, WindowOpenOptions, WindowScalePolicy};
use vst::buffer::AudioBuffer;
use vst::editor::Editor;
use vst::plugin::{Category, Info, Plugin, PluginParameters};
use vst::util::AtomicFloat;
use egui_basev... | rust | MIT | 4623ad8e38e3df149bc78b5c749fc0db26124554 | 2026-01-04T20:19:21.735521Z | false |
facebookarchive/propfuzz | https://github.com/facebookarchive/propfuzz/blob/742567d73088988fc24f065a0aba3e88adb049f4/propfuzz/src/prelude.rs | propfuzz/src/prelude.rs | // Copyright (c) The propfuzz Contributors
// SPDX-License-Identifier: MIT OR Apache-2.0
//! Re-exports for the most commonly used APIs of `propfuzz`.
//!
//! This includes:
//! * the `propfuzz` macro from this crate
//! * the entire prelude of `proptest`, so existing tests can be migrated with minimal hassle.
//!
//!... | rust | Apache-2.0 | 742567d73088988fc24f065a0aba3e88adb049f4 | 2026-01-04T20:18:50.820316Z | false |
facebookarchive/propfuzz | https://github.com/facebookarchive/propfuzz/blob/742567d73088988fc24f065a0aba3e88adb049f4/propfuzz/src/lib.rs | propfuzz/src/lib.rs | // Copyright (c) The propfuzz Contributors
// SPDX-License-Identifier: MIT OR Apache-2.0
//! Rust toolkit to combine property-based testing with fuzzing.
//!
//! For more, see the [`README`](https://github.com/facebookincubator/propfuzz/blob/main/README.md)
//! at the root of the `propfuzz` repository.
pub mod prelud... | rust | Apache-2.0 | 742567d73088988fc24f065a0aba3e88adb049f4 | 2026-01-04T20:18:50.820316Z | false |
facebookarchive/propfuzz | https://github.com/facebookarchive/propfuzz/blob/742567d73088988fc24f065a0aba3e88adb049f4/propfuzz/src/runtime.rs | propfuzz/src/runtime.rs | // Copyright (c) The propfuzz Contributors
// SPDX-License-Identifier: MIT OR Apache-2.0
//! Runtime support.
use crate::traits::StructuredTarget;
use proptest::test_runner::{TestError, TestRunner};
use std::fmt;
/// Executes a propfuzz target as a standard property-based test.
pub fn execute_as_proptest(fuzz_target... | rust | Apache-2.0 | 742567d73088988fc24f065a0aba3e88adb049f4 | 2026-01-04T20:18:50.820316Z | false |
facebookarchive/propfuzz | https://github.com/facebookarchive/propfuzz/blob/742567d73088988fc24f065a0aba3e88adb049f4/propfuzz/src/traits.rs | propfuzz/src/traits.rs | // Copyright (c) The propfuzz Contributors
// SPDX-License-Identifier: MIT OR Apache-2.0
//! The core traits powering `propfuzz`.
//!
//! `propfuzz` relies on separating out a standard property-based test into its components:
//! * constructing a configuration
//! * executing the test, given a test runner
//! * format... | rust | Apache-2.0 | 742567d73088988fc24f065a0aba3e88adb049f4 | 2026-01-04T20:18:50.820316Z | false |
facebookarchive/propfuzz | https://github.com/facebookarchive/propfuzz/blob/742567d73088988fc24f065a0aba3e88adb049f4/propfuzz/tests/trybuild.rs | propfuzz/tests/trybuild.rs | // Copyright (c) The propfuzz Contributors
// SPDX-License-Identifier: MIT OR Apache-2.0
//! Trybuild tests for propfuzz-macro.
#[test]
fn trybuild_tests() {
let t = trybuild::TestCases::new();
t.compile_fail("tests/compile-fail/*.rs");
}
| rust | Apache-2.0 | 742567d73088988fc24f065a0aba3e88adb049f4 | 2026-01-04T20:18:50.820316Z | false |
facebookarchive/propfuzz | https://github.com/facebookarchive/propfuzz/blob/742567d73088988fc24f065a0aba3e88adb049f4/propfuzz/tests/basic.rs | propfuzz/tests/basic.rs | // Copyright (c) The propfuzz Contributors
// SPDX-License-Identifier: MIT OR Apache-2.0
/// Basic tests for propfuzz-macro.
use pretty_assertions::assert_eq;
use propfuzz::{prelude::*, traits::StructuredTarget};
use proptest::{
collection::vec,
test_runner::{FileFailurePersistence, TestError, TestRunner},
};
... | rust | Apache-2.0 | 742567d73088988fc24f065a0aba3e88adb049f4 | 2026-01-04T20:18:50.820316Z | false |
facebookarchive/propfuzz | https://github.com/facebookarchive/propfuzz/blob/742567d73088988fc24f065a0aba3e88adb049f4/propfuzz/tests/compile-fail/bad-args.rs | propfuzz/tests/compile-fail/bad-args.rs | // Copyright (c) The propfuzz Contributors
// SPDX-License-Identifier: MIT OR Apache-2.0
//! Propfuzz with bad arguments.
use propfuzz::propfuzz;
/// Arguments of the wrong type (note multiple errors).
#[propfuzz(cases = true, fork = 1024)]
fn wrong_type1(_: u8) {}
/// Basic test for repeated arguments.
#[propfuzz(... | rust | Apache-2.0 | 742567d73088988fc24f065a0aba3e88adb049f4 | 2026-01-04T20:18:50.820316Z | false |
facebookarchive/propfuzz | https://github.com/facebookarchive/propfuzz/blob/742567d73088988fc24f065a0aba3e88adb049f4/propfuzz/tests/compile-fail/bad_strategies.rs | propfuzz/tests/compile-fail/bad_strategies.rs | // Copyright (c) The propfuzz Contributors
// SPDX-License-Identifier: MIT OR Apache-2.0
//! Propfuzz with bad strategies.
use propfuzz::prelude::*;
use proptest::collection::vec;
use std::collections::HashSet;
/// Incorrect strategy format.
#[propfuzz]
fn wrong_format(#[propfuzz(strategy(foo))] _: u8) {}
/// Inval... | rust | Apache-2.0 | 742567d73088988fc24f065a0aba3e88adb049f4 | 2026-01-04T20:18:50.820316Z | false |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.