Struct poem_openapi::types::multipart::Upload
source · pub struct Upload { /* private fields */ }
Expand description
A uploaded file for multipart.
Implementations§
source§impl Upload
impl Upload
sourcepub fn content_type(&self) -> Option<&str>
pub fn content_type(&self) -> Option<&str>
Get the content type of the field.
sourcepub async fn into_vec(self) -> Result<Vec<u8>, IoError>
pub async fn into_vec(self) -> Result<Vec<u8>, IoError>
Consumes this body object to return a Vec<u8>
that contains all
data.
sourcepub async fn into_string(self) -> Result<String, IoError>
pub async fn into_string(self) -> Result<String, IoError>
Consumes this body object to return a String
that contains all data.
sourcepub fn into_async_read(self) -> impl AsyncRead + Unpin + Send + 'static
pub fn into_async_read(self) -> impl AsyncRead + Unpin + Send + 'static
Consumes this body object to return a reader.
Trait Implementations§
source§impl ParseFromMultipartField for Upload
impl ParseFromMultipartField for Upload
source§fn parse_from_multipart<'async_trait>(
field: Option<PoemField>
) -> Pin<Box<dyn Future<Output = ParseResult<Self>> + Send + 'async_trait>>where
Self: 'async_trait,
fn parse_from_multipart<'async_trait>(
field: Option<PoemField>
) -> Pin<Box<dyn Future<Output = ParseResult<Self>> + Send + 'async_trait>>where
Self: 'async_trait,
Parse from multipart field.
source§fn parse_from_repeated_field<'async_trait>(
self,
_field: PoemField
) -> Pin<Box<dyn Future<Output = ParseResult<Self>> + Send + 'async_trait>>where
Self: Send + 'async_trait,
fn parse_from_repeated_field<'async_trait>(
self,
_field: PoemField
) -> Pin<Box<dyn Future<Output = ParseResult<Self>> + Send + 'async_trait>>where
Self: Send + 'async_trait,
Parse from repeated multipart field.
source§impl Type for Upload
impl Type for Upload
source§const IS_REQUIRED: bool = true
const IS_REQUIRED: bool = true
If it is
true
, it means that this type is required.§type RawValueType = Upload
type RawValueType = Upload
The raw type used for validator. Read more
§type RawElementValueType = Upload
type RawElementValueType = Upload
The raw element type used for validator.
source§fn schema_ref() -> MetaSchemaRef
fn schema_ref() -> MetaSchemaRef
Get schema reference of this type.
source§fn as_raw_value(&self) -> Option<&Self::RawValueType>
fn as_raw_value(&self) -> Option<&Self::RawValueType>
Returns a reference to the raw value.
source§fn raw_element_iter<'a>(
&'a self
) -> Box<dyn Iterator<Item = &'a Self::RawElementValueType> + 'a>
fn raw_element_iter<'a>(
&'a self
) -> Box<dyn Iterator<Item = &'a Self::RawElementValueType> + 'a>
Returns an iterator for traversing the elements.