From fd31e691af6e03b2235a9449e61f2c48c437daec Mon Sep 17 00:00:00 2001 From: Emmanuel Gil Peyrot Date: Thu, 20 Jul 2017 23:46:44 +0100 Subject: [PATCH] lib: Improve the wording of the docstring. --- src/lib.rs | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/src/lib.rs b/src/lib.rs index 359ba7b0..b3f57fdf 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -1,10 +1,19 @@ //! A crate parsing common XMPP elements into Rust structures. //! -//! Each module implements the `TryFrom<&minidom::Element>` trait, which takes -//! a minidom `Element` reference and returns a `Result`. +//! Each module implements the [`TryFrom`] trait, which takes a minidom +//! [`Element`] reference and returns a `Result` whose value is `Ok` if the +//! element parsed correctly, `Err(error::Error)` otherwise. //! -//! Parsed structs can then be manipulated manually, and must be serialised -//! back before being sent over the wire. +//! The returned structure can be manipuled as any Rust structure, with each +//! field being public. You can also create the same structure manually, with +//! some having `new()` and `with_*()` helper methods to create them. +//! +//! Once you are happy with your structure, you can serialise it back to an +//! [`Element`], using either `From` or `Into`, which give you what +//! you want to be sending on the wire. +//! +//! [`TryFrom`]: ../try_from/trait.TryFrom.html +//! [`Element`]: ../minidom/element/struct.Element.html // Copyright (c) 2017 Emmanuel Gil Peyrot // Copyright (c) 2017 Maxime “pep” Buquet