From 1fdf6d13be9037cf82b90305f43dc02b604780a1 Mon Sep 17 00:00:00 2001 From: axon-q Date: Sat, 9 Jun 2018 13:38:21 +0000 Subject: [PATCH] content_disposition: add doc example --- src/header/common/content_disposition.rs | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/src/header/common/content_disposition.rs b/src/header/common/content_disposition.rs index 93102d46..0edebfed 100644 --- a/src/header/common/content_disposition.rs +++ b/src/header/common/content_disposition.rs @@ -70,7 +70,7 @@ pub enum DispositionParam { /// ``` /// use actix_web::http::header::{ContentDisposition, DispositionType, DispositionParam, Charset}; /// -/// let cd = ContentDisposition { +/// let cd1 = ContentDisposition { /// disposition: DispositionType::Attachment, /// parameters: vec![DispositionParam::Filename( /// Charset::Iso_8859_1, // The character set for the bytes of the filename @@ -78,6 +78,15 @@ pub enum DispositionParam { /// b"\xa9 Copyright 1989.txt".to_vec() // the actual bytes of the filename /// )] /// }; +/// +/// let cd2 = ContentDisposition { +/// disposition: DispositionType::Inline, +/// parameters: vec![DispositionParam::Filename( +/// Charset::Ext("UTF-8".to_owned()), +/// None, +/// "\u{2764}".as_bytes().to_vec() +/// )] +/// }; /// ``` #[derive(Clone, Debug, PartialEq)] pub struct ContentDisposition {