Improve documentation on duplex.rs

Adding example and short documentation for methods.