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 |
|---|---|---|---|---|---|---|---|---|
ballsteve/xrust | https://github.com/ballsteve/xrust/blob/4b8681166cc9894c2bf068afe79a8414d7a13970/tests/conformance/xml/eduni_errata4e_valid.rs | tests/conformance/xml/eduni_errata4e_valid.rs | /*
University of Edinburgh XML 1.0 4th edition errata test suite.
*/
use std::fs;
use xrust::item::Node;
use xrust::parser::xml;
use xrust::trees::smite::RNode;
use xrust::validators::Schema;
#[test]
fn xrmt008b() {
/*
Test ID:x-rmt-008b
Test URI:008.xml
Spec Sections:2.8 4.3.4
D... | rust | Apache-2.0 | 4b8681166cc9894c2bf068afe79a8414d7a13970 | 2026-01-04T20:23:44.719720Z | true |
ballsteve/xrust | https://github.com/ballsteve/xrust/blob/4b8681166cc9894c2bf068afe79a8414d7a13970/tests/conformance/xml/xmltest_valid_ext_sa.rs | tests/conformance/xml/xmltest_valid_ext_sa.rs | /*
James Clark XMLTEST cases - Standalone
This contains cases that are valid XML documents.
This contains case that are standalone and have references to external general entities .
*/
use crate::conformance::dtdfileresolve;
use std::fs;
use xrust::item::Node;
use xrust::parser::{xml, ParserConfig};
use xrus... | rust | Apache-2.0 | 4b8681166cc9894c2bf068afe79a8414d7a13970 | 2026-01-04T20:23:44.719720Z | false |
ballsteve/xrust | https://github.com/ballsteve/xrust/blob/4b8681166cc9894c2bf068afe79a8414d7a13970/tests/conformance/xml/oasis_invalid.rs | tests/conformance/xml/oasis_invalid.rs | /*
OASIS/NIST test cases
*/
use crate::conformance::dtdfileresolve;
use std::fs;
use xrust::item::Node;
use xrust::parser::{xml, ParserConfig};
use xrust::trees::smite::RNode;
use xrust::validators::Schema;
#[test]
fn op01pass1() {
/*
Test ID:o-p01pass1
Test URI:p01pass1.xml
Spec Section... | rust | Apache-2.0 | 4b8681166cc9894c2bf068afe79a8414d7a13970 | 2026-01-04T20:23:44.719720Z | true |
ballsteve/xrust | https://github.com/ballsteve/xrust/blob/4b8681166cc9894c2bf068afe79a8414d7a13970/tests/conformance/xml/eduni_xml11_error.rs | tests/conformance/xml/eduni_xml11_error.rs | /*
Richard Tobin's XML 1.1 test suite 13 Feb 2003
*/
use crate::conformance::non_utf8_file_reader;
use std::fs;
use xrust::item::Node;
use xrust::parser::xml;
use xrust::trees::smite::RNode;
#[test]
fn rmt008() {
/*
Test ID:rmt-008
Test URI:008.xml
Spec Sections:2.8 4.3.4
Descrip... | rust | Apache-2.0 | 4b8681166cc9894c2bf068afe79a8414d7a13970 | 2026-01-04T20:23:44.719720Z | false |
ballsteve/xrust | https://github.com/ballsteve/xrust/blob/4b8681166cc9894c2bf068afe79a8414d7a13970/tests/conformance/xml/oasis_notwf.rs | tests/conformance/xml/oasis_notwf.rs | /*
OASIS/NIST test cases
*/
use crate::conformance::{dtdfileresolve, non_utf8_file_reader};
use std::fs;
use xrust::item::Node;
use xrust::parser::{xml, ParserConfig};
use xrust::trees::smite::RNode;
#[test]
fn op01fail1() {
/*
Test ID:o-p01fail1
Test URI:p01fail1.xml
Spec Sections:2.1 [... | rust | Apache-2.0 | 4b8681166cc9894c2bf068afe79a8414d7a13970 | 2026-01-04T20:23:44.719720Z | true |
ballsteve/xrust | https://github.com/ballsteve/xrust/blob/4b8681166cc9894c2bf068afe79a8414d7a13970/tests/conformance/xml/xmltest_invalid.rs | tests/conformance/xml/xmltest_invalid.rs | /*
James Clark XMLTEST cases
This contains cases that are well-formed XML documents but are not valid XML documents
*/
use crate::conformance::dtdfileresolve;
use std::fs;
use xrust::item::Node;
use xrust::parser::{xml, ParserConfig};
use xrust::trees::smite::RNode;
#[test]
#[ignore]
fn invalid002() {
/*
... | rust | Apache-2.0 | 4b8681166cc9894c2bf068afe79a8414d7a13970 | 2026-01-04T20:23:44.719720Z | false |
ballsteve/xrust | https://github.com/ballsteve/xrust/blob/4b8681166cc9894c2bf068afe79a8414d7a13970/tests/conformance/xml/eduni_errata4e_notwf.rs | tests/conformance/xml/eduni_errata4e_notwf.rs | /*
University of Edinburgh XML 1.0 4th edition errata test suite.
*/
use std::fs;
use xrust::item::Node;
use xrust::parser::xml;
use xrust::trees::smite::RNode;
#[test]
fn xibm105notwf_p04ibm04n02xml() {
/*
Test ID:x-ibm-1-0.5-not-wf-P04-ibm04n02.xml
Test URI:ibm04n02.xml
Spec Sections:2... | rust | Apache-2.0 | 4b8681166cc9894c2bf068afe79a8414d7a13970 | 2026-01-04T20:23:44.719720Z | false |
ballsteve/xrust | https://github.com/ballsteve/xrust/blob/4b8681166cc9894c2bf068afe79a8414d7a13970/tests/conformance/xml/eduni_misc_invalid.rs | tests/conformance/xml/eduni_misc_invalid.rs | /*
Bjoern Hoehrmann via HST 2013-09-18
*/
use std::fs;
use xrust::item::Node;
use xrust::parser::xml;
use xrust::trees::smite::RNode;
use xrust::validators::Schema;
#[test]
#[ignore]
fn hstbh005() {
/*
Test ID:hst-bh-005
Test URI:005.xml
Spec Sections:3.1 [41]
Description:xmlns:x... | rust | Apache-2.0 | 4b8681166cc9894c2bf068afe79a8414d7a13970 | 2026-01-04T20:23:44.719720Z | false |
ballsteve/xrust | https://github.com/ballsteve/xrust/blob/4b8681166cc9894c2bf068afe79a8414d7a13970/tests/conformance/xml/ibm11_valid.rs | tests/conformance/xml/ibm11_valid.rs | /*
IBM test cases
*/
use crate::conformance::dtdfileresolve;
use std::fs;
use xrust::item::Node;
use xrust::parser::{xml, ParserConfig};
use xrust::trees::smite::RNode;
use xrust::validators::Schema;
#[test]
fn ibm11valid_p02ibm02v01xml() {
/*
Test ID:ibm-1-1-valid-P02-ibm02v01.xml
Test URI:vali... | rust | Apache-2.0 | 4b8681166cc9894c2bf068afe79a8414d7a13970 | 2026-01-04T20:23:44.719720Z | true |
ballsteve/xrust | https://github.com/ballsteve/xrust/blob/4b8681166cc9894c2bf068afe79a8414d7a13970/tests/conformance/xml/oasis_valid.rs | tests/conformance/xml/oasis_valid.rs | /*
OASIS/NIST test cases
*/
use std::fs;
use xrust::item::Node;
use xrust::parser::xml;
use xrust::trees::smite::RNode;
use xrust::validators::Schema;
#[test]
fn op01pass2() {
/*
Test ID:o-p01pass2
Test URI:p01pass2.xml
Spec Sections:2.2 [1]
Description:various Misc items where t... | rust | Apache-2.0 | 4b8681166cc9894c2bf068afe79a8414d7a13970 | 2026-01-04T20:23:44.719720Z | false |
ballsteve/xrust | https://github.com/ballsteve/xrust/blob/4b8681166cc9894c2bf068afe79a8414d7a13970/tests/conformance/xml/xmltest_notwf_sa.rs | tests/conformance/xml/xmltest_notwf_sa.rs | /*
James Clark XMLTEST cases - Standalone
This contains cases that are not well-formed XML documents
This contains cases that are not standalone.
*/
use std::fs;
use xrust::item::Node;
use xrust::parser::xml;
use xrust::trees::smite::RNode;
#[test]
fn notwfsa001() {
/*
Test ID:not-wf-sa-001
... | rust | Apache-2.0 | 4b8681166cc9894c2bf068afe79a8414d7a13970 | 2026-01-04T20:23:44.719720Z | true |
ballsteve/xrust | https://github.com/ballsteve/xrust/blob/4b8681166cc9894c2bf068afe79a8414d7a13970/tests/conformance/xml/eduni_errata3e_valid.rs | tests/conformance/xml/eduni_errata3e_valid.rs | /*
Richard Tobin's XML 1.0 3rd edition errata test suite 1 June 2006
*/
use std::fs;
use xrust::item::Node;
use xrust::parser::xml;
use xrust::trees::smite::RNode;
use xrust::validators::Schema;
#[test]
fn rmte3e05a() {
/*
Test ID:rmt-e3e-05a
Test URI:E05a.xml
Spec Sections:E05
De... | rust | Apache-2.0 | 4b8681166cc9894c2bf068afe79a8414d7a13970 | 2026-01-04T20:23:44.719720Z | false |
ballsteve/xrust | https://github.com/ballsteve/xrust/blob/4b8681166cc9894c2bf068afe79a8414d7a13970/tests/conformance/xml/oasis_error.rs | tests/conformance/xml/oasis_error.rs | /*
OASIS/NIST test cases
*/
use std::fs;
use xrust::item::Node;
use xrust::parser::xml;
use xrust::trees::smite::RNode;
#[test]
#[ignore]
fn op11pass1() {
/*
Test ID:o-p11pass1
Test URI:p11pass1.xml
Spec Sections:2.3, 4.2.2 [11]
Description:system literals may not contain URI fra... | rust | Apache-2.0 | 4b8681166cc9894c2bf068afe79a8414d7a13970 | 2026-01-04T20:23:44.719720Z | false |
ballsteve/xrust | https://github.com/ballsteve/xrust/blob/4b8681166cc9894c2bf068afe79a8414d7a13970/benches/bench_smite.rs | benches/bench_smite.rs | use std::rc::Rc;
use criterion::{black_box, criterion_group, criterion_main, Criterion};
use xrust::item::Node;
use xrust::parser::xml::parse;
use xrust::qname::QualifiedName;
use xrust::trees::smite::{Node as SmiteNode, RNode};
use xrust::value::Value;
fn make_rnode(n: u64) -> RNode {
let mut a = RNode::new_doc... | rust | Apache-2.0 | 4b8681166cc9894c2bf068afe79a8414d7a13970 | 2026-01-04T20:23:44.719720Z | false |
ballsteve/xrust | https://github.com/ballsteve/xrust/blob/4b8681166cc9894c2bf068afe79a8414d7a13970/examples/issue-30.rs | examples/issue-30.rs | //! Issue #30. An example using XPath, but not XSLT.
//!
//! Suggested by Micah Dubinko.
use std::env;
use std::fs::File;
use std::io::Read;
use std::path::Path;
use xrust::ErrorKind;
use xrust::item::{Item, Node, SequenceTrait};
use xrust::parser::xml::parse as xmlparse;
use xrust::parser::xpath::parse;
use xrust::... | rust | Apache-2.0 | 4b8681166cc9894c2bf068afe79a8414d7a13970 | 2026-01-04T20:23:44.719720Z | false |
ballsteve/xrust | https://github.com/ballsteve/xrust/blob/4b8681166cc9894c2bf068afe79a8414d7a13970/examples/ixml.rs | examples/ixml.rs | //! Integrating Invisible XML with Xrust.
//!
//! This example accepts to input files: an XSL Stylesheet and a Markdown document.
//! It uses Invisible XML to parse the Markdown document into a document for Xrust.
//! It then performs the XSL Transformation on the Markdown document
//! and writes the result as an XML d... | rust | Apache-2.0 | 4b8681166cc9894c2bf068afe79a8414d7a13970 | 2026-01-04T20:23:44.719720Z | false |
pfpacket/rust-9p | https://github.com/pfpacket/rust-9p/blob/bf021eb876d5a43b8b26ffd6f3a3e240e1ad6d79/src/lib.rs | src/lib.rs | //! Filesystems library using 9P2000.L protocol, an extended variant of 9P from Plan 9.
//!
//! 9P protocol is originally developed for Plan 9 distributed OS.
//! As it's extendable and suitable for filesystems 9P is ported to Linux.
//! However, 9P protocol lacks Linux or Unix specific features,
//! which is the probl... | rust | BSD-3-Clause | bf021eb876d5a43b8b26ffd6f3a3e240e1ad6d79 | 2026-01-04T20:22:36.760821Z | false |
pfpacket/rust-9p | https://github.com/pfpacket/rust-9p/blob/bf021eb876d5a43b8b26ffd6f3a3e240e1ad6d79/src/fcall.rs | src/fcall.rs | //! 9P protocol data types and constants.
//!
//! # Protocol
//! 9P2000.L
use std::fs;
use std::mem::{size_of, size_of_val};
use std::os::unix::fs::MetadataExt;
use bitflags::bitflags;
use enum_primitive::*;
/// 9P2000 version string
pub const P92000: &str = "9P2000";
/// 9P2000.L version string
pub const P92000L: ... | rust | BSD-3-Clause | bf021eb876d5a43b8b26ffd6f3a3e240e1ad6d79 | 2026-01-04T20:22:36.760821Z | false |
pfpacket/rust-9p | https://github.com/pfpacket/rust-9p/blob/bf021eb876d5a43b8b26ffd6f3a3e240e1ad6d79/src/serialize.rs | src/serialize.rs | //! Serialize/deserialize 9P messages into/from binary.
use crate::fcall::*;
use byteorder::{LittleEndian, ReadBytesExt, WriteBytesExt};
use num_traits::FromPrimitive;
use std::io::{Read, Result};
use std::mem;
use std::ops::{Shl, Shr};
macro_rules! decode {
($decoder:expr) => {
Decodable::decode(&mut $de... | rust | BSD-3-Clause | bf021eb876d5a43b8b26ffd6f3a3e240e1ad6d79 | 2026-01-04T20:22:36.760821Z | false |
pfpacket/rust-9p | https://github.com/pfpacket/rust-9p/blob/bf021eb876d5a43b8b26ffd6f3a3e240e1ad6d79/src/error.rs | src/error.rs | //! 9P error representations.
//!
//! In 9P2000 errors are represented as strings.
//! All the error strings in this module are imported from include/net/9p/error.c of Linux kernel.
//!
//! By contrast, in 9P2000.L, errors are represented as numbers (errno).
//! Using the Linux system errno numbers is the expected beha... | rust | BSD-3-Clause | bf021eb876d5a43b8b26ffd6f3a3e240e1ad6d79 | 2026-01-04T20:22:36.760821Z | false |
pfpacket/rust-9p | https://github.com/pfpacket/rust-9p/blob/bf021eb876d5a43b8b26ffd6f3a3e240e1ad6d79/src/utils.rs | src/utils.rs | use crate::error;
pub type Result<T> = ::std::result::Result<T, error::Error>;
macro_rules! io_err {
($kind:ident, $msg:expr) => {
::std::io::Error::new(::std::io::ErrorKind::$kind, $msg)
};
}
macro_rules! res {
($err:expr) => {
Err(From::from($err))
};
}
pub fn parse_proto(arg: &str... | rust | BSD-3-Clause | bf021eb876d5a43b8b26ffd6f3a3e240e1ad6d79 | 2026-01-04T20:22:36.760821Z | false |
pfpacket/rust-9p | https://github.com/pfpacket/rust-9p/blob/bf021eb876d5a43b8b26ffd6f3a3e240e1ad6d79/src/srv.rs | src/srv.rs | //! Asynchronous server side 9P library.
//!
//! # Protocol
//! 9P2000.L
use {
crate::{
error,
error::errno::*,
fcall::*,
serialize,
utils::{self, Result},
},
async_trait::async_trait,
bytes::buf::{Buf, BufMut},
futures::sink::SinkExt,
std::{collections::... | rust | BSD-3-Clause | bf021eb876d5a43b8b26ffd6f3a3e240e1ad6d79 | 2026-01-04T20:22:36.760821Z | false |
pfpacket/rust-9p | https://github.com/pfpacket/rust-9p/blob/bf021eb876d5a43b8b26ffd6f3a3e240e1ad6d79/example/unpfs/src/utils.rs | example/unpfs/src/utils.rs | use {
rs9p::fcall::*,
std::{fs::Metadata, os::unix::prelude::*, path::Path},
tokio::fs,
};
#[macro_export]
macro_rules! res {
($err:expr) => {
Err(From::from($err))
};
}
#[macro_export]
macro_rules! io_err {
($kind:ident, $msg:expr) => {
::std::io::Error::new(::std::io::ErrorKi... | rust | BSD-3-Clause | bf021eb876d5a43b8b26ffd6f3a3e240e1ad6d79 | 2026-01-04T20:22:36.760821Z | false |
pfpacket/rust-9p | https://github.com/pfpacket/rust-9p/blob/bf021eb876d5a43b8b26ffd6f3a3e240e1ad6d79/example/unpfs/src/main.rs | example/unpfs/src/main.rs | use {
async_trait::async_trait,
filetime::FileTime,
nix::libc::{O_CREAT, O_RDONLY, O_RDWR, O_TRUNC, O_WRONLY},
rs9p::{
srv::{srv_async, Fid, Filesystem},
*,
},
std::{
io::SeekFrom,
os::unix::{fs::PermissionsExt, io::FromRawFd},
path::PathBuf,
},
to... | rust | BSD-3-Clause | bf021eb876d5a43b8b26ffd6f3a3e240e1ad6d79 | 2026-01-04T20:22:36.760821Z | false |
redox-os/games | https://github.com/redox-os/games/blob/80349c4fc60b0440fd6d64892b8cbb53a4ff38c2/src/baduk/main.rs | src/baduk/main.rs | #![cfg_attr(feature = "nightly", feature(io))]
extern crate libgo;
extern crate liner;
extern crate termion;
use std::cmp;
use std::io::{self, stdout, Write};
use libgo::game::board::Board;
use libgo::game::Game;
use libgo::gtp::engine::Engine;
use libgo::gtp::command::Command;
use liner::Context;
use liner::Prompt;... | rust | MIT | 80349c4fc60b0440fd6d64892b8cbb53a4ff38c2 | 2026-01-04T20:23:55.000424Z | false |
redox-os/games | https://github.com/redox-os/games/blob/80349c4fc60b0440fd6d64892b8cbb53a4ff38c2/src/rusthello/lib.rs | src/rusthello/lib.rs | #![crate_name = "rusthello_lib"]
#![crate_type = "lib"]
// External crates
extern crate rand;
extern crate rayon;
extern crate reversi;
extern crate termion;
// Modules
pub mod interface;
pub mod human_player;
pub mod ai_player;
use reversi::{ReversiError};
use reversi::game::{PlayerAction};
use std::result;
pub e... | rust | MIT | 80349c4fc60b0440fd6d64892b8cbb53a4ff38c2 | 2026-01-04T20:23:55.000424Z | false |
redox-os/games | https://github.com/redox-os/games/blob/80349c4fc60b0440fd6d64892b8cbb53a4ff38c2/src/rusthello/ai_player.rs | src/rusthello/ai_player.rs | //! Provides `game::IsPlayer<::OtherAction>` types.
use {Result, Action};
use rand::thread_rng;
use rand::distributions::{IndependentSample, Range};
use rayon::prelude::*;
use reversi::{board, turn, game, Side, ReversiError};
use reversi::board::Coord;
use std::cmp::Ordering;
const RANDOMNESS: f64 = 0.05f64;
const WE... | rust | MIT | 80349c4fc60b0440fd6d64892b8cbb53a4ff38c2 | 2026-01-04T20:23:55.000424Z | false |
redox-os/games | https://github.com/redox-os/games/blob/80349c4fc60b0440fd6d64892b8cbb53a4ff38c2/src/rusthello/interface.rs | src/rusthello/interface.rs | //! This module provides interface functionalities and manages all the input/output part of the program
use std::string::String;
use std::io::{self, Write};
use reversi::Side;
use reversi::board::{BOARD_SIZE, Coord};
use reversi::game::PlayerAction;
use reversi::turn::{State, Turn};
use {Result, Action, OtherAction};
... | rust | MIT | 80349c4fc60b0440fd6d64892b8cbb53a4ff38c2 | 2026-01-04T20:23:55.000424Z | false |
redox-os/games | https://github.com/redox-os/games/blob/80349c4fc60b0440fd6d64892b8cbb53a4ff38c2/src/rusthello/human_player.rs | src/rusthello/human_player.rs | //! Provides `game::IsPlayer<::OtherAction>` types.
use interface;
use reversi::{turn, game};
use ::{Action, Result};
/// The type of human players. Its `make_move` calls the interface to ask user for an input.
pub struct HumanPlayer;
impl game::IsPlayer<::OtherAction> for HumanPlayer {
/// Calls the interface t... | rust | MIT | 80349c4fc60b0440fd6d64892b8cbb53a4ff38c2 | 2026-01-04T20:23:55.000424Z | false |
redox-os/games | https://github.com/redox-os/games/blob/80349c4fc60b0440fd6d64892b8cbb53a4ff38c2/src/rusthello/main.rs | src/rusthello/main.rs | //! `RUSThello`
//! A simple Reversi game written in Rust with love.
//! Based on `reversi` library (by the same author).
//! Released under MIT license.
//! by Enrico Ghiorzi
#![crate_name = "rusthello"]
#![crate_type = "bin"]
#![cfg_attr(feature="clippy", feature(plugin))]
#![cfg_attr(feature="clippy", plugin(clippy... | rust | MIT | 80349c4fc60b0440fd6d64892b8cbb53a4ff38c2 | 2026-01-04T20:23:55.000424Z | false |
redox-os/games | https://github.com/redox-os/games/blob/80349c4fc60b0440fd6d64892b8cbb53a4ff38c2/src/snake/main.rs | src/snake/main.rs | extern crate termion;
extern crate extra;
use termion::{async_stdin, clear, color, cursor, style};
use termion::raw::IntoRawMode;
use std::io::{stdout, stdin, Read, Write};
use std::time::{Instant, Duration};
use std::collections::VecDeque;
use std::thread::sleep;
use extra::rand::Randomizer;
mod graphics {
pub c... | rust | MIT | 80349c4fc60b0440fd6d64892b8cbb53a4ff38c2 | 2026-01-04T20:23:55.000424Z | false |
redox-os/games | https://github.com/redox-os/games/blob/80349c4fc60b0440fd6d64892b8cbb53a4ff38c2/src/reblox/grid.rs | src/reblox/grid.rs | use std::time::Duration;
use extra::rand::Randomizer;
pub const GRID_WIDTH: u8 = 10;
pub const GRID_HEIGHT: u8 = 20;
const START_BLOCK_SPEED_NANOSEC: u32 = 2000000000;
const END_BLOCK_SPEED_NANOSEC: u32 = 50000000;
const BLOCK_SPEED_STEP: u32 =
(START_BLOCK_SPEED_NANOSEC - END_BLOCK_SPEED_NANOSEC) / 255;
const LIN... | rust | MIT | 80349c4fc60b0440fd6d64892b8cbb53a4ff38c2 | 2026-01-04T20:23:55.000424Z | false |
redox-os/games | https://github.com/redox-os/games/blob/80349c4fc60b0440fd6d64892b8cbb53a4ff38c2/src/reblox/main.rs | src/reblox/main.rs | #![feature(nll)]
extern crate termion;
extern crate extra;
mod grid;
use termion::{async_stdin, clear, color, cursor, style};
use termion::raw::{IntoRawMode, RawTerminal};
use std::io::{self, Write, Read, Result};
use std::thread;
use std::time;
fn main() {
let stdout = io::stdout();
let mut game = Game::n... | rust | MIT | 80349c4fc60b0440fd6d64892b8cbb53a4ff38c2 | 2026-01-04T20:23:55.000424Z | false |
redox-os/games | https://github.com/redox-os/games/blob/80349c4fc60b0440fd6d64892b8cbb53a4ff38c2/src/minesweeper/main.rs | src/minesweeper/main.rs | //! This crate is a simple implementation of minesweeper. It is carefully documented to encourage
//! newbies to add new games to the repository.
extern crate termion;
extern crate extra;
use termion::{clear, cursor, color, style};
use termion::raw::IntoRawMode;
use termion::input::TermRead;
use termion::event::Key;
... | rust | MIT | 80349c4fc60b0440fd6d64892b8cbb53a4ff38c2 | 2026-01-04T20:23:55.000424Z | false |
redox-os/games | https://github.com/redox-os/games/blob/80349c4fc60b0440fd6d64892b8cbb53a4ff38c2/src/h4xx3r/main.rs | src/h4xx3r/main.rs | extern crate termion;
use termion::{clear, color, cursor, style};
use termion::raw::IntoRawMode;
use std::io::{self, Read, Write};
const SPEED: usize = 7;
const GUI_INTERFACE_IN_VISUAL_BASIC: &'static [u8] = br#"
U mad bro? Write a GUI interface in visual basic. C-D to exit. l33t h4xx3r.
#![crate_name="kernel"]
#![... | rust | MIT | 80349c4fc60b0440fd6d64892b8cbb53a4ff38c2 | 2026-01-04T20:23:55.000424Z | false |
redox-os/games | https://github.com/redox-os/games/blob/80349c4fc60b0440fd6d64892b8cbb53a4ff38c2/src/dem/main.rs | src/dem/main.rs | #[macro_use]
extern crate extra;
use extra::io::WriteExt;
use std::collections::HashMap;
use std::io::{self, BufRead, BufReader, Write};
use std::mem;
/// The number of factors.
const FACTORS: usize = 7;
/// Construct a dependency in a struct-like manner.
macro_rules! dep {
{
gdp: $gdp:expr,
agb... | rust | MIT | 80349c4fc60b0440fd6d64892b8cbb53a4ff38c2 | 2026-01-04T20:23:55.000424Z | false |
redox-os/games | https://github.com/redox-os/games/blob/80349c4fc60b0440fd6d64892b8cbb53a4ff38c2/src/ice/main.rs | src/ice/main.rs | extern crate termion;
use termion::{clear, cursor, style};
use termion::raw::{IntoRawMode, RawTerminal};
use std::io::{self, Write, Read};
use std::thread;
use std::time;
const MAP_1: &'static [u8] = include_bytes!("map1.txt");
const MAP_2: &'static [u8] = include_bytes!("map2.txt");
const MAP_3: &'static [u8] = incl... | rust | MIT | 80349c4fc60b0440fd6d64892b8cbb53a4ff38c2 | 2026-01-04T20:23:55.000424Z | false |
redox-os/games | https://github.com/redox-os/games/blob/80349c4fc60b0440fd6d64892b8cbb53a4ff38c2/src/flappy/main.rs | src/flappy/main.rs | /// TODO:
/// * Randomly generated walls
/// * User-defined width and height
/// * Tune speed, walls for better gameplay
extern crate termion;
use termion::{async_stdin, clear, cursor, style};
use termion::raw::{IntoRawMode, RawTerminal};
use std::collections::VecDeque;
use std::io::{self, Write, Read};
use std::thre... | rust | MIT | 80349c4fc60b0440fd6d64892b8cbb53a4ff38c2 | 2026-01-04T20:23:55.000424Z | false |
redox-os/games | https://github.com/redox-os/games/blob/80349c4fc60b0440fd6d64892b8cbb53a4ff38c2/src/redoku/main.rs | src/redoku/main.rs | extern crate termion;
extern crate extra;
use termion::{clear, color, cursor, style};
use termion::raw::{IntoRawMode, RawTerminal};
use std::io::{self, Write, Read};
use extra::rand::Randomizer;
use std::collections::HashSet;
use std::env;
fn main() {
let stdin = io::stdin();
let stdout = io::stdout();
l... | rust | MIT | 80349c4fc60b0440fd6d64892b8cbb53a4ff38c2 | 2026-01-04T20:23:55.000424Z | false |
denoland/deno_task_shell | https://github.com/denoland/deno_task_shell/blob/fce58e23a8493c054101a214af58c2cf0c80f0ad/src/lib.rs | src/lib.rs | // Copyright 2018-2025 the Deno authors. MIT license.
#![deny(clippy::print_stderr)]
#![deny(clippy::print_stdout)]
#![deny(clippy::unused_async)]
pub mod parser;
#[cfg(feature = "shell")]
mod shell;
#[cfg(feature = "shell")]
pub use shell::*;
| rust | MIT | fce58e23a8493c054101a214af58c2cf0c80f0ad | 2026-01-04T20:23:51.638081Z | false |
denoland/deno_task_shell | https://github.com/denoland/deno_task_shell/blob/fce58e23a8493c054101a214af58c2cf0c80f0ad/src/parser.rs | src/parser.rs | // Copyright 2018-2025 the Deno authors. MIT license.
use anyhow::Result;
use anyhow::bail;
use monch::*;
// Shell grammar rules this is loosely based on:
// https://pubs.opengroup.org/onlinepubs/009604499/utilities/xcu_chap02.html#tag_02_10_02
#[cfg_attr(feature = "serialization", derive(serde::Serialize))]
#[cfg_a... | rust | MIT | fce58e23a8493c054101a214af58c2cf0c80f0ad | 2026-01-04T20:23:51.638081Z | true |
denoland/deno_task_shell | https://github.com/denoland/deno_task_shell/blob/fce58e23a8493c054101a214af58c2cf0c80f0ad/src/shell/fs_util.rs | src/shell/fs_util.rs | // Copyright 2018-2025 the Deno authors. MIT license.
use std::path::Path;
use std::path::PathBuf;
use anyhow::Result;
/// Similar to `std::fs::canonicalize()` but strips UNC prefixes on Windows.
pub fn canonicalize_path(path: &Path) -> Result<PathBuf> {
Ok(deno_path_util::strip_unc_prefix(path.canonicalize()?))
}... | rust | MIT | fce58e23a8493c054101a214af58c2cf0c80f0ad | 2026-01-04T20:23:51.638081Z | false |
denoland/deno_task_shell | https://github.com/denoland/deno_task_shell/blob/fce58e23a8493c054101a214af58c2cf0c80f0ad/src/shell/child_process_tracker.rs | src/shell/child_process_tracker.rs | use std::rc::Rc;
use anyhow::Result;
use tokio::process::Child;
/// Windows does not have a concept of parent processes and so
/// killing the deno task process will not also kill any spawned
/// processes by default. To make this work, we can use winapi's
/// jobs api, which allows for associating a main process so... | rust | MIT | fce58e23a8493c054101a214af58c2cf0c80f0ad | 2026-01-04T20:23:51.638081Z | false |
denoland/deno_task_shell | https://github.com/denoland/deno_task_shell/blob/fce58e23a8493c054101a214af58c2cf0c80f0ad/src/shell/command.rs | src/shell/command.rs | // Copyright 2018-2025 the Deno authors. MIT license.
use std::borrow::Cow;
use std::ffi::OsString;
use std::io::BufRead;
use std::io::BufReader;
use std::io::Read;
use std::path::Path;
use std::path::PathBuf;
use crate::ExecutableCommand;
use crate::ExecuteResult;
use crate::FutureExecuteResult;
use crate::ShellComm... | rust | MIT | fce58e23a8493c054101a214af58c2cf0c80f0ad | 2026-01-04T20:23:51.638081Z | false |
denoland/deno_task_shell | https://github.com/denoland/deno_task_shell/blob/fce58e23a8493c054101a214af58c2cf0c80f0ad/src/shell/execute.rs | src/shell/execute.rs | // Copyright 2018-2025 the Deno authors. MIT license.
use std::collections::HashMap;
use std::ffi::OsStr;
use std::ffi::OsString;
use std::path::Path;
use std::path::PathBuf;
use std::rc::Rc;
use std::string::FromUtf8Error;
use futures::FutureExt;
use futures::future;
use futures::future::LocalBoxFuture;
use thiserro... | rust | MIT | fce58e23a8493c054101a214af58c2cf0c80f0ad | 2026-01-04T20:23:51.638081Z | true |
denoland/deno_task_shell | https://github.com/denoland/deno_task_shell/blob/fce58e23a8493c054101a214af58c2cf0c80f0ad/src/shell/which.rs | src/shell/which.rs | // Copyright 2018-2025 the Deno authors. MIT license.
use std::borrow::Cow;
use std::ffi::OsStr;
use std::ffi::OsString;
use std::path::Path;
use std::path::PathBuf;
use thiserror::Error;
use super::ShellState;
/// Error when a command path could not be resolved.
#[derive(Error, Debug, PartialEq)]
pub enum CommandP... | rust | MIT | fce58e23a8493c054101a214af58c2cf0c80f0ad | 2026-01-04T20:23:51.638081Z | false |
denoland/deno_task_shell | https://github.com/denoland/deno_task_shell/blob/fce58e23a8493c054101a214af58c2cf0c80f0ad/src/shell/types.rs | src/shell/types.rs | // Copyright 2018-2025 the Deno authors. MIT license.
use std::borrow::Cow;
use std::cell::Cell;
use std::cell::RefCell;
use std::collections::HashMap;
use std::ffi::OsStr;
use std::ffi::OsString;
use std::io::Read;
use std::io::Write;
use std::path::Path;
use std::path::PathBuf;
use std::rc::Rc;
use std::rc::Weak;
u... | rust | MIT | fce58e23a8493c054101a214af58c2cf0c80f0ad | 2026-01-04T20:23:51.638081Z | false |
denoland/deno_task_shell | https://github.com/denoland/deno_task_shell/blob/fce58e23a8493c054101a214af58c2cf0c80f0ad/src/shell/mod.rs | src/shell/mod.rs | // Copyright 2018-2025 the Deno authors. MIT license.
pub use commands::ExecutableCommand;
pub use commands::ExecuteCommandArgsContext;
pub use commands::ShellCommand;
pub use commands::ShellCommandContext;
pub use execute::execute;
pub use execute::execute_with_pipes;
pub use types::EnvChange;
pub use types::ExecuteR... | rust | MIT | fce58e23a8493c054101a214af58c2cf0c80f0ad | 2026-01-04T20:23:51.638081Z | false |
denoland/deno_task_shell | https://github.com/denoland/deno_task_shell/blob/fce58e23a8493c054101a214af58c2cf0c80f0ad/src/shell/commands/mkdir.rs | src/shell/commands/mkdir.rs | // Copyright 2018-2025 the Deno authors. MIT license.
use anyhow::Result;
use anyhow::bail;
use futures::FutureExt;
use futures::future::LocalBoxFuture;
use std::ffi::OsStr;
use std::ffi::OsString;
use std::path::Path;
use crate::shell::types::ExecuteResult;
use crate::shell::types::ShellPipeWriter;
use super::Shell... | rust | MIT | fce58e23a8493c054101a214af58c2cf0c80f0ad | 2026-01-04T20:23:51.638081Z | false |
denoland/deno_task_shell | https://github.com/denoland/deno_task_shell/blob/fce58e23a8493c054101a214af58c2cf0c80f0ad/src/shell/commands/cd.rs | src/shell/commands/cd.rs | // Copyright 2018-2025 the Deno authors. MIT license.
use std::ffi::OsStr;
use std::ffi::OsString;
use std::path::Path;
use std::path::PathBuf;
use anyhow::Result;
use anyhow::bail;
use futures::future::LocalBoxFuture;
use path_dedot::ParseDot;
use crate::shell::fs_util;
use crate::shell::types::EnvChange;
use crate... | rust | MIT | fce58e23a8493c054101a214af58c2cf0c80f0ad | 2026-01-04T20:23:51.638081Z | false |
denoland/deno_task_shell | https://github.com/denoland/deno_task_shell/blob/fce58e23a8493c054101a214af58c2cf0c80f0ad/src/shell/commands/rm.rs | src/shell/commands/rm.rs | // Copyright 2018-2025 the Deno authors. MIT license.
use anyhow::Result;
use anyhow::bail;
use futures::FutureExt;
use futures::future::LocalBoxFuture;
use std::ffi::OsStr;
use std::ffi::OsString;
use std::io::ErrorKind;
use std::path::Path;
use crate::shell::types::ExecuteResult;
use crate::shell::types::ShellPipeW... | rust | MIT | fce58e23a8493c054101a214af58c2cf0c80f0ad | 2026-01-04T20:23:51.638081Z | false |
denoland/deno_task_shell | https://github.com/denoland/deno_task_shell/blob/fce58e23a8493c054101a214af58c2cf0c80f0ad/src/shell/commands/executable.rs | src/shell/commands/executable.rs | // Copyright 2018-2025 the Deno authors. MIT license.
use std::path::PathBuf;
use crate::ExecuteResult;
use crate::FutureExecuteResult;
use crate::ShellCommand;
use crate::ShellCommandContext;
use futures::FutureExt;
/// Command that resolves the command name and
/// executes it in a separate process.
pub struct Exe... | rust | MIT | fce58e23a8493c054101a214af58c2cf0c80f0ad | 2026-01-04T20:23:51.638081Z | false |
denoland/deno_task_shell | https://github.com/denoland/deno_task_shell/blob/fce58e23a8493c054101a214af58c2cf0c80f0ad/src/shell/commands/args.rs | src/shell/commands/args.rs | // Copyright 2018-2025 the Deno authors. MIT license.
use std::ffi::OsStr;
use std::ffi::OsString;
use anyhow::Result;
use anyhow::bail;
#[derive(Debug, PartialEq, Eq)]
pub enum ArgKind<'a> {
ShortFlag(char),
LongFlag(&'a str),
Arg(&'a OsStr),
}
impl ArgKind<'_> {
pub fn bail_unsupported(&self) -> Result<()... | rust | MIT | fce58e23a8493c054101a214af58c2cf0c80f0ad | 2026-01-04T20:23:51.638081Z | false |
denoland/deno_task_shell | https://github.com/denoland/deno_task_shell/blob/fce58e23a8493c054101a214af58c2cf0c80f0ad/src/shell/commands/sleep.rs | src/shell/commands/sleep.rs | // Copyright 2018-2025 the Deno authors. MIT license.
use std::ffi::OsString;
use std::time::Duration;
use anyhow::Result;
use anyhow::bail;
use futures::FutureExt;
use futures::future::LocalBoxFuture;
use crate::shell::types::ExecuteResult;
use crate::shell::types::ShellPipeWriter;
use super::ShellCommand;
use sup... | rust | MIT | fce58e23a8493c054101a214af58c2cf0c80f0ad | 2026-01-04T20:23:51.638081Z | false |
denoland/deno_task_shell | https://github.com/denoland/deno_task_shell/blob/fce58e23a8493c054101a214af58c2cf0c80f0ad/src/shell/commands/echo.rs | src/shell/commands/echo.rs | // Copyright 2018-2025 the Deno authors. MIT license.
use futures::future::LocalBoxFuture;
use crate::shell::types::ExecuteResult;
use super::ShellCommand;
use super::ShellCommandContext;
pub struct EchoCommand;
impl ShellCommand for EchoCommand {
fn execute(
&self,
mut context: ShellCommandContext,
) ... | rust | MIT | fce58e23a8493c054101a214af58c2cf0c80f0ad | 2026-01-04T20:23:51.638081Z | false |
denoland/deno_task_shell | https://github.com/denoland/deno_task_shell/blob/fce58e23a8493c054101a214af58c2cf0c80f0ad/src/shell/commands/pwd.rs | src/shell/commands/pwd.rs | // Copyright 2018-2025 the Deno authors. MIT license.
use anyhow::Context;
use anyhow::Result;
use futures::future::LocalBoxFuture;
use std::ffi::OsString;
use std::path::Path;
use crate::shell::fs_util;
use crate::shell::types::ExecuteResult;
use super::ShellCommand;
use super::ShellCommandContext;
use super::args:... | rust | MIT | fce58e23a8493c054101a214af58c2cf0c80f0ad | 2026-01-04T20:23:51.638081Z | false |
denoland/deno_task_shell | https://github.com/denoland/deno_task_shell/blob/fce58e23a8493c054101a214af58c2cf0c80f0ad/src/shell/commands/xargs.rs | src/shell/commands/xargs.rs | // Copyright 2018-2025 the Deno authors. MIT license.
use std::ffi::OsString;
use anyhow::Result;
use anyhow::bail;
use futures::FutureExt;
use futures::future::LocalBoxFuture;
use crate::ExecuteCommandArgsContext;
use crate::shell::types::ExecuteResult;
use crate::shell::types::ShellPipeReader;
use super::ShellCom... | rust | MIT | fce58e23a8493c054101a214af58c2cf0c80f0ad | 2026-01-04T20:23:51.638081Z | false |
denoland/deno_task_shell | https://github.com/denoland/deno_task_shell/blob/fce58e23a8493c054101a214af58c2cf0c80f0ad/src/shell/commands/mod.rs | src/shell/commands/mod.rs | // Copyright 2018-2025 the Deno authors. MIT license.
mod args;
mod cat;
mod cd;
mod cp_mv;
mod echo;
mod executable;
mod exit;
mod export;
mod head;
mod mkdir;
mod pwd;
mod rm;
mod sleep;
mod unset;
mod xargs;
use std::collections::HashMap;
use std::ffi::OsString;
use std::rc::Rc;
use futures::future::LocalBoxFutur... | rust | MIT | fce58e23a8493c054101a214af58c2cf0c80f0ad | 2026-01-04T20:23:51.638081Z | false |
denoland/deno_task_shell | https://github.com/denoland/deno_task_shell/blob/fce58e23a8493c054101a214af58c2cf0c80f0ad/src/shell/commands/head.rs | src/shell/commands/head.rs | // Copyright 2018-2025 the Deno authors. MIT license.
use std::ffi::OsStr;
use std::ffi::OsString;
use std::fs::File;
use std::io::Read;
use anyhow::Result;
use anyhow::bail;
use futures::future::LocalBoxFuture;
use crate::ExecuteResult;
use crate::ShellCommand;
use crate::ShellCommandContext;
use crate::ShellPipeWr... | rust | MIT | fce58e23a8493c054101a214af58c2cf0c80f0ad | 2026-01-04T20:23:51.638081Z | false |
denoland/deno_task_shell | https://github.com/denoland/deno_task_shell/blob/fce58e23a8493c054101a214af58c2cf0c80f0ad/src/shell/commands/unset.rs | src/shell/commands/unset.rs | // Copyright 2018-2025 the Deno authors. MIT license.
use std::ffi::OsString;
use anyhow::Result;
use anyhow::bail;
use futures::future::LocalBoxFuture;
use crate::EnvChange;
use crate::shell::types::ExecuteResult;
use super::ShellCommand;
use super::ShellCommandContext;
pub struct UnsetCommand;
impl ShellCommand... | rust | MIT | fce58e23a8493c054101a214af58c2cf0c80f0ad | 2026-01-04T20:23:51.638081Z | false |
denoland/deno_task_shell | https://github.com/denoland/deno_task_shell/blob/fce58e23a8493c054101a214af58c2cf0c80f0ad/src/shell/commands/export.rs | src/shell/commands/export.rs | // Copyright 2018-2025 the Deno authors. MIT license.
use futures::future::LocalBoxFuture;
use crate::shell::types::EnvChange;
use crate::shell::types::ExecuteResult;
use super::ShellCommand;
use super::ShellCommandContext;
pub struct ExportCommand;
impl ShellCommand for ExportCommand {
fn execute(
&self,
... | rust | MIT | fce58e23a8493c054101a214af58c2cf0c80f0ad | 2026-01-04T20:23:51.638081Z | false |
denoland/deno_task_shell | https://github.com/denoland/deno_task_shell/blob/fce58e23a8493c054101a214af58c2cf0c80f0ad/src/shell/commands/exit.rs | src/shell/commands/exit.rs | // Copyright 2018-2025 the Deno authors. MIT license.
use std::ffi::OsString;
use anyhow::Result;
use anyhow::bail;
use futures::future::LocalBoxFuture;
use crate::shell::types::ExecuteResult;
use super::ShellCommand;
use super::ShellCommandContext;
use super::args::ArgKind;
use super::args::parse_arg_kinds;
pub s... | rust | MIT | fce58e23a8493c054101a214af58c2cf0c80f0ad | 2026-01-04T20:23:51.638081Z | false |
denoland/deno_task_shell | https://github.com/denoland/deno_task_shell/blob/fce58e23a8493c054101a214af58c2cf0c80f0ad/src/shell/commands/cat.rs | src/shell/commands/cat.rs | // Copyright 2018-2025 the Deno authors. MIT license.
use anyhow::Result;
use futures::future::LocalBoxFuture;
use std::ffi::OsString;
use std::fs::File;
use std::io::Read;
use crate::shell::types::ExecuteResult;
use super::ShellCommand;
use super::ShellCommandContext;
use super::args::ArgKind;
use super::args::pars... | rust | MIT | fce58e23a8493c054101a214af58c2cf0c80f0ad | 2026-01-04T20:23:51.638081Z | false |
denoland/deno_task_shell | https://github.com/denoland/deno_task_shell/blob/fce58e23a8493c054101a214af58c2cf0c80f0ad/src/shell/commands/cp_mv.rs | src/shell/commands/cp_mv.rs | // Copyright 2018-2025 the Deno authors. MIT license.
use std::ffi::OsStr;
use std::ffi::OsString;
use std::path::Path;
use std::path::PathBuf;
use anyhow::Context;
use anyhow::Result;
use anyhow::bail;
use futures::FutureExt;
use futures::future::BoxFuture;
use futures::future::LocalBoxFuture;
use crate::shell::typ... | rust | MIT | fce58e23a8493c054101a214af58c2cf0c80f0ad | 2026-01-04T20:23:51.638081Z | false |
denoland/deno_task_shell | https://github.com/denoland/deno_task_shell/blob/fce58e23a8493c054101a214af58c2cf0c80f0ad/tests/integration_test.rs | tests/integration_test.rs | // Copyright 2018-2025 the Deno authors. MIT license.
use std::time::Duration;
use std::time::Instant;
use deno_task_shell::ExecuteResult;
use deno_task_shell::KillSignal;
use deno_task_shell::SignalKind;
use futures::FutureExt;
use self::test_builder::TestBuilder;
mod test_builder;
const FOLDER_SEPERATOR: char = ... | rust | MIT | fce58e23a8493c054101a214af58c2cf0c80f0ad | 2026-01-04T20:23:51.638081Z | true |
denoland/deno_task_shell | https://github.com/denoland/deno_task_shell/blob/fce58e23a8493c054101a214af58c2cf0c80f0ad/tests/test_builder.rs | tests/test_builder.rs | // Copyright 2018-2025 the Deno authors. MIT license.
use std::collections::HashMap;
use std::ffi::OsString;
use std::fs;
use std::path::Path;
use std::path::PathBuf;
use std::rc::Rc;
use anyhow::Context;
use deno_task_shell::KillSignal;
use deno_task_shell::ShellCommand;
use deno_task_shell::ShellCommandContext;
use... | rust | MIT | fce58e23a8493c054101a214af58c2cf0c80f0ad | 2026-01-04T20:23:51.638081Z | false |
lilyball/rust-lua | https://github.com/lilyball/rust-lua/blob/2233b2444930a31c8448bf34fe3fbd33d2fea524/build.rs | build.rs | use std::process::{Command,Stdio};
fn main() {
let mut cmd = Command::new("make");
cmd.arg("cargo-prep");
println!("running: {:?}", cmd);
assert!(cmd.stdin(Stdio::null())
.status()
.unwrap()
.success());
}
| rust | MIT | 2233b2444930a31c8448bf34fe3fbd33d2fea524 | 2026-01-04T20:23:56.240447Z | false |
lilyball/rust-lua | https://github.com/lilyball/rust-lua/blob/2233b2444930a31c8448bf34fe3fbd33d2fea524/src/lualib.rs | src/lualib.rs | pub mod raw {
use libc::c_int;
use raw::lua_State;
pub const LUA_COLIBNAME: &'static str = "coroutine";
pub const LUA_TABLIBNAME: &'static str = "table";
pub const LUA_IOLIBNAME: &'static str = "io";
pub const LUA_OSLIBNAME: &'static str = "os";
pub const LUA_STRLIBNAME: &'static str = "str... | rust | MIT | 2233b2444930a31c8448bf34fe3fbd33d2fea524 | 2026-01-04T20:23:56.240447Z | false |
lilyball/rust-lua | https://github.com/lilyball/rust-lua/blob/2233b2444930a31c8448bf34fe3fbd33d2fea524/src/lib.rs | src/lib.rs | //! Lua 5.1 bindings for Rust
#![crate_name = "lua"]
#![crate_type = "rlib"]
#![warn(missing_docs)]
#![allow(non_snake_case)]
#![allow(trivial_numeric_casts)] // FIXME: rust-lang/rfcs#1020
extern crate libc;
use libc::c_int;
use std::{fmt, mem, ptr, str, slice};
use std::ffi::{CStr, CString};
use std::marker;
use ... | rust | MIT | 2233b2444930a31c8448bf34fe3fbd33d2fea524 | 2026-01-04T20:23:56.240447Z | true |
lilyball/rust-lua | https://github.com/lilyball/rust-lua/blob/2233b2444930a31c8448bf34fe3fbd33d2fea524/src/tests.rs | src/tests.rs | use State;
use GLOBALSINDEX;
use Type;
use raw;
use libc;
use std::thread;
#[test]
fn test_state_init() {
let mut _s = State::new();
}
#[test]
#[should_panic]
fn test_error() {
let mut s = State::new();
s.pushinteger(42);
s.error()
}
#[test]
fn test_errorstr() {
let res = thread::spawn(|| {
... | rust | MIT | 2233b2444930a31c8448bf34fe3fbd33d2fea524 | 2026-01-04T20:23:56.240447Z | false |
lilyball/rust-lua | https://github.com/lilyball/rust-lua/blob/2233b2444930a31c8448bf34fe3fbd33d2fea524/src/aux_.rs | src/aux_.rs | //! Lua Auxilliary Library
pub mod raw {
use libc;
use libc::c_int;
use std::ptr;
use raw;
use raw::{lua_State, lua_CFunction, lua_Number, lua_Integer};
use raw::{MULTRET, LUA_REGISTRYINDEX, LUA_ERRERR};
use config;
// don't bother defining luaL_getn and luaL_setn. They're obsolete fu... | rust | MIT | 2233b2444930a31c8448bf34fe3fbd33d2fea524 | 2026-01-04T20:23:56.240447Z | false |
lilyball/rust-lua | https://github.com/lilyball/rust-lua/blob/2233b2444930a31c8448bf34fe3fbd33d2fea524/src/macro.rs | src/macro.rs | /// Macro for defining Lua CFunctions
#[macro_export]
macro_rules! lua_extern {
($(unsafe fn $name:ident($arg:ident: &mut $typ:ty) -> i32 $code:block)+) => (
$(
unsafe extern "C" fn $name($arg: *mut ::lua::raw::lua_State) -> ::libc::c_int {
let mut $arg = ::lua::ExternState::fro... | rust | MIT | 2233b2444930a31c8448bf34fe3fbd33d2fea524 | 2026-01-04T20:23:56.240447Z | false |
lilyball/rust-lua | https://github.com/lilyball/rust-lua/blob/2233b2444930a31c8448bf34fe3fbd33d2fea524/src/raw.rs | src/raw.rs | #![allow(non_camel_case_types)]
use config;
use std::{default, ptr};
use libc;
use libc::c_int;
/// Type of numbers in Lua.
pub type lua_Number = config::LUA_NUMBER;
/// Type for integer functions
pub type lua_Integer = config::LUA_INTEGER;
pub const MULTRET: c_int = -1;
pub const LUA_REGISTRYINDEX: c_int = -10000... | rust | MIT | 2233b2444930a31c8448bf34fe3fbd33d2fea524 | 2026-01-04T20:23:56.240447Z | false |
lilyball/rust-lua | https://github.com/lilyball/rust-lua/blob/2233b2444930a31c8448bf34fe3fbd33d2fea524/src/rawtests.rs | src/rawtests.rs | use libc;
use std::ptr;
use std::ffi::CString;
use raw;
use aux;
// implement the same function that luaL_newstate uses, so we can test lua_newstate directly
// FIXME (#10025): We can't define this as `unsafe extern "C"`
unsafe extern "C" fn alloc_helper(_ud: *mut libc::c_void, ptr: *mut libc::c_void,
... | rust | MIT | 2233b2444930a31c8448bf34fe3fbd33d2fea524 | 2026-01-04T20:23:56.240447Z | false |
lilyball/rust-lua | https://github.com/lilyball/rust-lua/blob/2233b2444930a31c8448bf34fe3fbd33d2fea524/examples/sine.rs | examples/sine.rs | #![allow(non_snake_case)]
#![allow(trivial_numeric_casts)] // FIXME: rust-lang/rfcs#1020
#[macro_use]
extern crate lua;
extern crate libc;
use std::io;
use std::io::prelude::*;
pub fn repl(L: &mut lua::State) {
let stdin = io::stdin();
let mut stdout = io::stdout();
let mut stderr = io::stderr();
let... | rust | MIT | 2233b2444930a31c8448bf34fe3fbd33d2fea524 | 2026-01-04T20:23:56.240447Z | false |
lilyball/rust-lua | https://github.com/lilyball/rust-lua/blob/2233b2444930a31c8448bf34fe3fbd33d2fea524/examples/table.rs | examples/table.rs | // Sample code that shows how to traverse a table.
// We'll use it to traverse the global table
#![allow(non_snake_case)]
extern crate lua;
fn main() {
let mut L = lua::State::new();
L.open_base();
L.pushnil(); // push the first key
while L.next(lua::GLOBALSINDEX) {
println!("{} - {}", L.desc... | rust | MIT | 2233b2444930a31c8448bf34fe3fbd33d2fea524 | 2026-01-04T20:23:56.240447Z | false |
lilyball/rust-lua | https://github.com/lilyball/rust-lua/blob/2233b2444930a31c8448bf34fe3fbd33d2fea524/examples/simpleapi.rs | examples/simpleapi.rs | // Simple API example, ported from http://lua-users.org/wiki/SimpleLuaApiExample
// This is a simple introductory example of how to interface to Lua from Rust.
// The Rust program loads a Lua script file, sets some Lua variables, runs the
// Lua script, and reads back the return value.
#![allow(non_snake_case)]
exte... | rust | MIT | 2233b2444930a31c8448bf34fe3fbd33d2fea524 | 2026-01-04T20:23:56.240447Z | false |
lilyball/rust-lua | https://github.com/lilyball/rust-lua/blob/2233b2444930a31c8448bf34fe3fbd33d2fea524/examples/simple.rs | examples/simple.rs | #![allow(non_snake_case)]
extern crate lua;
fn main() {
let mut L = lua::State::new();
L.openlibs();
match L.loadfile(None) {
Ok(()) => (),
Err(lua::LoadFileError::ErrSyntax) => panic!("syntax error"),
Err(lua::LoadFileError::ErrMem) => panic!("memory allocation error"),
Er... | rust | MIT | 2233b2444930a31c8448bf34fe3fbd33d2fea524 | 2026-01-04T20:23:56.240447Z | false |
JannikSt/ibtop | https://github.com/JannikSt/ibtop/blob/cb929697eadff95fb6120f401429fdec05c08b82/src/simulation.rs | src/simulation.rs | //! Sophisticated traffic simulation for demo and testing
//!
//! Generates realistic `InfiniBand` traffic patterns including:
//! - Burst patterns (MPI collective operations)
//! - Steady streaming (RDMA transfers)
//! - Wave patterns (periodic workloads)
//! - Idle with occasional spikes (interactive)
//! - Congestio... | rust | Apache-2.0 | cb929697eadff95fb6120f401429fdec05c08b82 | 2026-01-04T20:23:53.094428Z | false |
JannikSt/ibtop | https://github.com/JannikSt/ibtop/blob/cb929697eadff95fb6120f401429fdec05c08b82/src/types.rs | src/types.rs | use serde::{Deserialize, Serialize};
use std::fmt::Display;
use std::str::FromStr;
#[derive(Debug, Serialize, Deserialize)]
pub(crate) struct IbtopOutput {
pub(crate) hostname: String,
pub(crate) adapters: Vec<AdapterInfo>,
}
#[derive(Debug, Clone, Copy, PartialEq, Eq, Default, Serialize, Deserialize)]
pub(cr... | rust | Apache-2.0 | cb929697eadff95fb6120f401429fdec05c08b82 | 2026-01-04T20:23:53.094428Z | false |
JannikSt/ibtop | https://github.com/JannikSt/ibtop/blob/cb929697eadff95fb6120f401429fdec05c08b82/src/history.rs | src/history.rs | //! Historical data storage with configurable time windows
//!
//! Provides ring buffer storage for time-series metrics data,
//! enabling sparklines and charts in the TUI.
#![allow(dead_code)] // Many methods are for future use or testing
#![allow(clippy::cast_precision_loss)] // Acceptable for metrics
#![allow(clipp... | rust | Apache-2.0 | cb929697eadff95fb6120f401429fdec05c08b82 | 2026-01-04T20:23:53.094428Z | false |
JannikSt/ibtop | https://github.com/JannikSt/ibtop/blob/cb929697eadff95fb6120f401429fdec05c08b82/src/ui.rs | src/ui.rs | //! Enhanced TUI with real-time charts and sparklines
//!
//! Provides a visually stunning interface with:
//! - Sparklines in the main table view
//! - Expandable detail view with full throughput charts
//! - Color-coded status indicators
//! - Smooth visual transitions
#![allow(clippy::cast_precision_loss)] // Accep... | rust | Apache-2.0 | cb929697eadff95fb6120f401429fdec05c08b82 | 2026-01-04T20:23:53.094428Z | false |
JannikSt/ibtop | https://github.com/JannikSt/ibtop/blob/cb929697eadff95fb6120f401429fdec05c08b82/src/main.rs | src/main.rs | mod discovery;
mod history;
mod metrics;
mod simulation;
mod types;
mod ui;
use crossterm::{
event::{self, DisableMouseCapture, EnableMouseCapture, Event, KeyCode, KeyModifiers},
execute,
terminal::{disable_raw_mode, enable_raw_mode, EnterAlternateScreen, LeaveAlternateScreen},
};
use ratatui::{backend::Cr... | rust | Apache-2.0 | cb929697eadff95fb6120f401429fdec05c08b82 | 2026-01-04T20:23:53.094428Z | false |
JannikSt/ibtop | https://github.com/JannikSt/ibtop/blob/cb929697eadff95fb6120f401429fdec05c08b82/src/metrics.rs | src/metrics.rs | use std::collections::HashMap;
use std::time::{Duration, Instant};
use crate::history::HistoryCollector;
use crate::types::{AdapterInfo, PortCounters};
#[derive(Debug, Clone)]
pub struct PortMetrics {
pub rx_bytes_per_sec: f64,
pub tx_bytes_per_sec: f64,
pub rx_packets_per_sec: f64,
pub tx_packets_per... | rust | Apache-2.0 | cb929697eadff95fb6120f401429fdec05c08b82 | 2026-01-04T20:23:53.094428Z | false |
JannikSt/ibtop | https://github.com/JannikSt/ibtop/blob/cb929697eadff95fb6120f401429fdec05c08b82/src/discovery/mod.rs | src/discovery/mod.rs | use crate::types::{AdapterInfo, PortCounters, PortInfo, PortState};
const MLX5_DATA_MULTIPLIER: u64 = 4; // mlx5 reports in 32-bit words
pub(crate) fn discover_adapters() -> Vec<AdapterInfo> {
let mut adapters: Vec<AdapterInfo> = Vec::new();
let path =
std::env::var("INFINIBAND_PATH").unwrap_or_else(... | rust | Apache-2.0 | cb929697eadff95fb6120f401429fdec05c08b82 | 2026-01-04T20:23:53.094428Z | false |
dalek-cryptography/merlin | https://github.com/dalek-cryptography/merlin/blob/53535f32e6d6de421372d67f56176af0c0f55fd7/src/lib.rs | src/lib.rs | #![cfg_attr(not(feature = "std"), no_std)]
#![cfg_attr(feature = "nightly", feature(external_doc))]
#![cfg_attr(feature = "nightly", doc(include = "../README.md"))]
#![doc(html_logo_url = "https://doc.dalek.rs/assets/dalek-logo-clear.png")]
// put this after the #![doc(..)] so it appears as a footer:
//! Note that docs... | rust | MIT | 53535f32e6d6de421372d67f56176af0c0f55fd7 | 2026-01-04T20:23:59.295534Z | false |
dalek-cryptography/merlin | https://github.com/dalek-cryptography/merlin/blob/53535f32e6d6de421372d67f56176af0c0f55fd7/src/strobe.rs | src/strobe.rs | //! Minimal implementation of (parts of) Strobe.
use core::ops::{Deref, DerefMut};
use keccak;
use zeroize::Zeroize;
/// Strobe R value; security level 128 is hardcoded
const STROBE_R: u8 = 166;
const FLAG_I: u8 = 1;
const FLAG_A: u8 = 1 << 1;
const FLAG_C: u8 = 1 << 2;
const FLAG_T: u8 = 1 << 3;
const FLAG_M: u8 =... | rust | MIT | 53535f32e6d6de421372d67f56176af0c0f55fd7 | 2026-01-04T20:23:59.295534Z | false |
dalek-cryptography/merlin | https://github.com/dalek-cryptography/merlin/blob/53535f32e6d6de421372d67f56176af0c0f55fd7/src/constants.rs | src/constants.rs | /// Domain separation label to initialize the STROBE context.
///
/// This is not to be confused with the crate's semver string:
/// the latter applies to the API, while this label defines the protocol.
/// E.g. it is possible that crate 2.0 will have an incompatible API,
/// but implement the same 1.0 protocol.
pub co... | rust | MIT | 53535f32e6d6de421372d67f56176af0c0f55fd7 | 2026-01-04T20:23:59.295534Z | false |
dalek-cryptography/merlin | https://github.com/dalek-cryptography/merlin/blob/53535f32e6d6de421372d67f56176af0c0f55fd7/src/transcript.rs | src/transcript.rs | use rand_core;
use zeroize::Zeroize;
use crate::strobe::Strobe128;
fn encode_u64(x: u64) -> [u8; 8] {
use byteorder::{ByteOrder, LittleEndian};
let mut buf = [0; 8];
LittleEndian::write_u64(&mut buf, x);
buf
}
fn encode_usize_as_u32(x: usize) -> [u8; 4] {
use byteorder::{ByteOrder, LittleEndian}... | rust | MIT | 53535f32e6d6de421372d67f56176af0c0f55fd7 | 2026-01-04T20:23:59.295534Z | false |
alyalin/PraccJS | https://github.com/alyalin/PraccJS/blob/4359cfbd4b360b71987873a3b470db5efd21e93d/src-tauri/build.rs | src-tauri/build.rs | fn main() {
tauri_build::build()
}
| rust | MIT | 4359cfbd4b360b71987873a3b470db5efd21e93d | 2026-01-04T20:23:56.558639Z | false |
alyalin/PraccJS | https://github.com/alyalin/PraccJS/blob/4359cfbd4b360b71987873a3b470db5efd21e93d/src-tauri/src/lib.rs | src-tauri/src/lib.rs | mod ast_replacer;
mod plugins;
mod tab;
use std::sync::mpsc::channel;
use std::sync::mpsc::RecvTimeoutError;
use std::thread;
use std::time::Duration;
use ast_replacer::lib::AstReplacer;
use ast_replacer::utils::transform_to_result;
use oxc_allocator::Allocator;
use oxc_ast::AstBuilder;
use oxc_codegen::{CodeGenerat... | rust | MIT | 4359cfbd4b360b71987873a3b470db5efd21e93d | 2026-01-04T20:23:56.558639Z | false |
alyalin/PraccJS | https://github.com/alyalin/PraccJS/blob/4359cfbd4b360b71987873a3b470db5efd21e93d/src-tauri/src/main.rs | src-tauri/src/main.rs | // Prevents additional console window on Windows in release, DO NOT REMOVE!!
#![cfg_attr(
all(not(debug_assertions), target_os = "windows"),
windows_subsystem = "windows"
)]
fn main() {
pracc_js_lib::run()
}
| rust | MIT | 4359cfbd4b360b71987873a3b470db5efd21e93d | 2026-01-04T20:23:56.558639Z | false |
alyalin/PraccJS | https://github.com/alyalin/PraccJS/blob/4359cfbd4b360b71987873a3b470db5efd21e93d/src-tauri/src/tab.rs | src-tauri/src/tab.rs | use serde::{Deserialize, Serialize};
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct Tab {
pub id: String,
pub name: String,
pub content: String,
pub active: bool,
pub result: String,
pub errors: String,
} | rust | MIT | 4359cfbd4b360b71987873a3b470db5efd21e93d | 2026-01-04T20:23:56.558639Z | false |
alyalin/PraccJS | https://github.com/alyalin/PraccJS/blob/4359cfbd4b360b71987873a3b470db5efd21e93d/src-tauri/src/ast_replacer/lib.rs | src-tauri/src/ast_replacer/lib.rs | use oxc_allocator::{Allocator, Box, CloneIn};
use oxc_ast::{ast::*, visit::walk_mut::*, AstBuilder, VisitMut, NONE};
use oxc_span::SPAN;
use super::utils::get_line_number;
pub struct AstReplacer<'a> {
source_text: String,
ast_builder: AstBuilder<'a>,
allocator: &'a Allocator
}
impl<'a> AstReplacer<'a> {
... | rust | MIT | 4359cfbd4b360b71987873a3b470db5efd21e93d | 2026-01-04T20:23:56.558639Z | false |
alyalin/PraccJS | https://github.com/alyalin/PraccJS/blob/4359cfbd4b360b71987873a3b470db5efd21e93d/src-tauri/src/ast_replacer/utils.rs | src-tauri/src/ast_replacer/utils.rs | use serde_json::Value;
pub fn get_line_number(source_text: &str, offset: usize) -> usize {
// Split by lines and calculate cumulative byte lengths to pinpoint the correct line
let mut cumulative_offset = 0;
for (i, line) in source_text.lines().enumerate() {
cumulative_offset += line.len() + 1; // ... | rust | MIT | 4359cfbd4b360b71987873a3b470db5efd21e93d | 2026-01-04T20:23:56.558639Z | false |
alyalin/PraccJS | https://github.com/alyalin/PraccJS/blob/4359cfbd4b360b71987873a3b470db5efd21e93d/src-tauri/src/ast_replacer/mod.rs | src-tauri/src/ast_replacer/mod.rs | pub mod lib;
pub mod utils; | rust | MIT | 4359cfbd4b360b71987873a3b470db5efd21e93d | 2026-01-04T20:23:56.558639Z | false |
alyalin/PraccJS | https://github.com/alyalin/PraccJS/blob/4359cfbd4b360b71987873a3b470db5efd21e93d/src-tauri/src/plugins/tauri_traffic_light_positioner_plugin.rs | src-tauri/src/plugins/tauri_traffic_light_positioner_plugin.rs | use tauri::{
plugin::{Builder, TauriPlugin},
Runtime,
};
pub fn init<R: Runtime>() -> TauriPlugin<R> {
Builder::new("traffic_light_positioner")
.on_window_ready(|window| {
#[cfg(target_os = "macos")]
osx::setup_traffic_light_positioner(window);
return;
})... | rust | MIT | 4359cfbd4b360b71987873a3b470db5efd21e93d | 2026-01-04T20:23:56.558639Z | false |
alyalin/PraccJS | https://github.com/alyalin/PraccJS/blob/4359cfbd4b360b71987873a3b470db5efd21e93d/src-tauri/src/plugins/mod.rs | src-tauri/src/plugins/mod.rs | pub mod tauri_traffic_light_positioner_plugin; | rust | MIT | 4359cfbd4b360b71987873a3b470db5efd21e93d | 2026-01-04T20:23:56.558639Z | false |
anza-xyz/wincode | https://github.com/anza-xyz/wincode/blob/9f0ffa346d95c31b94486b7bfea724b73330c42f/wincode/build.rs | wincode/build.rs | use std::io::Result;
mod codegen;
fn main() -> Result<()> {
codegen::generate()?;
println!("cargo:rerun-if-changed=codegen/mod.rs");
println!("cargo:rerun-if-changed=codegen/tuple.rs");
println!("cargo:rerun-if-changed=build.rs");
Ok(())
}
| rust | Apache-2.0 | 9f0ffa346d95c31b94486b7bfea724b73330c42f | 2026-01-04T20:24:02.028790Z | false |
anza-xyz/wincode | https://github.com/anza-xyz/wincode/blob/9f0ffa346d95c31b94486b7bfea724b73330c42f/wincode/codegen/tuple.rs | wincode/codegen/tuple.rs | use {
core::str,
proc_macro2::{Ident, Literal, Span},
quote::quote,
std::io::{Result, Write},
};
/// Generate `SchemaWrite` and `SchemaRead` implementations for tuples up to the given arity.
#[allow(clippy::arithmetic_side_effects)]
pub fn generate(arity: usize, mut out: impl Write) -> Result<()> {
... | rust | Apache-2.0 | 9f0ffa346d95c31b94486b7bfea724b73330c42f | 2026-01-04T20:24:02.028790Z | false |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.