aboutsummaryrefslogtreecommitdiff
path: root/src/model/channel
diff options
context:
space:
mode:
authorMaiddog <[email protected]>2017-06-03 16:33:46 -0500
committerZeyla Hellyer <[email protected]>2017-06-03 14:33:46 -0700
commitc00f3490f2fb0c045c2da72d850f70da8e2cdb95 (patch)
treedc249377dae54eaac823d82c0764c314ba653cdd /src/model/channel
parentFix compilations across feature combinations (diff)
downloadserenity-c00f3490f2fb0c045c2da72d850f70da8e2cdb95.tar.xz
serenity-c00f3490f2fb0c045c2da72d850f70da8e2cdb95.zip
Add some model docs, deprecate Role::edit_role
Deprecate `Role::edit_role` and rename it to `Role::edit`.
Diffstat (limited to 'src/model/channel')
-rw-r--r--src/model/channel/embed.rs16
1 files changed, 16 insertions, 0 deletions
diff --git a/src/model/channel/embed.rs b/src/model/channel/embed.rs
index 0db22ef..f46f0d3 100644
--- a/src/model/channel/embed.rs
+++ b/src/model/channel/embed.rs
@@ -68,6 +68,22 @@ impl Embed {
/// This should only be useful in conjunction with [`Webhook::execute`].
///
/// [`Webhook::execute`]: struct.Webhook.html
+ ///
+ /// # Examples
+ ///
+ /// Create an embed:
+ ///
+ /// ```rust,no_run
+ /// use serenity::model::Embed;
+ ///
+ /// let embed = Embed::fake(|e| e
+ /// .title("Embed title")
+ /// .description("Making a basic embed")
+ /// .field(|f| f
+ /// .name("A field")
+ /// .value("Has some content.")
+ /// .inline(false)));
+ /// ```
#[inline]
pub fn fake<F>(f: F) -> Value where F: FnOnce(CreateEmbed) -> CreateEmbed {
Value::Object(f(CreateEmbed::default()).0)