String processing with file/line/col information and the regular rust `str` API

Overview

Simple span handling for str and &[u8]

This crate exposes some of the methods that exist on str or bstr. If you are missing any you need, please open issues or PRs.

The basic usage is to read from a file and then use the methods to modify it:

let file = Spanned<String>::read_from_file(path)?;
for line in file.lines() {
    if let Some(rest) = line.strip_prefix("cake:") {
        println!("found a cake at {}: {}", rest.span.line_start, *rest);
    }
}

any Spanned object will always know its file, line and column information and correctly preserve it across operations that take subslices. The column information is counted in the number of utf8 characters, which is not entirely correct. Please open an issue if you encounter this to be a problem.

You might also like...
Rust-based command-line language-learning game. Uses the Tatoeba database.

minicloze A command-line language learning game using Tatoeba's great database. Accelerate your studies by putting your knowledge to the test in an ad

The official command-line interface for the makedeb Package Repository

Mist This is the repository for Mist, the official helper for the makedeb Package Repository. Installation Users have a few options for installing Mis

UEFI command-line tool for read/write access of variables

UEFI Command Line Tool for Reading/Writing UEFI Variables This tool is a rewritten version of the modded grub with setup_var commands, enhanced with m

Bevy plugin for a simple single-line text input widget.
Bevy plugin for a simple single-line text input widget.

bevy_simple_text_input An unambitious single-line text input widget for bevy_ui. Usage See examples/basic.rs. Alternatives If you need more features,

virtualization-rs provides the API of the Apple Virtualization.framework in Rust language.
virtualization-rs provides the API of the Apple Virtualization.framework in Rust language.

virtualization-rs Rust bindings for Virtualization.framework virtualization-rs provides the API of the Apple Virtualization.framework in Rust language

An ergonomic physics API for bevy games.

Heron An ergonomic physics API for 2d and 3d bevy games. (powered by rapier) How it looks like fn main() { App::build() .add_plugins(DefaultPlug

An immediate mode 2D drawing API for Bevy game engine

Bevy Canvas API prototype An unofficial immediate mode 2D drawing API for Bevy game engine. Check the documentation or the examples to know how to use

A wrapper around SDL2's game controller API.

fishsticks System for handling gamepad input, using SDL2's game controller API as the backend. License Fishsticks is dual-licensed under either Apache

Self Study on developing a game engine using wgpu as the rendering API. Learning as I go.
Self Study on developing a game engine using wgpu as the rendering API. Learning as I go.

Fabled Engine Any issues, enhancement, features, or bugs report are always welcome in Issues. The obj branch is where frequent development and up to d

Owner
Oli Scherer
Oli Scherer
Transform tagged Markdown string to HTML during build time.

tagged-md Transform tagged Markdown string to HTML! Check out the examples! Motivation Have you ever written HTML strings in your JavaScript code? It'

PortOne 23 May 30, 2023
Using information theory, this is the optimal wordle player

enwordle Using information theory, this is the optimal wordle player. It is written in Rust and runs on the command-line. Theory When you pick a word

Aaron Hillegass 2 May 6, 2022
A prototype plugin providing a simple line drawing api for bevy.

bevy_debug_lines A prototype plugin providing a simple line drawing api for bevy. See docs.rs for documentation. Expect breakage on master. Click on t

Michael Palmos 92 Dec 31, 2022
Easily update your minecraft mods with 1 file (guess I'm back to rust again)

Mod Updater This program updates all your mods to a newer/later version. To use: Create a file named config.toml Create a folder named mods; Add the f

sussyimpostor 2 Sep 18, 2022
Quick example of displaying a BMP file with uefi-rs

uefi-bmp Quick example of drawing a bitmap using uefi-rs and tinybmp. Not necessarily the most efficient :) Build and run (may need some modification

Nicholas Bishop 1 Jan 16, 2022
Persist game settings like music volume or graphic settings in a nice toml file in the right location.

Bevy Settings The goal of this project is to store settings in a resource throughout game launches. Currently this crate supports Linux, Mac and Windo

Tobias Kriebisch 9 Feb 25, 2023
API tool,but egui style and rusty

WEAVER About Weaver is a simple,easy-to-use and cross-platform API tool.Inspired by hoppscotch . It uses the Rust egui GUI library. Features Get,Post

will 14 Dec 11, 2022
Generic and extensible egui widgets to create analog synthesizer-like UI with data-oriented API

egui_cable A generic and extensible data-oriented widget for connecting ports by cables. I create this for the visual programming editor of Hihaheho/D

Ryo Hirayama 44 Dec 30, 2022
Generate rust command line executables from gRPC protobuf services.

Rust template repository. An opinionated starting point for rust projects such as systemd services command line tools client programs server programs

Kris Nóva 8 Sep 18, 2022
A Rust implementation of the GMT game Battle Line.

rsbl A Rust implementation of the game Battle Line. Running Currently there is only the simplest prototype of the game: a text-based table with ⚑ char

Matan Lurey 2 Nov 6, 2022