[][src]Crate genio

This crate provides more generic alternatives to std::io::* traits and types. std::io suffers several issues because of over-use of std::io::Error type. One of them is allocation when creating Error type, other is inability to cleanly define errors which make sense in particular implementation, impossibility of use in no_std environments and more.

To solve these problems, genio::Read, genio::Write and other traits are allowed to define their own error types. Together with other utilities and std glue they provide a way to write more clear, portable and re-usable code.



Contains traits and impls for buffering.


Error types and various operations on them.


This module contains various extension traits.


This module contains glue for std::io and other std types.


This module contains various generic utilities related to IO.



This trait is similar to slow one. The difference is that thanks to reader guaranteeing correctness, this one can use uninitialized buffer.


Some types can be extended by reading from reader. The most well-known is probably Vec. It is possible to implement it manually, but it may be more efficient if the type implements this trait directly. In case of Vec, it means reading directly into uninitialized part of reserved memory in case of the fast version of this trait.


The Read trait allows for reading bytes from a source.


This marker trait declares that the Read trait is implemented correctly, that means:


A trait for objects which are byte-oriented sinks.