#[non_exhaustive]pub struct UploadPartData {
pub filename: String,
pub content_type: String,
/* private fields */
}Expand description
EN: Uploadable part 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 part. 中文:分段发送的内容类型。
Implementations§
Source§impl UploadPartData
impl UploadPartData
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 upload part data 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 multipart part content type. 中文:设置 multipart 分段内容类型。
Trait Implementations§
Source§impl Clone for UploadPartData
impl Clone for UploadPartData
Source§fn clone(&self) -> UploadPartData
fn clone(&self) -> UploadPartData
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 UploadPartData
impl Debug for UploadPartData
impl Eq for UploadPartData
Source§impl PartialEq for UploadPartData
impl PartialEq for UploadPartData
Source§fn eq(&self, other: &UploadPartData) -> bool
fn eq(&self, other: &UploadPartData) -> bool
Tests for
self and other values to be equal, and is used by ==.impl StructuralPartialEq for UploadPartData
Auto Trait Implementations§
impl !Freeze for UploadPartData
impl RefUnwindSafe for UploadPartData
impl Send for UploadPartData
impl Sync for UploadPartData
impl Unpin for UploadPartData
impl UnsafeUnpin for UploadPartData
impl UnwindSafe for UploadPartData
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.