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 |
|---|---|---|---|---|---|---|---|---|
PrimeIntellect-ai/protocol | https://github.com/PrimeIntellect-ai/protocol/blob/d389f2035ec2c3c485c6b3e270625f86c7609d50/crates/p2p/src/protocol.rs | crates/p2p/src/protocol.rs | use libp2p::StreamProtocol;
use std::{collections::HashSet, hash::Hash};
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub enum Protocol {
// validator or orchestrator -> worker
Authentication,
// validator -> worker
HardwareChallenge,
// orchestrator -> worker
Invite,
// any -> worker
G... | rust | Apache-2.0 | d389f2035ec2c3c485c6b3e270625f86c7609d50 | 2026-01-04T20:18:07.676063Z | false |
PrimeIntellect-ai/protocol | https://github.com/PrimeIntellect-ai/protocol/blob/d389f2035ec2c3c485c6b3e270625f86c7609d50/crates/p2p/src/message/hardware_challenge.rs | crates/p2p/src/message/hardware_challenge.rs | use nalgebra::DMatrix;
use serde::{
de::{self, Visitor},
Deserialize, Deserializer, Serialize, Serializer,
};
use std::fmt;
#[derive(Debug, Clone)]
pub struct FixedF64(pub f64);
impl Serialize for FixedF64 {
fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
where
S: Serializer,
... | rust | Apache-2.0 | d389f2035ec2c3c485c6b3e270625f86c7609d50 | 2026-01-04T20:18:07.676063Z | false |
PrimeIntellect-ai/protocol | https://github.com/PrimeIntellect-ai/protocol/blob/d389f2035ec2c3c485c6b3e270625f86c7609d50/crates/p2p/src/message/mod.rs | crates/p2p/src/message/mod.rs | use crate::Protocol;
use libp2p::PeerId;
use serde::{Deserialize, Serialize};
use std::time::SystemTime;
mod hardware_challenge;
pub use hardware_challenge::*;
#[derive(Debug)]
pub struct IncomingMessage {
pub peer: PeerId,
pub message: libp2p::request_response::Message<Request, Response>,
}
#[allow(clippy:... | rust | Apache-2.0 | d389f2035ec2c3c485c6b3e270625f86c7609d50 | 2026-01-04T20:18:07.676063Z | false |
PrimeIntellect-ai/protocol | https://github.com/PrimeIntellect-ai/protocol/blob/d389f2035ec2c3c485c6b3e270625f86c7609d50/crates/shared/src/lib.rs | crates/shared/src/lib.rs | pub mod models;
pub mod p2p;
pub mod security;
pub mod utils;
pub mod web3;
| rust | Apache-2.0 | d389f2035ec2c3c485c6b3e270625f86c7609d50 | 2026-01-04T20:18:07.676063Z | false |
PrimeIntellect-ai/protocol | https://github.com/PrimeIntellect-ai/protocol/blob/d389f2035ec2c3c485c6b3e270625f86c7609d50/crates/shared/src/models/node.rs | crates/shared/src/models/node.rs | use alloy::primitives::U256;
use anyhow::anyhow;
use chrono::{DateTime, Utc};
use serde::{Deserialize, Serialize};
use std::fmt;
use std::ops::Deref;
use std::str::FromStr;
use utoipa::{openapi::Object, ToSchema};
#[derive(Debug, Clone, Deserialize, Serialize, PartialEq, Default, ToSchema)]
pub struct Node {
pub i... | rust | Apache-2.0 | d389f2035ec2c3c485c6b3e270625f86c7609d50 | 2026-01-04T20:18:07.676063Z | true |
PrimeIntellect-ai/protocol | https://github.com/PrimeIntellect-ai/protocol/blob/d389f2035ec2c3c485c6b3e270625f86c7609d50/crates/shared/src/models/storage.rs | crates/shared/src/models/storage.rs | use serde::{Deserialize, Serialize};
use utoipa::ToSchema;
#[derive(Deserialize, Serialize, Debug, ToSchema)]
pub struct RequestUploadRequest {
pub file_name: String,
pub file_size: u64,
pub file_type: String,
pub sha256: String,
pub task_id: String,
}
| rust | Apache-2.0 | d389f2035ec2c3c485c6b3e270625f86c7609d50 | 2026-01-04T20:18:07.676063Z | false |
PrimeIntellect-ai/protocol | https://github.com/PrimeIntellect-ai/protocol/blob/d389f2035ec2c3c485c6b3e270625f86c7609d50/crates/shared/src/models/api.rs | crates/shared/src/models/api.rs | use actix_web::HttpResponse;
use serde::{Deserialize, Serialize};
use utoipa::ToSchema;
#[derive(Debug, Serialize, Deserialize, Clone, ToSchema)]
pub struct ApiResponse<T: Serialize> {
pub success: bool,
pub data: T,
}
impl<T: Serialize> ApiResponse<T> {
pub fn new(success: bool, data: T) -> Self {
... | rust | Apache-2.0 | d389f2035ec2c3c485c6b3e270625f86c7609d50 | 2026-01-04T20:18:07.676063Z | false |
PrimeIntellect-ai/protocol | https://github.com/PrimeIntellect-ai/protocol/blob/d389f2035ec2c3c485c6b3e270625f86c7609d50/crates/shared/src/models/mod.rs | crates/shared/src/models/mod.rs | pub mod api;
pub mod heartbeat;
pub mod metric;
pub mod node;
pub mod storage;
pub mod task;
| rust | Apache-2.0 | d389f2035ec2c3c485c6b3e270625f86c7609d50 | 2026-01-04T20:18:07.676063Z | false |
PrimeIntellect-ai/protocol | https://github.com/PrimeIntellect-ai/protocol/blob/d389f2035ec2c3c485c6b3e270625f86c7609d50/crates/shared/src/models/task.rs | crates/shared/src/models/task.rs | use std::collections::HashMap;
use chrono::Utc;
use redis::{ErrorKind, FromRedisValue, RedisError, RedisResult, RedisWrite, ToRedisArgs, Value};
use serde::{Deserialize, Serialize};
use std::collections::hash_map::DefaultHasher;
use std::hash::{Hash, Hasher};
use utoipa::ToSchema;
use uuid::Uuid;
#[derive(Debug, Clon... | rust | Apache-2.0 | d389f2035ec2c3c485c6b3e270625f86c7609d50 | 2026-01-04T20:18:07.676063Z | false |
PrimeIntellect-ai/protocol | https://github.com/PrimeIntellect-ai/protocol/blob/d389f2035ec2c3c485c6b3e270625f86c7609d50/crates/shared/src/models/metric.rs | crates/shared/src/models/metric.rs | use anyhow::{bail, Result};
use serde::{Deserialize, Serialize};
use utoipa::ToSchema;
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, ToSchema)]
pub struct MetricEntry {
pub key: MetricKey,
pub value: f64,
}
#[derive(Debug, Clone, Hash, Eq, PartialEq, Serialize, Deserialize, ToSchema)]
pub struct M... | rust | Apache-2.0 | d389f2035ec2c3c485c6b3e270625f86c7609d50 | 2026-01-04T20:18:07.676063Z | false |
PrimeIntellect-ai/protocol | https://github.com/PrimeIntellect-ai/protocol/blob/d389f2035ec2c3c485c6b3e270625f86c7609d50/crates/shared/src/models/heartbeat.rs | crates/shared/src/models/heartbeat.rs | use super::api::ApiResponse;
use super::metric::MetricEntry;
use super::task::Task;
use actix_web::HttpResponse;
use serde::{Deserialize, Serialize};
use utoipa::ToSchema;
#[derive(Debug, Serialize, Deserialize, Clone, ToSchema)]
pub struct HeartbeatResponse {
pub current_task: Option<Task>,
}
impl From<HeartbeatR... | rust | Apache-2.0 | d389f2035ec2c3c485c6b3e270625f86c7609d50 | 2026-01-04T20:18:07.676063Z | false |
PrimeIntellect-ai/protocol | https://github.com/PrimeIntellect-ai/protocol/blob/d389f2035ec2c3c485c6b3e270625f86c7609d50/crates/shared/src/utils/mod.rs | crates/shared/src/utils/mod.rs | use std::collections::HashMap;
use async_trait::async_trait;
use std::sync::Arc;
use tokio::sync::Mutex;
pub mod google_cloud;
use anyhow::Result;
#[async_trait]
pub trait StorageProvider: Send + Sync {
/// Check if a file exists in storage
async fn file_exists(&self, object_path: &str) -> Result<bool>;
... | rust | Apache-2.0 | d389f2035ec2c3c485c6b3e270625f86c7609d50 | 2026-01-04T20:18:07.676063Z | false |
PrimeIntellect-ai/protocol | https://github.com/PrimeIntellect-ai/protocol/blob/d389f2035ec2c3c485c6b3e270625f86c7609d50/crates/shared/src/utils/google_cloud.rs | crates/shared/src/utils/google_cloud.rs | use anyhow::Result;
use async_trait::async_trait;
use base64::{engine::general_purpose, Engine as _};
use google_cloud_storage::client::google_cloud_auth::credentials::CredentialsFile;
use google_cloud_storage::client::{Client, ClientConfig};
use google_cloud_storage::http::objects::download::Range;
use google_cloud_st... | rust | Apache-2.0 | d389f2035ec2c3c485c6b3e270625f86c7609d50 | 2026-01-04T20:18:07.676063Z | false |
PrimeIntellect-ai/protocol | https://github.com/PrimeIntellect-ai/protocol/blob/d389f2035ec2c3c485c6b3e270625f86c7609d50/crates/shared/src/security/auth_signature_middleware.rs | crates/shared/src/security/auth_signature_middleware.rs | use actix_web::dev::Payload;
use actix_web::dev::{forward_ready, Service, ServiceRequest, ServiceResponse, Transform};
use actix_web::error::{ErrorBadRequest, PayloadError};
use actix_web::web::Bytes;
use actix_web::web::BytesMut;
use actix_web::HttpMessage;
use actix_web::{Error, Result};
use alloy::primitives::Addres... | rust | Apache-2.0 | d389f2035ec2c3c485c6b3e270625f86c7609d50 | 2026-01-04T20:18:07.676063Z | true |
PrimeIntellect-ai/protocol | https://github.com/PrimeIntellect-ai/protocol/blob/d389f2035ec2c3c485c6b3e270625f86c7609d50/crates/shared/src/security/mod.rs | crates/shared/src/security/mod.rs | pub mod api_key_middleware;
pub mod auth_signature_middleware;
pub mod request_signer;
| rust | Apache-2.0 | d389f2035ec2c3c485c6b3e270625f86c7609d50 | 2026-01-04T20:18:07.676063Z | false |
PrimeIntellect-ai/protocol | https://github.com/PrimeIntellect-ai/protocol/blob/d389f2035ec2c3c485c6b3e270625f86c7609d50/crates/shared/src/security/request_signer.rs | crates/shared/src/security/request_signer.rs | // request_signer.rs
use crate::web3::wallet::Wallet;
use alloy::signers::Signer;
use uuid::Uuid;
#[derive(Clone)]
pub struct SignedRequest {
pub signature: String,
pub data: Option<serde_json::Value>,
pub nonce: String,
}
pub async fn sign_request_with_nonce(
endpoint: &str,
wallet: &Wallet,
... | rust | Apache-2.0 | d389f2035ec2c3c485c6b3e270625f86c7609d50 | 2026-01-04T20:18:07.676063Z | false |
PrimeIntellect-ai/protocol | https://github.com/PrimeIntellect-ai/protocol/blob/d389f2035ec2c3c485c6b3e270625f86c7609d50/crates/shared/src/security/api_key_middleware.rs | crates/shared/src/security/api_key_middleware.rs | use actix_web::{
dev::{forward_ready, Service, ServiceRequest, ServiceResponse, Transform},
error::ErrorUnauthorized,
http::header::AUTHORIZATION,
Error,
};
use futures_util::future::{ready, LocalBoxFuture, Ready};
use subtle::ConstantTimeEq;
pub struct ApiKeyMiddleware {
api_key: String,
}
impl A... | rust | Apache-2.0 | d389f2035ec2c3c485c6b3e270625f86c7609d50 | 2026-01-04T20:18:07.676063Z | false |
PrimeIntellect-ai/protocol | https://github.com/PrimeIntellect-ai/protocol/blob/d389f2035ec2c3c485c6b3e270625f86c7609d50/crates/shared/src/web3/mod.rs | crates/shared/src/web3/mod.rs | pub mod contracts;
pub mod wallet;
| rust | Apache-2.0 | d389f2035ec2c3c485c6b3e270625f86c7609d50 | 2026-01-04T20:18:07.676063Z | false |
PrimeIntellect-ai/protocol | https://github.com/PrimeIntellect-ai/protocol/blob/d389f2035ec2c3c485c6b3e270625f86c7609d50/crates/shared/src/web3/wallet.rs | crates/shared/src/web3/wallet.rs | use alloy::primitives::Address;
use alloy::{
network::EthereumWallet,
primitives::U256,
providers::fillers::{
BlobGasFiller, ChainIdFiller, FillProvider, GasFiller, JoinFill, NonceFiller, WalletFiller,
},
providers::{Provider, ProviderBuilder, RootProvider},
signers::local::PrivateKeySig... | rust | Apache-2.0 | d389f2035ec2c3c485c6b3e270625f86c7609d50 | 2026-01-04T20:18:07.676063Z | false |
PrimeIntellect-ai/protocol | https://github.com/PrimeIntellect-ai/protocol/blob/d389f2035ec2c3c485c6b3e270625f86c7609d50/crates/shared/src/web3/contracts/mod.rs | crates/shared/src/web3/contracts/mod.rs | pub mod constants;
pub mod core;
pub mod helpers;
pub mod implementations;
pub mod structs;
| rust | Apache-2.0 | d389f2035ec2c3c485c6b3e270625f86c7609d50 | 2026-01-04T20:18:07.676063Z | false |
PrimeIntellect-ai/protocol | https://github.com/PrimeIntellect-ai/protocol/blob/d389f2035ec2c3c485c6b3e270625f86c7609d50/crates/shared/src/web3/contracts/helpers/utils.rs | crates/shared/src/web3/contracts/helpers/utils.rs | // This is the correct, minimal, and tested fix.
use alloy::contract::CallDecoder;
use alloy::providers::Provider;
use alloy::{
contract::CallBuilder,
primitives::{keccak256, FixedBytes, Selector},
providers::Network,
};
use anyhow::Result;
use log::{debug, info, warn};
use tokio::time::Duration;
use crat... | rust | Apache-2.0 | d389f2035ec2c3c485c6b3e270625f86c7609d50 | 2026-01-04T20:18:07.676063Z | false |
PrimeIntellect-ai/protocol | https://github.com/PrimeIntellect-ai/protocol/blob/d389f2035ec2c3c485c6b3e270625f86c7609d50/crates/shared/src/web3/contracts/helpers/mod.rs | crates/shared/src/web3/contracts/helpers/mod.rs | pub mod utils;
| rust | Apache-2.0 | d389f2035ec2c3c485c6b3e270625f86c7609d50 | 2026-01-04T20:18:07.676063Z | false |
PrimeIntellect-ai/protocol | https://github.com/PrimeIntellect-ai/protocol/blob/d389f2035ec2c3c485c6b3e270625f86c7609d50/crates/shared/src/web3/contracts/structs/compute_provider.rs | crates/shared/src/web3/contracts/structs/compute_provider.rs | use super::compute_node::ComputeNode;
use alloy::primitives::Address;
pub struct ComputeProvider {
pub provider_address: Address,
pub is_whitelisted: bool,
pub active_nodes: u32,
pub nodes: Vec<ComputeNode>,
}
| rust | Apache-2.0 | d389f2035ec2c3c485c6b3e270625f86c7609d50 | 2026-01-04T20:18:07.676063Z | false |
PrimeIntellect-ai/protocol | https://github.com/PrimeIntellect-ai/protocol/blob/d389f2035ec2c3c485c6b3e270625f86c7609d50/crates/shared/src/web3/contracts/structs/rewards_distributor.rs | crates/shared/src/web3/contracts/structs/rewards_distributor.rs | use alloy::primitives::{Address, U256};
#[derive(Debug, Clone, PartialEq)]
pub struct NodeRewards {
pub claimable_tokens: U256,
pub locked_tokens: U256,
pub total_rewards: U256,
pub is_active: bool,
pub provider: Address,
}
#[derive(Debug, Clone)]
pub struct NodeBucketInfo {
pub last_24h: U256... | rust | Apache-2.0 | d389f2035ec2c3c485c6b3e270625f86c7609d50 | 2026-01-04T20:18:07.676063Z | false |
PrimeIntellect-ai/protocol | https://github.com/PrimeIntellect-ai/protocol/blob/d389f2035ec2c3c485c6b3e270625f86c7609d50/crates/shared/src/web3/contracts/structs/mod.rs | crates/shared/src/web3/contracts/structs/mod.rs | pub mod compute_node;
pub mod compute_pool;
pub mod compute_provider;
pub mod rewards_distributor;
| rust | Apache-2.0 | d389f2035ec2c3c485c6b3e270625f86c7609d50 | 2026-01-04T20:18:07.676063Z | false |
PrimeIntellect-ai/protocol | https://github.com/PrimeIntellect-ai/protocol/blob/d389f2035ec2c3c485c6b3e270625f86c7609d50/crates/shared/src/web3/contracts/structs/compute_node.rs | crates/shared/src/web3/contracts/structs/compute_node.rs | use alloy::primitives::Address;
// TODO: Consider renaming as we have an internal compute node struct also
#[derive(Debug, Clone, PartialEq)]
pub struct ComputeNode {
pub provider: Address,
pub subkey: Address,
pub specs_uri: String,
pub compute_units: u32, // H100 equivalents
pub benchmark_score... | rust | Apache-2.0 | d389f2035ec2c3c485c6b3e270625f86c7609d50 | 2026-01-04T20:18:07.676063Z | false |
PrimeIntellect-ai/protocol | https://github.com/PrimeIntellect-ai/protocol/blob/d389f2035ec2c3c485c6b3e270625f86c7609d50/crates/shared/src/web3/contracts/structs/compute_pool.rs | crates/shared/src/web3/contracts/structs/compute_pool.rs | use alloy::primitives::Address;
use alloy::primitives::U256;
#[derive(Debug, PartialEq)]
pub enum PoolStatus {
PENDING,
ACTIVE,
COMPLETED,
}
#[derive(Debug)]
pub struct PoolInfo {
pub pool_id: U256,
pub domain_id: U256,
pub pool_name: String,
pub creator: Address,
pub compute_manager_k... | rust | Apache-2.0 | d389f2035ec2c3c485c6b3e270625f86c7609d50 | 2026-01-04T20:18:07.676063Z | false |
PrimeIntellect-ai/protocol | https://github.com/PrimeIntellect-ai/protocol/blob/d389f2035ec2c3c485c6b3e270625f86c7609d50/crates/shared/src/web3/contracts/core/builder.rs | crates/shared/src/web3/contracts/core/builder.rs | use alloy::primitives::Address;
use crate::web3::contracts::{
core::error::ContractError, // Using custom error ContractError
implementations::{
ai_token_contract::AIToken, compute_pool_contract::ComputePool,
compute_registry_contract::ComputeRegistryContract,
domain_registry_contract::... | rust | Apache-2.0 | d389f2035ec2c3c485c6b3e270625f86c7609d50 | 2026-01-04T20:18:07.676063Z | false |
PrimeIntellect-ai/protocol | https://github.com/PrimeIntellect-ai/protocol/blob/d389f2035ec2c3c485c6b3e270625f86c7609d50/crates/shared/src/web3/contracts/core/contract.rs | crates/shared/src/web3/contracts/core/contract.rs | use alloy::{
contract::{ContractInstance, Interface},
primitives::Address,
};
use std::include_bytes;
macro_rules! include_abi {
($path:expr) => {{
const ABI_BYTES: &[u8] = include_bytes!($path);
ABI_BYTES
}};
}
#[derive(Clone)]
pub struct Contract<P: alloy_provider::Provider> {
i... | rust | Apache-2.0 | d389f2035ec2c3c485c6b3e270625f86c7609d50 | 2026-01-04T20:18:07.676063Z | false |
PrimeIntellect-ai/protocol | https://github.com/PrimeIntellect-ai/protocol/blob/d389f2035ec2c3c485c6b3e270625f86c7609d50/crates/shared/src/web3/contracts/core/error.rs | crates/shared/src/web3/contracts/core/error.rs | use alloy::primitives::Address;
use std::fmt;
#[derive(Debug)]
pub enum ContractError {
// Initialization errors
AbiParseError(String),
ArtifactReadError(String),
// Contract interaction errors
CallError(String),
TransactionError(String),
// Data parsing errors
DecodingError(String),
... | rust | Apache-2.0 | d389f2035ec2c3c485c6b3e270625f86c7609d50 | 2026-01-04T20:18:07.676063Z | false |
PrimeIntellect-ai/protocol | https://github.com/PrimeIntellect-ai/protocol/blob/d389f2035ec2c3c485c6b3e270625f86c7609d50/crates/shared/src/web3/contracts/core/mod.rs | crates/shared/src/web3/contracts/core/mod.rs | pub mod builder;
pub mod contract;
pub mod error;
| rust | Apache-2.0 | d389f2035ec2c3c485c6b3e270625f86c7609d50 | 2026-01-04T20:18:07.676063Z | false |
PrimeIntellect-ai/protocol | https://github.com/PrimeIntellect-ai/protocol/blob/d389f2035ec2c3c485c6b3e270625f86c7609d50/crates/shared/src/web3/contracts/implementations/compute_pool_contract.rs | crates/shared/src/web3/contracts/implementations/compute_pool_contract.rs | use crate::web3::contracts::constants::addresses::COMPUTE_POOL_ADDRESS;
use crate::web3::contracts::core::contract::Contract;
use crate::web3::contracts::helpers::utils::{get_selector, PrimeCallBuilder};
use crate::web3::contracts::implementations::rewards_distributor_contract::RewardsDistributor;
use crate::web3::cont... | rust | Apache-2.0 | d389f2035ec2c3c485c6b3e270625f86c7609d50 | 2026-01-04T20:18:07.676063Z | false |
PrimeIntellect-ai/protocol | https://github.com/PrimeIntellect-ai/protocol/blob/d389f2035ec2c3c485c6b3e270625f86c7609d50/crates/shared/src/web3/contracts/implementations/prime_network_contract.rs | crates/shared/src/web3/contracts/implementations/prime_network_contract.rs | use crate::web3::contracts::constants::addresses::PRIME_NETWORK_ADDRESS;
use crate::web3::contracts::core::contract::Contract;
use crate::web3::wallet::WalletProvider;
use alloy::dyn_abi::DynSolValue;
use alloy::primitives::{keccak256, Address, FixedBytes, U256};
use alloy_provider::Provider as _;
use anyhow::Error;
#... | rust | Apache-2.0 | d389f2035ec2c3c485c6b3e270625f86c7609d50 | 2026-01-04T20:18:07.676063Z | false |
PrimeIntellect-ai/protocol | https://github.com/PrimeIntellect-ai/protocol/blob/d389f2035ec2c3c485c6b3e270625f86c7609d50/crates/shared/src/web3/contracts/implementations/ai_token_contract.rs | crates/shared/src/web3/contracts/implementations/ai_token_contract.rs | use crate::web3::contracts::constants::addresses::{AI_TOKEN_ADDRESS, PRIME_NETWORK_ADDRESS};
use crate::web3::contracts::core::contract::Contract;
use crate::web3::contracts::helpers::utils::PrimeCallBuilder;
use crate::web3::wallet::WalletProvider;
use alloy::primitives::{Address, FixedBytes, U256};
#[derive(Clone)]
... | rust | Apache-2.0 | d389f2035ec2c3c485c6b3e270625f86c7609d50 | 2026-01-04T20:18:07.676063Z | false |
PrimeIntellect-ai/protocol | https://github.com/PrimeIntellect-ai/protocol/blob/d389f2035ec2c3c485c6b3e270625f86c7609d50/crates/shared/src/web3/contracts/implementations/compute_registry_contract.rs | crates/shared/src/web3/contracts/implementations/compute_registry_contract.rs | use super::{
super::constants::addresses::COMPUTE_REGISTRY_ADDRESS, super::core::contract::Contract,
super::structs::compute_provider::ComputeProvider,
};
use crate::web3::contracts::helpers::utils::get_selector;
use alloy::dyn_abi::DynSolValue;
use alloy::primitives::{Address, U256};
use anyhow::Result;
#[der... | rust | Apache-2.0 | d389f2035ec2c3c485c6b3e270625f86c7609d50 | 2026-01-04T20:18:07.676063Z | false |
PrimeIntellect-ai/protocol | https://github.com/PrimeIntellect-ai/protocol/blob/d389f2035ec2c3c485c6b3e270625f86c7609d50/crates/shared/src/web3/contracts/implementations/rewards_distributor_contract.rs | crates/shared/src/web3/contracts/implementations/rewards_distributor_contract.rs | use crate::web3::contracts::core::contract::Contract;
use crate::web3::contracts::structs::rewards_distributor::{NodeBucketInfo, NodeRewards};
use crate::web3::wallet::WalletProvider;
use alloy::primitives::{Address, U256};
#[derive(Clone)]
pub struct RewardsDistributor<P: alloy_provider::Provider> {
pub instance:... | rust | Apache-2.0 | d389f2035ec2c3c485c6b3e270625f86c7609d50 | 2026-01-04T20:18:07.676063Z | false |
PrimeIntellect-ai/protocol | https://github.com/PrimeIntellect-ai/protocol/blob/d389f2035ec2c3c485c6b3e270625f86c7609d50/crates/shared/src/web3/contracts/implementations/mod.rs | crates/shared/src/web3/contracts/implementations/mod.rs | pub mod ai_token_contract;
pub mod compute_pool_contract;
pub mod compute_registry_contract;
pub mod domain_registry_contract;
pub mod prime_network_contract;
pub mod rewards_distributor_contract;
pub mod stake_manager;
pub mod work_validators;
| rust | Apache-2.0 | d389f2035ec2c3c485c6b3e270625f86c7609d50 | 2026-01-04T20:18:07.676063Z | false |
PrimeIntellect-ai/protocol | https://github.com/PrimeIntellect-ai/protocol/blob/d389f2035ec2c3c485c6b3e270625f86c7609d50/crates/shared/src/web3/contracts/implementations/domain_registry_contract.rs | crates/shared/src/web3/contracts/implementations/domain_registry_contract.rs | use crate::web3::contracts::constants::addresses::DOMAIN_REGISTRY_ADDRESS;
use crate::web3::contracts::core::contract::Contract;
use alloy::dyn_abi::DynSolValue;
use alloy::primitives::{Address, U256};
use anyhow::Error;
pub struct Domain {
pub domain_id: U256,
pub name: String,
pub validation_logic: Addre... | rust | Apache-2.0 | d389f2035ec2c3c485c6b3e270625f86c7609d50 | 2026-01-04T20:18:07.676063Z | false |
PrimeIntellect-ai/protocol | https://github.com/PrimeIntellect-ai/protocol/blob/d389f2035ec2c3c485c6b3e270625f86c7609d50/crates/shared/src/web3/contracts/implementations/stake_manager.rs | crates/shared/src/web3/contracts/implementations/stake_manager.rs | use crate::web3::contracts::constants::addresses::STAKE_MANAGER_ADDRESS;
use crate::web3::contracts::core::contract::Contract;
use alloy::primitives::{Address, U256};
#[derive(Clone)]
pub struct StakeManagerContract<P: alloy_provider::Provider> {
instance: Contract<P>,
}
impl<P: alloy_provider::Provider> StakeMan... | rust | Apache-2.0 | d389f2035ec2c3c485c6b3e270625f86c7609d50 | 2026-01-04T20:18:07.676063Z | false |
PrimeIntellect-ai/protocol | https://github.com/PrimeIntellect-ai/protocol/blob/d389f2035ec2c3c485c6b3e270625f86c7609d50/crates/shared/src/web3/contracts/implementations/work_validators/synthetic_data_validator.rs | crates/shared/src/web3/contracts/implementations/work_validators/synthetic_data_validator.rs | use crate::web3::contracts::core::contract::Contract;
use alloy::{
dyn_abi::{DynSolValue, Word},
primitives::{Address, U256},
};
use anyhow::Error;
use serde::Deserialize;
use serde::Serialize;
#[derive(Clone)]
pub struct SyntheticDataWorkValidator<P: alloy_provider::Provider> {
pub instance: Contract<P>,
... | rust | Apache-2.0 | d389f2035ec2c3c485c6b3e270625f86c7609d50 | 2026-01-04T20:18:07.676063Z | false |
PrimeIntellect-ai/protocol | https://github.com/PrimeIntellect-ai/protocol/blob/d389f2035ec2c3c485c6b3e270625f86c7609d50/crates/shared/src/web3/contracts/implementations/work_validators/mod.rs | crates/shared/src/web3/contracts/implementations/work_validators/mod.rs | pub mod synthetic_data_validator;
| rust | Apache-2.0 | d389f2035ec2c3c485c6b3e270625f86c7609d50 | 2026-01-04T20:18:07.676063Z | false |
PrimeIntellect-ai/protocol | https://github.com/PrimeIntellect-ai/protocol/blob/d389f2035ec2c3c485c6b3e270625f86c7609d50/crates/shared/src/web3/contracts/constants/mod.rs | crates/shared/src/web3/contracts/constants/mod.rs | pub mod addresses;
| rust | Apache-2.0 | d389f2035ec2c3c485c6b3e270625f86c7609d50 | 2026-01-04T20:18:07.676063Z | false |
PrimeIntellect-ai/protocol | https://github.com/PrimeIntellect-ai/protocol/blob/d389f2035ec2c3c485c6b3e270625f86c7609d50/crates/shared/src/web3/contracts/constants/addresses.rs | crates/shared/src/web3/contracts/constants/addresses.rs | use alloy::primitives::{hex, Address};
// TODO: Parse these from env
#[cfg(not(feature = "testnet"))]
pub mod contract_addresses {
use super::*;
pub const PRIME_NETWORK_ADDRESS: Address =
Address::new(hex!("0xCf7Ed3AccA5a467e9e704C703E8D87F634fB0Fc9"));
pub const AI_TOKEN_ADDRESS: Address =
... | rust | Apache-2.0 | d389f2035ec2c3c485c6b3e270625f86c7609d50 | 2026-01-04T20:18:07.676063Z | false |
PrimeIntellect-ai/protocol | https://github.com/PrimeIntellect-ai/protocol/blob/d389f2035ec2c3c485c6b3e270625f86c7609d50/crates/shared/src/p2p/service.rs | crates/shared/src/p2p/service.rs | use crate::web3::wallet::Wallet;
use anyhow::{bail, Context as _, Result};
use futures::stream::FuturesUnordered;
use p2p::{
AuthenticationInitiationRequest, AuthenticationResponse, AuthenticationSolutionRequest,
IncomingMessage, Libp2pIncomingMessage, Node, NodeBuilder, OutgoingMessage, PeerId, Protocol,
P... | rust | Apache-2.0 | d389f2035ec2c3c485c6b3e270625f86c7609d50 | 2026-01-04T20:18:07.676063Z | false |
PrimeIntellect-ai/protocol | https://github.com/PrimeIntellect-ai/protocol/blob/d389f2035ec2c3c485c6b3e270625f86c7609d50/crates/shared/src/p2p/mod.rs | crates/shared/src/p2p/mod.rs | mod service;
pub use service::*;
| rust | Apache-2.0 | d389f2035ec2c3c485c6b3e270625f86c7609d50 | 2026-01-04T20:18:07.676063Z | false |
lukebitts/blend | https://github.com/lukebitts/blend/blob/6c4f0b55c6314441c9482097ac33497320326aaf/src/lib.rs | src/lib.rs | //! # Blend - A crate for parsing .blend files from Blender
//!
//! ## Example
//!
//! ```rust
//! # use blend::Blend;
//!
//! /// Prints the name and position of every object
//! # fn main() {
//! let blend = Blend::from_path("examples/blend_files/3_5.blend").expect("error loading blend file");
//!
//! for... | rust | MIT | 6c4f0b55c6314441c9482097ac33497320326aaf | 2026-01-04T20:18:08.827467Z | false |
lukebitts/blend | https://github.com/lukebitts/blend/blob/6c4f0b55c6314441c9482097ac33497320326aaf/src/runtime.rs | src/runtime.rs | use crate::parsers::{
blend::{Block, BlockData, Header as BlendHeader, RawBlend},
dna::{Dna, DnaStruct, DnaType},
field::{parse_field, FieldInfo},
primitive::*,
BlendParseError, Endianness, PointerSize,
};
use linked_hash_map::LinkedHashMap;
use std::fmt;
use std::{io::Read, mem::size_of, num::NonZe... | rust | MIT | 6c4f0b55c6314441c9482097ac33497320326aaf | 2026-01-04T20:18:08.827467Z | true |
lukebitts/blend | https://github.com/lukebitts/blend/blob/6c4f0b55c6314441c9482097ac33497320326aaf/src/parsers/field.rs | src/parsers/field.rs | use nom::{
branch::alt,
bytes::complete::{tag, take_till, take_until},
combinator::complete,
error::{ErrorKind, ParseError},
multi::{many0, many1},
sequence::delimited,
Err, IResult,
};
#[derive(Debug)]
pub enum FieldParseError {
NomError {
kind: ErrorKind,
other: Option... | rust | MIT | 6c4f0b55c6314441c9482097ac33497320326aaf | 2026-01-04T20:18:08.827467Z | false |
lukebitts/blend | https://github.com/lukebitts/blend/blob/6c4f0b55c6314441c9482097ac33497320326aaf/src/parsers/dna.rs | src/parsers/dna.rs | use crate::parsers::{Endianness, PointerSize, Result};
use nom::{
bytes::complete::{tag, take, take_while},
combinator::map,
multi::count,
number::complete::{be_u16, be_u32, le_u16, le_u32},
sequence::terminated,
};
use std::convert::TryInto;
#[derive(Debug)]
pub struct Dna {
pub names: Vec<Str... | rust | MIT | 6c4f0b55c6314441c9482097ac33497320326aaf | 2026-01-04T20:18:08.827467Z | false |
lukebitts/blend | https://github.com/lukebitts/blend/blob/6c4f0b55c6314441c9482097ac33497320326aaf/src/parsers/primitive.rs | src/parsers/primitive.rs | use super::Endianness;
use nom::number::complete::{
be_f32, be_f64, be_i16, be_i32, be_i64, be_i8, be_u16, be_u32, be_u64, le_f32, le_f64, le_i16,
le_i32, le_i64, le_i8, le_u16, le_u32, le_u64,
};
pub(crate) trait BlendPrimitive {
fn parse(data: &[u8], endianness: Endianness) -> Self;
fn blender_name()... | rust | MIT | 6c4f0b55c6314441c9482097ac33497320326aaf | 2026-01-04T20:18:08.827467Z | false |
lukebitts/blend | https://github.com/lukebitts/blend/blob/6c4f0b55c6314441c9482097ac33497320326aaf/src/parsers/mod.rs | src/parsers/mod.rs | pub mod blend;
pub mod dna;
pub mod field;
pub mod primitive;
use nom::{
error::{ErrorKind, ParseError},
IResult,
};
use std::io;
type Result<'a, T> = IResult<&'a [u8], T, BlendParseError>;
/// Size of a pointer on the machine used to create the .blend file.
#[derive(Debug, Copy, Clone)]
pub enum PointerSize... | rust | MIT | 6c4f0b55c6314441c9482097ac33497320326aaf | 2026-01-04T20:18:08.827467Z | false |
lukebitts/blend | https://github.com/lukebitts/blend/blob/6c4f0b55c6314441c9482097ac33497320326aaf/src/parsers/blend.rs | src/parsers/blend.rs | use crate::parsers::{
dna::{Dna, DnaParseContext},
BlendParseError, Endianness, PointerSize, Result,
};
use nom::{
branch::alt,
bytes::complete::{tag, take},
multi::many_till,
number::complete::{be_u32, be_u64, le_u32, le_u64},
sequence::tuple,
Err,
};
use std::{
convert::TryInto,
... | rust | MIT | 6c4f0b55c6314441c9482097ac33497320326aaf | 2026-01-04T20:18:08.827467Z | false |
lukebitts/blend | https://github.com/lukebitts/blend/blob/6c4f0b55c6314441c9482097ac33497320326aaf/examples/names_positions.rs | examples/names_positions.rs | use blend::Blend;
use std::{env, path};
fn print_names_and_positions(file_name: &str) {
let base_path = path::PathBuf::from(
env::var_os("CARGO_MANIFEST_DIR").expect("could not find cargo manifest dir"),
);
let blend_path = base_path.join(format!("examples/blend_files/{}", file_name));
let blen... | rust | MIT | 6c4f0b55c6314441c9482097ac33497320326aaf | 2026-01-04T20:18:08.827467Z | false |
lukebitts/blend | https://github.com/lukebitts/blend/blob/6c4f0b55c6314441c9482097ac33497320326aaf/examples/read_mesh_280.rs | examples/read_mesh_280.rs | use blend::{Blend, Instance};
use std::{env, path};
type Vertex = ([f32; 3], [f32; 3], [f32; 2]);
type Face = [Vertex; 3];
#[derive(Debug)]
struct Mesh {
_faces: Vec<Face>,
}
#[derive(Debug)]
struct Object {
_name: String,
_location: [f32; 3],
_rotation: [f32; 3],
_scale: [f32; 3],
_mesh: Mes... | rust | MIT | 6c4f0b55c6314441c9482097ac33497320326aaf | 2026-01-04T20:18:08.827467Z | false |
lukebitts/blend | https://github.com/lukebitts/blend/blob/6c4f0b55c6314441c9482097ac33497320326aaf/examples/print_blend/main.rs | examples/print_blend/main.rs | use blend::Blend;
use libflate::gzip::Decoder;
use std::{
env,
fs::File,
io::{self, BufWriter, Read, Write},
path::{self, PathBuf},
};
fn print_blend(file_name: impl AsRef<str>) -> Result<(), io::Error> {
let file_name = file_name.as_ref();
let base_path = path::PathBuf::from(
env::var_... | rust | MIT | 6c4f0b55c6314441c9482097ac33497320326aaf | 2026-01-04T20:18:08.827467Z | false |
samrat/rug | https://github.com/samrat/rug/blob/40f81c7ba5da19890dd234dba4ca26634bc64d78/src/lockfile.rs | src/lockfile.rs | use std::fs::{self, File, OpenOptions};
use std::io::prelude::*;
use std::io::{self, ErrorKind};
use std::path::{Path, PathBuf};
#[derive(Debug)]
pub struct Lockfile {
file_path: PathBuf,
lock_path: PathBuf,
pub lock: Option<File>,
}
impl Lockfile {
pub fn new(path: &Path) -> Lockfile {
Lockfi... | rust | MIT | 40f81c7ba5da19890dd234dba4ca26634bc64d78 | 2026-01-04T20:18:11.106865Z | false |
samrat/rug | https://github.com/samrat/rug/blob/40f81c7ba5da19890dd234dba4ca26634bc64d78/src/refs.rs | src/refs.rs | use crate::lockfile::Lockfile;
use crate::util;
use regex::{Regex, RegexSet};
use std::fs::{self, DirEntry, File};
use std::io::{self, Read};
use std::path::{Path, PathBuf};
use std::cmp::{Ord, Ordering};
use std::collections::HashMap;
lazy_static! {
static ref INVALID_FILENAME: RegexSet = {
RegexSet::new(... | rust | MIT | 40f81c7ba5da19890dd234dba4ca26634bc64d78 | 2026-01-04T20:18:11.106865Z | false |
samrat/rug | https://github.com/samrat/rug/blob/40f81c7ba5da19890dd234dba4ca26634bc64d78/src/revision.rs | src/revision.rs | use crate::database::{commit, Database, ParsedObject};
use crate::repository::Repository;
use regex::{Regex, RegexSet};
use std::collections::HashMap;
use std::fmt;
lazy_static! {
static ref INVALID_NAME: RegexSet = {
RegexSet::new(&[
r"^\.",
r"/\.",
r"\.\.",
... | rust | MIT | 40f81c7ba5da19890dd234dba4ca26634bc64d78 | 2026-01-04T20:18:11.106865Z | false |
samrat/rug | https://github.com/samrat/rug/blob/40f81c7ba5da19890dd234dba4ca26634bc64d78/src/workspace.rs | src/workspace.rs | use crate::database::tree::{TreeEntry, TREE_MODE};
use crate::database::{Database, ParsedObject};
use crate::repository::migration::Action;
use std::collections::{BTreeSet, HashMap};
use std::fs::{self, File, OpenOptions};
use std::io::prelude::*;
use std::io::BufReader;
use std::os::unix::fs::PermissionsExt;
use std::... | rust | MIT | 40f81c7ba5da19890dd234dba4ca26634bc64d78 | 2026-01-04T20:18:11.106865Z | false |
samrat/rug | https://github.com/samrat/rug/blob/40f81c7ba5da19890dd234dba4ca26634bc64d78/src/index.rs | src/index.rs | use crypto::digest::Digest;
use crypto::sha1::Sha1;
use std::cmp;
use std::collections::{BTreeMap, HashMap, HashSet};
use std::convert::TryInto;
use std::fs::{self, File, OpenOptions};
use std::io::{self, ErrorKind, Read, Write};
use std::os::unix::fs::MetadataExt;
use std::path::{Path, PathBuf};
use std::str;
use cra... | rust | MIT | 40f81c7ba5da19890dd234dba4ca26634bc64d78 | 2026-01-04T20:18:11.106865Z | false |
samrat/rug | https://github.com/samrat/rug/blob/40f81c7ba5da19890dd234dba4ca26634bc64d78/src/util.rs | src/util.rs | use rand::distributions::Alphanumeric;
use rand::{thread_rng, Rng};
use std::fmt::Write;
use std::num::ParseIntError;
use std::path::Path;
pub fn decode_hex(s: &str) -> Result<Vec<u8>, ParseIntError> {
(0..s.len())
.step_by(2)
.map(|i| u8::from_str_radix(&s[i..i + 2], 16))
.collect()
}
pub... | rust | MIT | 40f81c7ba5da19890dd234dba4ca26634bc64d78 | 2026-01-04T20:18:11.106865Z | false |
samrat/rug | https://github.com/samrat/rug/blob/40f81c7ba5da19890dd234dba4ca26634bc64d78/src/main.rs | src/main.rs | extern crate chrono;
extern crate crypto;
extern crate flate2;
extern crate rand;
#[macro_use]
extern crate lazy_static;
extern crate regex;
extern crate clap;
use std::collections::HashMap;
use std::env;
use std::io::{self, Write};
mod lockfile;
mod database;
mod index;
mod refs;
mod repository;
mod util;
mod works... | rust | MIT | 40f81c7ba5da19890dd234dba4ca26634bc64d78 | 2026-01-04T20:18:11.106865Z | false |
samrat/rug | https://github.com/samrat/rug/blob/40f81c7ba5da19890dd234dba4ca26634bc64d78/src/pager.rs | src/pager.rs | use std::collections::HashMap;
use std::ffi::OsString;
const PAGER_CMD: &str = "less";
lazy_static! {
static ref PAGER_ENV: HashMap<&'static str, &'static str> = {
let mut m = HashMap::new();
m.insert("LESS", "FRX");
m.insert("LV", "-c");
m
};
}
mod utils {
use std::ffi::{... | rust | MIT | 40f81c7ba5da19890dd234dba4ca26634bc64d78 | 2026-01-04T20:18:11.106865Z | false |
samrat/rug | https://github.com/samrat/rug/blob/40f81c7ba5da19890dd234dba4ca26634bc64d78/src/commands/branch.rs | src/commands/branch.rs | use crate::commands::CommandContext;
use crate::database::object::Object;
use crate::database::{Database, ParsedObject};
use crate::pager::Pager;
use crate::refs::Ref;
use crate::repository::Repository;
use crate::revision::Revision;
use colored::*;
use std::io::{Read, Write};
pub struct Branch<'a, I, O, E>
where
... | rust | MIT | 40f81c7ba5da19890dd234dba4ca26634bc64d78 | 2026-01-04T20:18:11.106865Z | false |
samrat/rug | https://github.com/samrat/rug/blob/40f81c7ba5da19890dd234dba4ca26634bc64d78/src/commands/diff.rs | src/commands/diff.rs | use crate::commands::CommandContext;
use crate::database::blob::Blob;
use crate::database::object::Object;
use crate::database::{Database, ParsedObject};
use crate::diff;
use crate::diff::myers::{Edit, EditType};
use crate::pager::Pager;
use crate::repository::{ChangeType, Repository};
use colored::*;
use std::io::{Rea... | rust | MIT | 40f81c7ba5da19890dd234dba4ca26634bc64d78 | 2026-01-04T20:18:11.106865Z | false |
samrat/rug | https://github.com/samrat/rug/blob/40f81c7ba5da19890dd234dba4ca26634bc64d78/src/commands/status.rs | src/commands/status.rs | use crate::commands::CommandContext;
use crate::repository::{ChangeType, Repository};
use colored::*;
use std::collections::HashMap;
use std::io::{Read, Write};
static LABEL_WIDTH: usize = 12;
lazy_static! {
static ref SHORT_STATUS: HashMap<ChangeType, &'static str> = {
let mut m = HashMap::new();
... | rust | MIT | 40f81c7ba5da19890dd234dba4ca26634bc64d78 | 2026-01-04T20:18:11.106865Z | false |
samrat/rug | https://github.com/samrat/rug/blob/40f81c7ba5da19890dd234dba4ca26634bc64d78/src/commands/checkout.rs | src/commands/checkout.rs | use crate::commands::CommandContext;
use crate::database::object::Object;
use crate::database::tree::TreeEntry;
use crate::database::tree_diff::TreeDiff;
use crate::database::{Database, ParsedObject};
use crate::refs::Ref;
use crate::repository::Repository;
use crate::revision::Revision;
use std::collections::HashMap;
... | rust | MIT | 40f81c7ba5da19890dd234dba4ca26634bc64d78 | 2026-01-04T20:18:11.106865Z | true |
samrat/rug | https://github.com/samrat/rug/blob/40f81c7ba5da19890dd234dba4ca26634bc64d78/src/commands/log.rs | src/commands/log.rs | use crate::commands::CommandContext;
use crate::database::commit::Commit;
use crate::database::object::Object;
use crate::database::{Database, ParsedObject};
use crate::pager::Pager;
use crate::refs::Ref;
use crate::repository::Repository;
use colored::*;
use std::collections::HashMap;
use std::io::{Read, Write};
#[de... | rust | MIT | 40f81c7ba5da19890dd234dba4ca26634bc64d78 | 2026-01-04T20:18:11.106865Z | false |
samrat/rug | https://github.com/samrat/rug/blob/40f81c7ba5da19890dd234dba4ca26634bc64d78/src/commands/commit.rs | src/commands/commit.rs | use std::io::{Read, Write};
use chrono::prelude::*;
use crate::commands::CommandContext;
use crate::database::commit::{Author, Commit};
use crate::database::object::Object;
use crate::database::tree::Tree;
use crate::database::Entry;
use crate::repository::Repository;
pub fn commit_command<I, O, E>(mut ctx: CommandC... | rust | MIT | 40f81c7ba5da19890dd234dba4ca26634bc64d78 | 2026-01-04T20:18:11.106865Z | false |
samrat/rug | https://github.com/samrat/rug/blob/40f81c7ba5da19890dd234dba4ca26634bc64d78/src/commands/mod.rs | src/commands/mod.rs | use clap::{App, Arg, ArgMatches, SubCommand};
use std::collections::HashMap;
use std::io::{Read, Write};
use std::path::PathBuf;
mod add;
use add::add_command;
mod init;
use init::init_command;
mod commit;
use commit::commit_command;
mod status;
use status::Status;
mod diff;
use diff::Diff;
mod branch;
use branch::Bra... | rust | MIT | 40f81c7ba5da19890dd234dba4ca26634bc64d78 | 2026-01-04T20:18:11.106865Z | false |
samrat/rug | https://github.com/samrat/rug/blob/40f81c7ba5da19890dd234dba4ca26634bc64d78/src/commands/init.rs | src/commands/init.rs | use crate::refs::Refs;
use std::fs;
use std::io::{Read, Write};
use std::path::Path;
use crate::commands::CommandContext;
const DEFAULT_BRANCH: &str = "master";
pub fn init_command<I, O, E>(ctx: CommandContext<I, O, E>) -> Result<(), String>
where
I: Read,
O: Write,
E: Write,
{
let working_dir = ctx.... | rust | MIT | 40f81c7ba5da19890dd234dba4ca26634bc64d78 | 2026-01-04T20:18:11.106865Z | false |
samrat/rug | https://github.com/samrat/rug/blob/40f81c7ba5da19890dd234dba4ca26634bc64d78/src/commands/add.rs | src/commands/add.rs | use std::io::{self, Read, Write};
use crate::commands::CommandContext;
use crate::database::blob::Blob;
use crate::database::object::Object;
use crate::repository::Repository;
static INDEX_LOAD_OR_CREATE_FAILED: &'static str = "fatal: could not create/load .git/index\n";
fn locked_index_message(e: &std::io::Error)... | rust | MIT | 40f81c7ba5da19890dd234dba4ca26634bc64d78 | 2026-01-04T20:18:11.106865Z | false |
samrat/rug | https://github.com/samrat/rug/blob/40f81c7ba5da19890dd234dba4ca26634bc64d78/src/diff/myers.rs | src/diff/myers.rs | use crate::diff::Line;
use std::collections::BTreeMap;
use std::convert::TryFrom;
use std::fmt;
#[derive(Clone, Debug, PartialEq, Eq)]
pub enum EditType {
Eql,
Ins,
Del,
}
impl EditType {
fn to_string(&self) -> &str {
match self {
EditType::Eql => " ",
EditType::Ins => ... | rust | MIT | 40f81c7ba5da19890dd234dba4ca26634bc64d78 | 2026-01-04T20:18:11.106865Z | false |
samrat/rug | https://github.com/samrat/rug/blob/40f81c7ba5da19890dd234dba4ca26634bc64d78/src/diff/mod.rs | src/diff/mod.rs | pub mod myers;
use myers::{Edit, EditType, Myers};
use std::fmt;
pub struct Diff {}
#[derive(Clone, Debug)]
pub struct Line {
number: usize,
text: String,
}
impl Line {
fn new(number: usize, text: &str) -> Line {
Line {
number,
text: text.to_string(),
}
}
}
im... | rust | MIT | 40f81c7ba5da19890dd234dba4ca26634bc64d78 | 2026-01-04T20:18:11.106865Z | false |
samrat/rug | https://github.com/samrat/rug/blob/40f81c7ba5da19890dd234dba4ca26634bc64d78/src/repository/mod.rs | src/repository/mod.rs | use crate::database::blob::Blob;
use crate::database::commit::Commit;
use crate::database::object::Object;
use crate::database::tree::TreeEntry;
use crate::database::Database;
use crate::database::ParsedObject;
use crate::index;
use crate::index::Index;
use crate::refs::Refs;
use crate::workspace::Workspace;
use std::c... | rust | MIT | 40f81c7ba5da19890dd234dba4ca26634bc64d78 | 2026-01-04T20:18:11.106865Z | false |
samrat/rug | https://github.com/samrat/rug/blob/40f81c7ba5da19890dd234dba4ca26634bc64d78/src/repository/migration.rs | src/repository/migration.rs | use crate::database::tree::TreeEntry;
use crate::index::Entry;
use crate::repository::{ChangeType, Repository};
use std::collections::{BTreeSet, HashMap, HashSet};
use std::fs;
use std::path::{Path, PathBuf};
lazy_static! {
static ref MESSAGES: HashMap<ConflictType, (&'static str, &'static str)> = {
let mu... | rust | MIT | 40f81c7ba5da19890dd234dba4ca26634bc64d78 | 2026-01-04T20:18:11.106865Z | false |
samrat/rug | https://github.com/samrat/rug/blob/40f81c7ba5da19890dd234dba4ca26634bc64d78/src/database/object.rs | src/database/object.rs | use crate::database::ParsedObject;
use crypto::digest::Digest;
use crypto::sha1::Sha1;
pub trait Object {
fn r#type(&self) -> String;
fn to_string(&self) -> Vec<u8>;
fn parse(s: &[u8]) -> ParsedObject;
fn get_oid(&self) -> String {
let mut hasher = Sha1::new();
hasher.input(&self.get_... | rust | MIT | 40f81c7ba5da19890dd234dba4ca26634bc64d78 | 2026-01-04T20:18:11.106865Z | false |
samrat/rug | https://github.com/samrat/rug/blob/40f81c7ba5da19890dd234dba4ca26634bc64d78/src/database/tree.rs | src/database/tree.rs | use crate::database::object::Object;
use crate::database::{Entry, ParsedObject};
use crate::util::*;
use std::collections::{BTreeMap};
use std::path::{Path};
use std::str;
pub const TREE_MODE: u32 = 0o40000;
#[derive(Clone, Debug, PartialEq, Eq)]
pub enum TreeEntry {
Entry(Entry),
Tree(Tree),
}
impl TreeEnt... | rust | MIT | 40f81c7ba5da19890dd234dba4ca26634bc64d78 | 2026-01-04T20:18:11.106865Z | false |
samrat/rug | https://github.com/samrat/rug/blob/40f81c7ba5da19890dd234dba4ca26634bc64d78/src/database/commit.rs | src/database/commit.rs | use chrono::prelude::*;
use std::collections::HashMap;
use std::str;
use crate::database::{Object, ParsedObject};
#[derive(Debug, Clone)]
pub struct Author {
pub name: String,
pub email: String,
pub time: DateTime<FixedOffset>,
}
impl Author {
fn to_string(&self) -> String {
format!(
... | rust | MIT | 40f81c7ba5da19890dd234dba4ca26634bc64d78 | 2026-01-04T20:18:11.106865Z | false |
samrat/rug | https://github.com/samrat/rug/blob/40f81c7ba5da19890dd234dba4ca26634bc64d78/src/database/mod.rs | src/database/mod.rs | use std::collections::HashMap;
use std::fs::{self, OpenOptions};
use std::io::prelude::*;
use std::path::{Path, PathBuf};
use std::str;
use flate2::read::ZlibDecoder;
use flate2::write::ZlibEncoder;
use flate2::Compression;
use crate::index;
use crate::util::*;
pub mod blob;
pub mod commit;
pub mod object;
pub mod t... | rust | MIT | 40f81c7ba5da19890dd234dba4ca26634bc64d78 | 2026-01-04T20:18:11.106865Z | false |
samrat/rug | https://github.com/samrat/rug/blob/40f81c7ba5da19890dd234dba4ca26634bc64d78/src/database/blob.rs | src/database/blob.rs | use crate::database::object::Object;
use crate::database::ParsedObject;
#[derive(Debug)]
pub struct Blob {
pub data: Vec<u8>,
}
impl Blob {
pub fn new(data: &[u8]) -> Blob {
Blob {
data: data.to_vec(),
}
}
}
impl Object for Blob {
fn r#type(&self) -> String {
"blob... | rust | MIT | 40f81c7ba5da19890dd234dba4ca26634bc64d78 | 2026-01-04T20:18:11.106865Z | false |
samrat/rug | https://github.com/samrat/rug/blob/40f81c7ba5da19890dd234dba4ca26634bc64d78/src/database/tree_diff.rs | src/database/tree_diff.rs | use crate::database::tree::TreeEntry;
use crate::database::{Database, ParsedObject, Tree};
use std::collections::{BTreeMap, HashMap};
use std::path::{Path, PathBuf};
pub struct TreeDiff<'a> {
database: &'a mut Database,
pub changes: HashMap<PathBuf, (Option<TreeEntry>, Option<TreeEntry>)>,
}
impl<'a> TreeDiff... | rust | MIT | 40f81c7ba5da19890dd234dba4ca26634bc64d78 | 2026-01-04T20:18:11.106865Z | false |
LeoBorai/local-ip-address | https://github.com/LeoBorai/local-ip-address/blob/eed9856f5e2ee03e2490922867337b24d8000a91/src/unix.rs | src/unix.rs | use std::alloc::{alloc, dealloc, Layout};
use std::net::{IpAddr, Ipv4Addr, Ipv6Addr};
use libc::{
getifaddrs, strlen, c_char, ifaddrs, sockaddr_in, sockaddr_in6, AF_INET, AF_INET6, IFF_LOOPBACK,
};
use crate::Error;
/// `ifaddrs` struct raw pointer alias
type IfAddrsPtr = *mut *mut ifaddrs;
/// Perform a search... | rust | Apache-2.0 | eed9856f5e2ee03e2490922867337b24d8000a91 | 2026-01-04T20:18:14.206471Z | false |
LeoBorai/local-ip-address | https://github.com/LeoBorai/local-ip-address/blob/eed9856f5e2ee03e2490922867337b24d8000a91/src/lib.rs | src/lib.rs | /*!
# Local IP Address
Retrieve system's local IP address and Network Interfaces/Adapters on
Linux, Windows, and macOS (and other BSD-based systems).
## Usage
Get the local IP address of your system by executing the `local_ip` function:
```rust
use local_ip_address::local_ip;
let my_local_ip = local_ip();
if let ... | rust | Apache-2.0 | eed9856f5e2ee03e2490922867337b24d8000a91 | 2026-01-04T20:18:14.206471Z | false |
LeoBorai/local-ip-address | https://github.com/LeoBorai/local-ip-address/blob/eed9856f5e2ee03e2490922867337b24d8000a91/src/linux.rs | src/linux.rs | use std::collections::HashMap;
use std::ffi::{CStr, c_int};
use std::net::{IpAddr, Ipv4Addr, Ipv6Addr};
use neli::attr::Attribute;
use neli::consts::nl::{NlmF};
use neli::consts::socket::NlFamily;
use neli::consts::rtnl::{Ifa, Ifla, RtAddrFamily, RtScope, RtTable, Rta, Rtm, RtmF, Rtn, Rtprot};
use neli::err::RouterErr... | rust | Apache-2.0 | eed9856f5e2ee03e2490922867337b24d8000a91 | 2026-01-04T20:18:14.206471Z | false |
LeoBorai/local-ip-address | https://github.com/LeoBorai/local-ip-address/blob/eed9856f5e2ee03e2490922867337b24d8000a91/src/error.rs | src/error.rs | #[derive(thiserror::Error, Debug, PartialEq)]
pub enum Error {
/// Returned when `local_ip` is unable to find the system's local IP address
/// in the collection of network interfaces
#[error("The Local IP Address wasn't available in the network interfaces list/table")]
LocalIpAddressNotFound,
/// R... | rust | Apache-2.0 | eed9856f5e2ee03e2490922867337b24d8000a91 | 2026-01-04T20:18:14.206471Z | false |
LeoBorai/local-ip-address | https://github.com/LeoBorai/local-ip-address/blob/eed9856f5e2ee03e2490922867337b24d8000a91/src/windows.rs | src/windows.rs | use std::{
alloc::{alloc, dealloc, Layout},
net::IpAddr,
ptr::{NonNull, self},
slice,
marker::PhantomData,
ops::Deref,
mem,
};
use windows_sys::Win32::{
Foundation::{
GetLastError, LocalFree, ERROR_ADDRESS_NOT_ASSOCIATED, ERROR_BUFFER_OVERFLOW,
ERROR_INSUFFICIENT_BUFFER,... | rust | Apache-2.0 | eed9856f5e2ee03e2490922867337b24d8000a91 | 2026-01-04T20:18:14.206471Z | false |
LeoBorai/local-ip-address | https://github.com/LeoBorai/local-ip-address/blob/eed9856f5e2ee03e2490922867337b24d8000a91/examples/show_ip_and_ifs.rs | examples/show_ip_and_ifs.rs | use local_ip_address::{list_afinet_netifas, local_ip, local_ipv6};
// this is only supported on linux currently
#[cfg(target_os = "linux")]
use local_ip_address::local_broadcast_ip;
fn main() {
match local_ip() {
Ok(ip) => println!("Local IPv4: {}", ip),
Err(err) => println!("Failed to get local IP... | rust | Apache-2.0 | eed9856f5e2ee03e2490922867337b24d8000a91 | 2026-01-04T20:18:14.206471Z | false |
ameknite/rust-ci-cd-template | https://github.com/ameknite/rust-ci-cd-template/blob/658abcd10b7863f7926f0256ee7457b48e132ec5/src/main.rs | src/main.rs | // SPDX-License-Identifier: CC0-1.0 OR MIT OR Apache-2.0
// -> todo! remove this notice
//! Documentation for the crate: A rust ci/cd templates
fn main() {
println!("Hello, world!");
}
| rust | Apache-2.0 | 658abcd10b7863f7926f0256ee7457b48e132ec5 | 2026-01-04T20:18:15.064331Z | false |
abdolence/firestore-rs | https://github.com/abdolence/firestore-rs/blob/47f0e847ebda47a41e7a6f4458b54fd6af814874/src/errors.rs | src/errors.rs | use crate::{FirestoreTransaction, FirestoreTransactionId};
use gcloud_sdk::google::firestore::v1::WriteRequest;
use rsb_derive::Builder;
use serde::*;
use std::error::Error;
use std::fmt::Display;
use std::fmt::Formatter;
/// The main error type for all Firestore operations.
///
/// This enum consolidates various spec... | rust | Apache-2.0 | 47f0e847ebda47a41e7a6f4458b54fd6af814874 | 2026-01-04T20:18:05.696537Z | false |
abdolence/firestore-rs | https://github.com/abdolence/firestore-rs/blob/47f0e847ebda47a41e7a6f4458b54fd6af814874/src/firestore_document_functions.rs | src/firestore_document_functions.rs | use crate::FirestoreDocument;
use std::collections::HashMap;
/// Retrieves a field's value from a Firestore document using a dot-separated path.
///
/// This function allows accessing nested fields within a document's map values.
/// For example, given a document with a field `user` which is a map containing
/// a fie... | rust | Apache-2.0 | 47f0e847ebda47a41e7a6f4458b54fd6af814874 | 2026-01-04T20:18:05.696537Z | false |
abdolence/firestore-rs | https://github.com/abdolence/firestore-rs/blob/47f0e847ebda47a41e7a6f4458b54fd6af814874/src/firestore_meta.rs | src/firestore_meta.rs | use crate::errors::FirestoreError;
use crate::timestamp_utils::{from_duration, from_timestamp};
use crate::FirestoreTransactionId;
use chrono::{DateTime, Duration, Utc};
use gcloud_sdk::google::firestore::v1::{Document, ExplainMetrics, RunQueryResponse};
use gcloud_sdk::prost_types::value::Kind;
use rsb_derive::Builder... | rust | Apache-2.0 | 47f0e847ebda47a41e7a6f4458b54fd6af814874 | 2026-01-04T20:18:05.696537Z | false |
abdolence/firestore-rs | https://github.com/abdolence/firestore-rs/blob/47f0e847ebda47a41e7a6f4458b54fd6af814874/src/lib.rs | src/lib.rs | //! # Firestore for Rust
//!
//! Library provides a simple API for Google Firestore:
//! - Create or update documents using Rust structures and Serde;
//! - Support for querying / streaming / listing / listening changes / aggregated queries of documents from Firestore;
//! - Fluent high-level and strongly typed API;
//... | rust | Apache-2.0 | 47f0e847ebda47a41e7a6f4458b54fd6af814874 | 2026-01-04T20:18:05.696537Z | false |
abdolence/firestore-rs | https://github.com/abdolence/firestore-rs/blob/47f0e847ebda47a41e7a6f4458b54fd6af814874/src/timestamp_utils.rs | src/timestamp_utils.rs | use crate::errors::*;
use crate::FirestoreResult;
use chrono::prelude::*;
/// Converts a Google `prost_types::Timestamp` to a `chrono::DateTime<Utc>`.
///
/// Firestore uses Google's `Timestamp` protobuf message to represent timestamps.
/// This function facilitates conversion to the more commonly used `chrono::DateTi... | rust | Apache-2.0 | 47f0e847ebda47a41e7a6f4458b54fd6af814874 | 2026-01-04T20:18:05.696537Z | false |
abdolence/firestore-rs | https://github.com/abdolence/firestore-rs/blob/47f0e847ebda47a41e7a6f4458b54fd6af814874/src/firestore_value.rs | src/firestore_value.rs | use gcloud_sdk::google::firestore::v1::Value;
use std::collections::HashMap;
/// Represents a Firestore value, wrapping the underlying gRPC `Value` type.
///
/// This struct provides a convenient way to work with Firestore's native data types
/// and is used extensively throughout the crate, especially in serializatio... | rust | Apache-2.0 | 47f0e847ebda47a41e7a6f4458b54fd6af814874 | 2026-01-04T20:18:05.696537Z | false |
abdolence/firestore-rs | https://github.com/abdolence/firestore-rs/blob/47f0e847ebda47a41e7a6f4458b54fd6af814874/src/struct_path_macro.rs | src/struct_path_macro.rs | #[macro_export]
macro_rules! path {
($($x:tt)*) => {{
$crate::struct_path::path!($($x)*).to_string()
}};
}
#[macro_export]
macro_rules! paths {
($($x:tt)*) => {{
$crate::struct_path::paths!($($x)*).iter().map(|s| s.to_string()).collect::<Vec<String>>()
}};
}
#[macro_export]
macro_rules... | rust | Apache-2.0 | 47f0e847ebda47a41e7a6f4458b54fd6af814874 | 2026-01-04T20:18:05.696537Z | false |
abdolence/firestore-rs | https://github.com/abdolence/firestore-rs/blob/47f0e847ebda47a41e7a6f4458b54fd6af814874/src/cache/configuration.rs | src/cache/configuration.rs | use crate::{FirestoreDb, FirestoreListenerTarget};
use std::collections::HashMap;
#[derive(Clone)]
pub struct FirestoreCacheConfiguration {
pub collections: HashMap<String, FirestoreCacheCollectionConfiguration>,
}
impl FirestoreCacheConfiguration {
#[inline]
pub fn new() -> Self {
Self {
... | rust | Apache-2.0 | 47f0e847ebda47a41e7a6f4458b54fd6af814874 | 2026-01-04T20:18:05.696537Z | false |
abdolence/firestore-rs | https://github.com/abdolence/firestore-rs/blob/47f0e847ebda47a41e7a6f4458b54fd6af814874/src/cache/cache_query_engine.rs | src/cache/cache_query_engine.rs | use crate::cache::cache_filter_engine::FirestoreCacheFilterEngine;
use crate::*;
use futures::stream::BoxStream;
use futures::stream::StreamExt;
use futures::{future, TryStreamExt};
use std::cmp::Ordering;
#[derive(Clone)]
pub struct FirestoreCacheQueryEngine {
pub query: FirestoreQueryParams,
}
impl FirestoreCac... | rust | Apache-2.0 | 47f0e847ebda47a41e7a6f4458b54fd6af814874 | 2026-01-04T20:18:05.696537Z | false |
abdolence/firestore-rs | https://github.com/abdolence/firestore-rs/blob/47f0e847ebda47a41e7a6f4458b54fd6af814874/src/cache/options.rs | src/cache/options.rs | use crate::FirestoreListenerParams;
use rsb_derive::Builder;
use rvstruct::ValueStruct;
#[derive(Clone, Debug, Eq, PartialEq, Hash, ValueStruct)]
pub struct FirestoreCacheName(String);
#[derive(Debug, Eq, PartialEq, Clone, Builder)]
pub struct FirestoreCacheOptions {
pub name: FirestoreCacheName,
pub listener... | rust | Apache-2.0 | 47f0e847ebda47a41e7a6f4458b54fd6af814874 | 2026-01-04T20:18:05.696537Z | false |
abdolence/firestore-rs | https://github.com/abdolence/firestore-rs/blob/47f0e847ebda47a41e7a6f4458b54fd6af814874/src/cache/mod.rs | src/cache/mod.rs | //! Provides caching capabilities for Firestore data.
//!
//! This module allows for caching Firestore documents and query results to reduce
//! latency and the number of reads to the Firestore database. It defines traits
//! for cache backends and provides a `FirestoreCache` struct that orchestrates
//! listening to F... | rust | Apache-2.0 | 47f0e847ebda47a41e7a6f4458b54fd6af814874 | 2026-01-04T20:18:05.696537Z | false |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.