Struct matrix_sdk_base::ruma::api::client::http_headers::ContentDisposition
source · #[non_exhaustive]pub struct ContentDisposition {
pub disposition_type: ContentDispositionType,
pub filename: Option<String>,
}
Available on crate feature
api
and (crate features client
or server
) only.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
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional
Struct { .. }
syntax; cannot be matched against without a wildcard ..
; and struct update syntax will not work.disposition_type: ContentDispositionType
The 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
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
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
Returns the “default value” for a type. Read more
source§impl Display for ContentDisposition
impl Display for ContentDisposition
source§impl FromStr for ContentDisposition
impl FromStr for ContentDisposition
§type Err = ContentDispositionParseError
type Err = ContentDispositionParseError
The associated error which can be returned from parsing.
source§fn from_str(
s: &str,
) -> Result<ContentDisposition, <ContentDisposition as FromStr>::Err>
fn from_str( s: &str, ) -> Result<ContentDisposition, <ContentDisposition as FromStr>::Err>
Parses a string
s
to return a value of this type. Read moresource§impl PartialEq for ContentDisposition
impl PartialEq for ContentDisposition
source§fn eq(&self, other: &ContentDisposition) -> bool
fn eq(&self, other: &ContentDisposition) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.source§impl TryFrom<&[u8]> for ContentDisposition
impl TryFrom<&[u8]> for ContentDisposition
§type Error = ContentDispositionParseError
type Error = ContentDispositionParseError
The type returned in the event of a conversion error.
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>
Performs the conversion.
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
Mutably borrows from an owned value. Read more
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§default unsafe fn clone_to_uninit(&self, dst: *mut T)
default unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)§impl<T> CompatExt for T
impl<T> CompatExt for T
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
Compare self to
key
and return true
if they are equal.source§impl<T, UT> HandleAlloc<UT> for T
impl<T, UT> HandleAlloc<UT> for T
source§fn consume_handle(handle: Handle) -> Arc<T>
fn consume_handle(handle: Handle) -> Arc<T>
Consume a handle, getting back the initial
Arc<>
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,
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§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>
Converts
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>
Converts
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 more