#[non_exhaustive]pub struct ContentDisposition {
pub disposition_type: ContentDispositionType,
pub filename: Option<String>,
}Expand description
The value of a Content-Disposition HTTP header.
This implementation supports the Content-Disposition header format as defined for HTTP in RFC
6266.
The only supported parameter is filename. It is encoded or decoded as needed, using a quoted
string or the ext-token = ext-value format, with the encoding defined in RFC 8187.
This implementation does not support serializing to the format defined for the
multipart/form-data content type in RFC 7578. It should however manage to parse the
disposition type and filename parameter of the body parts.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.disposition_type: ContentDispositionTypeThe disposition type.
filename: Option<String>The filename of the content.
Implementations§
Source§impl ContentDisposition
impl ContentDisposition
Sourcepub fn new(disposition_type: ContentDispositionType) -> ContentDisposition
pub fn new(disposition_type: ContentDispositionType) -> ContentDisposition
Creates a new ContentDisposition with the given disposition type.
Sourcepub fn with_filename(self, filename: Option<String>) -> ContentDisposition
pub fn with_filename(self, filename: Option<String>) -> ContentDisposition
Add the given filename to this ContentDisposition.
Trait Implementations§
Source§impl Clone for ContentDisposition
impl Clone for ContentDisposition
Source§fn clone(&self) -> ContentDisposition
fn clone(&self) -> ContentDisposition
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for ContentDisposition
impl Debug for ContentDisposition
Source§impl Default for ContentDisposition
impl Default for ContentDisposition
Source§fn default() -> ContentDisposition
fn default() -> ContentDisposition
Source§impl Display for ContentDisposition
impl Display for ContentDisposition
Source§impl FromStr for ContentDisposition
impl FromStr for ContentDisposition
Source§type Err = ContentDispositionParseError
type Err = ContentDispositionParseError
Source§fn from_str(
s: &str,
) -> Result<ContentDisposition, <ContentDisposition as FromStr>::Err>
fn from_str( s: &str, ) -> Result<ContentDisposition, <ContentDisposition as FromStr>::Err>
s to return a value of this type. Read moreSource§impl PartialEq for ContentDisposition
impl PartialEq for ContentDisposition
Source§impl TryFrom<&[u8]> for ContentDisposition
impl TryFrom<&[u8]> for ContentDisposition
Source§type Error = ContentDispositionParseError
type Error = ContentDispositionParseError
Source§fn try_from(
value: &[u8],
) -> Result<ContentDisposition, <ContentDisposition as TryFrom<&[u8]>>::Error>
fn try_from( value: &[u8], ) -> Result<ContentDisposition, <ContentDisposition as TryFrom<&[u8]>>::Error>
impl Eq for ContentDisposition
impl StructuralPartialEq for ContentDisposition
Auto Trait Implementations§
impl Freeze for ContentDisposition
impl RefUnwindSafe for ContentDisposition
impl Send for ContentDisposition
impl Sync for ContentDisposition
impl Unpin for ContentDisposition
impl UnwindSafe for ContentDisposition
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.Source§impl<T, W> HasTypeWitness<W> for Twhere
W: MakeTypeWitness<Arg = T>,
T: ?Sized,
impl<T, W> HasTypeWitness<W> for Twhere
W: MakeTypeWitness<Arg = T>,
T: ?Sized,
Source§impl<T> Identity for Twhere
T: ?Sized,
impl<T> Identity for Twhere
T: ?Sized,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
Source§impl<T> ToStringFallible for Twhere
T: Display,
impl<T> ToStringFallible for Twhere
T: Display,
Source§fn try_to_string(&self) -> Result<String, TryReserveError>
fn try_to_string(&self) -> Result<String, TryReserveError>
ToString::to_string, but without panic on OOM.