1
0
mirror of https://github.com/fafhrd91/actix-web synced 2024-11-30 18:44:35 +01:00

content_disposition: add doc example

This commit is contained in:
axon-q 2018-06-09 13:38:21 +00:00
parent 3751656722
commit 1fdf6d13be

View File

@ -70,7 +70,7 @@ pub enum DispositionParam {
/// ``` /// ```
/// use actix_web::http::header::{ContentDisposition, DispositionType, DispositionParam, Charset}; /// use actix_web::http::header::{ContentDisposition, DispositionType, DispositionParam, Charset};
/// ///
/// let cd = ContentDisposition { /// let cd1 = ContentDisposition {
/// disposition: DispositionType::Attachment, /// disposition: DispositionType::Attachment,
/// parameters: vec![DispositionParam::Filename( /// parameters: vec![DispositionParam::Filename(
/// Charset::Iso_8859_1, // The character set for the bytes of the 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 /// 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)] #[derive(Clone, Debug, PartialEq)]
pub struct ContentDisposition { pub struct ContentDisposition {