io 0.1.0

Core I/O functionality.


To use this package, run the following command in your project's root directory:

Manual usage
Put the following dependency into your project's dependences section:

io Build Status Build Status codecov

Documentation std.io

IOs are thin, OS-independent abstractions I/O devices.

size_t write(const scope ubyte[] buffer);
size_t read(scope ubyte[] buffer);

IOs support scatter/gather read/write.

size_t write(const scope ubyte[][] buffers...);
size_t read(scope ubyte[][] buffers...);

IOs are @safe and @nogc.

void read() @safe @nogc
{
    auto f = File(chainPath("tmp", "file.txt"));
    ubyte[128] buf;
    f.read(buf[]);
    // ...
}

IOs use exceptions for error handling.

try
    File("");
catch (IOException e)
{}

IOs use unique ownership and are moveable but not copyable. (Use refCounted for shared ownership)

io2 = io.move;
assert(!io2.isClosed);
assert(io.isClosed);

auto rc = refCounted(io2.move);
auto rc2 = rc;

IOs can be converted to polymorphic interfaces if necessary.

Input input = ioObject(io.move);
Authors:
  • Martin Nowak
Dependencies:
none
Versions:
0.3.5 2023-Sep-19
0.3.4 2022-Feb-04
0.3.3 2021-Nov-05
0.3.2 2021-Mar-14
0.3.1 2020-Jul-26
Show all 15 versions
Download Stats:
  • 3 downloads today

  • 62 downloads this week

  • 100 downloads this month

  • 136001 downloads total

Score:
2.9
Short URL:
io.dub.pm