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 |
|---|---|---|---|---|---|---|---|---|
Levizor/tray-tui | https://github.com/Levizor/tray-tui/blob/fe96a8111d711dcecf0fe31922fb122e0ef8b80e/src/config.rs | src/config.rs | use crate::CMD;
use crokey::{key, KeyCombination};
use crossterm::event::{KeyCode, KeyModifiers};
use std::error::Error;
use std::str::FromStr;
use ratatui::style::Color;
use serde::{Deserialize, Deserializer};
use std::collections::HashMap;
use std::path::PathBuf;
#[derive(Debug, Deserialize, Clone, Copy)]
#[serde(re... | rust | MIT | fe96a8111d711dcecf0fe31922fb122e0ef8b80e | 2026-01-04T20:23:48.573203Z | false |
Levizor/tray-tui | https://github.com/Levizor/tray-tui/blob/fe96a8111d711dcecf0fe31922fb122e0ef8b80e/src/app.rs | src/app.rs | use indexmap::IndexMap;
use ratatui::layout::{Position, Rect};
use std::{
cell::{Ref, RefMut},
collections::HashMap,
error,
sync::{Arc, Mutex, MutexGuard},
};
use system_tray::client::ActivateRequest;
use system_tray::{
client::{Client, Event},
item::StatusNotifierItem,
menu::TrayMenu,
};
us... | rust | MIT | fe96a8111d711dcecf0fe31922fb122e0ef8b80e | 2026-01-04T20:23:48.573203Z | false |
Levizor/tray-tui | https://github.com/Levizor/tray-tui/blob/fe96a8111d711dcecf0fe31922fb122e0ef8b80e/src/wrappers.rs | src/wrappers.rs | use std::cell::RefCell;
use ratatui::widgets::{Block, StatefulWidget};
use ratatui::{
buffer::Buffer,
layout::{self, Rect},
style::{Color, Style},
widgets::Widget,
};
use system_tray::client::{Event, UpdateEvent};
use system_tray::{
item::StatusNotifierItem,
menu::{MenuItem, TrayMenu},
};
use ... | rust | MIT | fe96a8111d711dcecf0fe31922fb122e0ef8b80e | 2026-01-04T20:23:48.573203Z | false |
Levizor/tray-tui | https://github.com/Levizor/tray-tui/blob/fe96a8111d711dcecf0fe31922fb122e0ef8b80e/src/event.rs | src/event.rs | use std::collections::HashMap;
use crokey::KeyCombination;
use crossterm::event::{Event as CrosstermEvent, MouseEvent, KeyEventKind};
use futures::{FutureExt, StreamExt};
use tokio::sync::mpsc;
use crate::app::AppResult;
use crate::config::KeyBindEvent;
/// Terminal events.
#[derive(Clone, Copy, Debug)]
pub enum Eve... | rust | MIT | fe96a8111d711dcecf0fe31922fb122e0ef8b80e | 2026-01-04T20:23:48.573203Z | false |
Levizor/tray-tui | https://github.com/Levizor/tray-tui/blob/fe96a8111d711dcecf0fe31922fb122e0ef8b80e/src/cli.rs | src/cli.rs | use clap::value_parser;
use clap::Parser;
use clap_complete::Shell;
#[derive(Parser, Debug)]
#[command(version, about, long_about=None)]
pub struct Cli {
/// Path to config file
#[arg(short, long, value_name = "CONFIG_PATH", value_parser = value_parser!(std::path::PathBuf))]
pub config_path: Option<std::pa... | rust | MIT | fe96a8111d711dcecf0fe31922fb122e0ef8b80e | 2026-01-04T20:23:48.573203Z | false |
Levizor/tray-tui | https://github.com/Levizor/tray-tui/blob/fe96a8111d711dcecf0fe31922fb122e0ef8b80e/src/ui.rs | src/ui.rs | use std::iter::repeat_n;
use ratatui::{
layout::{Constraint, Layout, Rect},
Frame,
};
use crate::app::App;
use crate::wrappers::Item;
/// Renders the user interface widgets.
pub fn render(app: &mut App, frame: &mut Frame) {
let mut rectangles: Vec<Rect> = Vec::default();
if let Some(items) = app.get_... | rust | MIT | fe96a8111d711dcecf0fe31922fb122e0ef8b80e | 2026-01-04T20:23:48.573203Z | false |
Levizor/tray-tui | https://github.com/Levizor/tray-tui/blob/fe96a8111d711dcecf0fe31922fb122e0ef8b80e/src/main.rs | src/main.rs | use std::{fs::File, io};
use crate::{
app::{App, AppResult},
cli::Cli,
config::Config,
event::{Event, EventHandler},
handler::{handle_key_events, handle_mouse_event},
tui::Tui,
wrappers::LoggableEvent,
};
use clap::{CommandFactory, Parser};
use clap_complete::generate;
use ratatui::{backend... | rust | MIT | fe96a8111d711dcecf0fe31922fb122e0ef8b80e | 2026-01-04T20:23:48.573203Z | false |
Levizor/tray-tui | https://github.com/Levizor/tray-tui/blob/fe96a8111d711dcecf0fe31922fb122e0ef8b80e/src/tui.rs | src/tui.rs | use crate::app::{App, AppResult};
use crate::event::EventHandler;
use crate::ui;
use crossterm::event::{DisableMouseCapture, EnableMouseCapture};
use crossterm::terminal::{self, EnterAlternateScreen, LeaveAlternateScreen};
use ratatui::backend::Backend;
use ratatui::Terminal;
use std::io;
use std::panic;
/// Represent... | rust | MIT | fe96a8111d711dcecf0fe31922fb122e0ef8b80e | 2026-01-04T20:23:48.573203Z | false |
Levizor/tray-tui | https://github.com/Levizor/tray-tui/blob/fe96a8111d711dcecf0fe31922fb122e0ef8b80e/src/handler.rs | src/handler.rs | use crate::{
app::{App, AppResult, FocusDirection},
config::KeyBindEvent,
};
use crossterm::event::{MouseButton, MouseEvent, MouseEventKind};
use ratatui::layout::Position;
/// Handles the key events and updates the state of [`App`].
pub async fn handle_key_events(key_bind_event: KeyBindEvent, app: &mut App) -... | rust | MIT | fe96a8111d711dcecf0fe31922fb122e0ef8b80e | 2026-01-04T20:23:48.573203Z | false |
nbdd0121/unwinding | https://github.com/nbdd0121/unwinding/blob/3bc28cec6c30eade0e1caa094b49db78101b19ef/cdylib/src/lib.rs | cdylib/src/lib.rs | #![no_std]
// Keep this explicit
#[allow(unused_extern_crates)]
extern crate unwinding;
| rust | Apache-2.0 | 3bc28cec6c30eade0e1caa094b49db78101b19ef | 2026-01-04T20:23:52.098121Z | false |
nbdd0121/unwinding | https://github.com/nbdd0121/unwinding/blob/3bc28cec6c30eade0e1caa094b49db78101b19ef/src/lib.rs | src/lib.rs | #![doc = include_str!("../README.md")]
// We use `non_exhaustive_omitted_patterns_lint` which is a nightly lint.
#![allow(unknown_lints)]
#![cfg_attr(
any(
feature = "personality",
feature = "personality-dummy",
feature = "panicking",
feature = "panic-handler-dummy"
),
allow(... | rust | Apache-2.0 | 3bc28cec6c30eade0e1caa094b49db78101b19ef | 2026-01-04T20:23:52.098121Z | false |
nbdd0121/unwinding | https://github.com/nbdd0121/unwinding/blob/3bc28cec6c30eade0e1caa094b49db78101b19ef/src/panic_handler_dummy.rs | src/panic_handler_dummy.rs | use core::panic::PanicInfo;
#[panic_handler]
fn panic(_info: &PanicInfo<'_>) -> ! {
crate::util::abort();
}
| rust | Apache-2.0 | 3bc28cec6c30eade0e1caa094b49db78101b19ef | 2026-01-04T20:23:52.098121Z | false |
nbdd0121/unwinding | https://github.com/nbdd0121/unwinding/blob/3bc28cec6c30eade0e1caa094b49db78101b19ef/src/abi.rs | src/abi.rs | use core::ffi::c_void;
use core::ops;
use crate::util::*;
#[cfg(not(feature = "unwinder"))]
use crate::arch::Arch;
#[cfg(feature = "unwinder")]
pub use crate::unwinder::*;
#[repr(transparent)]
#[derive(Clone, Copy, PartialEq, Eq)]
pub struct UnwindReasonCode(pub c_int);
#[allow(unused)]
impl UnwindReasonCode {
... | rust | Apache-2.0 | 3bc28cec6c30eade0e1caa094b49db78101b19ef | 2026-01-04T20:23:52.098121Z | false |
nbdd0121/unwinding | https://github.com/nbdd0121/unwinding/blob/3bc28cec6c30eade0e1caa094b49db78101b19ef/src/panic.rs | src/panic.rs | use alloc::boxed::Box;
use core::any::Any;
use core::mem::MaybeUninit;
use crate::abi::*;
#[cfg(feature = "panic-handler")]
pub use crate::panic_handler::*;
use crate::panicking::Exception;
static CANARY: u8 = 0;
#[repr(transparent)]
struct RustPanic(Box<dyn Any + Send>, DropGuard);
struct DropGuard;
impl Drop for... | rust | Apache-2.0 | 3bc28cec6c30eade0e1caa094b49db78101b19ef | 2026-01-04T20:23:52.098121Z | false |
nbdd0121/unwinding | https://github.com/nbdd0121/unwinding/blob/3bc28cec6c30eade0e1caa094b49db78101b19ef/src/util.rs | src/util.rs | use gimli::{EndianSlice, NativeEndian, Pointer};
pub type StaticSlice = EndianSlice<'static, NativeEndian>;
pub unsafe fn get_unlimited_slice<'a>(start: *const u8) -> &'a [u8] {
// Create the largest possible slice for this address.
let start = start as usize;
let end = start.saturating_add(isize::MAX as ... | rust | Apache-2.0 | 3bc28cec6c30eade0e1caa094b49db78101b19ef | 2026-01-04T20:23:52.098121Z | false |
nbdd0121/unwinding | https://github.com/nbdd0121/unwinding/blob/3bc28cec6c30eade0e1caa094b49db78101b19ef/src/personality.rs | src/personality.rs | // References:
// https://github.com/rust-lang/rust/blob/c4be230b4a30eb74e3a3908455731ebc2f731d3d/library/panic_unwind/src/gcc.rs
// https://github.com/rust-lang/rust/blob/c4be230b4a30eb74e3a3908455731ebc2f731d3d/library/panic_unwind/src/dwarf/eh.rs
// https://docs.rs/gimli/0.25.0/src/gimli/read/cfi.rs.html
use core::... | rust | Apache-2.0 | 3bc28cec6c30eade0e1caa094b49db78101b19ef | 2026-01-04T20:23:52.098121Z | false |
nbdd0121/unwinding | https://github.com/nbdd0121/unwinding/blob/3bc28cec6c30eade0e1caa094b49db78101b19ef/src/panic_handler.rs | src/panic_handler.rs | use crate::abi::*;
use crate::print::*;
use alloc::boxed::Box;
use core::any::Any;
use core::cell::Cell;
use core::ffi::c_void;
use core::panic::{Location, PanicInfo};
use core::sync::atomic::{AtomicI32, Ordering};
#[thread_local]
static PANIC_COUNT: Cell<usize> = Cell::new(0);
#[link(name = "c")]
unsafe extern "C" {... | rust | Apache-2.0 | 3bc28cec6c30eade0e1caa094b49db78101b19ef | 2026-01-04T20:23:52.098121Z | false |
nbdd0121/unwinding | https://github.com/nbdd0121/unwinding/blob/3bc28cec6c30eade0e1caa094b49db78101b19ef/src/personality_dummy.rs | src/personality_dummy.rs | use crate::abi::*;
use crate::util::*;
#[lang = "eh_personality"]
unsafe extern "C" fn personality(
version: c_int,
_actions: UnwindAction,
_exception_class: u64,
_exception: *mut UnwindException,
_ctx: &mut UnwindContext<'_>,
) -> UnwindReasonCode {
if version != 1 {
return UnwindReaso... | rust | Apache-2.0 | 3bc28cec6c30eade0e1caa094b49db78101b19ef | 2026-01-04T20:23:52.098121Z | false |
nbdd0121/unwinding | https://github.com/nbdd0121/unwinding/blob/3bc28cec6c30eade0e1caa094b49db78101b19ef/src/system_alloc.rs | src/system_alloc.rs | use core::alloc::{GlobalAlloc, Layout};
use core::{cmp, mem, ptr};
pub struct System;
const MIN_ALIGN: usize = mem::size_of::<usize>() * 2;
// Taken std
unsafe impl GlobalAlloc for System {
#[inline]
unsafe fn alloc(&self, layout: Layout) -> *mut u8 {
if layout.align() <= MIN_ALIGN && layout.align() ... | rust | Apache-2.0 | 3bc28cec6c30eade0e1caa094b49db78101b19ef | 2026-01-04T20:23:52.098121Z | false |
nbdd0121/unwinding | https://github.com/nbdd0121/unwinding/blob/3bc28cec6c30eade0e1caa094b49db78101b19ef/src/print.rs | src/print.rs | pub use crate::{eprint, eprintln, print, println};
#[doc(hidden)]
pub struct StdoutPrinter;
impl core::fmt::Write for StdoutPrinter {
fn write_str(&mut self, s: &str) -> core::fmt::Result {
unsafe { libc::printf(b"%.*s\0".as_ptr() as _, s.len() as i32, s.as_ptr()) };
Ok(())
}
}
#[doc(hidden)]
... | rust | Apache-2.0 | 3bc28cec6c30eade0e1caa094b49db78101b19ef | 2026-01-04T20:23:52.098121Z | false |
nbdd0121/unwinding | https://github.com/nbdd0121/unwinding/blob/3bc28cec6c30eade0e1caa094b49db78101b19ef/src/arch.rs | src/arch.rs | #[cfg(target_arch = "x86_64")]
mod x86_64 {
use gimli::{Register, X86_64};
pub struct Arch;
#[allow(unused)]
impl Arch {
pub const SP: Register = X86_64::RSP;
pub const RA: Register = X86_64::RA;
pub const UNWIND_DATA_REG: (Register, Register) = (X86_64::RAX, X86_64::RDX);
... | rust | Apache-2.0 | 3bc28cec6c30eade0e1caa094b49db78101b19ef | 2026-01-04T20:23:52.098121Z | false |
nbdd0121/unwinding | https://github.com/nbdd0121/unwinding/blob/3bc28cec6c30eade0e1caa094b49db78101b19ef/src/panicking.rs | src/panicking.rs | use core::mem::ManuallyDrop;
use crate::abi::*;
pub unsafe trait Exception {
const CLASS: [u8; 8];
fn wrap(this: Self) -> *mut UnwindException;
unsafe fn unwrap(ex: *mut UnwindException) -> Self;
}
pub fn begin_panic<E: Exception>(exception: E) -> UnwindReasonCode {
unsafe extern "C" fn exception_cl... | rust | Apache-2.0 | 3bc28cec6c30eade0e1caa094b49db78101b19ef | 2026-01-04T20:23:52.098121Z | false |
nbdd0121/unwinding | https://github.com/nbdd0121/unwinding/blob/3bc28cec6c30eade0e1caa094b49db78101b19ef/src/unwinder/mod.rs | src/unwinder/mod.rs | mod arch;
mod find_fde;
mod frame;
use core::ffi::c_void;
use core::ptr;
use gimli::Register;
use crate::abi::*;
use crate::arch::*;
use crate::util::*;
use arch::*;
use find_fde::FDEFinder;
use frame::Frame;
#[cfg(feature = "fde-custom")]
pub use find_fde::custom_eh_frame_finder;
// Helper function to turn `save_c... | rust | Apache-2.0 | 3bc28cec6c30eade0e1caa094b49db78101b19ef | 2026-01-04T20:23:52.098121Z | false |
nbdd0121/unwinding | https://github.com/nbdd0121/unwinding/blob/3bc28cec6c30eade0e1caa094b49db78101b19ef/src/unwinder/frame.rs | src/unwinder/frame.rs | use gimli::{
BaseAddresses, CfaRule, Register, RegisterRule, UnwindContext, UnwindExpression, UnwindTableRow,
};
#[cfg(feature = "dwarf-expr")]
use gimli::{Evaluation, EvaluationResult, Location, Value};
use super::arch::*;
use super::find_fde::{self, FDEFinder, FDESearchResult};
use crate::abi::PersonalityRoutine... | rust | Apache-2.0 | 3bc28cec6c30eade0e1caa094b49db78101b19ef | 2026-01-04T20:23:52.098121Z | false |
nbdd0121/unwinding | https://github.com/nbdd0121/unwinding/blob/3bc28cec6c30eade0e1caa094b49db78101b19ef/src/unwinder/find_fde/gnu_eh_frame_hdr.rs | src/unwinder/find_fde/gnu_eh_frame_hdr.rs | use super::FDESearchResult;
use crate::util::*;
use gimli::{BaseAddresses, EhFrame, EhFrameHdr, NativeEndian, UnwindSection};
pub struct StaticFinder(());
pub fn get_finder() -> &'static StaticFinder {
&StaticFinder(())
}
unsafe extern "C" {
static __executable_start: u8;
static __etext: u8;
static ... | rust | Apache-2.0 | 3bc28cec6c30eade0e1caa094b49db78101b19ef | 2026-01-04T20:23:52.098121Z | false |
nbdd0121/unwinding | https://github.com/nbdd0121/unwinding/blob/3bc28cec6c30eade0e1caa094b49db78101b19ef/src/unwinder/find_fde/fixed.rs | src/unwinder/find_fde/fixed.rs | use super::FDESearchResult;
use crate::util::*;
use gimli::{BaseAddresses, EhFrame, NativeEndian, UnwindSection};
pub struct StaticFinder(());
pub fn get_finder() -> &'static StaticFinder {
&StaticFinder(())
}
unsafe extern "C" {
static __executable_start: u8;
static __etext: u8;
static __eh_frame: ... | rust | Apache-2.0 | 3bc28cec6c30eade0e1caa094b49db78101b19ef | 2026-01-04T20:23:52.098121Z | false |
nbdd0121/unwinding | https://github.com/nbdd0121/unwinding/blob/3bc28cec6c30eade0e1caa094b49db78101b19ef/src/unwinder/find_fde/phdr.rs | src/unwinder/find_fde/phdr.rs | use super::FDESearchResult;
use crate::util::*;
use core::mem;
use core::slice;
use gimli::{BaseAddresses, EhFrame, EhFrameHdr, NativeEndian, UnwindSection};
use libc::{PT_DYNAMIC, PT_GNU_EH_FRAME, PT_LOAD};
#[cfg(target_pointer_width = "32")]
use libc::Elf32_Phdr as Elf_Phdr;
#[cfg(target_pointer_width = "64")]
use ... | rust | Apache-2.0 | 3bc28cec6c30eade0e1caa094b49db78101b19ef | 2026-01-04T20:23:52.098121Z | false |
nbdd0121/unwinding | https://github.com/nbdd0121/unwinding/blob/3bc28cec6c30eade0e1caa094b49db78101b19ef/src/unwinder/find_fde/registry.rs | src/unwinder/find_fde/registry.rs | use super::FDESearchResult;
use crate::util::get_unlimited_slice;
use alloc::boxed::Box;
use core::ffi::c_void;
use core::mem::MaybeUninit;
use core::ops;
use core::ptr;
use gimli::{BaseAddresses, EhFrame, NativeEndian, UnwindSection};
enum Table {
Single(*const c_void),
Multiple(*const *const c_void),
}
stru... | rust | Apache-2.0 | 3bc28cec6c30eade0e1caa094b49db78101b19ef | 2026-01-04T20:23:52.098121Z | false |
nbdd0121/unwinding | https://github.com/nbdd0121/unwinding/blob/3bc28cec6c30eade0e1caa094b49db78101b19ef/src/unwinder/find_fde/mod.rs | src/unwinder/find_fde/mod.rs | #[cfg(feature = "fde-custom")]
mod custom;
#[cfg(feature = "fde-static")]
mod fixed;
#[cfg(feature = "fde-gnu-eh-frame-hdr")]
mod gnu_eh_frame_hdr;
#[cfg(feature = "fde-phdr")]
mod phdr;
#[cfg(feature = "fde-registry")]
mod registry;
use crate::util::*;
use gimli::{BaseAddresses, EhFrame, FrameDescriptionEntry};
#[cf... | rust | Apache-2.0 | 3bc28cec6c30eade0e1caa094b49db78101b19ef | 2026-01-04T20:23:52.098121Z | false |
nbdd0121/unwinding | https://github.com/nbdd0121/unwinding/blob/3bc28cec6c30eade0e1caa094b49db78101b19ef/src/unwinder/find_fde/custom.rs | src/unwinder/find_fde/custom.rs | use super::{FDEFinder, FDESearchResult};
use crate::util::{deref_pointer, get_unlimited_slice};
use core::sync::atomic::{AtomicU32, Ordering};
use gimli::{BaseAddresses, EhFrame, EhFrameHdr, NativeEndian, UnwindSection};
pub(crate) struct CustomFinder(());
pub(crate) fn get_finder() -> &'static CustomFinder {
&C... | rust | Apache-2.0 | 3bc28cec6c30eade0e1caa094b49db78101b19ef | 2026-01-04T20:23:52.098121Z | false |
nbdd0121/unwinding | https://github.com/nbdd0121/unwinding/blob/3bc28cec6c30eade0e1caa094b49db78101b19ef/src/unwinder/arch/x86.rs | src/unwinder/arch/x86.rs | use core::fmt;
use core::ops;
use gimli::{Register, X86};
use super::maybe_cfi;
// Match DWARF_FRAME_REGISTERS in libgcc
pub const MAX_REG_RULES: usize = 17;
#[repr(C)]
#[derive(Clone, Default)]
pub struct Context {
pub registers: [usize; 8],
pub ra: usize,
pub mcxsr: usize,
pub fcw: usize,
}
impl f... | rust | Apache-2.0 | 3bc28cec6c30eade0e1caa094b49db78101b19ef | 2026-01-04T20:23:52.098121Z | false |
nbdd0121/unwinding | https://github.com/nbdd0121/unwinding/blob/3bc28cec6c30eade0e1caa094b49db78101b19ef/src/unwinder/arch/riscv64.rs | src/unwinder/arch/riscv64.rs | use core::fmt;
use core::ops;
use gimli::{Register, RiscV};
use super::maybe_cfi;
// Match DWARF_FRAME_REGISTERS in libgcc
pub const MAX_REG_RULES: usize = 65;
#[cfg(all(target_feature = "f", not(target_feature = "d")))]
compile_error!("RISC-V with only F extension is not supported");
#[repr(C)]
#[derive(Clone, Def... | rust | Apache-2.0 | 3bc28cec6c30eade0e1caa094b49db78101b19ef | 2026-01-04T20:23:52.098121Z | false |
nbdd0121/unwinding | https://github.com/nbdd0121/unwinding/blob/3bc28cec6c30eade0e1caa094b49db78101b19ef/src/unwinder/arch/x86_64.rs | src/unwinder/arch/x86_64.rs | use core::fmt;
use core::ops;
use gimli::{Register, X86_64};
use super::maybe_cfi;
// Match DWARF_FRAME_REGISTERS in libgcc
pub const MAX_REG_RULES: usize = 17;
#[repr(C)]
#[derive(Clone, Default)]
pub struct Context {
pub registers: [usize; 16],
pub ra: usize,
pub mcxsr: usize,
pub fcw: usize,
}
im... | rust | Apache-2.0 | 3bc28cec6c30eade0e1caa094b49db78101b19ef | 2026-01-04T20:23:52.098121Z | false |
nbdd0121/unwinding | https://github.com/nbdd0121/unwinding/blob/3bc28cec6c30eade0e1caa094b49db78101b19ef/src/unwinder/arch/mod.rs | src/unwinder/arch/mod.rs | #[cfg(target_arch = "x86_64")]
mod x86_64;
#[cfg(target_arch = "x86_64")]
pub use x86_64::*;
#[cfg(target_arch = "x86")]
mod x86;
#[cfg(target_arch = "x86")]
pub use x86::*;
#[cfg(target_arch = "riscv64")]
mod riscv64;
#[cfg(target_arch = "riscv64")]
pub use riscv64::*;
#[cfg(target_arch = "riscv32")]
mod riscv32;
#... | rust | Apache-2.0 | 3bc28cec6c30eade0e1caa094b49db78101b19ef | 2026-01-04T20:23:52.098121Z | false |
nbdd0121/unwinding | https://github.com/nbdd0121/unwinding/blob/3bc28cec6c30eade0e1caa094b49db78101b19ef/src/unwinder/arch/aarch64.rs | src/unwinder/arch/aarch64.rs | use core::fmt;
use core::ops;
use gimli::{AArch64, Register};
use super::maybe_cfi;
// Match DWARF_FRAME_REGISTERS in libgcc
pub const MAX_REG_RULES: usize = 97;
#[repr(C)]
#[derive(Clone, Default)]
pub struct Context {
pub gp: [usize; 31],
pub sp: usize,
pub fp: [usize; 32],
}
impl fmt::Debug for Conte... | rust | Apache-2.0 | 3bc28cec6c30eade0e1caa094b49db78101b19ef | 2026-01-04T20:23:52.098121Z | false |
nbdd0121/unwinding | https://github.com/nbdd0121/unwinding/blob/3bc28cec6c30eade0e1caa094b49db78101b19ef/src/unwinder/arch/riscv32.rs | src/unwinder/arch/riscv32.rs | use core::fmt;
use core::ops;
use gimli::{Register, RiscV};
use super::maybe_cfi;
// Match DWARF_FRAME_REGISTERS in libgcc
pub const MAX_REG_RULES: usize = 65;
#[cfg(all(target_feature = "f", not(target_feature = "d")))]
compile_error!("RISC-V with only F extension is not supported");
#[repr(C)]
#[derive(Clone, Def... | rust | Apache-2.0 | 3bc28cec6c30eade0e1caa094b49db78101b19ef | 2026-01-04T20:23:52.098121Z | false |
nbdd0121/unwinding | https://github.com/nbdd0121/unwinding/blob/3bc28cec6c30eade0e1caa094b49db78101b19ef/tests/compile_tests.rs | tests/compile_tests.rs | use std::process::Command;
#[test]
fn main() {
let dir = env!("CARGO_MANIFEST_DIR");
let tests = [
"throw_and_catch",
"catch_std_exception",
"std_catch_exception",
"panic_abort_no_debuginfo",
];
for test in tests {
let status = Command::new("./check.sh")
... | rust | Apache-2.0 | 3bc28cec6c30eade0e1caa094b49db78101b19ef | 2026-01-04T20:23:52.098121Z | false |
nbdd0121/unwinding | https://github.com/nbdd0121/unwinding/blob/3bc28cec6c30eade0e1caa094b49db78101b19ef/test_crates/panic_abort_no_debuginfo/src/main.rs | test_crates/panic_abort_no_debuginfo/src/main.rs | extern crate unwinding;
fn main() {}
| rust | Apache-2.0 | 3bc28cec6c30eade0e1caa094b49db78101b19ef | 2026-01-04T20:23:52.098121Z | false |
nbdd0121/unwinding | https://github.com/nbdd0121/unwinding/blob/3bc28cec6c30eade0e1caa094b49db78101b19ef/test_crates/std_catch_exception/src/main.rs | test_crates/std_catch_exception/src/main.rs | extern crate unwinding;
fn main() {
let _ = std::panic::catch_unwind(|| {
unwinding::panic::begin_panic(Box::new("test"));
});
}
| rust | Apache-2.0 | 3bc28cec6c30eade0e1caa094b49db78101b19ef | 2026-01-04T20:23:52.098121Z | false |
nbdd0121/unwinding | https://github.com/nbdd0121/unwinding/blob/3bc28cec6c30eade0e1caa094b49db78101b19ef/test_crates/catch_std_exception/src/main.rs | test_crates/catch_std_exception/src/main.rs | extern crate unwinding;
fn main() {
let _ = unwinding::panic::catch_unwind(|| {
panic!();
});
}
| rust | Apache-2.0 | 3bc28cec6c30eade0e1caa094b49db78101b19ef | 2026-01-04T20:23:52.098121Z | false |
nbdd0121/unwinding | https://github.com/nbdd0121/unwinding/blob/3bc28cec6c30eade0e1caa094b49db78101b19ef/test_crates/throw_and_catch/src/main.rs | test_crates/throw_and_catch/src/main.rs | #![no_std]
#![no_main]
extern crate alloc;
extern crate unwinding;
use alloc::{borrow::ToOwned, string::String};
use unwinding::print::*;
#[link(name = "c")]
unsafe extern "C" {}
struct PrintOnDrop(String);
impl Drop for PrintOnDrop {
fn drop(&mut self) {
eprintln!("dropped: {:?}", self.0);
}
}
st... | rust | Apache-2.0 | 3bc28cec6c30eade0e1caa094b49db78101b19ef | 2026-01-04T20:23:52.098121Z | false |
ballsteve/xrust | https://github.com/ballsteve/xrust/blob/4b8681166cc9894c2bf068afe79a8414d7a13970/src/lib.rs | src/lib.rs | /*!
A Rust implementation of the [XQuery and XPath Data Model 3.1](https://www.w3.org/TR/xpath-datamodel-31/) and [XSLT 3.0](http://www.w3.org/TR/xslt-30/). The idea is to separate the syntax from the semantics. A [Transform] performs the semantics; an XPath expression or XSL Stylesheet is the syntax that is mapped to ... | rust | Apache-2.0 | 4b8681166cc9894c2bf068afe79a8414d7a13970 | 2026-01-04T20:23:44.719720Z | false |
ballsteve/xrust | https://github.com/ballsteve/xrust/blob/4b8681166cc9894c2bf068afe79a8414d7a13970/src/pattern.rs | src/pattern.rs | /*! # Support for XPath patterns.
This module provides both a parser to compile a [Pattern], and an interpreter to determine if an item matches a compiled pattern.
Patterns are defined in XSLT 3.0 5.5.2.
A string can be compiled as [Pattern] by using the ```try_from``` associated function.
```rust
# use xrust::item... | rust | Apache-2.0 | 4b8681166cc9894c2bf068afe79a8414d7a13970 | 2026-01-04T20:23:44.719720Z | false |
ballsteve/xrust | https://github.com/ballsteve/xrust/blob/4b8681166cc9894c2bf068afe79a8414d7a13970/src/externals.rs | src/externals.rs | /*! Defines interfaces for closures and functions that are used to communicate with external processes.
*/
use crate::xdmerror::Error;
/// Resolves a URL, given as a base URI and a relative URL, and returns the content of the resource as a string.
pub(crate) type URLResolver = fn(Option<String>, String) -> Result<Str... | rust | Apache-2.0 | 4b8681166cc9894c2bf068afe79a8414d7a13970 | 2026-01-04T20:23:44.719720Z | false |
ballsteve/xrust | https://github.com/ballsteve/xrust/blob/4b8681166cc9894c2bf068afe79a8414d7a13970/src/value.rs | src/value.rs | //! An atomic value.
//!
//! An atomic value that is an item in a sequence.
use crate::qname::QualifiedName;
use crate::xdmerror::{Error, ErrorKind};
use chrono::{DateTime, Local, NaiveDate};
use core::fmt;
use core::hash::{Hash, Hasher};
use rust_decimal::prelude::ToPrimitive;
use rust_decimal::Decimal;
#[cfg(test)]
... | rust | Apache-2.0 | 4b8681166cc9894c2bf068afe79a8414d7a13970 | 2026-01-04T20:23:44.719720Z | false |
ballsteve/xrust | https://github.com/ballsteve/xrust/blob/4b8681166cc9894c2bf068afe79a8414d7a13970/src/xdmerror.rs | src/xdmerror.rs | //! XDM, XPath, XQuery, and XSLT errors.
use crate::qname::QualifiedName;
use core::str;
use std::fmt;
use std::fmt::Formatter;
/// Errors defined in XPath
#[derive(Copy, Clone, Debug, PartialEq)]
pub enum ErrorKind {
StaticAbsent,
/// XPST0001
DynamicAbsent,
/// XPDY0002
StaticSyntax,
/// XPS... | rust | Apache-2.0 | 4b8681166cc9894c2bf068afe79a8414d7a13970 | 2026-01-04T20:23:44.719720Z | false |
ballsteve/xrust | https://github.com/ballsteve/xrust/blob/4b8681166cc9894c2bf068afe79a8414d7a13970/src/xslt.rs | src/xslt.rs | /*! ## An XSLT compiler
Compile an XSLT stylesheet into a [Transform]ation.
Once the stylesheet has been compiled, it may then be evaluated with an appropriate context.
NB. This module, by default, does not resolve include or import statements. See the xrust-net crate for a helper module to do that.
```rust
use std... | rust | Apache-2.0 | 4b8681166cc9894c2bf068afe79a8414d7a13970 | 2026-01-04T20:23:44.719720Z | true |
ballsteve/xrust | https://github.com/ballsteve/xrust/blob/4b8681166cc9894c2bf068afe79a8414d7a13970/src/xmldecl.rs | src/xmldecl.rs | /*! Defines common features of XML documents.
*/
use crate::qname::QualifiedName;
use std::collections::HashMap;
use std::fmt;
use std::fmt::Formatter;
#[derive(Clone, PartialEq)]
pub struct XMLDecl {
pub(crate) version: String,
pub(crate) encoding: Option<String>,
pub(crate) standalone: Option<String>,
... | rust | Apache-2.0 | 4b8681166cc9894c2bf068afe79a8414d7a13970 | 2026-01-04T20:23:44.719720Z | false |
ballsteve/xrust | https://github.com/ballsteve/xrust/blob/4b8681166cc9894c2bf068afe79a8414d7a13970/src/qname.rs | src/qname.rs | //! Support for Qualified Names.
//! TODO: Intern names for speedy equality checks (compare pointers, rather than characters).
use crate::item::Node;
use crate::namespace::NamespaceMap;
use crate::parser::xml::qname::eqname;
use crate::parser::ParserState;
use crate::trees::nullo::Nullo;
use crate::value::Value;
use c... | rust | Apache-2.0 | 4b8681166cc9894c2bf068afe79a8414d7a13970 | 2026-01-04T20:23:44.719720Z | false |
ballsteve/xrust | https://github.com/ballsteve/xrust/blob/4b8681166cc9894c2bf068afe79a8414d7a13970/src/item.rs | src/item.rs | /*! Sequences and Items.
A [Sequence] is the fundamental data type in XPath. It is a series of zero or more [Item]s.
An [Item] is a [Node], Function or atomic [Value].
[Node]s are defined as a trait.
*/
use crate::item;
use crate::output::OutputDefinition;
use crate::qname::QualifiedName;
use crate::validators::{Sc... | rust | Apache-2.0 | 4b8681166cc9894c2bf068afe79a8414d7a13970 | 2026-01-04T20:23:44.719720Z | false |
ballsteve/xrust | https://github.com/ballsteve/xrust/blob/4b8681166cc9894c2bf068afe79a8414d7a13970/src/output.rs | src/output.rs | /*! How to serialise a tree structure.
*/
use crate::qname::QualifiedName;
use core::fmt;
/// An output definition. See XSLT v3.0 26 Serialization
#[derive(Clone, Debug)]
pub struct OutputDefinition {
name: Option<QualifiedName>, // TODO: EQName
indent: bool,
// TODO: all the other myriad output parameter... | rust | Apache-2.0 | 4b8681166cc9894c2bf068afe79a8414d7a13970 | 2026-01-04T20:23:44.719720Z | false |
ballsteve/xrust | https://github.com/ballsteve/xrust/blob/4b8681166cc9894c2bf068afe79a8414d7a13970/src/namespace.rs | src/namespace.rs | //! Support for XML Namespaces
//!
//! The [NamespaceMap] object represents a static mapping of prefix to namespace URI. Since namespaces don't change once they are declared, this object is usually Rc-shared.
use crate::value::Value;
use std::collections::hash_map::Iter;
use std::collections::HashMap;
use std::rc::Rc;... | rust | Apache-2.0 | 4b8681166cc9894c2bf068afe79a8414d7a13970 | 2026-01-04T20:23:44.719720Z | false |
ballsteve/xrust | https://github.com/ballsteve/xrust/blob/4b8681166cc9894c2bf068afe79a8414d7a13970/src/validators/mod.rs | src/validators/mod.rs | pub mod dtd;
use crate::item::{Node, NodeType};
use crate::validators::dtd::validate_dtd;
#[derive(Clone)]
pub enum Schema {
DTD, //Will add the rest as they become available.
}
#[derive(Debug)]
pub enum ValidationError {
DocumentError(String),
SchemaError(String),
}
pub(crate) fn validate(doc: &impl No... | rust | Apache-2.0 | 4b8681166cc9894c2bf068afe79a8414d7a13970 | 2026-01-04T20:23:44.719720Z | false |
ballsteve/xrust | https://github.com/ballsteve/xrust/blob/4b8681166cc9894c2bf068afe79a8414d7a13970/src/validators/relaxng/pattern.rs | src/validators/relaxng/pattern.rs | use std::collections::HashMap;
use crate::xdmerror::Error;
use crate::item::{Node, Item};
use crate::trees::smite::RNode;
use crate::parser::xml::{parse as xmlparse};
use crate::transform::context::{StaticContextBuilder};
use crate::xslt::from_document;
pub(crate) type Param = (String, String);
#[derive(Debug)]
pub(... | rust | Apache-2.0 | 4b8681166cc9894c2bf068afe79a8414d7a13970 | 2026-01-04T20:23:44.719720Z | false |
ballsteve/xrust | https://github.com/ballsteve/xrust/blob/4b8681166cc9894c2bf068afe79a8414d7a13970/src/validators/relaxng/derive.rs | src/validators/relaxng/derive.rs | use crate::item::{Node, NodeType};
use crate::qname::QualifiedName;
use crate::trees::smite::RNode;
use crate::validators::relaxng::pattern::Param;
use crate::value::Value;
use std::collections::HashMap;
use std::rc::Rc;
pub(crate) fn derive(doc: &RNode, pat: RNode, refs: &HashMap<String, RNode>) -> RNode {
//prin... | rust | Apache-2.0 | 4b8681166cc9894c2bf068afe79a8414d7a13970 | 2026-01-04T20:23:44.719720Z | false |
ballsteve/xrust | https://github.com/ballsteve/xrust/blob/4b8681166cc9894c2bf068afe79a8414d7a13970/src/validators/relaxng/mod.rs | src/validators/relaxng/mod.rs | mod derive;
mod pattern;
use crate::trees::smite::RNode;
use crate::validators::relaxng::derive::{derive, is_nullable};
use crate::validators::ValidationError;
pub fn validate_relaxng(doc: &RNode, schema: &RNode) -> Result<(), ValidationError> {
let schemapattern = pattern::prepare(schema);
match schemapatte... | rust | Apache-2.0 | 4b8681166cc9894c2bf068afe79a8414d7a13970 | 2026-01-04T20:23:44.719720Z | false |
ballsteve/xrust | https://github.com/ballsteve/xrust/blob/4b8681166cc9894c2bf068afe79a8414d7a13970/src/validators/dtd/derive.rs | src/validators/dtd/derive.rs | use crate::item::NodeType;
use crate::qname::QualifiedName;
use crate::Node;
use crate::xmldecl::{DTDPattern, DTD};
pub(crate) fn is_nullable(pat: DTDPattern) -> bool {
match pat {
DTDPattern::Empty => true,
DTDPattern::Text => true,
DTDPattern::Any => true, //TODO Check
DTDPattern... | rust | Apache-2.0 | 4b8681166cc9894c2bf068afe79a8414d7a13970 | 2026-01-04T20:23:44.719720Z | false |
ballsteve/xrust | https://github.com/ballsteve/xrust/blob/4b8681166cc9894c2bf068afe79a8414d7a13970/src/validators/dtd/mod.rs | src/validators/dtd/mod.rs | mod derive;
use crate::item::NodeType;
use crate::validators::dtd::derive::{child_deriv, is_nullable};
use crate::validators::ValidationError;
use crate::Node;
pub(crate) fn validate_dtd(doc: impl Node) -> Result<(), ValidationError> {
match doc.node_type() {
NodeType::Document => {
match doc.... | rust | Apache-2.0 | 4b8681166cc9894c2bf068afe79a8414d7a13970 | 2026-01-04T20:23:44.719720Z | false |
ballsteve/xrust | https://github.com/ballsteve/xrust/blob/4b8681166cc9894c2bf068afe79a8414d7a13970/src/transform/misc.rs | src/transform/misc.rs | //! Miscellaneous support functions.
use crate::item::{Node, Sequence, SequenceTrait};
use crate::qname::QualifiedName;
use crate::transform::context::{Context, StaticContext};
use crate::transform::Transform;
use crate::xdmerror::Error;
use crate::ErrorKind;
use url::Url;
/// XSLT current function.
pub fn current<N:... | rust | Apache-2.0 | 4b8681166cc9894c2bf068afe79a8414d7a13970 | 2026-01-04T20:23:44.719720Z | false |
ballsteve/xrust | https://github.com/ballsteve/xrust/blob/4b8681166cc9894c2bf068afe79a8414d7a13970/src/transform/variables.rs | src/transform/variables.rs | //! Support for variables.
use crate::item::{Node, Sequence};
use crate::transform::context::{Context, ContextBuilder, StaticContext};
use crate::transform::Transform;
use crate::xdmerror::{Error, ErrorKind};
use url::Url;
/// Declare a variable in a new scope and then evaluate the given transformation.
/// Returns t... | rust | Apache-2.0 | 4b8681166cc9894c2bf068afe79a8414d7a13970 | 2026-01-04T20:23:44.719720Z | false |
ballsteve/xrust | https://github.com/ballsteve/xrust/blob/4b8681166cc9894c2bf068afe79a8414d7a13970/src/transform/datetime.rs | src/transform/datetime.rs | //! These functions are for features defined in XPath Functions 1.0 and 2.0.
use std::rc::Rc;
#[allow(unused_imports)]
use chrono::{DateTime, Datelike, FixedOffset, Local, Timelike};
use url::Url;
use crate::item::{Item, Node, Sequence, SequenceTrait};
use crate::parser::datetime::parse as picture_parse;
use crate::... | rust | Apache-2.0 | 4b8681166cc9894c2bf068afe79a8414d7a13970 | 2026-01-04T20:23:44.719720Z | false |
ballsteve/xrust | https://github.com/ballsteve/xrust/blob/4b8681166cc9894c2bf068afe79a8414d7a13970/src/transform/booleans.rs | src/transform/booleans.rs | //! These functions are for features defined in XPath Functions 1.0 and 2.0.
use std::rc::Rc;
use url::Url;
use crate::item::{Item, Node, Sequence, SequenceTrait};
use crate::transform::context::{Context, StaticContext};
use crate::transform::Transform;
use crate::value::Value;
use crate::xdmerror::Error;
/// XPath ... | rust | Apache-2.0 | 4b8681166cc9894c2bf068afe79a8414d7a13970 | 2026-01-04T20:23:44.719720Z | false |
ballsteve/xrust | https://github.com/ballsteve/xrust/blob/4b8681166cc9894c2bf068afe79a8414d7a13970/src/transform/callable.rs | src/transform/callable.rs | //! # Callables
//! Sequence constructors that are invoked by stylesheet code, such as named templates and functions.
//! The difference between them is that named templates have named parameters,
//! whereas functions have positional parameters.
// TODO: tunneling parameters
use crate::item::Node;
use crate::qname::... | rust | Apache-2.0 | 4b8681166cc9894c2bf068afe79a8414d7a13970 | 2026-01-04T20:23:44.719720Z | false |
ballsteve/xrust | https://github.com/ballsteve/xrust/blob/4b8681166cc9894c2bf068afe79a8414d7a13970/src/transform/template.rs | src/transform/template.rs | //! # Templates
use std::cmp::Ordering;
use std::fmt::{Debug, Formatter};
use std::rc::Rc;
use url::Url;
use crate::qname::QualifiedName;
use crate::transform::context::{Context, ContextBuilder, StaticContext};
use crate::transform::{do_sort, Order, Transform};
use crate::xdmerror::Error;
use crate::{Node, Pattern, S... | rust | Apache-2.0 | 4b8681166cc9894c2bf068afe79a8414d7a13970 | 2026-01-04T20:23:44.719720Z | false |
ballsteve/xrust | https://github.com/ballsteve/xrust/blob/4b8681166cc9894c2bf068afe79a8414d7a13970/src/transform/functions.rs | src/transform/functions.rs | //! These functions are for features defined in XPath Functions 1.0 and 2.0.
use pkg_version::*;
use std::rc::Rc;
use url::Url;
use crate::item::{Item, Node, Sequence};
use crate::qname::QualifiedName;
use crate::transform::context::{Context, StaticContext};
use crate::transform::{NamespaceMap, Transform};
use crate:... | rust | Apache-2.0 | 4b8681166cc9894c2bf068afe79a8414d7a13970 | 2026-01-04T20:23:44.719720Z | false |
ballsteve/xrust | https://github.com/ballsteve/xrust/blob/4b8681166cc9894c2bf068afe79a8414d7a13970/src/transform/mod.rs | src/transform/mod.rs | /*! The transformation engine.
A [Transform] performs processing, control flow, calculations, navigation, and construction to produce a [Sequence]. It starts with an initial context, the most important component of which is the current [Item]; this is often a [Node] that is the source document.
All functions in the [... | rust | Apache-2.0 | 4b8681166cc9894c2bf068afe79a8414d7a13970 | 2026-01-04T20:23:44.719720Z | true |
ballsteve/xrust | https://github.com/ballsteve/xrust/blob/4b8681166cc9894c2bf068afe79a8414d7a13970/src/transform/numbers.rs | src/transform/numbers.rs | //! These functions are for features defined in XPath Functions 1.0 and 2.0.
use std::rc::Rc;
use url::Url;
use english_numbers::{convert, Formatting};
use formato::Formato;
use italian_numbers::roman_converter;
use crate::item::{Item, Node, NodeType, Sequence, SequenceTrait};
use crate::pattern::{Branch, Pattern, S... | rust | Apache-2.0 | 4b8681166cc9894c2bf068afe79a8414d7a13970 | 2026-01-04T20:23:44.719720Z | false |
ballsteve/xrust | https://github.com/ballsteve/xrust/blob/4b8681166cc9894c2bf068afe79a8414d7a13970/src/transform/grouping.rs | src/transform/grouping.rs | //! These functions are for features defined in XPath Functions 1.0 and 2.0.
use crate::item::{Item, Node, Sequence};
use crate::transform::context::Context;
use crate::xdmerror::{Error, ErrorKind};
/// XSLT current-group function.
pub fn current_group<N: Node>(ctxt: &Context<N>) -> Result<Sequence<N>, Error> {
O... | rust | Apache-2.0 | 4b8681166cc9894c2bf068afe79a8414d7a13970 | 2026-01-04T20:23:44.719720Z | false |
ballsteve/xrust | https://github.com/ballsteve/xrust/blob/4b8681166cc9894c2bf068afe79a8414d7a13970/src/transform/strings.rs | src/transform/strings.rs | //! These functions are for features defined in XPath Functions 1.0 and 2.0.
use std::rc::Rc;
use unicode_segmentation::UnicodeSegmentation;
use url::Url;
use crate::item::{Item, Node, Sequence, SequenceTrait};
use crate::transform::context::{Context, StaticContext};
use crate::transform::Transform;
use crate::value... | rust | Apache-2.0 | 4b8681166cc9894c2bf068afe79a8414d7a13970 | 2026-01-04T20:23:44.719720Z | false |
ballsteve/xrust | https://github.com/ballsteve/xrust/blob/4b8681166cc9894c2bf068afe79a8414d7a13970/src/transform/controlflow.rs | src/transform/controlflow.rs | //! These functions are for features that control program flow.
use std::collections::HashMap;
use std::rc::Rc;
use url::Url;
use crate::item::{Node, Sequence, SequenceTrait};
use crate::transform::context::{Context, ContextBuilder, StaticContext};
use crate::transform::{do_sort, Grouping, Order, Transform};
use crat... | rust | Apache-2.0 | 4b8681166cc9894c2bf068afe79a8414d7a13970 | 2026-01-04T20:23:44.719720Z | false |
ballsteve/xrust | https://github.com/ballsteve/xrust/blob/4b8681166cc9894c2bf068afe79a8414d7a13970/src/transform/construct.rs | src/transform/construct.rs | //! These functions construct nodes, possibly destined for the result document.
use crate::item::{Node, NodeType, Sequence, SequenceTrait};
use crate::qname::QualifiedName;
use crate::transform::context::{Context, StaticContext};
use crate::transform::Transform;
use crate::value::Value;
use crate::xdmerror::{Error, Er... | rust | Apache-2.0 | 4b8681166cc9894c2bf068afe79a8414d7a13970 | 2026-01-04T20:23:44.719720Z | false |
ballsteve/xrust | https://github.com/ballsteve/xrust/blob/4b8681166cc9894c2bf068afe79a8414d7a13970/src/transform/context.rs | src/transform/context.rs | /*! Context for a transformation
A dynamic and static context for a transformation. These are both necessary to give the transformation all the data it needs to performs its functions.
The dynamic [Context] stores data that changes. It is frequently cloned to create a new context. A [ContextBuilder] can be used to cr... | rust | Apache-2.0 | 4b8681166cc9894c2bf068afe79a8414d7a13970 | 2026-01-04T20:23:44.719720Z | false |
ballsteve/xrust | https://github.com/ballsteve/xrust/blob/4b8681166cc9894c2bf068afe79a8414d7a13970/src/transform/keys.rs | src/transform/keys.rs | //! Support for keys.
use crate::item::{Node, Sequence};
use crate::transform::context::{Context, ContextBuilder, StaticContext};
use crate::transform::Transform;
use crate::xdmerror::Error;
use crate::{Item, SequenceTrait};
use std::collections::HashMap;
use url::Url;
/// For each key declaration:
/// 1. find the no... | rust | Apache-2.0 | 4b8681166cc9894c2bf068afe79a8414d7a13970 | 2026-01-04T20:23:44.719720Z | false |
ballsteve/xrust | https://github.com/ballsteve/xrust/blob/4b8681166cc9894c2bf068afe79a8414d7a13970/src/transform/navigate.rs | src/transform/navigate.rs | //! Navigation routines
use crate::item::{Node, NodeType, Sequence, SequenceTrait};
use crate::transform::context::{Context, ContextBuilder, StaticContext};
use crate::transform::{Axis, NodeMatch, Transform};
use crate::xdmerror::{Error, ErrorKind};
use crate::Item;
use url::Url;
/// The root node of the context item... | rust | Apache-2.0 | 4b8681166cc9894c2bf068afe79a8414d7a13970 | 2026-01-04T20:23:44.719720Z | false |
ballsteve/xrust | https://github.com/ballsteve/xrust/blob/4b8681166cc9894c2bf068afe79a8414d7a13970/src/transform/logic.rs | src/transform/logic.rs | //! These functions are for features defined in XPath Functions 1.0 and 2.0.
use std::rc::Rc;
use url::Url;
use crate::item::{Item, Node, Sequence, SequenceTrait};
use crate::transform::context::{Context, StaticContext};
use crate::transform::Transform;
use crate::value::{Operator, Value};
use crate::xdmerror::{Error... | rust | Apache-2.0 | 4b8681166cc9894c2bf068afe79a8414d7a13970 | 2026-01-04T20:23:44.719720Z | false |
ballsteve/xrust | https://github.com/ballsteve/xrust/blob/4b8681166cc9894c2bf068afe79a8414d7a13970/src/testutils/item_value.rs | src/testutils/item_value.rs | #[macro_export]
macro_rules! item_value_tests (
( $x:ty ) => {
use std::rc::Rc;
use xrust::value::Value;
use xrust::item::{Sequence, SequenceTrait, Item};
#[test]
fn item_value_string_empty_to_bool() {
assert_eq!(Item::<$x>::Value(Rc::new(Value::from(""))).to_bool(), false)
}
#[test]
fn item_value_str... | rust | Apache-2.0 | 4b8681166cc9894c2bf068afe79a8414d7a13970 | 2026-01-04T20:23:44.719720Z | false |
ballsteve/xrust | https://github.com/ballsteve/xrust/blob/4b8681166cc9894c2bf068afe79a8414d7a13970/src/testutils/pattern_tests.rs | src/testutils/pattern_tests.rs | #[macro_export]
macro_rules! pattern_tests (
( $t:ty , $x:expr , $y:expr ) => {
use xrust::pattern::Pattern;
#[test]
#[should_panic]
fn pattern_empty() {
let p: Pattern<$t> = Pattern::try_from("").expect("unable to parse empty string");
}
#[test]
fn pattern_predicate_1_pos() {
let p: Patter... | rust | Apache-2.0 | 4b8681166cc9894c2bf068afe79a8414d7a13970 | 2026-01-04T20:23:44.719720Z | false |
ballsteve/xrust | https://github.com/ballsteve/xrust/blob/4b8681166cc9894c2bf068afe79a8414d7a13970/src/testutils/item_node.rs | src/testutils/item_node.rs | #[macro_export]
macro_rules! item_node_tests (
( $x:expr, $y:expr, $z:expr ) => {
use std::cmp::Ordering;
#[test]
fn node_push_content() {
let mut d = $x();
let n = d.new_element(Rc::new(QualifiedName::new(None, None, String::from("Test"))))
.expect("unable to create element node");
d.push(n)
... | rust | Apache-2.0 | 4b8681166cc9894c2bf068afe79a8414d7a13970 | 2026-01-04T20:23:44.719720Z | false |
ballsteve/xrust | https://github.com/ballsteve/xrust/blob/4b8681166cc9894c2bf068afe79a8414d7a13970/src/testutils/mod.rs | src/testutils/mod.rs | /*! A generic test suite.
Most of xrust's modules are written to use the generic Node trait. However, to test their functionality a concrete implementation must be used. Rather than writing, and rewriting, the same set of tests for each concrete implementation, all of the tests have been written as macros. An implemen... | rust | Apache-2.0 | 4b8681166cc9894c2bf068afe79a8414d7a13970 | 2026-01-04T20:23:44.719720Z | false |
ballsteve/xrust | https://github.com/ballsteve/xrust/blob/4b8681166cc9894c2bf068afe79a8414d7a13970/src/trees/rctree.rs | src/trees/rctree.rs | //! # A tree structure for XDM
//!
//! Uses Rc and Weak for a fully navigable tree structure, without using interior mutability.
//!
//! The tree structure has two phases:
//!
//! * Tree construction and mutation - the tree is built and can be mutated, but is not fully navigable. It can only be traversed in a recursive... | rust | Apache-2.0 | 4b8681166cc9894c2bf068afe79a8414d7a13970 | 2026-01-04T20:23:44.719720Z | false |
ballsteve/xrust | https://github.com/ballsteve/xrust/blob/4b8681166cc9894c2bf068afe79a8414d7a13970/src/trees/intmuttree.rs | src/trees/intmuttree.rs | /*! # A tree structure for XDM
This module implements the Item module's [Node](crate::item::Node) trait.
This implementation uses interior mutability to create and manage a tree structure that is both mutable and fully navigable.
To create a tree, use [NodeBuilder](crate::trees::intmuttree::NodeBuilder) to make a Do... | rust | Apache-2.0 | 4b8681166cc9894c2bf068afe79a8414d7a13970 | 2026-01-04T20:23:44.719720Z | true |
ballsteve/xrust | https://github.com/ballsteve/xrust/blob/4b8681166cc9894c2bf068afe79a8414d7a13970/src/trees/forest.rs | src/trees/forest.rs | //! # xrust::forest
//!
//! A forest is a collection of [Tree]s. A [Tree] is a collection of [Node]s. A [Node] is an index into the [Tree].
//!
//! Both [Forest]s and [Tree]s use an arena allocator, so the object itself is simply an index that may be copied and cloned. However, in order to dererence the [Tree] or [Node... | rust | Apache-2.0 | 4b8681166cc9894c2bf068afe79a8414d7a13970 | 2026-01-04T20:23:44.719720Z | true |
ballsteve/xrust | https://github.com/ballsteve/xrust/blob/4b8681166cc9894c2bf068afe79a8414d7a13970/src/trees/mod.rs | src/trees/mod.rs | //! Various implementations of tree data structures.
/// Interior Mutability Tree. This tree implementation is both mutable and fully navigable.
//pub mod intmuttree;
pub(crate) mod nullo;
/// Interior Mutability Tuple-Struct with Enum.
/// This tree implementation is an evolution of intmuttree that represents each ty... | rust | Apache-2.0 | 4b8681166cc9894c2bf068afe79a8414d7a13970 | 2026-01-04T20:23:44.719720Z | false |
ballsteve/xrust | https://github.com/ballsteve/xrust/blob/4b8681166cc9894c2bf068afe79a8414d7a13970/src/trees/nullo.rs | src/trees/nullo.rs | use crate::item::{Node, NodeType};
use crate::output::OutputDefinition;
use crate::qname::QualifiedName;
use crate::validators::{Schema, ValidationError};
use crate::value::Value;
use crate::xdmerror::{Error, ErrorKind};
use crate::xmldecl::{XMLDecl, XMLDeclBuilder, DTD};
/// A null tree implementation
///
/// This tre... | rust | Apache-2.0 | 4b8681166cc9894c2bf068afe79a8414d7a13970 | 2026-01-04T20:23:44.719720Z | false |
ballsteve/xrust | https://github.com/ballsteve/xrust/blob/4b8681166cc9894c2bf068afe79a8414d7a13970/src/trees/smite.rs | src/trees/smite.rs | /*! # A tree structure for XDM
This module implements the Item module's [Node](crate::item::Node) trait.
This implementation uses interior mutability to create and manage a tree structure that is both mutable and fully navigable.
To create a tree, use [Node::new()](crate::trees::smite::Node) to make a Document-type ... | rust | Apache-2.0 | 4b8681166cc9894c2bf068afe79a8414d7a13970 | 2026-01-04T20:23:44.719720Z | true |
ballsteve/xrust | https://github.com/ballsteve/xrust/blob/4b8681166cc9894c2bf068afe79a8414d7a13970/src/parser/mod.rs | src/parser/mod.rs | /*!
A parser combinator, inspired by nom.
This parser combinator passes a context into the function, which includes the string being parsed. This supports resolving context-based constructs such as general entities and XML Namespaces.
*/
use crate::externals::URLResolver;
use crate::item::Node;
use crate::namespace::... | rust | Apache-2.0 | 4b8681166cc9894c2bf068afe79a8414d7a13970 | 2026-01-04T20:23:44.719720Z | false |
ballsteve/xrust | https://github.com/ballsteve/xrust/blob/4b8681166cc9894c2bf068afe79a8414d7a13970/src/parser/common.rs | src/parser/common.rs | pub(crate) fn is_namechar(ch: &char) -> bool {
if is_namestartchar(ch) {
true
} else {
matches!(ch,
'.'
| '-'
| '0'..='9'
| '\u{B7}'
| '\u{0300}'..='\u{036F}'
| '\u{203F}'..='\u{2040}'
)
}
}
pub(crate) fn is_ncn... | rust | Apache-2.0 | 4b8681166cc9894c2bf068afe79a8414d7a13970 | 2026-01-04T20:23:44.719720Z | false |
ballsteve/xrust | https://github.com/ballsteve/xrust/blob/4b8681166cc9894c2bf068afe79a8414d7a13970/src/parser/avt/mod.rs | src/parser/avt/mod.rs | /*!
Parse an Attribute Value Template.
See XSL Transformations v3.0 5.6.1.
*/
use crate::item::{Item, Node};
use crate::parser::combinators::alt::alt2;
use crate::parser::combinators::many::{many0, many1};
use crate::parser::combinators::map::map;
use crate::parser::{ParseError, ParseInput, ParserState};
use crate::... | rust | Apache-2.0 | 4b8681166cc9894c2bf068afe79a8414d7a13970 | 2026-01-04T20:23:44.719720Z | false |
ballsteve/xrust | https://github.com/ballsteve/xrust/blob/4b8681166cc9894c2bf068afe79a8414d7a13970/src/parser/datetime/mod.rs | src/parser/datetime/mod.rs | //! # parsepicture
//!
//! A parser for XPath format picture strings, as a parser combinator.
//!
//! This implementation is a quick-and-dirty translation to strftime format.
//!
//! TODO: presentation modifiers, and width modifiers
use crate::item::Node;
use crate::parser::combinators::alt::alt4;
use crate::parser::c... | rust | Apache-2.0 | 4b8681166cc9894c2bf068afe79a8414d7a13970 | 2026-01-04T20:23:44.719720Z | false |
ballsteve/xrust | https://github.com/ballsteve/xrust/blob/4b8681166cc9894c2bf068afe79a8414d7a13970/src/parser/xml/reference.rs | src/parser/xml/reference.rs | use crate::item::{Node, NodeType};
use crate::parser::combinators::delimited::delimited;
use crate::parser::combinators::tag::tag;
use crate::parser::combinators::take::take_until;
use crate::parser::xml::dtd::extsubset::extsubset;
use crate::parser::xml::element::content;
use crate::parser::{ParseError, ParseInput};
u... | rust | Apache-2.0 | 4b8681166cc9894c2bf068afe79a8414d7a13970 | 2026-01-04T20:23:44.719720Z | false |
ballsteve/xrust | https://github.com/ballsteve/xrust/blob/4b8681166cc9894c2bf068afe79a8414d7a13970/src/parser/xml/attribute.rs | src/parser/xml/attribute.rs | use crate::item::Node;
use crate::namespace::NamespaceMap;
use crate::parser::combinators::alt::{alt2, alt3};
use crate::parser::combinators::delimited::delimited;
use crate::parser::combinators::many::many0;
use crate::parser::combinators::map::map;
use crate::parser::combinators::tag::tag;
use crate::parser::combinat... | rust | Apache-2.0 | 4b8681166cc9894c2bf068afe79a8414d7a13970 | 2026-01-04T20:23:44.719720Z | false |
ballsteve/xrust | https://github.com/ballsteve/xrust/blob/4b8681166cc9894c2bf068afe79a8414d7a13970/src/parser/xml/misc.rs | src/parser/xml/misc.rs | use crate::item::{Node, NodeType};
use crate::parser::combinators::alt::alt2;
use crate::parser::combinators::delimited::delimited;
use crate::parser::combinators::many::many0;
use crate::parser::combinators::map::map;
use crate::parser::combinators::opt::opt;
use crate::parser::combinators::tag::tag;
use crate::parser... | rust | Apache-2.0 | 4b8681166cc9894c2bf068afe79a8414d7a13970 | 2026-01-04T20:23:44.719720Z | false |
ballsteve/xrust | https://github.com/ballsteve/xrust/blob/4b8681166cc9894c2bf068afe79a8414d7a13970/src/parser/xml/element.rs | src/parser/xml/element.rs | use crate::item::{Node, NodeType};
use crate::parser::combinators::alt::{alt2, alt4};
use crate::parser::combinators::many::many0nsreset;
use crate::parser::combinators::map::map;
use crate::parser::combinators::opt::opt;
use crate::parser::combinators::tag::tag;
use crate::parser::combinators::tuple::{tuple10, tuple2,... | rust | Apache-2.0 | 4b8681166cc9894c2bf068afe79a8414d7a13970 | 2026-01-04T20:23:44.719720Z | false |
ballsteve/xrust | https://github.com/ballsteve/xrust/blob/4b8681166cc9894c2bf068afe79a8414d7a13970/src/parser/xml/mod.rs | src/parser/xml/mod.rs | mod attribute;
mod chardata;
mod dtd;
mod element;
mod misc;
pub mod qname;
mod reference;
mod strings;
mod xmldecl;
use crate::item::Node;
use crate::namespace::NamespaceMap;
use crate::parser::combinators::map::map;
use crate::parser::combinators::opt::opt;
use crate::parser::combinators::tag::tag;
use crate::parser... | rust | Apache-2.0 | 4b8681166cc9894c2bf068afe79a8414d7a13970 | 2026-01-04T20:23:44.719720Z | false |
ballsteve/xrust | https://github.com/ballsteve/xrust/blob/4b8681166cc9894c2bf068afe79a8414d7a13970/src/parser/xml/xmldecl.rs | src/parser/xml/xmldecl.rs | use crate::item::Node;
use crate::parser::combinators::alt::alt2;
use crate::parser::combinators::map::map;
use crate::parser::combinators::opt::opt;
use crate::parser::combinators::tag::tag;
use crate::parser::combinators::take::{take_one, take_while};
use crate::parser::combinators::tuple::{tuple2, tuple3, tuple5, tu... | rust | Apache-2.0 | 4b8681166cc9894c2bf068afe79a8414d7a13970 | 2026-01-04T20:23:44.719720Z | false |
ballsteve/xrust | https://github.com/ballsteve/xrust/blob/4b8681166cc9894c2bf068afe79a8414d7a13970/src/parser/xml/chardata.rs | src/parser/xml/chardata.rs | use crate::item::Node;
use crate::parser::combinators::alt::{alt2, alt3};
use crate::parser::combinators::delimited::delimited;
use crate::parser::combinators::many::many1;
use crate::parser::combinators::map::{map, map_ver};
use crate::parser::combinators::tag::tag;
use crate::parser::combinators::take::{take_until, t... | rust | Apache-2.0 | 4b8681166cc9894c2bf068afe79a8414d7a13970 | 2026-01-04T20:23:44.719720Z | false |
ballsteve/xrust | https://github.com/ballsteve/xrust/blob/4b8681166cc9894c2bf068afe79a8414d7a13970/src/parser/xml/qname.rs | src/parser/xml/qname.rs | use crate::item::Node;
use crate::parser::combinators::alt::alt2;
use crate::parser::combinators::many::many1;
use crate::parser::combinators::map::map;
use crate::parser::combinators::opt::opt;
use crate::parser::combinators::pair::pair;
use crate::parser::combinators::support::none_of;
use crate::parser::combinators:... | rust | Apache-2.0 | 4b8681166cc9894c2bf068afe79a8414d7a13970 | 2026-01-04T20:23:44.719720Z | false |
ballsteve/xrust | https://github.com/ballsteve/xrust/blob/4b8681166cc9894c2bf068afe79a8414d7a13970/src/parser/xml/strings.rs | src/parser/xml/strings.rs | use crate::item::Node;
use crate::parser::combinators::alt::{alt2, alt3};
use crate::parser::combinators::delimited::delimited;
use crate::parser::combinators::many::many0;
use crate::parser::combinators::map::map;
use crate::parser::combinators::tag::tag;
use crate::parser::combinators::take::take_while;
use crate::pa... | rust | Apache-2.0 | 4b8681166cc9894c2bf068afe79a8414d7a13970 | 2026-01-04T20:23:44.719720Z | false |
ballsteve/xrust | https://github.com/ballsteve/xrust/blob/4b8681166cc9894c2bf068afe79a8414d7a13970/src/parser/xml/dtd/misc.rs | src/parser/xml/dtd/misc.rs | use crate::item::Node;
use crate::parser::combinators::alt::{alt2, alt3, alt4};
use crate::parser::combinators::many::{many0, many1};
use crate::parser::combinators::map::map;
use crate::parser::combinators::opt::opt;
use crate::parser::combinators::tag::tag;
use crate::parser::combinators::take::take_while;
use crate:... | rust | Apache-2.0 | 4b8681166cc9894c2bf068afe79a8414d7a13970 | 2026-01-04T20:23:44.719720Z | false |
ballsteve/xrust | https://github.com/ballsteve/xrust/blob/4b8681166cc9894c2bf068afe79a8414d7a13970/src/parser/xml/dtd/pedecl.rs | src/parser/xml/dtd/pedecl.rs | use crate::item::Node;
use crate::parser::combinators::alt::{alt3, alt4};
use crate::parser::combinators::delimited::delimited;
use crate::parser::combinators::many::many0;
use crate::parser::combinators::map::map;
use crate::parser::combinators::tag::tag;
use crate::parser::combinators::take::{take_until, take_until_e... | rust | Apache-2.0 | 4b8681166cc9894c2bf068afe79a8414d7a13970 | 2026-01-04T20:23:44.719720Z | false |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.