pub struct UploadFile {
pub field_name: String,
pub file_name: Option<String>,
pub content_type: Option<String>,
pub bytes: Vec<u8>,
}Expand description
Runtime-neutral buffered upload metadata.
Native and Cloudflare adapters may obtain these bytes differently; neither storage nor socket APIs leak into the operation contract.
§Wire forms
Deserialization accepts two shapes, because the same type serves two very different transports:
- the plain object —
field_name,file_name,content_type,bytes— which is whatSerializeproduces and what an MCP client sends; - a one-entry slot token the multipart extractor writes in place of the
bytes, resolved through [
UploadSlots] instead of through the document.
The second form exists so that Multipart<T> never has to render megabytes
of upload payload as a JSON array of numbers; see [UploadSlots].
Fields§
§field_name: String§file_name: Option<String>§content_type: Option<String>§bytes: Vec<u8>Implementations§
Trait Implementations§
Source§impl ApiSchema for UploadFile
impl ApiSchema for UploadFile
fn type_descriptor() -> TypeDescriptor
Source§fn validate_input(&self) -> Result<(), ValidationErrors>
fn validate_input(&self) -> Result<(), ValidationErrors>
Validates a decoded operation argument. Read more
Source§impl Clone for UploadFile
impl Clone for UploadFile
Source§fn clone(&self) -> UploadFile
fn clone(&self) -> UploadFile
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · 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 UploadFile
impl Debug for UploadFile
Source§impl<'de> Deserialize<'de> for UploadFile
impl<'de> Deserialize<'de> for UploadFile
Source§fn deserialize<D: Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error>
fn deserialize<D: Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error>
Deserialize this value from the given Serde deserializer. Read more
impl Eq for UploadFile
Source§impl PartialEq for UploadFile
impl PartialEq for UploadFile
Source§impl Serialize for UploadFile
impl Serialize for UploadFile
impl StructuralPartialEq for UploadFile
Auto Trait Implementations§
impl Freeze for UploadFile
impl RefUnwindSafe for UploadFile
impl Send for UploadFile
impl Sync for UploadFile
impl Unpin for UploadFile
impl UnsafeUnpin for UploadFile
impl UnwindSafe for UploadFile
Blanket Implementations§
Source§impl<T> BackgroundExt for T
impl<T> BackgroundExt for T
fn background(self, task: BackgroundTask) -> Background<Self>
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