pub enum GraphQLMultipart {
Single(/* private fields */),
Multiple(/* private fields */),
}
Expand description
A GraphQLRequest multipart body as according to this specification.
Only files can be included in the multipart body.
It can either be Single
(one file) or Multiple
(multiple files).
Variants§
Implementations§
Source§impl GraphQLMultipart
impl GraphQLMultipart
Sourcepub fn single(path: impl Into<String>, file: MultipartFile) -> Self
pub fn single(path: impl Into<String>, file: MultipartFile) -> Self
Creates a GraphQL multipart body containing a single file.
The path
parameter is the path to the field in the GraphQL variables
object
that will act as a placeholder for the uploaded file.
The field will be automatically injected into the variables
object: you don’t need to add it
to your existing variables struct.
Sourcepub fn multiple(map: HashMap<impl Into<String>, Vec<MultipartFile>>) -> Self
pub fn multiple(map: HashMap<impl Into<String>, Vec<MultipartFile>>) -> Self
Creates a GraphQL multipart body containing a list of files or multiple lists of files.
Each key in the hash map is the path to the array field in the GraphQL variables
object that will act as a placeholder for the list of files corresponding to that key.
The fields will be automatically injected into the variables
object: you don’t need to add them
to your existing variables struct.
Auto Trait Implementations§
impl !Freeze for GraphQLMultipart
impl !RefUnwindSafe for GraphQLMultipart
impl Send for GraphQLMultipart
impl Sync for GraphQLMultipart
impl Unpin for GraphQLMultipart
impl !UnwindSafe for GraphQLMultipart
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> FutureExt for T
impl<T> FutureExt for T
Source§fn with_context(self, otel_cx: Context) -> WithContext<Self>
fn with_context(self, otel_cx: Context) -> WithContext<Self>
Source§fn with_current_context(self) -> WithContext<Self>
fn with_current_context(self) -> WithContext<Self>
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> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T
in a tonic::Request