• Stars
    star
    104
  • Rank 330,604 (Top 7 %)
  • Language
    Rust
  • License
    Apache License 2.0
  • Created almost 3 years ago
  • Updated almost 3 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Easy IO for Rust

ezio - a crate for easy IO

ezio offers an easy to use IO API for reading and writing to files and stdio. ezio includes utilities for generating random numbers and other IO-like functionality. Performance and idiomatic error handling are explicit non-goals, so ezio is probably not suitable for production use. It is better suited for education, experimentation, and prototyping.

ezio wraps the standard library's IO APIs and other well-established crates, and is designed to interoperate with them, so ezio should be compatible with most upstream libraries.

Examples

use ezio::prelude::*;

fn main() {
    // Read a line from stdin
    let _ = stdio::read_line();

    // Iterate lines in a file
    for line in file::reader("path/to/file.txt") {
        // ...
    }

    // Read a whole file
    let _ = file::read("path/to/file.txt");

    // Write to a file
    file::write("path/to/file.txt", "Some text");

    // Write multiple things to a file
    let mut w = file::writer("path/to/file.txt");
    w.write("Some text\n");
    w.write("Some more text");

    // Generates a random u32
    let _ = random::u32();
}

Design principals

(ezio is work in progress, so these may still be aspirational)

  • Easy to use!
  • Easy to import - provide a prelude and most users will not need anything else
  • Simple module hierarchy
  • String-based, not byte-based by default
  • Panic-happy: panic by default, try_ versions of functions where you really need an error
  • Allocation-happy: returns Strings, etc rather than taking buffers
  • Compatible and interoperable with std IO so programs can gradually migrate from ezio to std::io
  • Just because we're doing unsophisticated IO, doesn't mean the rest of the program is unsophisticated. Therefore:
    • should be idiomatic Rust
    • should support generics and trait objects, etc

More Repositories

1

r4cppp

Rust for C++ programmers
Rust
3,348
star
2

derive-new

derive simple constructor functions for Rust structs
Rust
525
star
3

libhoare

Design by contract style assertions for Rust
Rust
247
star
4

graphql

A Rust GraphQL server framework
Rust
236
star
5

xmas-elf

elf parser and navigation tool, pure Rust
Rust
157
star
6

rustaceans.org

Backing data for
150
star
7

portable-interoperable

Async fundamentals initiative: portable and interoperable
75
star
8

apr-intro

An alternate introdcution to the APR book
60
star
9

talks

Slides and artifacts for talks
58
star
10

stupid-stats

Tutorial and demo of rust compiler replacement tooling
Rust
54
star
11

proc-macro-rules

Macro-rules-style syntax matching for procedural macros
Rust
51
star
12

error-docs

Documentation of Rust error handling
48
star
13

zero

A Rust library for zero-allocation parsing of binary data.
Rust
47
star
14

darkly

Rust
40
star
15

callgraph.rs

Callgraphs for Rust programs
Rust
32
star
16

rfc-index

A curated index of Rust RFCs
Rust
27
star
17

find-work

find something Rusty to work on
Rust
20
star
18

big-book-ffi

The Big Book of Rust Interop
20
star
19

provide-any

Proposed API for type-driven member access
Rust
12
star
20

leb128

Implementation of LEB128 encoding in Rust
Rust
9
star
21

mentor-rfcs

A place to improve your RFC writing skills and collaborate on writing RFCs
9
star
22

async-io-traits

Async versions of io traits
Rust
8
star
23

tikv-bench

Rust
7
star
24

rust-dxr

Rust indexing in DXR
7
star
25

rustdoc-highlight

A Rust syntax highlighting library
Rust
5
star
26

box-error

A library for error handling using boxed errors
Rust
4
star
27

clyde

wip
Rust
3
star
28

grpc-snoop

A tool to capture TiKV gRPC messages
Go
3
star
29

gh-velocity

measure the velocity of PRs landing in GitHub
Rust
3
star
30

survey-processing

Utility code for processing Rust's annual survey
Rust
3
star
31

N

PL Semantics Tool
Python
3
star
32

parcom

Rust
2
star
33

tmit

This Month in TiKV
2
star
34

owned-buf

An owned buffer type for reading into possibly uninitialized memory
Rust
2
star
35

github-issues-import

Fork of IQAndreas/github-issues-import
Python
2
star
36

triage

Scripts for helping with Rust issue triage
JavaScript
2
star
37

rustc-perf-data

1
star
38

grpc-benchmark

Shell
1
star
39

macro-libs

Design a proc macro library for Rust
1
star
40

collections

having some fun implementing basic data structures in Rust
Rust
1
star
41

fmtfmt

very WIP ideas for a generic formatting tool
Rust
1
star
42

read-buf

Very sketchy experimentation with ReadBuf things
Rust
1
star
43

raft-proto

Rust
1
star
44

ios-apnea

experiments in ios apps (an apnea timer)
Swift
1
star
45

ray

Rust and JS ray tracers
Rust
1
star
46

derive-display-rfc

repo for collaborating on an RFC for derive display
1
star
47

grpc-rs-squashed

grpc-rs without any Git history
Rust
1
star