pub struct FieldData<T> {
pub metadata: FieldMetadata,
pub contents: T,
}Expand description
A multipart field’s parsed contents along with its metadata.
Use this wrapper when you need access to the file name, content type, or other headers alongside the parsed value.
ⓘ
use vespera::multipart::FieldData;
use tempfile::NamedTempFile;
#[derive(Multipart, Schema)]
pub struct Upload {
pub file: FieldData<NamedTempFile>,
}Fields§
§metadata: FieldMetadataMetadata about the field (name, filename, content-type, headers).
contents: TThe parsed contents of the field.
Trait Implementations§
Source§impl<T, S> TryFromFieldWithState<S> for FieldData<T>
impl<T, S> TryFromFieldWithState<S> for FieldData<T>
Source§async fn try_from_field_with_state(
field: MeteredField<'_>,
limit_bytes: Option<usize>,
state: &S,
) -> Result<Self, TypedMultipartError>
async fn try_from_field_with_state( field: MeteredField<'_>, limit_bytes: Option<usize>, state: &S, ) -> Result<Self, TypedMultipartError>
Parse a single field into
Self, optionally enforcing a byte-size limit. Read moreAuto Trait Implementations§
impl<T> Freeze for FieldData<T>where
T: Freeze,
impl<T> RefUnwindSafe for FieldData<T>where
T: RefUnwindSafe,
impl<T> Send for FieldData<T>where
T: Send,
impl<T> Sync for FieldData<T>where
T: Sync,
impl<T> Unpin for FieldData<T>where
T: Unpin,
impl<T> UnsafeUnpin for FieldData<T>where
T: UnsafeUnpin,
impl<T> UnwindSafe for FieldData<T>where
T: UnwindSafe,
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
impl<A, B, T> HttpServerConnExec<A, B> for Twhere
B: Body,
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<C> ValidationContext<C> for C
impl<C> ValidationContext<C> for C
Source§fn validation_context(&self) -> &C
fn validation_context(&self) -> &C
Borrow the context used by
garde::Validate::validate_with.