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 |
|---|---|---|---|---|---|---|---|---|
hako/bbcli | https://github.com/hako/bbcli/blob/709c6417c8dc4ffd4f7d5f5b42b2672c68f4c8d1/src/date_utils.rs | src/date_utils.rs | use chrono::{DateTime, Utc};
/// Humanizes a date string from "YYYY-MM-DD HH:MM:SS" format to relative time
/// Returns strings like "just now", "5 minutes ago", "2 hours ago", "yesterday", etc.
pub fn humanize_time(date_str: &str) -> String {
// Try to parse the date string (format: "YYYY-MM-DD HH:MM:SS")
let... | rust | MIT | 709c6417c8dc4ffd4f7d5f5b42b2672c68f4c8d1 | 2026-01-04T20:18:31.214572Z | false |
rust-embedded/rust-spidev | https://github.com/rust-embedded/rust-spidev/blob/9b2a483bc92c806112a9133c78bc2103c73d9780/src/spidevioctl.rs | src/spidevioctl.rs | // Copyright 2015, Paul Osborne <osbpau@gmail.com>
//
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
// http://www.apache.org/license/LICENSE-2.0> or the MIT license
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
// option. This file may not be copied, modified, or distributed
//... | rust | Apache-2.0 | 9b2a483bc92c806112a9133c78bc2103c73d9780 | 2026-01-04T20:18:19.386705Z | false |
rust-embedded/rust-spidev | https://github.com/rust-embedded/rust-spidev/blob/9b2a483bc92c806112a9133c78bc2103c73d9780/src/lib.rs | src/lib.rs | // Copyright 2015, Paul Osborne <osbpau@gmail.com>
//
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
// http://www.apache.org/license/LICENSE-2.0> or the MIT license
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
// option. This file may not be copied, modified, or distributed
//... | rust | Apache-2.0 | 9b2a483bc92c806112a9133c78bc2103c73d9780 | 2026-01-04T20:18:19.386705Z | false |
rust-embedded/rust-spidev | https://github.com/rust-embedded/rust-spidev/blob/9b2a483bc92c806112a9133c78bc2103c73d9780/examples/spidev-hello.rs | examples/spidev-hello.rs | extern crate spidev;
use spidev::Spidev;
use std::io::prelude::*;
fn main() {
let mut spidev = Spidev::open("/dev/spidev0.0").unwrap();
let wrote = spidev.write(&[0xAA, 0x00, 0x01, 0x02, 0x04]).unwrap();
let mut buf: [u8; 10] = [0; 10];
let read = spidev.read(&mut buf).unwrap(); // read 10
println... | rust | Apache-2.0 | 9b2a483bc92c806112a9133c78bc2103c73d9780 | 2026-01-04T20:18:19.386705Z | false |
rust-embedded/rust-spidev | https://github.com/rust-embedded/rust-spidev/blob/9b2a483bc92c806112a9133c78bc2103c73d9780/examples/spidev-bidir.rs | examples/spidev-bidir.rs | extern crate spidev;
use spidev::spidevioctl::SpidevTransfer;
use spidev::{SpiModeFlags, Spidev, SpidevOptions};
fn main() {
let mut spidev = Spidev::open("/dev/spidev0.0").unwrap();
let options = SpidevOptions::new()
.bits_per_word(8)
.max_speed_hz(5000)
.lsb_first(false)
.mode... | rust | Apache-2.0 | 9b2a483bc92c806112a9133c78bc2103c73d9780 | 2026-01-04T20:18:19.386705Z | false |
dtolnay/dtoa | https://github.com/dtolnay/dtoa/blob/902d0d7e180457b9997b8ef3a67e68ee2e78a5b1/src/lib.rs | src/lib.rs | //! [![github]](https://github.com/dtolnay/dtoa) [![crates-io]](https://crates.io/crates/dtoa) [![docs-rs]](https://docs.rs/dtoa)
//!
//! [github]: https://img.shields.io/badge/github-8da0cb?style=for-the-badge&labelColor=555555&logo=github
//! [crates-io]: https://img.shields.io/badge/crates.io-fc8d62?style=... | rust | Apache-2.0 | 902d0d7e180457b9997b8ef3a67e68ee2e78a5b1 | 2026-01-04T20:18:53.491463Z | false |
dtolnay/dtoa | https://github.com/dtolnay/dtoa/blob/902d0d7e180457b9997b8ef3a67e68ee2e78a5b1/src/diyfp.rs | src/diyfp.rs | // Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
// option. This file may not be copied, modified, or distributed
// except according to those terms.
//
// ---
//
// The ... | rust | Apache-2.0 | 902d0d7e180457b9997b8ef3a67e68ee2e78a5b1 | 2026-01-04T20:18:53.491463Z | false |
dtolnay/dtoa | https://github.com/dtolnay/dtoa/blob/902d0d7e180457b9997b8ef3a67e68ee2e78a5b1/src/dtoa.rs | src/dtoa.rs | // Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
// option. This file may not be copied, modified, or distributed
// except according to those terms.
//
// ---
//
// The ... | rust | Apache-2.0 | 902d0d7e180457b9997b8ef3a67e68ee2e78a5b1 | 2026-01-04T20:18:53.491463Z | false |
dtolnay/dtoa | https://github.com/dtolnay/dtoa/blob/902d0d7e180457b9997b8ef3a67e68ee2e78a5b1/tests/test.rs | tests/test.rs | #![allow(
clippy::approx_constant,
clippy::unreadable_literal,
clippy::unseparated_literal_suffix
)]
use std::{f32, f64};
#[test]
fn test_f64() {
test_write(1.234e20f64, "123400000000000000000.0");
test_write(1.234e21f64, "1.234e21");
test_write(2.71828f64, "2.71828");
test_write(0.0f64, "... | rust | Apache-2.0 | 902d0d7e180457b9997b8ef3a67e68ee2e78a5b1 | 2026-01-04T20:18:53.491463Z | false |
dtolnay/dtoa | https://github.com/dtolnay/dtoa/blob/902d0d7e180457b9997b8ef3a67e68ee2e78a5b1/benches/bench.rs | benches/bench.rs | use criterion::{criterion_group, criterion_main, Criterion};
use std::fmt::Display;
use std::hint;
use std::io::Write;
use std::{f32, f64};
fn do_bench(c: &mut Criterion, group_name: &str, float: impl dtoa::Float + Display) {
let mut group = c.benchmark_group(group_name);
group.bench_function("dtoa", |b| {
... | rust | Apache-2.0 | 902d0d7e180457b9997b8ef3a67e68ee2e78a5b1 | 2026-01-04T20:18:53.491463Z | false |
svenstaro/wiresmith | https://github.com/svenstaro/wiresmith/blob/2060e98f5d3eb79ea85ad4b6720464ed7f19d100/src/consul.rs | src/consul.rs | use std::{collections::HashSet, future::Future, time::Duration};
use anyhow::{anyhow, bail, Context, Result};
use base64::prelude::{Engine as _, BASE64_STANDARD};
use futures::future::join_all;
use reqwest::{
header::{HeaderMap, HeaderName, HeaderValue},
StatusCode, Url,
};
use serde::{Deserialize, Serialize};... | rust | MIT | 2060e98f5d3eb79ea85ad4b6720464ed7f19d100 | 2026-01-04T20:18:52.192476Z | false |
svenstaro/wiresmith | https://github.com/svenstaro/wiresmith/blob/2060e98f5d3eb79ea85ad4b6720464ed7f19d100/src/lib.rs | src/lib.rs | use std::time::Duration;
pub mod consul;
pub mod networkd;
pub mod wireguard;
pub const CONSUL_TTL: Duration = Duration::from_secs(15);
| rust | MIT | 2060e98f5d3eb79ea85ad4b6720464ed7f19d100 | 2026-01-04T20:18:52.192476Z | false |
svenstaro/wiresmith | https://github.com/svenstaro/wiresmith/blob/2060e98f5d3eb79ea85ad4b6720464ed7f19d100/src/wireguard.rs | src/wireguard.rs | use std::{fmt, net::IpAddr};
use ipnet::IpNet;
use serde::{Deserialize, Serialize};
use wireguard_keys::Pubkey;
#[derive(Clone, Eq, PartialEq, Hash, Serialize, Deserialize)]
pub struct WgPeer {
pub public_key: Pubkey,
pub endpoint: String,
/// The WireGuard internal IP of the peer.
///
/// It sho... | rust | MIT | 2060e98f5d3eb79ea85ad4b6720464ed7f19d100 | 2026-01-04T20:18:52.192476Z | false |
svenstaro/wiresmith | https://github.com/svenstaro/wiresmith/blob/2060e98f5d3eb79ea85ad4b6720464ed7f19d100/src/args.rs | src/args.rs | use std::{net::IpAddr, path::PathBuf, time::Duration};
use clap::{Parser, ValueEnum};
use ipnet::IpNet;
use pnet::datalink::{self, NetworkInterface};
use reqwest::Url;
#[derive(Copy, Clone, ValueEnum)]
pub enum NetworkBackend {
Networkd,
// Wgquick
}
#[derive(Parser)]
#[command(name = "wiresmith", author, ab... | rust | MIT | 2060e98f5d3eb79ea85ad4b6720464ed7f19d100 | 2026-01-04T20:18:52.192476Z | false |
svenstaro/wiresmith | https://github.com/svenstaro/wiresmith/blob/2060e98f5d3eb79ea85ad4b6720464ed7f19d100/src/main.rs | src/main.rs | mod args;
use std::{collections::HashSet, time::Duration};
use anyhow::{bail, ensure, Context, Result};
use args::CliArgs;
use clap::Parser;
use tokio::time::{interval, sleep};
use tokio_util::sync::CancellationToken;
use tracing::{debug, error, info, trace};
use wiresmith::{
consul::ConsulClient, networkd::Netw... | rust | MIT | 2060e98f5d3eb79ea85ad4b6720464ed7f19d100 | 2026-01-04T20:18:52.192476Z | false |
svenstaro/wiresmith | https://github.com/svenstaro/wiresmith/blob/2060e98f5d3eb79ea85ad4b6720464ed7f19d100/src/networkd.rs | src/networkd.rs | use std::{
collections::HashSet, fmt, fs::Permissions, net::IpAddr, os::unix::prelude::PermissionsExt,
path::Path,
};
use anyhow::{anyhow, Context, Result};
use file_owner::set_group;
use ipnet::IpNet;
use tokio::{fs, process::Command};
use wireguard_keys::{Privkey, Pubkey};
use crate::wireguard::WgPeer;
///... | rust | MIT | 2060e98f5d3eb79ea85ad4b6720464ed7f19d100 | 2026-01-04T20:18:52.192476Z | false |
svenstaro/wiresmith | https://github.com/svenstaro/wiresmith/blob/2060e98f5d3eb79ea85ad4b6720464ed7f19d100/tests/integration.rs | tests/integration.rs | mod fixtures;
mod utils;
use std::{collections::HashSet, time::Duration};
use anyhow::{ensure, Result};
use assert_fs::TempDir;
use configparser::ini::Ini;
use fixtures::{consul, federated_consul_cluster, tmpdir, ConsulContainer};
use pretty_assertions::assert_eq;
use rand::seq::SliceRandom;
use rstest::rstest;
use t... | rust | MIT | 2060e98f5d3eb79ea85ad4b6720464ed7f19d100 | 2026-01-04T20:18:52.192476Z | false |
svenstaro/wiresmith | https://github.com/svenstaro/wiresmith/blob/2060e98f5d3eb79ea85ad4b6720464ed7f19d100/tests/fixtures/mod.rs | tests/fixtures/mod.rs | use std::{
process::{Command, Stdio},
time::{Duration, Instant},
};
use anyhow::Result;
use assert_fs::fixture::TempDir;
use port_check::free_local_port;
use rstest::fixture;
use tokio::time::sleep;
use wiresmith::consul::ConsulClient;
/// Get a free port.
#[fixture]
pub fn port() -> u16 {
free_local_por... | rust | MIT | 2060e98f5d3eb79ea85ad4b6720464ed7f19d100 | 2026-01-04T20:18:52.192476Z | false |
svenstaro/wiresmith | https://github.com/svenstaro/wiresmith/blob/2060e98f5d3eb79ea85ad4b6720464ed7f19d100/tests/utils/mod.rs | tests/utils/mod.rs | use std::{
path::Path,
process::Stdio,
time::{Duration, Instant},
};
use anyhow::Result;
use tokio::{process::Command, time::sleep};
/// Wait a few seconds for the files to become available
pub async fn wait_for_files(files: Vec<&Path>) {
let start_time = Instant::now();
while !files.iter().all(|... | rust | MIT | 2060e98f5d3eb79ea85ad4b6720464ed7f19d100 | 2026-01-04T20:18:52.192476Z | false |
raymontag/rust-keepass | https://github.com/raymontag/rust-keepass/blob/8c8cde446c833f57eebfdb50dc3dbaad21f4affa/src/lib.rs | src/lib.rs | #![crate_name="keepass"]
#![crate_type = "dylib"]
#![crate_type = "rlib"]
extern crate libc;
extern crate openssl;
extern crate rustc_serialize;
extern crate chrono;
extern crate rand;
extern crate uuid;
pub mod sec_str;
pub mod kpdb;
pub mod common;
| rust | ISC | 8c8cde446c833f57eebfdb50dc3dbaad21f4affa | 2026-01-04T20:18:55.975833Z | false |
raymontag/rust-keepass | https://github.com/raymontag/rust-keepass/blob/8c8cde446c833f57eebfdb50dc3dbaad21f4affa/src/kpdb/tests_v1kpdb.rs | src/kpdb/tests_v1kpdb.rs | use chrono::{Timelike, Local, TimeZone, Datelike};
use kpdb::v1kpdb::V1Kpdb;
use kpdb::v1error::V1KpdbError;
#[test]
fn test_new() {
// No keyfile and password should give error as result
let mut result = V1Kpdb::new("test/test_password.kdb".to_string(), None, None);
match result {
Ok(_) => assert... | rust | ISC | 8c8cde446c833f57eebfdb50dc3dbaad21f4affa | 2026-01-04T20:18:55.975833Z | false |
raymontag/rust-keepass | https://github.com/raymontag/rust-keepass/blob/8c8cde446c833f57eebfdb50dc3dbaad21f4affa/src/kpdb/parser.rs | src/kpdb/parser.rs | use libc::{c_void, munlock, size_t};
use std::cell::{RefCell, RefMut};
use std::rc::Rc;
use std::str;
use chrono::{DateTime, Local, TimeZone, Datelike, Timelike};
use rustc_serialize::hex::FromHex;
use uuid::Uuid;
use kpdb::v1entry::V1Entry;
use kpdb::v1group::V1Group;
use kpdb::v1header::V1Header;
use kpdb::v1kpdb::... | rust | ISC | 8c8cde446c833f57eebfdb50dc3dbaad21f4affa | 2026-01-04T20:18:55.975833Z | false |
raymontag/rust-keepass | https://github.com/raymontag/rust-keepass/blob/8c8cde446c833f57eebfdb50dc3dbaad21f4affa/src/kpdb/v1group.rs | src/kpdb/v1group.rs | use std::cell::RefCell;
use std::rc::{Rc, Weak};
use chrono::{DateTime, Local, TimeZone};
use kpdb::GetIndex;
use kpdb::v1entry::V1Entry;
use kpdb::v1error::V1KpdbError;
#[doc = "
Implements a group of a KeePass v1.x database
"]
pub struct V1Group {
/// Group id unique in the database
pub id: u32,
/// Ti... | rust | ISC | 8c8cde446c833f57eebfdb50dc3dbaad21f4affa | 2026-01-04T20:18:55.975833Z | false |
raymontag/rust-keepass | https://github.com/raymontag/rust-keepass/blob/8c8cde446c833f57eebfdb50dc3dbaad21f4affa/src/kpdb/v1header.rs | src/kpdb/v1header.rs | use kpdb::v1error::V1KpdbError;
// Todo:
// * Drop for critical data
// * Parsing into LoadParser
#[doc = "
V1Header implements the header of a KeePass v1.x database.
Normally you don't need to mess with this yourself.
"]
#[derive(Clone)]
pub struct V1Header {
/// File signature
pub signature1: u32,
/// F... | rust | ISC | 8c8cde446c833f57eebfdb50dc3dbaad21f4affa | 2026-01-04T20:18:55.975833Z | false |
raymontag/rust-keepass | https://github.com/raymontag/rust-keepass/blob/8c8cde446c833f57eebfdb50dc3dbaad21f4affa/src/kpdb/v1error.rs | src/kpdb/v1error.rs | use std::fmt;
use std::error;
pub use self::V1KpdbError::*;
#[doc = "
Use this for catching various errors that
can happen when using V1Kpdb.
"]
#[derive(Debug, Clone, PartialEq, Eq, Copy)]
pub enum V1KpdbError {
/// E.g. Couldn't open a file or file is to
/// small.
FileErr,
/// Something went wrong ... | rust | ISC | 8c8cde446c833f57eebfdb50dc3dbaad21f4affa | 2026-01-04T20:18:55.975833Z | false |
raymontag/rust-keepass | https://github.com/raymontag/rust-keepass/blob/8c8cde446c833f57eebfdb50dc3dbaad21f4affa/src/kpdb/v1entry.rs | src/kpdb/v1entry.rs | use std::cell::RefCell;
use std::rc::Rc;
use chrono::{DateTime, Local, TimeZone};
use uuid::Uuid;
use super::v1group::V1Group;
use super::super::sec_str::SecureString;
#[doc = "
Implements an entry in a KeePass v1.x database.
"]
pub struct V1Entry {
/// UUID of the entry
pub uuid: Uuid,
/// ID of the gro... | rust | ISC | 8c8cde446c833f57eebfdb50dc3dbaad21f4affa | 2026-01-04T20:18:55.975833Z | false |
raymontag/rust-keepass | https://github.com/raymontag/rust-keepass/blob/8c8cde446c833f57eebfdb50dc3dbaad21f4affa/src/kpdb/tests_parser.rs | src/kpdb/tests_parser.rs | #![allow(dead_code, unused_imports)]
use std::io::{Seek, SeekFrom, Read, Write};
use std::fs::File;
use chrono::Datelike;
use uuid::Uuid;
use kpdb::crypter::Crypter;
use kpdb::parser::{HeaderLoadParser, LoadParser,SaveParser};
use kpdb::v1header::V1Header;
use kpdb::v1kpdb::V1Kpdb;
use super::super::sec_str::SecureSt... | rust | ISC | 8c8cde446c833f57eebfdb50dc3dbaad21f4affa | 2026-01-04T20:18:55.975833Z | false |
raymontag/rust-keepass | https://github.com/raymontag/rust-keepass/blob/8c8cde446c833f57eebfdb50dc3dbaad21f4affa/src/kpdb/mod.rs | src/kpdb/mod.rs | pub mod v1kpdb;
pub mod v1error;
pub mod v1group;
pub mod v1entry;
pub mod v1header;
mod crypter;
mod parser;
#[cfg(test)]
mod tests_v1kpdb;
mod tests_parser;
mod tests_crypter;
use std::rc::Weak;
use self::v1error::V1KpdbError;
trait GetIndex<T> {
fn get_index(&self, item: &T) -> Result<usize, V1KpdbError>;
}... | rust | ISC | 8c8cde446c833f57eebfdb50dc3dbaad21f4affa | 2026-01-04T20:18:55.975833Z | false |
raymontag/rust-keepass | https://github.com/raymontag/rust-keepass/blob/8c8cde446c833f57eebfdb50dc3dbaad21f4affa/src/kpdb/crypter.rs | src/kpdb/crypter.rs | use libc::{c_void, mlock, munlock, size_t};
use std::fs::File;
use std::io::{Seek, SeekFrom, Read, Write};
use openssl::hash;
use openssl::symm;
use rustc_serialize::hex::FromHex;
use sec_str::SecureString;
use common::common::write_array_volatile;
use kpdb::v1error::V1KpdbError;
use kpdb::v1header::V1Header;
// imp... | rust | ISC | 8c8cde446c833f57eebfdb50dc3dbaad21f4affa | 2026-01-04T20:18:55.975833Z | false |
raymontag/rust-keepass | https://github.com/raymontag/rust-keepass/blob/8c8cde446c833f57eebfdb50dc3dbaad21f4affa/src/kpdb/v1kpdb.rs | src/kpdb/v1kpdb.rs | use std::cell::RefCell;
use std::rc::Rc;
use std::io::{Read, Write};
use std::fs::File;
use chrono::{DateTime, Local};
use rand;
use kpdb::GetIndex;
use kpdb::crypter::Crypter;
use kpdb::parser::{HeaderLoadParser, HeaderSaveParser, LoadParser, SaveParser};
use kpdb::v1error::V1KpdbError;
use kpdb::v1group::V1Group;
u... | rust | ISC | 8c8cde446c833f57eebfdb50dc3dbaad21f4affa | 2026-01-04T20:18:55.975833Z | false |
raymontag/rust-keepass | https://github.com/raymontag/rust-keepass/blob/8c8cde446c833f57eebfdb50dc3dbaad21f4affa/src/kpdb/tests_crypter.rs | src/kpdb/tests_crypter.rs | #![allow(dead_code)]
use std::fs::File;
use std::io::Read;
use kpdb::parser::HeaderLoadParser;
use kpdb::crypter::Crypter;
use kpdb::v1header::V1Header;
use super::super::sec_str::SecureString;
fn setup(path: String,
password: Option<String>,
keyfile: Option<String>)
-> (Crypter, V1Header, ... | rust | ISC | 8c8cde446c833f57eebfdb50dc3dbaad21f4affa | 2026-01-04T20:18:55.975833Z | false |
raymontag/rust-keepass | https://github.com/raymontag/rust-keepass/blob/8c8cde446c833f57eebfdb50dc3dbaad21f4affa/src/common/mod.rs | src/common/mod.rs | pub mod common;
pub mod common_error;
//#[cfg(tests)]
//mod tests_common;
| rust | ISC | 8c8cde446c833f57eebfdb50dc3dbaad21f4affa | 2026-01-04T20:18:55.975833Z | false |
raymontag/rust-keepass | https://github.com/raymontag/rust-keepass/blob/8c8cde446c833f57eebfdb50dc3dbaad21f4affa/src/common/common.rs | src/common/common.rs | use std::ptr;
use common::common_error::CommonError;
pub fn slice_to_u16(slice: &[u8]) -> Result<u16, CommonError> {
if slice.len() < 2 {
return Err(CommonError::ConvertErr);
}
let value = (slice[1] as u16) << 8;
Ok(value | slice[0] as u16)
}
pub fn slice_to_u32(slice: &[u8]) -> Result<u32, ... | rust | ISC | 8c8cde446c833f57eebfdb50dc3dbaad21f4affa | 2026-01-04T20:18:55.975833Z | false |
raymontag/rust-keepass | https://github.com/raymontag/rust-keepass/blob/8c8cde446c833f57eebfdb50dc3dbaad21f4affa/src/common/common_error.rs | src/common/common_error.rs | use std::fmt;
use std::error;
pub use self::CommonError::*;
#[doc = "
Use this for catching various errors that
can happen when using V1Kpdb.
"]
#[derive(Debug, Clone, PartialEq, Eq, Copy)]
pub enum CommonError {
/// Some error in parsing
ConvertErr,
}
impl fmt::Display for CommonError {
fn fmt(&self, fm... | rust | ISC | 8c8cde446c833f57eebfdb50dc3dbaad21f4affa | 2026-01-04T20:18:55.975833Z | false |
raymontag/rust-keepass | https://github.com/raymontag/rust-keepass/blob/8c8cde446c833f57eebfdb50dc3dbaad21f4affa/src/sec_str/mod.rs | src/sec_str/mod.rs | use libc::{c_void, mlock, munlock, size_t};
use openssl::symm;
use rand;
use common::common::write_array_volatile;
#[doc = "
SecureString implements a secure string. This means in particular:
* The input string moves to the struct, i.e. it's not just borrowed
* The string is encrypted with a random password for obf... | rust | ISC | 8c8cde446c833f57eebfdb50dc3dbaad21f4affa | 2026-01-04T20:18:55.975833Z | false |
sotanakamura/winui-rust | https://github.com/sotanakamura/winui-rust/blob/fa2f3320ed110b65833344a24c32b200b398d62f/build.rs | build.rs | fn main() {
::windows_app::bootstrap::deploy::to_output_dir();
// Temporary workaround for https://github.com/microsoft/WindowsAppSDK/issues/2634
::windows_app::build::embed_manifest(
r#"<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<assembly manifestVersion="1.0" xmlns="urn:sc... | rust | MIT | fa2f3320ed110b65833344a24c32b200b398d62f | 2026-01-04T20:18:54.660398Z | false |
sotanakamura/winui-rust | https://github.com/sotanakamura/winui-rust/blob/fa2f3320ed110b65833344a24c32b200b398d62f/src/main.rs | src/main.rs | use std::cell::RefCell;
use std::ops::ControlFlow;
use windows::UI::Xaml::GridLengthHelper;
use windows::core::IInspectable;
use windows::core::implement;
use windows::Foundation::Collections::IVector;
use windows::UI::Xaml::Interop::TypeName;
use windows_app::Microsoft::UI::Xaml::ThicknessHelper;
use windows_app::boot... | rust | MIT | fa2f3320ed110b65833344a24c32b200b398d62f | 2026-01-04T20:18:54.660398Z | false |
tomhrr/cosh | https://github.com/tomhrr/cosh/blob/367a51684662fde5e9abff946538b08e60ea6ea9/src/vm.rs | src/vm.rs | use std::cell::RefCell;
use std::collections::HashMap;
use std::collections::HashSet;
use std::collections::VecDeque;
use std::convert::TryInto;
use std::io::BufRead;
use std::io::BufReader;
use std::ops::Index;
use std::ops::IndexMut;
use std::path::Path;
use std::rc::Rc;
use std::str;
use std::str::FromStr;
use std::... | rust | BSD-3-Clause | 367a51684662fde5e9abff946538b08e60ea6ea9 | 2026-01-04T20:18:56.825981Z | true |
tomhrr/cosh | https://github.com/tomhrr/cosh/blob/367a51684662fde5e9abff946538b08e60ea6ea9/src/lib.rs | src/lib.rs | #![allow(
clippy::needless_late_init,
clippy::comparison_chain,
clippy::question_mark,
clippy::type_complexity
)]
extern crate ahash;
extern crate ansi_term;
extern crate atty;
extern crate chrono;
extern crate chrono_tz;
extern crate chronoutil;
extern crate dirs;
#[cfg(feature = "fxhash")]
extern cra... | rust | BSD-3-Clause | 367a51684662fde5e9abff946538b08e60ea6ea9 | 2026-01-04T20:18:56.825981Z | false |
tomhrr/cosh | https://github.com/tomhrr/cosh/blob/367a51684662fde5e9abff946538b08e60ea6ea9/src/opcode.rs | src/opcode.rs | /// The opcodes used in the compiler and the bytecode.
#[derive(Debug, Clone, Copy)]
pub enum OpCode {
Constant = 1,
Add = 2,
Subtract = 3,
Multiply = 4,
Divide = 5,
EndFn = 6,
Call = 7,
CallImplicit = 8,
GLVCall = 9,
Function = 10,
Var = 11,
SetVar = 12,
GetVar = 13,... | rust | BSD-3-Clause | 367a51684662fde5e9abff946538b08e60ea6ea9 | 2026-01-04T20:18:56.825981Z | false |
tomhrr/cosh | https://github.com/tomhrr/cosh/blob/367a51684662fde5e9abff946538b08e60ea6ea9/src/hasher.rs | src/hasher.rs | use indexmap::IndexMap;
use crate::chunk::Value;
// Use compile-time features to select hasher
// Default to AHash for performance, but allow override
#[cfg(feature = "fxhash")]
use fxhash::FxBuildHasher;
#[cfg(feature = "fxhash")]
pub type CoshIndexMap<K, V> = IndexMap<K, V, FxBuildHasher>;
#[cfg(all(feature = "def... | rust | BSD-3-Clause | 367a51684662fde5e9abff946538b08e60ea6ea9 | 2026-01-04T20:18:56.825981Z | false |
tomhrr/cosh | https://github.com/tomhrr/cosh/blob/367a51684662fde5e9abff946538b08e60ea6ea9/src/rl.rs | src/rl.rs | use std::borrow::Cow::{self, Borrowed};
use std::cell::RefCell;
use std::collections::HashMap;
use std::env::current_dir;
use std::fs;
use std::path::{self, Path};
use std::rc::Rc;
use ansi_term::Colour::{Blue, Purple, Red};
use dirs::home_dir;
use memchr::memchr;
use rustyline::completion::{escape, unescape, Candidat... | rust | BSD-3-Clause | 367a51684662fde5e9abff946538b08e60ea6ea9 | 2026-01-04T20:18:56.825981Z | false |
tomhrr/cosh | https://github.com/tomhrr/cosh/blob/367a51684662fde5e9abff946538b08e60ea6ea9/src/chunk.rs | src/chunk.rs | use std::cell::RefCell;
use std::collections::HashMap;
use std::collections::HashSet;
use std::collections::VecDeque;
use std::convert::TryInto;
use std::fmt;
use std::fs::File;
use std::fs::ReadDir;
use std::io::BufRead;
use std::io::BufReader;
use std::io::BufWriter;
use std::io::ErrorKind;
use std::io::Read;
use std... | rust | BSD-3-Clause | 367a51684662fde5e9abff946538b08e60ea6ea9 | 2026-01-04T20:18:56.825981Z | true |
tomhrr/cosh | https://github.com/tomhrr/cosh/blob/367a51684662fde5e9abff946538b08e60ea6ea9/src/compiler.rs | src/compiler.rs | use std::cell::RefCell;
use std::collections::HashSet;
use std::convert::TryInto;
use std::fs;
use std::io::BufRead;
use std::io::ErrorKind;
use std::io::Read;
use std::io::Write;
use std::rc::Rc;
use std::str;
use lazy_static::lazy_static;
use regex::Regex;
use crate::chunk::{Chunk, StringTriple, Value, new_string_v... | rust | BSD-3-Clause | 367a51684662fde5e9abff946538b08e60ea6ea9 | 2026-01-04T20:18:56.825981Z | true |
tomhrr/cosh | https://github.com/tomhrr/cosh/blob/367a51684662fde5e9abff946538b08e60ea6ea9/src/bin/cosh.rs | src/bin/cosh.rs | extern crate cosh;
extern crate ctrlc;
extern crate dirs;
extern crate getopts;
extern crate nix;
extern crate regex;
extern crate rustyline;
extern crate tempfile;
use std::cell::RefCell;
use std::collections::HashMap;
use std::env;
use nix::fcntl::{Flock, FlockArg};
use std::fs;
use std::fs::OpenOptions;
use std::io... | rust | BSD-3-Clause | 367a51684662fde5e9abff946538b08e60ea6ea9 | 2026-01-04T20:18:56.825981Z | false |
tomhrr/cosh | https://github.com/tomhrr/cosh/blob/367a51684662fde5e9abff946538b08e60ea6ea9/src/vm/vm_json.rs | src/vm/vm_json.rs | use std::cell::RefCell;
use std::collections::VecDeque;
use std::convert::TryFrom;
use std::rc::Rc;
use indexmap::IndexMap;
use num_bigint::ToBigInt;
use crate::chunk::Value;
use crate::hasher::{new_hash_indexmap, new_set_indexmap};
use crate::vm::*;
/// Converts a serde_json object into a value.
fn convert_from_jso... | rust | BSD-3-Clause | 367a51684662fde5e9abff946538b08e60ea6ea9 | 2026-01-04T20:18:56.825981Z | false |
tomhrr/cosh | https://github.com/tomhrr/cosh/blob/367a51684662fde5e9abff946538b08e60ea6ea9/src/vm/vm_command.rs | src/vm/vm_command.rs | use std::cell::RefCell;
use std::collections::HashSet;
use std::collections::VecDeque;
use std::env;
use std::fs::File;
use std::io::Write;
use std::os::fd::FromRawFd;
use std::rc::Rc;
use std::str;
use lazy_static::lazy_static;
use nix::unistd::{fork, ForkResult};
use nonblock::NonBlockingReader;
use regex::Regex;
us... | rust | BSD-3-Clause | 367a51684662fde5e9abff946538b08e60ea6ea9 | 2026-01-04T20:18:56.825981Z | false |
tomhrr/cosh | https://github.com/tomhrr/cosh/blob/367a51684662fde5e9abff946538b08e60ea6ea9/src/vm/vm_ip.rs | src/vm/vm_ip.rs | use std::net::{Ipv4Addr, Ipv6Addr};
use ipnet::{Ipv4Net, Ipv6Net};
use iprange::IpRange;
use num_bigint::{BigInt, BigUint};
use num_traits::{FromPrimitive, ToPrimitive, Zero};
use crate::chunk::{IpSet, Ipv4Range, Ipv6Range};
use crate::vm::*;
/// Convert an IPv4 address to a u32.
fn ipv4_addr_to_int(ipv4: Ipv4Addr) ... | rust | BSD-3-Clause | 367a51684662fde5e9abff946538b08e60ea6ea9 | 2026-01-04T20:18:56.825981Z | true |
tomhrr/cosh | https://github.com/tomhrr/cosh/blob/367a51684662fde5e9abff946538b08e60ea6ea9/src/vm/vm_print.rs | src/vm/vm_print.rs | use std::convert::TryInto;
use std::io;
use std::io::Write;
use std::str;
use atty::Stream;
use termion::input::TermRead;
use termion::raw::IntoRawMode;
use unicode_segmentation::UnicodeSegmentation;
use crate::chunk::{Chunk, Value};
use crate::hasher::{new_hash_indexmap, new_set_indexmap};
use crate::vm::*;
/// Hel... | rust | BSD-3-Clause | 367a51684662fde5e9abff946538b08e60ea6ea9 | 2026-01-04T20:18:56.825981Z | true |
tomhrr/cosh | https://github.com/tomhrr/cosh/blob/367a51684662fde5e9abff946538b08e60ea6ea9/src/vm/vm_xml.rs | src/vm/vm_xml.rs | use std::cell::RefCell;
use std::collections::VecDeque;
use std::rc::Rc;
use indexmap::IndexMap;
use crate::chunk::{StringTriple, Value};
use crate::hasher::{new_hash_indexmap, new_set_indexmap};
use crate::vm::*;
/// Converts a value into an XML string.
fn convert_to_xml(v: &Value) -> Option<String> {
let mut b... | rust | BSD-3-Clause | 367a51684662fde5e9abff946538b08e60ea6ea9 | 2026-01-04T20:18:56.825981Z | false |
tomhrr/cosh | https://github.com/tomhrr/cosh/blob/367a51684662fde5e9abff946538b08e60ea6ea9/src/vm/vm_sort.rs | src/vm/vm_sort.rs | use std::cmp::Ordering;
use crate::chunk::Value;
use crate::vm::*;
impl VM {
/// Sorts the elements of a list or generator using behaviour per
/// the default cmp operation.
pub fn core_sort(&mut self) -> i32 {
if self.stack.is_empty() {
self.print_error("sort requires one argument");
... | rust | BSD-3-Clause | 367a51684662fde5e9abff946538b08e60ea6ea9 | 2026-01-04T20:18:56.825981Z | false |
tomhrr/cosh | https://github.com/tomhrr/cosh/blob/367a51684662fde5e9abff946538b08e60ea6ea9/src/vm/vm_basics.rs | src/vm/vm_basics.rs | use std::char;
use std::{thread, time};
use num_bigint::BigInt;
use num_traits::FromPrimitive;
use num_traits::Num;
use num_traits::ToPrimitive;
use rand::Rng;
use unicode_segmentation::UnicodeSegmentation;
use crate::chunk::Value;
use crate::hasher::{new_hash_indexmap, new_set_indexmap};
use crate::vm::*;
impl VM {... | rust | BSD-3-Clause | 367a51684662fde5e9abff946538b08e60ea6ea9 | 2026-01-04T20:18:56.825981Z | true |
tomhrr/cosh | https://github.com/tomhrr/cosh/blob/367a51684662fde5e9abff946538b08e60ea6ea9/src/vm/vm_datetime.rs | src/vm/vm_datetime.rs | use std::convert::TryFrom;
use std::fmt::Write;
use std::str::FromStr;
use chrono::format::{parse, Parsed, StrftimeItems};
use chrono::{DateTime, Duration, NaiveDateTime, TimeZone, Utc};
use chronoutil::RelativeDuration;
use crate::vm::*;
impl VM {
/// Returns the current time as a date-time object, offset at UT... | rust | BSD-3-Clause | 367a51684662fde5e9abff946538b08e60ea6ea9 | 2026-01-04T20:18:56.825981Z | false |
tomhrr/cosh | https://github.com/tomhrr/cosh/blob/367a51684662fde5e9abff946538b08e60ea6ea9/src/vm/vm_env.rs | src/vm/vm_env.rs | use std::cell::RefCell;
use std::env;
use std::rc::Rc;
use crate::hasher::new_hash_indexmap;
use crate::vm::*;
impl VM {
/// Add a hash containing the data from the current environment to
/// the stack.
pub fn core_env(&mut self) -> i32 {
let mut hsh = new_hash_indexmap();
for (key, value)... | rust | BSD-3-Clause | 367a51684662fde5e9abff946538b08e60ea6ea9 | 2026-01-04T20:18:56.825981Z | false |
tomhrr/cosh | https://github.com/tomhrr/cosh/blob/367a51684662fde5e9abff946538b08e60ea6ea9/src/vm/vm_parallel.rs | src/vm/vm_parallel.rs | use std::os::fd::AsRawFd;
use std::process::exit;
use std::thread;
use std::time;
use epoll;
use nix::sys::signal::Signal;
use nix::sys::wait::waitpid;
use nix::unistd::{fork, ForkResult};
use signal_hook::{consts::SIGTERM, iterator::Signals};
use std::fs::File;
use std::io::Read;
use std::io::Write;
use nix::fcntl::f... | rust | BSD-3-Clause | 367a51684662fde5e9abff946538b08e60ea6ea9 | 2026-01-04T20:18:56.825981Z | false |
tomhrr/cosh | https://github.com/tomhrr/cosh/blob/367a51684662fde5e9abff946538b08e60ea6ea9/src/vm/vm_http.rs | src/vm/vm_http.rs | use std::cell::RefCell;
use std::rc::Rc;
use http::Method;
use indexmap::IndexMap;
use mime::Mime;
use reqwest::blocking::{Client, Response, RequestBuilder};
use reqwest::header::CONTENT_TYPE;
use std::sync::mpsc;
use std::sync::mpsc::TryRecvError;
use std::thread;
use std::time;
use url::Url;
use crate::chunk::{Valu... | rust | BSD-3-Clause | 367a51684662fde5e9abff946538b08e60ea6ea9 | 2026-01-04T20:18:56.825981Z | false |
tomhrr/cosh | https://github.com/tomhrr/cosh/blob/367a51684662fde5e9abff946538b08e60ea6ea9/src/vm/vm_regex.rs | src/vm/vm_regex.rs | use std::cell::RefCell;
use std::collections::VecDeque;
use std::rc::Rc;
use regex::Regex;
use crate::chunk::Value;
use crate::vm::*;
lazy_static! {
static ref RE_ADJUST: Regex = Regex::new(r"\\([\d+])").unwrap();
}
impl VM {
/// Takes a value that can be stringified and a regex string as
/// its argume... | rust | BSD-3-Clause | 367a51684662fde5e9abff946538b08e60ea6ea9 | 2026-01-04T20:18:56.825981Z | false |
tomhrr/cosh | https://github.com/tomhrr/cosh/blob/367a51684662fde5e9abff946538b08e60ea6ea9/src/vm/vm_hash.rs | src/vm/vm_hash.rs | use std::cell::RefCell;
use std::rc::Rc;
use crate::chunk::{HashWithIndex, Value,
new_string_value};
use crate::vm::*;
impl VM {
/// Takes a hash or list (or generator) and a key string or list
/// index (or list of keys/indexes) as its arguments. Puts the
/// specified value (or list ... | rust | BSD-3-Clause | 367a51684662fde5e9abff946538b08e60ea6ea9 | 2026-01-04T20:18:56.825981Z | false |
tomhrr/cosh | https://github.com/tomhrr/cosh/blob/367a51684662fde5e9abff946538b08e60ea6ea9/src/vm/vm_digest.rs | src/vm/vm_digest.rs | use sha1::{Digest, Sha1};
use sha2::{Sha256, Sha512};
use crate::chunk::Value;
use crate::vm::*;
impl VM {
/// Takes a string as its single argument. Hashes the string
/// using the MD5 algorithm and adds the result to the stack.
pub fn core_md5(&mut self) -> i32 {
if self.stack.is_empty() {
... | rust | BSD-3-Clause | 367a51684662fde5e9abff946538b08e60ea6ea9 | 2026-01-04T20:18:56.825981Z | false |
tomhrr/cosh | https://github.com/tomhrr/cosh/blob/367a51684662fde5e9abff946538b08e60ea6ea9/src/vm/vm_dns.rs | src/vm/vm_dns.rs | use std::cell::RefCell;
use std::net::SocketAddr;
use std::rc::Rc;
use std::sync::mpsc;
use std::sync::mpsc::TryRecvError;
use std::thread;
use std::time;
use hickory_client::client::Client;
use hickory_client::client::SyncClient;
use hickory_client::op::ResponseCode;
use hickory_client::rr::Record;
use hickory_client... | rust | BSD-3-Clause | 367a51684662fde5e9abff946538b08e60ea6ea9 | 2026-01-04T20:18:56.825981Z | false |
tomhrr/cosh | https://github.com/tomhrr/cosh/blob/367a51684662fde5e9abff946538b08e60ea6ea9/src/vm/vm_system.rs | src/vm/vm_system.rs | use nix::sys::signal::Signal;
use nix::unistd::{Group, Pid, User};
use std::cell::RefCell;
use std::collections::HashSet;
use std::collections::VecDeque;
use std::convert::TryFrom;
use std::env;
use std::fs;
use std::io;
use std::os::unix::fs::MetadataExt;
use std::os::unix::fs::PermissionsExt;
use std::path::Path;
use... | rust | BSD-3-Clause | 367a51684662fde5e9abff946538b08e60ea6ea9 | 2026-01-04T20:18:56.825981Z | true |
tomhrr/cosh | https://github.com/tomhrr/cosh/blob/367a51684662fde5e9abff946538b08e60ea6ea9/src/vm/vm_arithmetic.rs | src/vm/vm_arithmetic.rs | use num::FromPrimitive;
use num::ToPrimitive;
use num::Integer;
use num_bigint::BigInt;
use num_traits::Signed;
use crate::chunk::Value;
use crate::vm::*;
/// Convert an i32 to a bigint value.
fn int_to_bigint(i: i32) -> Value {
Value::BigInt(BigInt::from_i32(i).unwrap())
}
/// Convert an i32 to a floating-point... | rust | BSD-3-Clause | 367a51684662fde5e9abff946538b08e60ea6ea9 | 2026-01-04T20:18:56.825981Z | true |
tomhrr/cosh | https://github.com/tomhrr/cosh/blob/367a51684662fde5e9abff946538b08e60ea6ea9/src/vm/vm_db.rs | src/vm/vm_db.rs | use crate::chunk::{DBConnectionMySQL, DBStatementMySQL,
DBConnectionPostgres, DBStatementPostgres,
DBConnectionSQLite, DBStatementSQLite,
Value};
use crate::hasher::new_hash_indexmap;
use crate::vm::*;
use chrono::Utc;
use ipnet::{Ipv4Net, Ipv6Net};
use num_bigin... | rust | BSD-3-Clause | 367a51684662fde5e9abff946538b08e60ea6ea9 | 2026-01-04T20:18:56.825981Z | true |
tomhrr/cosh | https://github.com/tomhrr/cosh/blob/367a51684662fde5e9abff946538b08e60ea6ea9/src/vm/vm_net.rs | src/vm/vm_net.rs | use std::cell::RefCell;
use std::io::BufWriter;
use std::net::TcpStream;
use std::rc::Rc;
use std::sync::mpsc;
use std::sync::mpsc::TryRecvError;
use std::thread;
use std::time;
use ipnetwork::IpNetwork::{V4, V6};
use netstat2::*;
use num::FromPrimitive;
use num_bigint::BigInt;
use pnet::datalink;
use sysinfo::Uid;
u... | rust | BSD-3-Clause | 367a51684662fde5e9abff946538b08e60ea6ea9 | 2026-01-04T20:18:56.825981Z | false |
tomhrr/cosh | https://github.com/tomhrr/cosh/blob/367a51684662fde5e9abff946538b08e60ea6ea9/src/vm/vm_list.rs | src/vm/vm_list.rs | use std::cell::RefCell;
use std::collections::VecDeque;
use std::mem;
use std::rc::Rc;
use std::sync::atomic::Ordering;
use std::thread;
use std::time;
use crate::chunk::{IpSet, Value, ValueSD,
valuesd_to_value, read_valuesd,
new_string_value};
use crate::hasher::new_set_indexmap;... | rust | BSD-3-Clause | 367a51684662fde5e9abff946538b08e60ea6ea9 | 2026-01-04T20:18:56.825981Z | false |
tomhrr/cosh | https://github.com/tomhrr/cosh/blob/367a51684662fde5e9abff946538b08e60ea6ea9/src/vm/vm_yaml.rs | src/vm/vm_yaml.rs | use std::cell::RefCell;
use std::collections::VecDeque;
use std::convert::TryFrom;
use std::rc::Rc;
use indexmap::IndexMap;
use num_bigint::ToBigInt;
use crate::chunk::Value;
use crate::hasher::{new_hash_indexmap, new_set_indexmap};
use crate::vm::*;
/// Converts a serde_yaml object into a value.
fn convert_from_yam... | rust | BSD-3-Clause | 367a51684662fde5e9abff946538b08e60ea6ea9 | 2026-01-04T20:18:56.825981Z | false |
tomhrr/cosh | https://github.com/tomhrr/cosh/blob/367a51684662fde5e9abff946538b08e60ea6ea9/src/vm/vm_io.rs | src/vm/vm_io.rs | use std::cell::RefCell;
use std::fs::metadata;
use std::fs::symlink_metadata;
use std::fs::File;
use std::io::BufReader;
use std::io::BufWriter;
use std::io::Write;
use std::rc::Rc;
use std::thread;
use std::time;
use lazy_static::lazy_static;
use nix::unistd::AccessFlags;
use regex::Regex;
use tempfile::{NamedTempFil... | rust | BSD-3-Clause | 367a51684662fde5e9abff946538b08e60ea6ea9 | 2026-01-04T20:18:56.825981Z | false |
tomhrr/cosh | https://github.com/tomhrr/cosh/blob/367a51684662fde5e9abff946538b08e60ea6ea9/src/vm/vm_string.rs | src/vm/vm_string.rs | use std::cell::RefCell;
use std::collections::VecDeque;
use std::rc::Rc;
use lazy_static::lazy_static;
use regex::Regex;
use crate::chunk::Value;
use crate::vm::*;
lazy_static! {
static ref CAPTURE_NUM: Regex = Regex::new("\\{(\\d+)\\}").unwrap();
static ref CAPTURE_WITHOUT_NUM: Regex = Regex::new("\\{\\}").... | rust | BSD-3-Clause | 367a51684662fde5e9abff946538b08e60ea6ea9 | 2026-01-04T20:18:56.825981Z | false |
tomhrr/cosh | https://github.com/tomhrr/cosh/blob/367a51684662fde5e9abff946538b08e60ea6ea9/tests/tests.rs | tests/tests.rs | extern crate assert_cmd;
extern crate cosh;
extern crate tempfile;
use assert_cmd::Command;
use std::env;
use std::fs;
use std::io::Write;
use tempfile::NamedTempFile;
#[test]
fn add_file() {
let mut file = NamedTempFile::new().unwrap();
writeln!(file, "1 2 +").unwrap();
let mut cmd = Command::cargo_bin(... | rust | BSD-3-Clause | 367a51684662fde5e9abff946538b08e60ea6ea9 | 2026-01-04T20:18:56.825981Z | true |
dank/tarkov | https://github.com/dank/tarkov/blob/93d32b66c8b01d8ded7f0b44c75be95a18a27f15/src/inventory.rs | src/inventory.rs | use crate::bad_json::deserialize_bad_location_as_none;
use crate::ErrorResponse;
use serde::{Deserialize, Serialize};
#[derive(Debug, Serialize)]
pub(crate) struct MoveItemRequest<'a, T> {
pub(crate) data: &'a [T],
pub(crate) tm: u64,
}
#[derive(Debug, Deserialize)]
#[serde(rename_all = "camelCase")]
pub(crat... | rust | MIT | 93d32b66c8b01d8ded7f0b44c75be95a18a27f15 | 2026-01-04T20:19:02.188879Z | false |
dank/tarkov | https://github.com/dank/tarkov/blob/93d32b66c8b01d8ded7f0b44c75be95a18a27f15/src/lib.rs | src/lib.rs | //! An unofficial client library for the [Escape from Tarkov](https://escapefromtarkov.com) (EFT) API.
//!
//! To get started, login to EFT with `Tarkov::login`, `from_access_token`, or `from_session`.
//! Additionally, on a new session, a profile must be selected with `select_profile` before continuing.
//!
//! Once a... | rust | MIT | 93d32b66c8b01d8ded7f0b44c75be95a18a27f15 | 2026-01-04T20:19:02.188879Z | false |
dank/tarkov | https://github.com/dank/tarkov/blob/93d32b66c8b01d8ded7f0b44c75be95a18a27f15/src/hwid.rs | src/hwid.rs | use rand::Rng;
fn random_md5<R: Rng + ?Sized>(rng: &mut R) -> String {
format!("{:x}", md5::compute(&rng.gen::<i32>().to_le_bytes()))
}
/// Generate a random EFT compatible HWID.
pub fn generate_hwid() -> String {
let mut rng = rand::thread_rng();
let short_md5 = {
let mut hash = random_md5(&mut ... | rust | MIT | 93d32b66c8b01d8ded7f0b44c75be95a18a27f15 | 2026-01-04T20:19:02.188879Z | false |
dank/tarkov | https://github.com/dank/tarkov/blob/93d32b66c8b01d8ded7f0b44c75be95a18a27f15/src/market_filter.rs | src/market_filter.rs | use serde_repr::Serialize_repr;
/// Search filter for the flea market.
#[derive(Debug, Clone, PartialEq)]
pub struct MarketFilter<'a> {
/// Sort type.
pub sort_type: SortBy,
/// Sort direction.
pub sort_direction: SortDirection,
/// Offer currency type.
pub currency: Currency,
/// Minimum i... | rust | MIT | 93d32b66c8b01d8ded7f0b44c75be95a18a27f15 | 2026-01-04T20:19:02.188879Z | false |
dank/tarkov | https://github.com/dank/tarkov/blob/93d32b66c8b01d8ded7f0b44c75be95a18a27f15/src/trading.rs | src/trading.rs | use crate::inventory::{
BarterItem, InventoryUpdate, Item, MoveItemRequest, RagfairResponseData, Upd,
};
use crate::{
handle_error, handle_error2, Error, ErrorResponse, Result, Tarkov, PROD_ENDPOINT,
TRADING_ENDPOINT,
};
use serde::{Deserialize, Serialize};
use std::collections::HashMap;
/// Trading error
... | rust | MIT | 93d32b66c8b01d8ded7f0b44c75be95a18a27f15 | 2026-01-04T20:19:02.188879Z | false |
dank/tarkov | https://github.com/dank/tarkov/blob/93d32b66c8b01d8ded7f0b44c75be95a18a27f15/src/auth.rs | src/auth.rs | use crate::{
handle_error, handle_error2, Error, ErrorResponse, Result, Tarkov, GAME_VERSION,
LAUNCHER_ENDPOINT, LAUNCHER_VERSION, PROD_ENDPOINT,
};
use flate2::read::ZlibDecoder;
use hyper::body::Buf;
use hyper::client::connect::dns::GaiResolver;
use hyper::client::{Client, HttpConnector};
use hyper::Request;
... | rust | MIT | 93d32b66c8b01d8ded7f0b44c75be95a18a27f15 | 2026-01-04T20:19:02.188879Z | false |
dank/tarkov | https://github.com/dank/tarkov/blob/93d32b66c8b01d8ded7f0b44c75be95a18a27f15/src/constant.rs | src/constant.rs | use crate::{handle_error, Error, ErrorResponse, Result, Tarkov, PROD_ENDPOINT};
use crate::bad_json::{deserialize_integer_to_option_string, StringOrInt};
use crate::profile::Side;
use serde::{Deserialize, Serialize};
use std::collections::HashMap;
#[derive(Debug, Serialize)]
#[serde(rename_all = "camelCase")]
struct ... | rust | MIT | 93d32b66c8b01d8ded7f0b44c75be95a18a27f15 | 2026-01-04T20:19:02.188879Z | true |
dank/tarkov | https://github.com/dank/tarkov/blob/93d32b66c8b01d8ded7f0b44c75be95a18a27f15/src/ragfair.rs | src/ragfair.rs | use crate::{
handle_error, handle_error2, Error, ErrorResponse, Result, Tarkov, PROD_ENDPOINT,
RAGFAIR_ENDPOINT,
};
use crate::inventory::{BarterItem, InventoryUpdate, Item, MoveItemRequest, RagfairResponseData};
use crate::market_filter::{Currency, MarketFilter, Owner, SortBy, SortDirection};
use serde::{Dese... | rust | MIT | 93d32b66c8b01d8ded7f0b44c75be95a18a27f15 | 2026-01-04T20:19:02.188879Z | false |
dank/tarkov | https://github.com/dank/tarkov/blob/93d32b66c8b01d8ded7f0b44c75be95a18a27f15/src/friend.rs | src/friend.rs | use crate::{handle_error, ErrorResponse, Result, Tarkov, PROD_ENDPOINT};
use crate::profile::Side;
use serde::{Deserialize, Serialize};
#[derive(Debug, Deserialize)]
struct FriendResponse {
#[serde(flatten)]
error: ErrorResponse,
data: Option<Friends>,
}
/// Friend list
#[derive(Debug, Deserialize, Seria... | rust | MIT | 93d32b66c8b01d8ded7f0b44c75be95a18a27f15 | 2026-01-04T20:19:02.188879Z | false |
dank/tarkov | https://github.com/dank/tarkov/blob/93d32b66c8b01d8ded7f0b44c75be95a18a27f15/src/profile.rs | src/profile.rs | use crate::{handle_error, Error, ErrorResponse, Result, Tarkov, PROD_ENDPOINT};
use crate::bad_json::deserialize_integer_to_string;
use crate::inventory::Item;
use crate::ragfair::Offer;
use serde::{Deserialize, Serialize};
use std::collections::HashMap;
#[derive(Debug, Deserialize)]
struct ProfileResponse {
#[se... | rust | MIT | 93d32b66c8b01d8ded7f0b44c75be95a18a27f15 | 2026-01-04T20:19:02.188879Z | false |
dank/tarkov | https://github.com/dank/tarkov/blob/93d32b66c8b01d8ded7f0b44c75be95a18a27f15/src/bad_json.rs | src/bad_json.rs | //! EFT API returns a lot of inconsistent and bad JSON. Serde deserializers to fix those broken JSON.
use crate::inventory::Location;
use serde::de::{Error, Visitor};
use serde::{Deserialize, Deserializer, Serialize};
use serde_json::Value;
use std::fmt;
pub(crate) fn deserialize_integer_to_string<'de, D>(de: D) -> R... | rust | MIT | 93d32b66c8b01d8ded7f0b44c75be95a18a27f15 | 2026-01-04T20:19:02.188879Z | false |
dank/tarkov | https://github.com/dank/tarkov/blob/93d32b66c8b01d8ded7f0b44c75be95a18a27f15/tests/test_api.rs | tests/test_api.rs | use std::env;
use std::time::{SystemTime, UNIX_EPOCH};
use tarkov::inventory::BarterItem;
use tarkov::market_filter::{Currency, MarketFilter, Owner};
use tarkov::profile::Side;
use tarkov::ragfair::Requirement;
use tarkov::{Result, Tarkov};
#[tokio::test]
async fn test_profile() -> Result<()> {
let session = env::... | rust | MIT | 93d32b66c8b01d8ded7f0b44c75be95a18a27f15 | 2026-01-04T20:19:02.188879Z | false |
dank/tarkov | https://github.com/dank/tarkov/blob/93d32b66c8b01d8ded7f0b44c75be95a18a27f15/examples/auth_basic.rs | examples/auth_basic.rs | use tarkov::hwid::generate_hwid;
use tarkov::{Error, Tarkov};
#[tokio::main]
async fn main() -> Result<(), Error> {
std::env::set_var("RUST_LOG", "tarkov=info");
env_logger::init();
let t = Tarkov::login("me@example.com", "password", generate_hwid().as_str()).await?;
println!("{}", t.session);
le... | rust | MIT | 93d32b66c8b01d8ded7f0b44c75be95a18a27f15 | 2026-01-04T20:19:02.188879Z | false |
dank/tarkov | https://github.com/dank/tarkov/blob/93d32b66c8b01d8ded7f0b44c75be95a18a27f15/examples/auth_captcha.rs | examples/auth_captcha.rs | use tarkov::auth::LoginError;
use tarkov::hwid::generate_hwid;
use tarkov::{Error, Tarkov};
#[tokio::main]
async fn main() -> Result<(), Error> {
std::env::set_var("RUST_LOG", "tarkov=info");
env_logger::init();
let email = "me@example.com";
let password = "password";
let hwid = generate_hwid();
... | rust | MIT | 93d32b66c8b01d8ded7f0b44c75be95a18a27f15 | 2026-01-04T20:19:02.188879Z | false |
dank/tarkov | https://github.com/dank/tarkov/blob/93d32b66c8b01d8ded7f0b44c75be95a18a27f15/examples/ragfair_buy_item.rs | examples/ragfair_buy_item.rs | use std::time::{SystemTime, UNIX_EPOCH};
use tarkov::inventory::BarterItem;
use tarkov::market_filter::{Currency, MarketFilter, Owner};
use tarkov::profile::Side;
use tarkov::{Error, Tarkov};
#[tokio::main]
async fn main() -> Result<(), Error> {
std::env::set_var("RUST_LOG", "tarkov=info");
env_logger::init();... | rust | MIT | 93d32b66c8b01d8ded7f0b44c75be95a18a27f15 | 2026-01-04T20:19:02.188879Z | false |
dank/tarkov | https://github.com/dank/tarkov/blob/93d32b66c8b01d8ded7f0b44c75be95a18a27f15/examples/search_traders.rs | examples/search_traders.rs | use tarkov::profile::Side;
use tarkov::{Error, Tarkov};
#[tokio::main]
async fn main() -> Result<(), Error> {
std::env::set_var("RUST_LOG", "tarkov=info");
env_logger::init();
let t = Tarkov::from_session("e1bc65a216325f0ad0db8518fa299db2");
// Find and select PMC profile to complete login.
let p... | rust | MIT | 93d32b66c8b01d8ded7f0b44c75be95a18a27f15 | 2026-01-04T20:19:02.188879Z | false |
dank/tarkov | https://github.com/dank/tarkov/blob/93d32b66c8b01d8ded7f0b44c75be95a18a27f15/examples/auth_2fa.rs | examples/auth_2fa.rs | use tarkov::auth::LoginError;
use tarkov::hwid::generate_hwid;
use tarkov::{Error, Tarkov};
#[tokio::main]
async fn main() -> Result<(), Error> {
std::env::set_var("RUST_LOG", "tarkov=info");
env_logger::init();
let email = "me@example.com";
let password = "password";
let hwid = generate_hwid();
... | rust | MIT | 93d32b66c8b01d8ded7f0b44c75be95a18a27f15 | 2026-01-04T20:19:02.188879Z | false |
dank/tarkov | https://github.com/dank/tarkov/blob/93d32b66c8b01d8ded7f0b44c75be95a18a27f15/examples/search_trader_items.rs | examples/search_trader_items.rs | use tarkov::profile::Side;
use tarkov::{Error, Tarkov};
#[tokio::main]
async fn main() -> Result<(), Error> {
std::env::set_var("RUST_LOG", "tarkov=info");
env_logger::init();
let t = Tarkov::from_session("e1bc65a216325f0ad0db8518fa299db2");
// Find and select PMC profile to complete login.
let p... | rust | MIT | 93d32b66c8b01d8ded7f0b44c75be95a18a27f15 | 2026-01-04T20:19:02.188879Z | false |
dank/tarkov | https://github.com/dank/tarkov/blob/93d32b66c8b01d8ded7f0b44c75be95a18a27f15/examples/trader_cash_deal.rs | examples/trader_cash_deal.rs | use tarkov::inventory::BarterItem;
use tarkov::profile::Side;
use tarkov::{Error, Tarkov};
#[tokio::main]
async fn main() -> Result<(), Error> {
std::env::set_var("RUST_LOG", "tarkov=info");
env_logger::init();
let t = Tarkov::from_session("3e463058dd4884ab0c4a6035dc56066b");
// Find and select PMC p... | rust | MIT | 93d32b66c8b01d8ded7f0b44c75be95a18a27f15 | 2026-01-04T20:19:02.188879Z | false |
dank/tarkov | https://github.com/dank/tarkov/blob/93d32b66c8b01d8ded7f0b44c75be95a18a27f15/examples/trader_sell_item.rs | examples/trader_sell_item.rs | use tarkov::profile::Side;
use tarkov::{Error, Tarkov};
#[tokio::main]
async fn main() -> Result<(), Error> {
std::env::set_var("RUST_LOG", "tarkov=info");
env_logger::init();
let t = Tarkov::from_session("da3902b29e442da4972f8ce499834ee7");
// Find and select PMC profile to complete login.
let p... | rust | MIT | 93d32b66c8b01d8ded7f0b44c75be95a18a27f15 | 2026-01-04T20:19:02.188879Z | false |
dank/tarkov | https://github.com/dank/tarkov/blob/93d32b66c8b01d8ded7f0b44c75be95a18a27f15/examples/ragfair_sell_item.rs | examples/ragfair_sell_item.rs | use tarkov::profile::Side;
use tarkov::ragfair::Requirement;
use tarkov::{Error, Tarkov};
#[tokio::main]
async fn main() -> Result<(), Error> {
std::env::set_var("RUST_LOG", "tarkov=info");
env_logger::init();
let t = Tarkov::from_session("e1bc65a216325f0ad0db8518fa299db2");
// Find and select PMC pr... | rust | MIT | 93d32b66c8b01d8ded7f0b44c75be95a18a27f15 | 2026-01-04T20:19:02.188879Z | false |
dank/tarkov | https://github.com/dank/tarkov/blob/93d32b66c8b01d8ded7f0b44c75be95a18a27f15/examples/trader_barter_deal.rs | examples/trader_barter_deal.rs | use tarkov::inventory::BarterItem;
use tarkov::profile::Side;
use tarkov::{Error, Tarkov};
#[tokio::main]
async fn main() -> Result<(), Error> {
std::env::set_var("RUST_LOG", "tarkov=info");
env_logger::init();
let t = Tarkov::from_session("e1bc65a216325f0ad0db8518fa299db2");
// Find and select PMC p... | rust | MIT | 93d32b66c8b01d8ded7f0b44c75be95a18a27f15 | 2026-01-04T20:19:02.188879Z | false |
drmingdrmer/one-file-raft | https://github.com/drmingdrmer/one-file-raft/blob/3d9ebbbee5fde16f5bf0626be4c565ca9d67860d/src/lib.rs | src/lib.rs | #![doc = include_str!("../README.md")]
//!
//! - Read the [Tutorial](`crate::docs::tutorial`);
//! - Read the [Tutorial-cn](`crate::docs::tutorial_cn`);
//!
//! Features:
//!
//! - [x] Election(`Raft::elect()`)
//! - [x] Log replication(`Raft::handle_replicate_req()`)
//! - [x] Commit
//! - [x] Write application data(... | rust | Apache-2.0 | 3d9ebbbee5fde16f5bf0626be4c565ca9d67860d | 2026-01-04T20:19:09.207473Z | false |
drmingdrmer/one-file-raft | https://github.com/drmingdrmer/one-file-raft/blob/3d9ebbbee5fde16f5bf0626be4c565ca9d67860d/src/tests.rs | src/tests.rs | #![allow(clippy::let_underscore_future)]
use std::collections::BTreeSet;
use log::debug;
use log::info;
use mpsc::UnboundedSender;
use tokio::sync::mpsc;
use tokio::sync::oneshot;
use tokio::sync::watch;
use crate::Event;
use crate::LeaderId;
use crate::Log;
use crate::Metrics;
use crate::Net;
use crate::Raft;
use c... | rust | Apache-2.0 | 3d9ebbbee5fde16f5bf0626be4c565ca9d67860d | 2026-01-04T20:19:09.207473Z | false |
drmingdrmer/one-file-raft | https://github.com/drmingdrmer/one-file-raft/blob/3d9ebbbee5fde16f5bf0626be4c565ca9d67860d/src/display.rs | src/display.rs | use std::collections::BTreeMap;
use std::collections::BTreeSet;
use std::fmt;
use itertools::Itertools;
use crate::Log;
use crate::Metrics;
use crate::Progress;
use crate::Reply;
use crate::Request;
use crate::Vote;
pub struct Display<'a, T> {
v: &'a T,
}
pub(crate) trait DisplayExt {
fn display(&self) -> D... | rust | Apache-2.0 | 3d9ebbbee5fde16f5bf0626be4c565ca9d67860d | 2026-01-04T20:19:09.207473Z | false |
drmingdrmer/one-file-raft | https://github.com/drmingdrmer/one-file-raft/blob/3d9ebbbee5fde16f5bf0626be4c565ca9d67860d/src/docs/mod.rs | src/docs/mod.rs | #![doc = include_str!("docs.md")]
pub mod tutorial {
#![doc = include_str!("comment.md")]
}
pub mod tutorial_cn {
#![doc = include_str!("comment-cn.md")]
}
| rust | Apache-2.0 | 3d9ebbbee5fde16f5bf0626be4c565ca9d67860d | 2026-01-04T20:19:09.207473Z | false |
tun-rs/tun-rs | https://github.com/tun-rs/tun-rs/blob/c8e1cd8eb96adf915f0ae95e7c502e0f9ffd91a7/build.rs | build.rs | fn main() {
println!("cargo:rerun-if-env-changed=DOCS_RS");
let docs_builder = std::env::var("DOCS_RS").is_ok();
if docs_builder {
println!("cargo:rustc-cfg=docsrs");
return;
}
let target_os = std::env::var("CARGO_CFG_TARGET_OS").unwrap_or_default();
if target_os == "windows" {
... | rust | Apache-2.0 | c8e1cd8eb96adf915f0ae95e7c502e0f9ffd91a7 | 2026-01-04T20:19:01.665942Z | false |
tun-rs/tun-rs | https://github.com/tun-rs/tun-rs/blob/c8e1cd8eb96adf915f0ae95e7c502e0f9ffd91a7/src/builder.rs | src/builder.rs | use std::io;
use std::net::{IpAddr, Ipv4Addr, Ipv6Addr};
use std::str::FromStr;
use crate::platform::{DeviceImpl, SyncDevice};
/// Represents the OSI layer at which the TUN interface operates.
///
/// - **L2**: Data Link Layer (available on Windows, Linux, and FreeBSD; used for TAP interfaces).
/// - **L3**: Network ... | rust | Apache-2.0 | c8e1cd8eb96adf915f0ae95e7c502e0f9ffd91a7 | 2026-01-04T20:19:01.665942Z | true |
tun-rs/tun-rs | https://github.com/tun-rs/tun-rs/blob/c8e1cd8eb96adf915f0ae95e7c502e0f9ffd91a7/src/lib.rs | src/lib.rs | #![cfg_attr(docsrs, feature(doc_cfg))]
/*!
# Example:
```no_run
use tun_rs::DeviceBuilder;
let dev = DeviceBuilder::new()
.name("utun7")
.ipv4("10.0.0.12", 24, None)
.ipv6("CDCD:910A:2222:5498:8475:1111:3900:2021", 64)
.mtu(1400)
.build_sync()
.un... | rust | Apache-2.0 | c8e1cd8eb96adf915f0ae95e7c502e0f9ffd91a7 | 2026-01-04T20:19:01.665942Z | false |
tun-rs/tun-rs | https://github.com/tun-rs/tun-rs/blob/c8e1cd8eb96adf915f0ae95e7c502e0f9ffd91a7/src/async_device/mod.rs | src/async_device/mod.rs | #[cfg(unix)]
pub(crate) mod unix;
#[cfg(all(unix, not(target_os = "macos")))]
pub use unix::AsyncDevice;
#[cfg(target_os = "macos")]
mod macos;
#[cfg(target_os = "macos")]
pub use macos::AsyncDevice;
#[cfg(windows)]
mod windows;
#[cfg(windows)]
pub use windows::AsyncDevice;
#[cfg(all(
any(feature = "async_io", fea... | rust | Apache-2.0 | c8e1cd8eb96adf915f0ae95e7c502e0f9ffd91a7 | 2026-01-04T20:19:01.665942Z | false |
tun-rs/tun-rs | https://github.com/tun-rs/tun-rs/blob/c8e1cd8eb96adf915f0ae95e7c502e0f9ffd91a7/src/async_device/async_framed.rs | src/async_device/async_framed.rs | use std::borrow::Borrow;
use std::io;
use std::pin::Pin;
use std::task::{ready, Context, Poll};
use bytes::{BufMut, Bytes, BytesMut};
use futures::Sink;
use futures_core::Stream;
#[cfg(all(target_os = "linux", not(target_env = "ohos")))]
use crate::platform::offload::VirtioNetHdr;
use crate::AsyncDevice;
#[cfg(all(ta... | rust | Apache-2.0 | c8e1cd8eb96adf915f0ae95e7c502e0f9ffd91a7 | 2026-01-04T20:19:01.665942Z | false |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.