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 |
|---|---|---|---|---|---|---|---|---|
ljedrz/lambda_calculus | https://github.com/ljedrz/lambda_calculus/blob/6641e77f18e9f0698f367fa605c444d3d65d0cd5/src/data/result.rs | src/data/result.rs | //! Lambda-encoded [result type](https://doc.rust-lang.org/std/result/enum.Result.html)
use crate::combinators::I;
use crate::data::boolean::{fls, tru};
use crate::data::option::{none, some};
use crate::term::Term::*;
use crate::term::{abs, app, Term};
/// Applied to an argument it consumes it and produces a lambda-e... | rust | CC0-1.0 | 6641e77f18e9f0698f367fa605c444d3d65d0cd5 | 2026-01-04T20:17:59.260758Z | false |
ljedrz/lambda_calculus | https://github.com/ljedrz/lambda_calculus/blob/6641e77f18e9f0698f367fa605c444d3d65d0cd5/src/data/tuple.rs | src/data/tuple.rs | //! [Lambda-encoded `n`-tuple](https://www.mathstat.dal.ca/~selinger/papers/lambdanotes.pdf)
//!
//! This module contains the `tuple` and `pi` macros.
/// A macro for creating lambda-encoded tuples.
///
/// # Example
/// ```
/// # #[macro_use] extern crate lambda_calculus;
/// # fn main() {
/// use lambda_calculus::te... | rust | CC0-1.0 | 6641e77f18e9f0698f367fa605c444d3d65d0cd5 | 2026-01-04T20:17:59.260758Z | false |
ljedrz/lambda_calculus | https://github.com/ljedrz/lambda_calculus/blob/6641e77f18e9f0698f367fa605c444d3d65d0cd5/src/data/option.rs | src/data/option.rs | //! [Lambda-encoded option](https://en.wikipedia.org/wiki/Option_type)
use crate::combinators::I;
use crate::data::boolean::{fls, tru};
use crate::term::Term::*;
use crate::term::{abs, app, Term};
/// Produces a lambda-encoded empty option; equivalent to `boolean::tru`.
///
/// NONE ≡ λns.n ≡ λ λ 2 ≡ TRUE
pub fn none... | rust | CC0-1.0 | 6641e77f18e9f0698f367fa605c444d3d65d0cd5 | 2026-01-04T20:17:59.260758Z | false |
ljedrz/lambda_calculus | https://github.com/ljedrz/lambda_calculus/blob/6641e77f18e9f0698f367fa605c444d3d65d0cd5/src/data/mod.rs | src/data/mod.rs | //! Lambda-encoded data types
pub mod boolean;
pub mod list;
pub mod option;
pub mod pair;
pub mod result;
#[macro_use]
pub mod tuple;
pub mod num;
| rust | CC0-1.0 | 6641e77f18e9f0698f367fa605c444d3d65d0cd5 | 2026-01-04T20:17:59.260758Z | false |
ljedrz/lambda_calculus | https://github.com/ljedrz/lambda_calculus/blob/6641e77f18e9f0698f367fa605c444d3d65d0cd5/src/data/list/convert.rs | src/data/list/convert.rs | //! List encoding conversions
#![allow(missing_docs)]
use crate::data::num::convert::*;
use crate::term::Term::*;
use crate::term::{abs, app, Term};
macro_rules! make_trait {
($trait_name:ident, $function_name:ident) => {
pub trait $trait_name {
#[doc = "Performs the conversion."]
... | rust | CC0-1.0 | 6641e77f18e9f0698f367fa605c444d3d65d0cd5 | 2026-01-04T20:17:59.260758Z | false |
ljedrz/lambda_calculus | https://github.com/ljedrz/lambda_calculus/blob/6641e77f18e9f0698f367fa605c444d3d65d0cd5/src/data/list/church.rs | src/data/list/church.rs | //! [Church right fold list](https://ifl2014.github.io/submissions/ifl2014_submission_13.pdf)
use crate::data::boolean::{fls, tru};
use crate::data::pair::{fst, pair, snd};
use crate::term::Term::*;
use crate::term::{abs, app, Term, UD};
/// Produces a `nil`, the last link of a Church-encoded list; equivalent to `boo... | rust | CC0-1.0 | 6641e77f18e9f0698f367fa605c444d3d65d0cd5 | 2026-01-04T20:17:59.260758Z | false |
ljedrz/lambda_calculus | https://github.com/ljedrz/lambda_calculus/blob/6641e77f18e9f0698f367fa605c444d3d65d0cd5/src/data/list/scott.rs | src/data/list/scott.rs | //! [Scott list](https://ifl2014.github.io/submissions/ifl2014_submission_13.pdf)
use crate::data::boolean::{fls, tru};
use crate::term::Term::*;
use crate::term::{abs, app, Term, UD};
/// Produces a `nil`, the last link of a Scott-encoded list; equivalent to `boolean::tru`.
///
/// NIL ≡ λab.a ≡ λ λ 2 ≡ TRUE
pub fn ... | rust | CC0-1.0 | 6641e77f18e9f0698f367fa605c444d3d65d0cd5 | 2026-01-04T20:17:59.260758Z | false |
ljedrz/lambda_calculus | https://github.com/ljedrz/lambda_calculus/blob/6641e77f18e9f0698f367fa605c444d3d65d0cd5/src/data/list/pair.rs | src/data/list/pair.rs | //! [Single-pair list](https://en.wikipedia.org/wiki/Church_encoding#One_pair_as_a_list_node)
use crate::combinators::{I, Z};
use crate::data::boolean::{fls, tru};
use crate::data::num::church::{is_zero, pred, succ, zero};
use crate::data::pair::{fst, pair, snd};
use crate::term::Term::*;
use crate::term::{abs, app, T... | rust | CC0-1.0 | 6641e77f18e9f0698f367fa605c444d3d65d0cd5 | 2026-01-04T20:17:59.260758Z | false |
ljedrz/lambda_calculus | https://github.com/ljedrz/lambda_calculus/blob/6641e77f18e9f0698f367fa605c444d3d65d0cd5/src/data/list/mod.rs | src/data/list/mod.rs | //! List encodings
pub mod church;
pub mod convert;
pub mod pair;
pub mod parigot;
pub mod scott;
| rust | CC0-1.0 | 6641e77f18e9f0698f367fa605c444d3d65d0cd5 | 2026-01-04T20:17:59.260758Z | false |
ljedrz/lambda_calculus | https://github.com/ljedrz/lambda_calculus/blob/6641e77f18e9f0698f367fa605c444d3d65d0cd5/src/data/list/parigot.rs | src/data/list/parigot.rs | //! [Parigot list](https://ifl2014.github.io/submissions/ifl2014_submission_13.pdf)
use crate::data::boolean::{fls, tru};
use crate::term::Term::*;
use crate::term::{abs, app, Term, UD};
/// Produces a `nil`, the last link of a Parigot-encoded list; equivalent to `boolean::tru`.
///
/// NIL ≡ λab.a ≡ λ λ 2 ≡ TRUE
pub... | rust | CC0-1.0 | 6641e77f18e9f0698f367fa605c444d3d65d0cd5 | 2026-01-04T20:17:59.260758Z | false |
ljedrz/lambda_calculus | https://github.com/ljedrz/lambda_calculus/blob/6641e77f18e9f0698f367fa605c444d3d65d0cd5/src/data/num/convert.rs | src/data/num/convert.rs | //! Numeral encoding conversions
#![allow(missing_docs)]
use self::Encoding::*;
use crate::term::Term::*;
use crate::term::{abs, app, Term};
/// The type of numeric encoding.
#[derive(Debug, Clone, Copy)]
pub enum Encoding {
Church,
Scott,
Parigot,
StumpFu,
Binary,
}
macro_rules! make_trait {
... | rust | CC0-1.0 | 6641e77f18e9f0698f367fa605c444d3d65d0cd5 | 2026-01-04T20:17:59.260758Z | false |
ljedrz/lambda_calculus | https://github.com/ljedrz/lambda_calculus/blob/6641e77f18e9f0698f367fa605c444d3d65d0cd5/src/data/num/church.rs | src/data/num/church.rs | //! [Church numerals](https://en.wikipedia.org/wiki/Church_encoding#Church_numerals)
use crate::combinators::{I, K, Z};
use crate::data::boolean::{and, fls, not, or, tru};
use crate::data::num::{parigot, scott, stumpfu};
use crate::data::pair::pair;
use crate::term::Term::*;
use crate::term::{abs, app, Term};
/// Pro... | rust | CC0-1.0 | 6641e77f18e9f0698f367fa605c444d3d65d0cd5 | 2026-01-04T20:17:59.260758Z | false |
ljedrz/lambda_calculus | https://github.com/ljedrz/lambda_calculus/blob/6641e77f18e9f0698f367fa605c444d3d65d0cd5/src/data/num/scott.rs | src/data/num/scott.rs | //! [Scott numerals](http://lucacardelli.name/Papers/Notes/scott2.pdf)
use crate::combinators::Z;
use crate::data::boolean::{fls, tru};
use crate::term::Term::*;
use crate::term::{abs, app, Term};
/// Produces a Scott-encoded number zero; equivalent to `boolean::tru`.
///
/// ZERO ≡ λxy.x ≡ λ λ 2 ≡ TRUE
///
/// # Exa... | rust | CC0-1.0 | 6641e77f18e9f0698f367fa605c444d3d65d0cd5 | 2026-01-04T20:17:59.260758Z | false |
ljedrz/lambda_calculus | https://github.com/ljedrz/lambda_calculus/blob/6641e77f18e9f0698f367fa605c444d3d65d0cd5/src/data/num/mod.rs | src/data/num/mod.rs | //! Numeral encodings
pub mod binary;
pub mod church;
pub mod convert;
pub mod parigot;
pub mod scott;
pub mod signed;
pub mod stumpfu;
| rust | CC0-1.0 | 6641e77f18e9f0698f367fa605c444d3d65d0cd5 | 2026-01-04T20:17:59.260758Z | false |
ljedrz/lambda_calculus | https://github.com/ljedrz/lambda_calculus/blob/6641e77f18e9f0698f367fa605c444d3d65d0cd5/src/data/num/binary.rs | src/data/num/binary.rs | //! [Mogensen's binary number encoding](http://repository.readscheme.org/ftp/papers/topps/D-456.pdf)
use crate::combinators::I;
use crate::data::boolean::{fls, tru};
use crate::data::pair::{fst, pair, snd};
use crate::term::Term::*;
use crate::term::{abs, app, Term};
/// A 0 bit; equivalent to `boolean::tru`.
///
///... | rust | CC0-1.0 | 6641e77f18e9f0698f367fa605c444d3d65d0cd5 | 2026-01-04T20:17:59.260758Z | false |
ljedrz/lambda_calculus | https://github.com/ljedrz/lambda_calculus/blob/6641e77f18e9f0698f367fa605c444d3d65d0cd5/src/data/num/parigot.rs | src/data/num/parigot.rs | //! [Parigot numerals](https://ir.uiowa.edu/cgi/viewcontent.cgi?article=5357&context=etd)
use crate::data::boolean::{fls, tru};
use crate::term::Term::*;
use crate::term::{abs, app, Term};
/// Produces a Parigot-encoded number zero; equivalent to `boolean::fls`.
///
/// ZERO ≡ λsz.z ≡ λ λ 1 ≡ FALSE
///
/// # Example
... | rust | CC0-1.0 | 6641e77f18e9f0698f367fa605c444d3d65d0cd5 | 2026-01-04T20:17:59.260758Z | false |
ljedrz/lambda_calculus | https://github.com/ljedrz/lambda_calculus/blob/6641e77f18e9f0698f367fa605c444d3d65d0cd5/src/data/num/signed.rs | src/data/num/signed.rs | //! [Signed numbers](https://en.wikipedia.org/wiki/Church_encoding#Signed_numbers)
//!
//! The supported `Encoding`s are `Church`, `Scott`, `Parigot` and `StumpFu`.
use crate::combinators::{I, Z};
use crate::data::num::convert::Encoding;
use crate::data::num::convert::Encoding::*;
use crate::data::num::{church, parigo... | rust | CC0-1.0 | 6641e77f18e9f0698f367fa605c444d3d65d0cd5 | 2026-01-04T20:17:59.260758Z | false |
ljedrz/lambda_calculus | https://github.com/ljedrz/lambda_calculus/blob/6641e77f18e9f0698f367fa605c444d3d65d0cd5/src/data/num/stumpfu.rs | src/data/num/stumpfu.rs | //! [Stump-Fu numerals](http://homepage.cs.uiowa.edu/~astump/papers/stump-fu-jfp-2016.pdf)
use crate::data::boolean::{fls, tru};
use crate::data::num::convert::IntoChurchNum;
use crate::data::num::{church, parigot, scott};
use crate::term::Term::*;
use crate::term::{abs, app, Term};
/// Produces a Stump-Fu-encoded nu... | rust | CC0-1.0 | 6641e77f18e9f0698f367fa605c444d3d65d0cd5 | 2026-01-04T20:17:59.260758Z | false |
ljedrz/lambda_calculus | https://github.com/ljedrz/lambda_calculus/blob/6641e77f18e9f0698f367fa605c444d3d65d0cd5/tests/parser.rs | tests/parser.rs | use lambda_calculus::{
parse,
parser::{parse_with_context, ParseError},
term::{
Context,
Notation::{Classic, DeBruijn},
},
};
#[test]
fn parse_debruijn_and_classic() -> Result<(), ParseError> {
for (ctx, dbr, cla) in [
(Context::new(&["a", "b"]), "12", "a b"),
(Conte... | rust | CC0-1.0 | 6641e77f18e9f0698f367fa605c444d3d65d0cd5 | 2026-01-04T20:17:59.260758Z | false |
ljedrz/lambda_calculus | https://github.com/ljedrz/lambda_calculus/blob/6641e77f18e9f0698f367fa605c444d3d65d0cd5/tests/lists.rs | tests/lists.rs | #![cfg(feature = "encoding")]
extern crate lambda_calculus as lambda;
use lambda::data::list::{church, parigot, scott};
use lambda::*;
macro_rules! test_list {
($name:ident, $function:ident, $($($n:expr),+ => $result:expr),+) => (
#[test]
fn $name() {
$(
assert_eq!(
... | rust | CC0-1.0 | 6641e77f18e9f0698f367fa605c444d3d65d0cd5 | 2026-01-04T20:17:59.260758Z | false |
ljedrz/lambda_calculus | https://github.com/ljedrz/lambda_calculus/blob/6641e77f18e9f0698f367fa605c444d3d65d0cd5/tests/pair_list.rs | tests/pair_list.rs | #![cfg(feature = "encoding")]
#![allow(warnings)] // silence unnecessary mutability for empty church vectors
extern crate lambda_calculus as lambda;
use lambda::data::list::pair::*;
use lambda::data::num::church::is_zero;
use lambda::*;
macro_rules! vec_church {
( $( $e:expr ),* ) => {
{
let ... | rust | CC0-1.0 | 6641e77f18e9f0698f367fa605c444d3d65d0cd5 | 2026-01-04T20:17:59.260758Z | false |
ljedrz/lambda_calculus | https://github.com/ljedrz/lambda_calculus/blob/6641e77f18e9f0698f367fa605c444d3d65d0cd5/tests/term_error.rs | tests/term_error.rs | extern crate lambda_calculus as lambda;
use lambda::term::Term;
use std::error::Error;
#[test]
fn term_error_question_mark_operator() {
match using_question_mark_operator() {
Result::Ok(_) => panic!("Should not be Ok"),
Result::Err(e) => assert_eq!(e.to_string(), "the term is not an abstraction"),... | rust | CC0-1.0 | 6641e77f18e9f0698f367fa605c444d3d65d0cd5 | 2026-01-04T20:17:59.260758Z | false |
ljedrz/lambda_calculus | https://github.com/ljedrz/lambda_calculus/blob/6641e77f18e9f0698f367fa605c444d3d65d0cd5/tests/num.rs | tests/num.rs | #![cfg(feature = "encoding")]
extern crate lambda_calculus as lambda;
use lambda::data::num::{binary, church, parigot, scott, stumpfu};
use lambda::*;
macro_rules! test_num {
($encoding:ident, $name:ident, $conversion:ident, $function:ident, $($($n:expr),+ => $result:expr),+) => (
#[test]
fn $nam... | rust | CC0-1.0 | 6641e77f18e9f0698f367fa605c444d3d65d0cd5 | 2026-01-04T20:17:59.260758Z | false |
ljedrz/lambda_calculus | https://github.com/ljedrz/lambda_calculus/blob/6641e77f18e9f0698f367fa605c444d3d65d0cd5/tests/option.rs | tests/option.rs | #![cfg(feature = "encoding")]
extern crate lambda_calculus as lambda;
use lambda::data::num::church::succ;
use lambda::data::option::*;
use lambda::*;
#[test]
fn option_none() {
assert_eq!(beta(none(), HAP, 0), none());
}
#[test]
fn option_some() {
assert_eq!(
beta(app(some(), 3.into_church()), HAP,... | rust | CC0-1.0 | 6641e77f18e9f0698f367fa605c444d3d65d0cd5 | 2026-01-04T20:17:59.260758Z | false |
ljedrz/lambda_calculus | https://github.com/ljedrz/lambda_calculus/blob/6641e77f18e9f0698f367fa605c444d3d65d0cd5/tests/reduction.rs | tests/reduction.rs | extern crate lambda_calculus as lambda;
use lambda::combinators::{I, O};
use lambda::parser::{parse_with_context, ParseError};
use lambda::term::Context;
use lambda::*;
use std::thread;
#[test]
fn reduction_nor() {
let reduces_instantly = parse("(λλ1)((λλλ((32)1))(λλ2))", DeBruijn).unwrap();
assert_eq!(
... | rust | CC0-1.0 | 6641e77f18e9f0698f367fa605c444d3d65d0cd5 | 2026-01-04T20:17:59.260758Z | false |
ljedrz/lambda_calculus | https://github.com/ljedrz/lambda_calculus/blob/6641e77f18e9f0698f367fa605c444d3d65d0cd5/tests/signed.rs | tests/signed.rs | #![cfg(feature = "encoding")]
extern crate lambda_calculus as lambda;
use lambda::data::num::signed::*;
use lambda::*;
#[test]
fn signed_neg() {
assert_eq!(
beta(app(neg(), (-2).into_signed(Church)), NOR, 0),
beta(2.into_signed(Church), NOR, 0)
);
assert_eq!(
beta(app(neg(), (-1).... | rust | CC0-1.0 | 6641e77f18e9f0698f367fa605c444d3d65d0cd5 | 2026-01-04T20:17:59.260758Z | false |
ljedrz/lambda_calculus | https://github.com/ljedrz/lambda_calculus/blob/6641e77f18e9f0698f367fa605c444d3d65d0cd5/tests/parse_error.rs | tests/parse_error.rs | extern crate lambda_calculus as lambda;
use lambda::{parser::parse, term::Notation::Classic};
use std::error::Error;
#[test]
fn parse_error_question_mark_operator() {
match using_question_mark_operator() {
Result::Ok(_) => panic!("Should not be Ok"),
Result::Err(e) => assert_eq!(e.to_string(), "sy... | rust | CC0-1.0 | 6641e77f18e9f0698f367fa605c444d3d65d0cd5 | 2026-01-04T20:17:59.260758Z | false |
sarkahn/bevy_ascii_terminal | https://github.com/sarkahn/bevy_ascii_terminal/blob/fc7ab138659b1ca72f5f912990ed59fa5207b80e/src/tile.rs | src/tile.rs | //! A terminal tile.
use bevy::{
color::{Color, LinearRgba},
reflect::Reflect,
};
#[derive(Debug, Clone, Reflect, Copy, PartialEq)]
pub struct Tile {
pub glyph: char,
pub fg_color: LinearRgba,
pub bg_color: LinearRgba,
}
impl Default for Tile {
fn default() -> Self {
Self {
... | rust | MIT | fc7ab138659b1ca72f5f912990ed59fa5207b80e | 2026-01-04T20:17:59.844168Z | false |
sarkahn/bevy_ascii_terminal | https://github.com/sarkahn/bevy_ascii_terminal/blob/fc7ab138659b1ca72f5f912990ed59fa5207b80e/src/lib.rs | src/lib.rs | pub mod ascii;
pub mod border;
pub mod color;
pub mod padding;
pub mod render;
pub(crate) mod rexpaint;
pub mod string;
pub mod strings;
pub mod terminal;
pub mod tile;
pub mod transform;
pub use ascii::Glyph;
use bevy::{
app::{Plugin, PostUpdate},
prelude::IntoScheduleConfigs,
};
pub use border::TerminalBorde... | rust | MIT | fc7ab138659b1ca72f5f912990ed59fa5207b80e | 2026-01-04T20:17:59.844168Z | false |
sarkahn/bevy_ascii_terminal | https://github.com/sarkahn/bevy_ascii_terminal/blob/fc7ab138659b1ca72f5f912990ed59fa5207b80e/src/string.rs | src/string.rs | // //! Utilities for writing formatted/decorated strings to the terminal
// //! without any extra allocations.
// use std::{ops::Sub, str::Chars};
// use bevy::{color::LinearRgba, math::IVec2, reflect::Reflect};
// use sark_grids::{GridPoint, GridRect, GridSize, Pivot, PivotedPoint};
// use crate::strings::StringFor... | rust | MIT | fc7ab138659b1ca72f5f912990ed59fa5207b80e | 2026-01-04T20:17:59.844168Z | false |
sarkahn/bevy_ascii_terminal | https://github.com/sarkahn/bevy_ascii_terminal/blob/fc7ab138659b1ca72f5f912990ed59fa5207b80e/src/ascii.rs | src/ascii.rs | //! Extended ascii used as the default for mapping chars to terminal glyphs.
//! Note this is simply the default, a custom mapping can be defined via
//! [crate::render::UvMapping]
use enum_ordinalize::Ordinalize;
use thiserror::Error;
#[derive(Error, Debug)]
#[error("Unable to convert from char to terminal glyph")]
p... | rust | MIT | fc7ab138659b1ca72f5f912990ed59fa5207b80e | 2026-01-04T20:17:59.844168Z | false |
sarkahn/bevy_ascii_terminal | https://github.com/sarkahn/bevy_ascii_terminal/blob/fc7ab138659b1ca72f5f912990ed59fa5207b80e/src/transform.rs | src/transform.rs | //! Terminal component for translating between world positions and terminal
//! grid coordinates.
use bevy::{
app::{Plugin, PostUpdate},
asset::{AssetEvent, Assets},
ecs::{
component::Component,
entity::Entity,
message::MessageReader,
query::{Changed, With},
schedule... | rust | MIT | fc7ab138659b1ca72f5f912990ed59fa5207b80e | 2026-01-04T20:17:59.844168Z | false |
sarkahn/bevy_ascii_terminal | https://github.com/sarkahn/bevy_ascii_terminal/blob/fc7ab138659b1ca72f5f912990ed59fa5207b80e/src/terminal.rs | src/terminal.rs | //! A grid of tiles for rendering colorful ascii.
use bevy::{
color::{ColorToPacked, LinearRgba},
math::{IVec2, UVec2},
prelude::{Component, Mesh2d},
reflect::Reflect,
sprite_render::MeshMaterial2d,
};
use sark_grids::{GridRect, GridSize, Pivot, PivotedPoint};
use crate::{
Tile, ascii,
ren... | rust | MIT | fc7ab138659b1ca72f5f912990ed59fa5207b80e | 2026-01-04T20:17:59.844168Z | false |
sarkahn/bevy_ascii_terminal | https://github.com/sarkahn/bevy_ascii_terminal/blob/fc7ab138659b1ca72f5f912990ed59fa5207b80e/src/border.rs | src/border.rs | use std::ops::Sub;
use bevy::{math::IVec2, prelude::Component, reflect::Reflect};
use bevy_platform::collections::HashMap;
use enum_ordinalize::Ordinalize;
use sark_grids::{GridPoint, GridRect, GridSize, Pivot};
use crate::{
Tile,
strings::{DecoratedString, GridStringIterator, StringDecoration},
};
/// A co... | rust | MIT | fc7ab138659b1ca72f5f912990ed59fa5207b80e | 2026-01-04T20:17:59.844168Z | false |
sarkahn/bevy_ascii_terminal | https://github.com/sarkahn/bevy_ascii_terminal/blob/fc7ab138659b1ca72f5f912990ed59fa5207b80e/src/color.rs | src/color.rs | //! Set of [LinearRgba] colors that can be used in a const context.
use bevy::color::LinearRgba;
pub const fn hex_color(hex: u32) -> LinearRgba {
let r = (hex >> 16) & 0xff;
let g = (hex >> 8) & 0xff;
let b = hex & 0xff;
LinearRgba::new(r as f32 / 255.0, g as f32 / 255.0, b as f32 / 255.0, 1.0)
}
pub... | rust | MIT | fc7ab138659b1ca72f5f912990ed59fa5207b80e | 2026-01-04T20:17:59.844168Z | false |
sarkahn/bevy_ascii_terminal | https://github.com/sarkahn/bevy_ascii_terminal/blob/fc7ab138659b1ca72f5f912990ed59fa5207b80e/src/padding.rs | src/padding.rs | pub struct Padding {
pub left: i32,
pub bottom: i32,
pub top: i32,
pub right: i32,
}
impl Padding {
pub const fn one() -> Padding {
Self::new(1)
}
pub const fn new(edge_size: i32) -> Padding {
Self {
left: edge_size,
right: edge_size,
top... | rust | MIT | fc7ab138659b1ca72f5f912990ed59fa5207b80e | 2026-01-04T20:17:59.844168Z | false |
sarkahn/bevy_ascii_terminal | https://github.com/sarkahn/bevy_ascii_terminal/blob/fc7ab138659b1ca72f5f912990ed59fa5207b80e/src/rexpaint/reader.rs | src/rexpaint/reader.rs | //! Provides for reading of REXPaint .xp files
//!
//! Copyright (C) 2018 Mara <cyphergothic@protonmail.com>
//! This work is free. You can redistribute it and/or modify it under the
//! terms of the Do What The Fuck You Want To Public License, Version 2,
//! https://crates.io/crates/rexpaint
#![deny(missing_debug_impl... | rust | MIT | fc7ab138659b1ca72f5f912990ed59fa5207b80e | 2026-01-04T20:17:59.844168Z | false |
sarkahn/bevy_ascii_terminal | https://github.com/sarkahn/bevy_ascii_terminal/blob/fc7ab138659b1ca72f5f912990ed59fa5207b80e/src/rexpaint/mod.rs | src/rexpaint/mod.rs | pub mod reader;
| rust | MIT | fc7ab138659b1ca72f5f912990ed59fa5207b80e | 2026-01-04T20:17:59.844168Z | false |
sarkahn/bevy_ascii_terminal | https://github.com/sarkahn/bevy_ascii_terminal/blob/fc7ab138659b1ca72f5f912990ed59fa5207b80e/src/strings/parse.rs | src/strings/parse.rs | // use bevy::color::LinearRgba;
// use nom::{
// IResult, Parser,
// branch::alt,
// bytes::complete::{is_not, tag, tag_no_case},
// character::complete::alphanumeric1,
// sequence::{preceded, terminated},
// };
// use crate::color::parse_color_string;
// #[derive(Debug, Clone, Copy, PartialEq)]
/... | rust | MIT | fc7ab138659b1ca72f5f912990ed59fa5207b80e | 2026-01-04T20:17:59.844168Z | false |
sarkahn/bevy_ascii_terminal | https://github.com/sarkahn/bevy_ascii_terminal/blob/fc7ab138659b1ca72f5f912990ed59fa5207b80e/src/strings/grid_string.rs | src/strings/grid_string.rs | use std::{ops::Sub, str::Chars};
use bevy::{color::LinearRgba, math::IVec2};
use sark_grids::{GridPoint, GridRect, GridSize, Pivot, PivotedPoint};
use crate::strings::{StringDecoration, StringFormatting};
/// Precalculate the number of vertical lines a wrapped string will occupy.
// TODO: Integrate with `wrap_string... | rust | MIT | fc7ab138659b1ca72f5f912990ed59fa5207b80e | 2026-01-04T20:17:59.844168Z | false |
sarkahn/bevy_ascii_terminal | https://github.com/sarkahn/bevy_ascii_terminal/blob/fc7ab138659b1ca72f5f912990ed59fa5207b80e/src/strings/mod.rs | src/strings/mod.rs | mod formatting;
mod grid_string;
mod parse;
pub use formatting::{
DecoratedString, StringDecoration, StringDecorator, StringFormatting, TerminalString,
};
pub use grid_string::GridStringIterator;
//pub use parse::{TerminalStringToken, parse_tokens};
| rust | MIT | fc7ab138659b1ca72f5f912990ed59fa5207b80e | 2026-01-04T20:17:59.844168Z | false |
sarkahn/bevy_ascii_terminal | https://github.com/sarkahn/bevy_ascii_terminal/blob/fc7ab138659b1ca72f5f912990ed59fa5207b80e/src/strings/formatting.rs | src/strings/formatting.rs | //! Utilities for writing formatted/decorated strings to the terminal
//! without any extra allocations.
use bevy::{color::LinearRgba, reflect::Reflect};
/// A string with optional [StringDecoration] and [StringFormatting] applied.
///
/// `dont_word_wrap` Can be used to disable word wrapping, which is enabled by
//... | rust | MIT | fc7ab138659b1ca72f5f912990ed59fa5207b80e | 2026-01-04T20:17:59.844168Z | false |
sarkahn/bevy_ascii_terminal | https://github.com/sarkahn/bevy_ascii_terminal/blob/fc7ab138659b1ca72f5f912990ed59fa5207b80e/src/render/mesh.rs | src/render/mesh.rs | //! Systems for building the terminal mesh.
use bevy::{
app::{Plugin, PostUpdate},
asset::{AssetEvent, Assets, RenderAssetUsages},
color::ColorToComponents,
ecs::{
change_detection::DetectChangesMut,
component::Component,
entity::Entity,
message::{MessageReader, MessageW... | rust | MIT | fc7ab138659b1ca72f5f912990ed59fa5207b80e | 2026-01-04T20:17:59.844168Z | false |
sarkahn/bevy_ascii_terminal | https://github.com/sarkahn/bevy_ascii_terminal/blob/fc7ab138659b1ca72f5f912990ed59fa5207b80e/src/render/font.rs | src/render/font.rs | use bevy::{
app::PostUpdate,
asset::{AssetServer, Assets, Handle},
ecs::{
component::Component,
query::Changed,
resource::Resource,
schedule::{IntoScheduleConfigs, SystemSet},
system::{Query, Res, ResMut},
},
image::{Image, ImageLoaderSettings, ImageSampler},
... | rust | MIT | fc7ab138659b1ca72f5f912990ed59fa5207b80e | 2026-01-04T20:17:59.844168Z | false |
sarkahn/bevy_ascii_terminal | https://github.com/sarkahn/bevy_ascii_terminal/blob/fc7ab138659b1ca72f5f912990ed59fa5207b80e/src/render/uv_mapping.rs | src/render/uv_mapping.rs | //! A terminal component for precalculating uv data and mapping it to a rust [char].
use bevy::{
math::{Rect, Vec2},
prelude::{Asset, AssetApp, Assets, Component, Deref, DerefMut, Handle, Plugin},
reflect::{Reflect, TypePath},
};
use bevy_platform::collections::HashMap;
pub struct TerminalUvMappingPlugin;... | rust | MIT | fc7ab138659b1ca72f5f912990ed59fa5207b80e | 2026-01-04T20:17:59.844168Z | false |
sarkahn/bevy_ascii_terminal | https://github.com/sarkahn/bevy_ascii_terminal/blob/fc7ab138659b1ca72f5f912990ed59fa5207b80e/src/render/material.rs | src/render/material.rs | use bevy::{
asset::uuid_handle,
mesh::MeshVertexBufferLayoutRef,
prelude::{Asset, Assets, Color, Handle, Image, LinearRgba, Mesh, Plugin, Shader},
reflect::TypePath,
render::render_resource::{
AsBindGroup, RenderPipelineDescriptor, SpecializedMeshPipelineError,
},
shader::ShaderRef,
... | rust | MIT | fc7ab138659b1ca72f5f912990ed59fa5207b80e | 2026-01-04T20:17:59.844168Z | false |
sarkahn/bevy_ascii_terminal | https://github.com/sarkahn/bevy_ascii_terminal/blob/fc7ab138659b1ca72f5f912990ed59fa5207b80e/src/render/mod.rs | src/render/mod.rs | mod camera;
mod font;
mod material;
mod mesh;
mod uv_mapping;
use bevy::prelude::Resource;
pub use camera::TerminalCamera;
pub use font::TerminalFont;
pub use material::TerminalMaterial;
pub use mesh::{RebuildMeshVerts, TerminalMeshPivot, TerminalMeshTileScaling};
pub use uv_mapping::{UvMapping, UvMappingHandle};
pub... | rust | MIT | fc7ab138659b1ca72f5f912990ed59fa5207b80e | 2026-01-04T20:17:59.844168Z | false |
sarkahn/bevy_ascii_terminal | https://github.com/sarkahn/bevy_ascii_terminal/blob/fc7ab138659b1ca72f5f912990ed59fa5207b80e/src/render/camera.rs | src/render/camera.rs | use bevy::{
app::{First, Plugin},
asset::{AssetEvent, Assets},
camera::{Camera, Projection, ScalingMode, Viewport},
ecs::{
component::Component,
entity::Entity,
message::{Message, MessageReader, MessageWriter},
query::{Changed, Or, With},
schedule::{IntoScheduleCo... | rust | MIT | fc7ab138659b1ca72f5f912990ed59fa5207b80e | 2026-01-04T20:17:59.844168Z | false |
sarkahn/bevy_ascii_terminal | https://github.com/sarkahn/bevy_ascii_terminal/blob/fc7ab138659b1ca72f5f912990ed59fa5207b80e/examples/noise.rs | examples/noise.rs | //! An interactive ui to display noise using the fastnoise-lite crate.
use bevy::{app::AppExit, prelude::*, time::common_conditions::on_timer};
use bevy_ascii_terminal::*;
use fastnoise_lite::*;
fn main() {
let controls = State {
current_control: 0,
noise_type: NoiseType::OpenSimplex2,
fra... | rust | MIT | fc7ab138659b1ca72f5f912990ed59fa5207b80e | 2026-01-04T20:17:59.844168Z | false |
sarkahn/bevy_ascii_terminal | https://github.com/sarkahn/bevy_ascii_terminal/blob/fc7ab138659b1ca72f5f912990ed59fa5207b80e/examples/font_change.rs | examples/font_change.rs | use std::ops::Sub;
use bevy::{
color::palettes::css::{MAROON, MIDNIGHT_BLUE},
prelude::*,
reflect::{DynamicVariant, Enum},
};
use bevy_ascii_terminal::*;
fn main() {
App::new()
.add_plugins((DefaultPlugins, TerminalPlugins))
.add_systems(Startup, setup)
.add_systems(Update, (in... | rust | MIT | fc7ab138659b1ca72f5f912990ed59fa5207b80e | 2026-01-04T20:17:59.844168Z | false |
sarkahn/bevy_ascii_terminal | https://github.com/sarkahn/bevy_ascii_terminal/blob/fc7ab138659b1ca72f5f912990ed59fa5207b80e/examples/transform.rs | examples/transform.rs | //! Demonstrates how to use TerminalTransform and TerminalCamera to
//! convert world coordinates into terminal tile coordinates.
use bevy::{color::palettes::css::BLACK, prelude::*};
use bevy_ascii_terminal::*;
fn main() {
App::new()
.add_plugins((DefaultPlugins, TerminalPlugins))
.add_systems(Sta... | rust | MIT | fc7ab138659b1ca72f5f912990ed59fa5207b80e | 2026-01-04T20:17:59.844168Z | false |
sarkahn/bevy_ascii_terminal | https://github.com/sarkahn/bevy_ascii_terminal/blob/fc7ab138659b1ca72f5f912990ed59fa5207b80e/examples/rexpaint.rs | examples/rexpaint.rs | //! A terminal built from a rexpaint file.
use bevy::prelude::*;
use bevy_ascii_terminal::*;
fn main() {
App::new()
.add_plugins((DefaultPlugins, TerminalPlugins))
.add_systems(Startup, setup)
.run();
}
fn setup(mut commands: Commands) {
commands.spawn((
Terminal::from_rexpain... | rust | MIT | fc7ab138659b1ca72f5f912990ed59fa5207b80e | 2026-01-04T20:17:59.844168Z | false |
sarkahn/bevy_ascii_terminal | https://github.com/sarkahn/bevy_ascii_terminal/blob/fc7ab138659b1ca72f5f912990ed59fa5207b80e/examples/spam.rs | examples/spam.rs | //! Spamming the entire terminal with random glyphs and colors.
use bevy::diagnostic::{FrameTimeDiagnosticsPlugin, LogDiagnosticsPlugin};
use bevy::prelude::*;
use bevy::window::PresentMode;
use bevy_ascii_terminal::*;
use rand::Rng;
use rand::rngs::ThreadRng;
fn main() {
let mut app = App::new();
if !cfg!(de... | rust | MIT | fc7ab138659b1ca72f5f912990ed59fa5207b80e | 2026-01-04T20:17:59.844168Z | false |
sarkahn/bevy_ascii_terminal | https://github.com/sarkahn/bevy_ascii_terminal/blob/fc7ab138659b1ca72f5f912990ed59fa5207b80e/examples/hello.rs | examples/hello.rs | //! A minimal example with a terminal and camera.
use bevy::prelude::*;
use bevy_ascii_terminal::*;
fn main() {
App::new()
.add_plugins((DefaultPlugins, TerminalPlugins))
.add_systems(Startup, setup)
.run();
}
fn setup(mut commands: Commands) {
commands.spawn((
Terminal::new([... | rust | MIT | fc7ab138659b1ca72f5f912990ed59fa5207b80e | 2026-01-04T20:17:59.844168Z | false |
sarkahn/bevy_ascii_terminal | https://github.com/sarkahn/bevy_ascii_terminal/blob/fc7ab138659b1ca72f5f912990ed59fa5207b80e/examples/camera.rs | examples/camera.rs | //! Demonstrates how the [TerminalCamera] will automatically adjust the viewport
//! to render all visible terminals.
use bevy::{
app::AppExit,
color::palettes::css::{BLUE, RED},
prelude::*,
time::common_conditions::on_timer,
};
use bevy_ascii_terminal::*;
const FADED: f32 = 0.65;
const BRIGHT: f32 = ... | rust | MIT | fc7ab138659b1ca72f5f912990ed59fa5207b80e | 2026-01-04T20:17:59.844168Z | false |
sarkahn/bevy_ascii_terminal | https://github.com/sarkahn/bevy_ascii_terminal/blob/fc7ab138659b1ca72f5f912990ed59fa5207b80e/examples/resized.rs | examples/resized.rs | use std::time::Duration;
use bevy::{prelude::*, time::common_conditions::on_timer};
use bevy_ascii_terminal::*;
fn main() {
App::new()
.add_plugins((DefaultPlugins, TerminalPlugins))
.add_systems(Startup, setup)
.add_systems(
Update,
update.run_if(on_timer(Duration:... | rust | MIT | fc7ab138659b1ca72f5f912990ed59fa5207b80e | 2026-01-04T20:17:59.844168Z | false |
sarkahn/bevy_ascii_terminal | https://github.com/sarkahn/bevy_ascii_terminal/blob/fc7ab138659b1ca72f5f912990ed59fa5207b80e/examples/grid_position.rs | examples/grid_position.rs | //! Demonstrates how SetTerminalGridPosition and SetTerminalLayerPosition can
//! be used to position terminals on the virtual grid.
use bevy::prelude::*;
use bevy_ascii_terminal::*;
fn main() {
App::new()
.add_plugins((DefaultPlugins, TerminalPlugins))
.add_systems(Startup, setup)
.run();... | rust | MIT | fc7ab138659b1ca72f5f912990ed59fa5207b80e | 2026-01-04T20:17:59.844168Z | false |
esteinig/nanoq | https://github.com/esteinig/nanoq/blob/729d1f2ce3ee409ccc6b6d010b6e8d7fe1ec2883/src/needlecast.rs | src/needlecast.rs | use needletail::errors::ParseError;
use needletail::parser::{write_fasta, write_fastq};
use needletail::{parse_fastx_file, parse_fastx_stdin, FastxReader};
use std::fs::File;
use std::io::{sink, stdout};
use std::io::{BufWriter, Write};
use thiserror::Error;
use crate::cli::Cli;
use crate::utils::CompressionExt;
// N... | rust | MIT | 729d1f2ce3ee409ccc6b6d010b6e8d7fe1ec2883 | 2026-01-04T20:17:55.196637Z | false |
esteinig/nanoq | https://github.com/esteinig/nanoq/blob/729d1f2ce3ee409ccc6b6d010b6e8d7fe1ec2883/src/cli.rs | src/cli.rs | use std::path::PathBuf;
use structopt::StructOpt;
use thiserror::Error;
/// Filters and summary reports for nanopore reads
#[derive(Debug, StructOpt)]
#[structopt()]
pub struct Cli {
/// Fast{a,q}.{gz,xz,bz}, stdin if not present.
#[structopt(short = "i", long, parse(from_os_str))]
pub input: Option<PathBu... | rust | MIT | 729d1f2ce3ee409ccc6b6d010b6e8d7fe1ec2883 | 2026-01-04T20:17:55.196637Z | false |
esteinig/nanoq | https://github.com/esteinig/nanoq/blob/729d1f2ce3ee409ccc6b6d010b6e8d7fe1ec2883/src/utils.rs | src/utils.rs | use anyhow::Result;
use indoc::formatdoc;
use serde::Serialize;
use std::cmp::Ordering;
use std::collections::BTreeMap;
use std::ffi::OsStr;
use std::fs::File;
use std::io::Write;
use std::path::Path;
use std::path::PathBuf;
use thiserror::Error;
const LENGTH_THRESHOLDS: [usize; 10] = [
200, 500, 1000, 2000, 5000,... | rust | MIT | 729d1f2ce3ee409ccc6b6d010b6e8d7fe1ec2883 | 2026-01-04T20:17:55.196637Z | true |
esteinig/nanoq | https://github.com/esteinig/nanoq/blob/729d1f2ce3ee409ccc6b6d010b6e8d7fe1ec2883/src/main.rs | src/main.rs | use anyhow::{Context, Result};
use structopt::StructOpt;
use crate::cli::Cli;
use crate::needlecast::NeedleCast;
use crate::utils::ReadSet;
mod cli;
mod needlecast;
mod utils;
/// Nanoq application
///
/// Run the application from arguments provided
/// by the command line interface.
#[cfg(not(tarpaulin_include))]
f... | rust | MIT | 729d1f2ce3ee409ccc6b6d010b6e8d7fe1ec2883 | 2026-01-04T20:17:55.196637Z | false |
esteinig/nanoq | https://github.com/esteinig/nanoq/blob/729d1f2ce3ee409ccc6b6d010b6e8d7fe1ec2883/tests/app.rs | tests/app.rs | use assert_cmd::prelude::*;
use predicates::prelude::*;
use std::fs;
use std::process::Command;
use tempfile::tempdir;
#[test]
fn input_file_does_not_exist() -> Result<(), Box<dyn std::error::Error>> {
let mut cmd = Command::cargo_bin(env!("CARGO_PKG_NAME"))?;
cmd.args(vec!["-i", "file/does/not/exist.fq", "-s"... | rust | MIT | 729d1f2ce3ee409ccc6b6d010b6e8d7fe1ec2883 | 2026-01-04T20:17:55.196637Z | false |
Firstp1ck/Pacsea | https://github.com/Firstp1ck/Pacsea/blob/c433ad6a837b7985d8b99ba9afd8f07a93d046f4/src/lib.rs | src/lib.rs | //! # Pacsea Crate Overview
//!
//! Pacsea bundles the core event loop, data pipelines, and UI helpers that power the
//! `pacsea` terminal application. Integration tests and downstream tooling can depend on this
//! crate to drive the runtime without going through the binary entrypoint.
//!
//! ## Why Pacsea?
//! > **... | rust | MIT | c433ad6a837b7985d8b99ba9afd8f07a93d046f4 | 2026-01-04T20:14:32.225407Z | false |
Firstp1ck/Pacsea | https://github.com/Firstp1ck/Pacsea/blob/c433ad6a837b7985d8b99ba9afd8f07a93d046f4/src/announcements.rs | src/announcements.rs | //! Announcement system supporting both version-embedded and remote announcements.
use chrono::{NaiveDate, Utc};
use serde::Deserialize;
use std::cmp::Ordering;
/// What: Version-embedded announcement for a specific app version.
///
/// Inputs: None (static data).
///
/// Output: Represents an announcement tied to a ... | rust | MIT | c433ad6a837b7985d8b99ba9afd8f07a93d046f4 | 2026-01-04T20:14:32.225407Z | false |
Firstp1ck/Pacsea | https://github.com/Firstp1ck/Pacsea/blob/c433ad6a837b7985d8b99ba9afd8f07a93d046f4/src/test_utils.rs | src/test_utils.rs | //! Test utilities for common test setup.
//!
//! This module provides shared test helpers used across multiple test modules.
#[cfg(test)]
use crate::state::AppState;
#[cfg(test)]
/// What: Provide a baseline `AppState` for handler tests.
///
/// Inputs: None
///
/// Output: Fresh `AppState` with default values
pub f... | rust | MIT | c433ad6a837b7985d8b99ba9afd8f07a93d046f4 | 2026-01-04T20:14:32.225407Z | false |
Firstp1ck/Pacsea | https://github.com/Firstp1ck/Pacsea/blob/c433ad6a837b7985d8b99ba9afd8f07a93d046f4/src/ui.rs | src/ui.rs | //! TUI rendering for Pacsea.
//!
//! This module renders the full terminal user interface using `ratatui`.
//! The layout is split vertically into three regions:
//!
//! 1) Results list (top): shows search matches and keeps the current selection
//! centered when possible
//! 2) Middle row (three columns): Recent (... | rust | MIT | c433ad6a837b7985d8b99ba9afd8f07a93d046f4 | 2026-01-04T20:14:32.225407Z | false |
Firstp1ck/Pacsea | https://github.com/Firstp1ck/Pacsea/blob/c433ad6a837b7985d8b99ba9afd8f07a93d046f4/src/main.rs | src/main.rs | //! Pacsea binary entrypoint kept minimal. The full runtime lives in `app`.
mod args;
use clap::Parser;
use pacsea::{app, theme, util};
use std::sync::OnceLock;
use std::{fmt, str::FromStr, time::SystemTime};
/// What: Custom time formatter for tracing logs.
///
/// Inputs: None (implements `FormatTime` trait).
///
... | rust | MIT | c433ad6a837b7985d8b99ba9afd8f07a93d046f4 | 2026-01-04T20:14:32.225407Z | false |
Firstp1ck/Pacsea | https://github.com/Firstp1ck/Pacsea/blob/c433ad6a837b7985d8b99ba9afd8f07a93d046f4/src/util/config.rs | src/util/config.rs | //! Configuration file parsing utilities.
//!
//! This module provides helpers for parsing configuration files with common
//! patterns like comment skipping and key-value parsing.
/// What: Check if a line should be skipped (empty or comment).
///
/// Inputs:
/// - `line`: Line to check
///
/// Output:
/// - `true` i... | rust | MIT | c433ad6a837b7985d8b99ba9afd8f07a93d046f4 | 2026-01-04T20:14:32.225407Z | false |
Firstp1ck/Pacsea | https://github.com/Firstp1ck/Pacsea/blob/c433ad6a837b7985d8b99ba9afd8f07a93d046f4/src/util/srcinfo.rs | src/util/srcinfo.rs | //! .SRCINFO fetching utilities for AUR packages.
//!
//! This module provides functions for fetching .SRCINFO files from the AUR,
//! with support for both synchronous (curl) and asynchronous (reqwest) fetching.
use crate::util::{curl, percent_encode};
/// What: Fetch .SRCINFO content for an AUR package synchronousl... | rust | MIT | c433ad6a837b7985d8b99ba9afd8f07a93d046f4 | 2026-01-04T20:14:32.225407Z | false |
Firstp1ck/Pacsea | https://github.com/Firstp1ck/Pacsea/blob/c433ad6a837b7985d8b99ba9afd8f07a93d046f4/src/util/curl.rs | src/util/curl.rs | //! Curl-based HTTP utilities for fetching JSON and text content.
//!
//! This module provides functions for executing curl commands and handling
//! common error cases with user-friendly error messages.
//!
//! # Security
//! - Uses absolute paths for curl binary when available (defense-in-depth against PATH hijacking... | rust | MIT | c433ad6a837b7985d8b99ba9afd8f07a93d046f4 | 2026-01-04T20:14:32.225407Z | false |
Firstp1ck/Pacsea | https://github.com/Firstp1ck/Pacsea/blob/c433ad6a837b7985d8b99ba9afd8f07a93d046f4/src/util/pacman.rs | src/util/pacman.rs | //! Pacman command execution utilities.
//!
//! This module provides functions for executing pacman commands and handling
//! common error cases.
use std::process::Command;
use tracing::{debug, warn};
/// Result type alias for pacman command operations.
type Result<T> = std::result::Result<T, Box<dyn std::error::Error... | rust | MIT | c433ad6a837b7985d8b99ba9afd8f07a93d046f4 | 2026-01-04T20:14:32.225407Z | false |
Firstp1ck/Pacsea | https://github.com/Firstp1ck/Pacsea/blob/c433ad6a837b7985d8b99ba9afd8f07a93d046f4/src/util/mod.rs | src/util/mod.rs | //! Small utility helpers for encoding, JSON extraction, ranking, and time formatting.
//!
//! The functions in this module are intentionally lightweight and dependency-free
//! to keep hot paths fast and reduce compile times. They are used by networking,
//! indexing, and UI code.
pub mod config;
pub mod curl;
pub mo... | rust | MIT | c433ad6a837b7985d8b99ba9afd8f07a93d046f4 | 2026-01-04T20:14:32.225407Z | true |
Firstp1ck/Pacsea | https://github.com/Firstp1ck/Pacsea/blob/c433ad6a837b7985d8b99ba9afd8f07a93d046f4/src/state/types.rs | src/state/types.rs | //! Core value types used by Pacsea state.
/// Minimal news entry for Arch news modal.
#[derive(Clone, Debug)]
pub struct NewsItem {
/// Publication date (short, e.g., 2025-10-11)
pub date: String,
/// Title text
pub title: String,
/// Link URL
pub url: String,
}
/// What: High-level applicati... | rust | MIT | c433ad6a837b7985d8b99ba9afd8f07a93d046f4 | 2026-01-04T20:14:32.225407Z | false |
Firstp1ck/Pacsea | https://github.com/Firstp1ck/Pacsea/blob/c433ad6a837b7985d8b99ba9afd8f07a93d046f4/src/state/mod.rs | src/state/mod.rs | //! Modularized state module.
//!
//! This splits the original monolithic `state.rs` into smaller files while
//! preserving the public API under `crate::state::*` via re-exports.
pub mod app_state;
pub mod modal;
pub mod types;
// Public re-exports to keep existing paths working
pub use app_state::AppState;
pub use ... | rust | MIT | c433ad6a837b7985d8b99ba9afd8f07a93d046f4 | 2026-01-04T20:14:32.225407Z | false |
Firstp1ck/Pacsea | https://github.com/Firstp1ck/Pacsea/blob/c433ad6a837b7985d8b99ba9afd8f07a93d046f4/src/state/modal.rs | src/state/modal.rs | //! Modal dialog state for the UI.
use crate::state::types::{OptionalDepRow, PackageItem, Source};
use std::collections::HashSet;
/// What: Enumerates the high-level operations represented in the preflight
/// workflow.
///
/// - Input: Selected by callers when presenting confirmation or preflight
/// dialogs.
/// ... | rust | MIT | c433ad6a837b7985d8b99ba9afd8f07a93d046f4 | 2026-01-04T20:14:32.225407Z | false |
Firstp1ck/Pacsea | https://github.com/Firstp1ck/Pacsea/blob/c433ad6a837b7985d8b99ba9afd8f07a93d046f4/src/state/app_state/tests.rs | src/state/app_state/tests.rs | //! Tests for `AppState`.
use crate::state::app_state::AppState;
use crate::state::types::{
AdvisorySeverity, NewsFeedItem, NewsFeedSource, NewsReadFilter, NewsSortMode,
};
#[test]
/// What: Verify `AppState::default` initialises UI flags and filesystem paths under the configured lists directory.
///
/// Inputs:
... | rust | MIT | c433ad6a837b7985d8b99ba9afd8f07a93d046f4 | 2026-01-04T20:14:32.225407Z | false |
Firstp1ck/Pacsea | https://github.com/Firstp1ck/Pacsea/blob/c433ad6a837b7985d8b99ba9afd8f07a93d046f4/src/state/app_state/methods.rs | src/state/app_state/methods.rs | //! Implementation methods for `AppState`.
use crate::state::app_state::{AppState, recent_capacity};
use crate::state::types::{
NewsBookmark, NewsFeedItem, NewsReadFilter, NewsSortMode, severity_rank,
};
use chrono::{NaiveDate, Utc};
impl AppState {
/// What: Return recent searches in most-recent-first order.... | rust | MIT | c433ad6a837b7985d8b99ba9afd8f07a93d046f4 | 2026-01-04T20:14:32.225407Z | false |
Firstp1ck/Pacsea | https://github.com/Firstp1ck/Pacsea/blob/c433ad6a837b7985d8b99ba9afd8f07a93d046f4/src/state/app_state/mod.rs | src/state/app_state/mod.rs | //! Central `AppState` container, split out from the monolithic module.
use lru::LruCache;
use ratatui::widgets::ListState;
use std::{collections::HashMap, collections::HashSet, path::PathBuf, time::Instant};
use crate::state::modal::{CascadeMode, Modal, PreflightAction, ServiceImpact};
use crate::state::types::{
... | rust | MIT | c433ad6a837b7985d8b99ba9afd8f07a93d046f4 | 2026-01-04T20:14:32.225407Z | true |
Firstp1ck/Pacsea | https://github.com/Firstp1ck/Pacsea/blob/c433ad6a837b7985d8b99ba9afd8f07a93d046f4/src/state/app_state/constants.rs | src/state/app_state/constants.rs | //! Constants and type aliases for `AppState`.
use std::num::NonZeroUsize;
/// Maximum number of recent searches to retain (most-recent-first).
pub const RECENT_CAPACITY: usize = 20;
/// What: Provide the non-zero capacity used by the LRU recent cache.
///
/// Inputs: None.
///
/// Output:
/// - Non-zero capacity fo... | rust | MIT | c433ad6a837b7985d8b99ba9afd8f07a93d046f4 | 2026-01-04T20:14:32.225407Z | false |
Firstp1ck/Pacsea | https://github.com/Firstp1ck/Pacsea/blob/c433ad6a837b7985d8b99ba9afd8f07a93d046f4/src/state/app_state/defaults_cache.rs | src/state/app_state/defaults_cache.rs | //! Cache-related default initialization helpers for `AppState`.
use std::path::PathBuf;
use crate::state::modal::{CascadeMode, PreflightAction, ServiceImpact};
use crate::state::types::PackageItem;
/// Type alias for default services cache state tuple.
#[allow(clippy::type_complexity)]
pub(super) type DefaultServic... | rust | MIT | c433ad6a837b7985d8b99ba9afd8f07a93d046f4 | 2026-01-04T20:14:32.225407Z | false |
Firstp1ck/Pacsea | https://github.com/Firstp1ck/Pacsea/blob/c433ad6a837b7985d8b99ba9afd8f07a93d046f4/src/state/app_state/defaults.rs | src/state/app_state/defaults.rs | //! Default initialization helpers for `AppState`.
use lru::LruCache;
use ratatui::widgets::ListState;
use serde_json;
use std::fs;
use std::{collections::HashMap, collections::HashSet, path::PathBuf, time::Instant};
use crate::state::modal::Modal;
use crate::state::types::{
AppMode, ArchStatusColor, Focus, NewsF... | rust | MIT | c433ad6a837b7985d8b99ba9afd8f07a93d046f4 | 2026-01-04T20:14:32.225407Z | false |
Firstp1ck/Pacsea | https://github.com/Firstp1ck/Pacsea/blob/c433ad6a837b7985d8b99ba9afd8f07a93d046f4/src/state/app_state/default_impl.rs | src/state/app_state/default_impl.rs | //! Default implementation for `AppState`.
use super::AppState;
use super::defaults;
use super::defaults_cache;
use std::collections::HashMap;
impl Default for AppState {
/// What: Construct a default, empty [`AppState`] with initialized paths, selection states, and timers.
///
/// Inputs:
/// - None.... | rust | MIT | c433ad6a837b7985d8b99ba9afd8f07a93d046f4 | 2026-01-04T20:14:32.225407Z | false |
Firstp1ck/Pacsea | https://github.com/Firstp1ck/Pacsea/blob/c433ad6a837b7985d8b99ba9afd8f07a93d046f4/src/index/mirrors.rs | src/index/mirrors.rs | // Windows-only module - conditionally compiled in mod.rs
use std::fmt::Write;
use std::fs;
use std::io::Write as IoWrite;
use std::path::{Path, PathBuf};
use tokio::task;
/// Windows-only helpers to fetch Arch mirror data into the repository folder and
/// to build the official package index by querying the public Ar... | rust | MIT | c433ad6a837b7985d8b99ba9afd8f07a93d046f4 | 2026-01-04T20:14:32.225407Z | true |
Firstp1ck/Pacsea | https://github.com/Firstp1ck/Pacsea/blob/c433ad6a837b7985d8b99ba9afd8f07a93d046f4/src/index/persist.rs | src/index/persist.rs | use std::fs;
use std::path::Path;
use super::{OfficialIndex, idx};
/// What: Load the official index from `path` if a valid JSON exists.
///
/// Inputs:
/// - `path`: File path to read JSON from
///
/// Output:
/// - Replaces the in-memory index on success; ignores errors and leaves it unchanged on failure.
///
/// D... | rust | MIT | c433ad6a837b7985d8b99ba9afd8f07a93d046f4 | 2026-01-04T20:14:32.225407Z | false |
Firstp1ck/Pacsea | https://github.com/Firstp1ck/Pacsea/blob/c433ad6a837b7985d8b99ba9afd8f07a93d046f4/src/index/update.rs | src/index/update.rs | #[cfg(not(target_os = "windows"))]
use super::fetch::fetch_official_pkg_names;
#[cfg(not(target_os = "windows"))]
use super::{OfficialPkg, idx, save_to_disk};
/// What: Spawn a background task to refresh the official index and notify on changes.
///
/// Inputs:
/// - `persist_path`: File path to persist the updated in... | rust | MIT | c433ad6a837b7985d8b99ba9afd8f07a93d046f4 | 2026-01-04T20:14:32.225407Z | false |
Firstp1ck/Pacsea | https://github.com/Firstp1ck/Pacsea/blob/c433ad6a837b7985d8b99ba9afd8f07a93d046f4/src/index/explicit.rs | src/index/explicit.rs | use std::collections::HashSet;
use super::explicit_lock;
use crate::state::InstalledPackagesMode;
/// What: Refresh the process-wide cache of explicitly installed package names.
///
/// Inputs:
/// - `mode`: Filter mode for installed packages.
/// - `LeafOnly`: Uses `pacman -Qetq` (explicitly installed AND not requ... | rust | MIT | c433ad6a837b7985d8b99ba9afd8f07a93d046f4 | 2026-01-04T20:14:32.225407Z | false |
Firstp1ck/Pacsea | https://github.com/Firstp1ck/Pacsea/blob/c433ad6a837b7985d8b99ba9afd8f07a93d046f4/src/index/enrich.rs | src/index/enrich.rs | use super::{idx, save_to_disk};
/// What: Request enrichment (`pacman -Si`) for a set of package `names` in the background,
/// merge fields into the index, persist, and notify.
///
/// Inputs:
/// - `persist_path`: Path to write the updated index JSON
/// - `notify_tx`: Channel to notify the UI after enrichment/persi... | rust | MIT | c433ad6a837b7985d8b99ba9afd8f07a93d046f4 | 2026-01-04T20:14:32.225407Z | false |
Firstp1ck/Pacsea | https://github.com/Firstp1ck/Pacsea/blob/c433ad6a837b7985d8b99ba9afd8f07a93d046f4/src/index/fetch.rs | src/index/fetch.rs | #[cfg(not(windows))]
use super::OfficialPkg;
#[cfg(not(windows))]
use super::distro::{artix_repo_names, cachyos_repo_names, eos_repo_names};
/// What: Fetch a minimal list of official packages using `pacman -Sl`.
///
/// Inputs:
/// - None (calls `pacman -Sl` for known repositories in the background)
///
/// Output:
/... | rust | MIT | c433ad6a837b7985d8b99ba9afd8f07a93d046f4 | 2026-01-04T20:14:32.225407Z | false |
Firstp1ck/Pacsea | https://github.com/Firstp1ck/Pacsea/blob/c433ad6a837b7985d8b99ba9afd8f07a93d046f4/src/index/mod.rs | src/index/mod.rs | //! Official package index management, persistence, and enrichment.
//!
//! Split into submodules for maintainability. Public API is re-exported
//! to remain compatible with previous `crate::index` consumers.
use std::collections::{HashMap, HashSet};
use std::sync::{OnceLock, RwLock};
/// What: Represent the full co... | rust | MIT | c433ad6a837b7985d8b99ba9afd8f07a93d046f4 | 2026-01-04T20:14:32.225407Z | false |
Firstp1ck/Pacsea | https://github.com/Firstp1ck/Pacsea/blob/c433ad6a837b7985d8b99ba9afd8f07a93d046f4/src/index/query.rs | src/index/query.rs | use crate::state::{PackageItem, Source};
use super::idx;
/// What: Search the official index for packages whose names match `query`.
///
/// Inputs:
/// - `query`: Raw query string
/// - `fuzzy`: When `true`, uses fuzzy matching (fzf-style); when `false`, uses substring matching
///
/// Output:
/// - Vector of `Packa... | rust | MIT | c433ad6a837b7985d8b99ba9afd8f07a93d046f4 | 2026-01-04T20:14:32.225407Z | false |
Firstp1ck/Pacsea | https://github.com/Firstp1ck/Pacsea/blob/c433ad6a837b7985d8b99ba9afd8f07a93d046f4/src/index/installed.rs | src/index/installed.rs | use super::installed_lock;
/// What: Refresh the process-wide cache of installed package names using `pacman -Qq`.
///
/// Inputs:
/// - None (spawns a blocking task to run pacman)
///
/// Output:
/// - Updates the global installed-name set; ignores errors.
///
/// Details:
/// - Parses command stdout into a `HashSet`... | rust | MIT | c433ad6a837b7985d8b99ba9afd8f07a93d046f4 | 2026-01-04T20:14:32.225407Z | false |
Firstp1ck/Pacsea | https://github.com/Firstp1ck/Pacsea/blob/c433ad6a837b7985d8b99ba9afd8f07a93d046f4/src/index/distro.rs | src/index/distro.rs | //! Distro-specific helpers used across the app.
/// What: Determine if a package name is Manjaro-branded
///
/// Input:
/// - `name` package name
///
/// Output:
/// - `true` if it starts with "manjaro-" (case-insensitive)
///
/// Details:
/// - Compares a lowercased name with the "manjaro-" prefix.
#[must_use]
pub f... | rust | MIT | c433ad6a837b7985d8b99ba9afd8f07a93d046f4 | 2026-01-04T20:14:32.225407Z | false |
Firstp1ck/Pacsea | https://github.com/Firstp1ck/Pacsea/blob/c433ad6a837b7985d8b99ba9afd8f07a93d046f4/src/sources/comments.rs | src/sources/comments.rs | //! AUR package comments fetching via web scraping.
use scraper::{ElementRef, Html, Selector};
use std::time::Duration;
use tracing::debug;
use crate::state::types::AurComment;
/// Result type alias for AUR comments fetching operations.
type Result<T> = super::Result<T>;
/// Context for extracting comment data from... | rust | MIT | c433ad6a837b7985d8b99ba9afd8f07a93d046f4 | 2026-01-04T20:14:32.225407Z | false |
Firstp1ck/Pacsea | https://github.com/Firstp1ck/Pacsea/blob/c433ad6a837b7985d8b99ba9afd8f07a93d046f4/src/sources/search.rs | src/sources/search.rs | //! AUR search query execution and result parsing.
use crate::state::{PackageItem, Source};
use crate::util::{percent_encode, s};
/// What: Fetch search results from AUR and return items along with any error messages.
///
/// Input:
/// - `query` raw query string to search
///
/// Output:
/// - Tuple `(items, errors)... | rust | MIT | c433ad6a837b7985d8b99ba9afd8f07a93d046f4 | 2026-01-04T20:14:32.225407Z | false |
Firstp1ck/Pacsea | https://github.com/Firstp1ck/Pacsea/blob/c433ad6a837b7985d8b99ba9afd8f07a93d046f4/src/sources/mod.rs | src/sources/mod.rs | //! Network and system data retrieval module split into submodules.
/// Security advisories fetching.
mod advisories;
/// AUR comments fetching.
mod comments;
/// Package details fetching.
mod details;
/// News feed fetching.
mod feeds;
/// Arch Linux news fetching.
pub mod news;
/// PKGBUILD content fetching.
mod pkg... | rust | MIT | c433ad6a837b7985d8b99ba9afd8f07a93d046f4 | 2026-01-04T20:14:32.225407Z | false |
Firstp1ck/Pacsea | https://github.com/Firstp1ck/Pacsea/blob/c433ad6a837b7985d8b99ba9afd8f07a93d046f4/src/sources/pkgbuild.rs | src/sources/pkgbuild.rs | //! PKGBUILD fetching with rate limiting and caching.
use crate::logic::files::get_pkgbuild_from_cache;
use crate::state::{PackageItem, Source};
use crate::util::percent_encode;
use std::sync::Mutex;
use std::time::{Duration, Instant};
/// Result type alias for PKGBUILD fetching operations.
type Result<T> = super::Re... | rust | MIT | c433ad6a837b7985d8b99ba9afd8f07a93d046f4 | 2026-01-04T20:14:32.225407Z | false |
Firstp1ck/Pacsea | https://github.com/Firstp1ck/Pacsea/blob/c433ad6a837b7985d8b99ba9afd8f07a93d046f4/src/sources/details.rs | src/sources/details.rs | //! Package details fetching from official repositories and AUR.
use serde_json::Value;
use crate::state::{PackageDetails, PackageItem, Source};
use crate::util::{arrs, s, ss, u64_of};
/// Result type alias for package details fetching operations.
type Result<T> = super::Result<T>;
/// Split a whitespace-separated ... | rust | MIT | c433ad6a837b7985d8b99ba9afd8f07a93d046f4 | 2026-01-04T20:14:32.225407Z | false |
Firstp1ck/Pacsea | https://github.com/Firstp1ck/Pacsea/blob/c433ad6a837b7985d8b99ba9afd8f07a93d046f4/src/sources/advisories.rs | src/sources/advisories.rs | //! security.archlinux.org advisory fetcher.
use crate::state::types::{AdvisorySeverity, NewsFeedItem, NewsFeedSource};
use tracing::{info, warn};
/// Result type alias for advisory fetching operations.
type Result<T> = super::Result<T>;
/// What: Fetch security advisories from security.archlinux.org and convert to f... | rust | MIT | c433ad6a837b7985d8b99ba9afd8f07a93d046f4 | 2026-01-04T20:14:32.225407Z | false |
Firstp1ck/Pacsea | https://github.com/Firstp1ck/Pacsea/blob/c433ad6a837b7985d8b99ba9afd8f07a93d046f4/src/sources/news/parse.rs | src/sources/news/parse.rs | //! HTML parsing and rendering for news content.
use crate::sources::news::utils::{extract_origin, is_arch_package_url, resolve_href};
use ego_tree::NodeRef;
use scraper::{ElementRef, Html, Node, Selector};
/// What: Parse Arch Linux news HTML and extract article text using `scraper`.
///
/// Inputs:
/// - `html`: Ra... | rust | MIT | c433ad6a837b7985d8b99ba9afd8f07a93d046f4 | 2026-01-04T20:14:32.225407Z | false |
Firstp1ck/Pacsea | https://github.com/Firstp1ck/Pacsea/blob/c433ad6a837b7985d8b99ba9afd8f07a93d046f4/src/sources/news/tests.rs | src/sources/news/tests.rs | //! Tests for news module (parsing and RSS).
use crate::sources::news::parse::{parse_arch_news_html, prune_news_boilerplate};
use crate::sources::news::utils::{extract_between, strip_time_and_tz};
#[test]
fn advisory_boilerplate_is_removed() {
let input = r"
Arch Linux
• Home
• Packages
Arch Linux Security Advis... | rust | MIT | c433ad6a837b7985d8b99ba9afd8f07a93d046f4 | 2026-01-04T20:14:32.225407Z | false |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.