#[non_exhaustive]pub struct FileUpload {
pub filename: String,
pub content_type: String,
/* private fields */
}Expand description
EN: Uploadable file bytes and multipart metadata. 中文:可上传文件字节及 multipart 元数据。
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.filename: StringEN: Filename sent in the multipart part. 中文:multipart 分段中发送的文件名。
content_type: StringEN: Content type sent for the file part. 中文:文件分段发送的内容类型。
Implementations§
Source§impl FileUpload
impl FileUpload
Sourcepub fn from_bytes(
filename: impl Into<String>,
content: impl Into<Bytes>,
) -> Result<Self, LingerError>
pub fn from_bytes( filename: impl Into<String>, content: impl Into<Bytes>, ) -> Result<Self, LingerError>
EN: Creates an upload from already available bytes without copying them. 中文:通过已可用字节创建上传对象,不复制这些字节。
Sourcepub fn content_type(
self,
content_type: impl Into<String>,
) -> Result<Self, LingerError>
pub fn content_type( self, content_type: impl Into<String>, ) -> Result<Self, LingerError>
EN: Sets the file part content type. 中文:设置文件分段的内容类型。
Trait Implementations§
Source§impl Clone for FileUpload
impl Clone for FileUpload
Source§fn clone(&self) -> FileUpload
fn clone(&self) -> FileUpload
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 FileUpload
impl Debug for FileUpload
impl Eq for FileUpload
Source§impl PartialEq for FileUpload
impl PartialEq for FileUpload
Source§fn eq(&self, other: &FileUpload) -> bool
fn eq(&self, other: &FileUpload) -> bool
Tests for
self and other values to be equal, and is used by ==.impl StructuralPartialEq for FileUpload
Auto Trait Implementations§
impl !Freeze for FileUpload
impl RefUnwindSafe for FileUpload
impl Send for FileUpload
impl Sync for FileUpload
impl Unpin for FileUpload
impl UnsafeUnpin for FileUpload
impl UnwindSafe for FileUpload
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.