pub struct MultipartBody<'a, T> { /* private fields */ }Expand description
A multipart/form-data request body as an operation sends it: the typed body, borrowed, and
the filename each of its file parts sends where the caller sets one.
A generated operation whose multipart body has a binary part takes its body as
impl AsMultipartBody<T>, so &body sends every file part under its part name as its
filename, and MultipartBody::new(&body) with a file name set sends that one instead. The
generated client gives each body a typed setter per binary property, {property}_file_name, and
one for its binary additionalProperties entries by key; Self::file_name_for sets one by
its part name. The body’s fields read through it as through &T.
Implementations§
Source§impl<'a, T> MultipartBody<'a, T>
impl<'a, T> MultipartBody<'a, T>
Sourcepub fn new(body: &'a T) -> Self
pub fn new(body: &'a T) -> Self
body, with every file part sending its part name as its filename.
Sourcepub fn file_name_for(
self,
part: impl Into<String>,
file_name: impl Into<String>,
) -> Self
pub fn file_name_for( self, part: impl Into<String>, file_name: impl Into<String>, ) -> Self
Send file_name as the filename of the file part named part, replacing any set for it
before. Only the body’s file parts read it.
Sourcepub fn file_name_of(&self, part: &str) -> Option<&str>
pub fn file_name_of(&self, part: &str) -> Option<&str>
The filename set for the part named part, if one is.
Trait Implementations§
Source§impl<T> AsMultipartBody<T> for MultipartBody<'_, T>
impl<T> AsMultipartBody<T> for MultipartBody<'_, T>
Source§fn as_multipart_body(&self) -> MultipartBody<'_, T>
fn as_multipart_body(&self) -> MultipartBody<'_, T>
MultipartBody, with the file names set on it.Source§impl<T> Clone for MultipartBody<'_, T>
impl<T> Clone for MultipartBody<'_, T>
Source§impl<'a, T: Debug> Debug for MultipartBody<'a, T>
impl<'a, T: Debug> Debug for MultipartBody<'a, T>
Source§impl<T> Deref for MultipartBody<'_, T>
impl<T> Deref for MultipartBody<'_, T>
Auto Trait Implementations§
impl<'a, T> Freeze for MultipartBody<'a, T>
impl<'a, T> RefUnwindSafe for MultipartBody<'a, T>where
T: RefUnwindSafe,
impl<'a, T> Send for MultipartBody<'a, T>where
T: Sync,
impl<'a, T> Sync for MultipartBody<'a, T>where
T: Sync,
impl<'a, T> Unpin for MultipartBody<'a, T>
impl<'a, T> UnsafeUnpin for MultipartBody<'a, T>
impl<'a, T> UnwindSafe for MultipartBody<'a, T>where
T: RefUnwindSafe,
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<T> CompatExt for T
impl<T> CompatExt for T
impl<T> Formattable for T
§impl<T, UT> HandleAlloc<UT> for T
impl<T, UT> HandleAlloc<UT> for T
§fn new_handle(value: Arc<T>) -> Handle
fn new_handle(value: Arc<T>) -> Handle
§unsafe fn clone_handle(handle: Handle) -> Handle
unsafe fn clone_handle(handle: Handle) -> Handle
§unsafe fn consume_handle(handle: Handle) -> Arc<T> ⓘ
unsafe fn consume_handle(handle: Handle) -> Arc<T> ⓘ
Arc<> Read more§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>
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 more