From c0c9d04ca9da1956456f4ec6400fe4e9d5326d33 Mon Sep 17 00:00:00 2001 From: Paul Masurel Date: Mon, 22 May 2017 09:55:49 +0900 Subject: [PATCH] Added extra doc --- src/macros.rs | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) diff --git a/src/macros.rs b/src/macros.rs index b56e5e6b5..44029960a 100644 --- a/src/macros.rs +++ b/src/macros.rs @@ -5,7 +5,26 @@ macro_rules! get( /// `doc!` is a shortcut that helps building `Document` -/// object, assuming you have the field object. +/// objects. +/// +/// Assuming that `field1` and `field2` are `Field` instances. +/// You can create a document with a value of `value1` for `field1` +/// `value2` for `field2`, as follows : +/// +/// ``` +/// doc!( +/// field1 => value1, +/// field2 => value2, +/// ) +/// ``` +/// +/// The value can be a `u64`, a `&str`, a `i64`, or a `String`. +/// +/// # Warning +/// +/// The document hence created, is not yet validated against a schema. +/// Nothing prevents its user from creating an invalid document missing a +/// field, or associating a `String` to a `u64` field for instance. /// /// # Example ///