pub struct FilePart {
pub name: Option<String>,
pub mime_type: Option<String>,
pub data: DataRef,
pub metadata: MetadataMap,
}Expand description
Fields§
§name: Option<String>Optional human-readable filename (e.g. "report.csv").
mime_type: Option<String>Optional MIME type of the file.
data: DataRefReference to the file data.
metadata: MetadataMapArbitrary key-value metadata.
Implementations§
Source§impl FilePart
impl FilePart
Sourcepub fn named(name: impl Into<String>, data: DataRef) -> Self
pub fn named(name: impl Into<String>, data: DataRef) -> Self
Builds a named file part with empty metadata.
Sourcepub fn with_mime_type(self, mime_type: impl Into<String>) -> Self
pub fn with_mime_type(self, mime_type: impl Into<String>) -> Self
Sets the file mime type.
Sourcepub fn with_metadata(self, metadata: MetadataMap) -> Self
pub fn with_metadata(self, metadata: MetadataMap) -> Self
Replaces the file-part metadata.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for FilePart
impl<'de> Deserialize<'de> for FilePart
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
impl Eq for FilePart
impl StructuralPartialEq for FilePart
Auto Trait Implementations§
impl Freeze for FilePart
impl RefUnwindSafe for FilePart
impl Send for FilePart
impl Sync for FilePart
impl Unpin for FilePart
impl UnsafeUnpin for FilePart
impl UnwindSafe for FilePart
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