Improve documentation on duplex.rs

Adding example and short documentation for methods.
(Examples (preferably both the `Ok` and `Err` cases) would help.)