pub struct UploadFileInput {
pub path: PathBuf,
pub file_name: String,
pub mime_type: Option<String>,
pub file_type: UploadFileType,
pub video_metadata: Option<UploadVideoMetadata>,
}Expand description
Local file upload input.
Fields§
§path: PathBufLocal path to read and upload.
file_name: StringFile name reported to the server.
mime_type: Option<String>Optional MIME type override.
file_type: UploadFileTypeInline upload category.
video_metadata: Option<UploadVideoMetadata>Required video details when uploading a video.
Implementations§
Source§impl UploadFileInput
impl UploadFileInput
Sourcepub fn new(
path: impl Into<PathBuf>,
file_name: impl Into<String>,
file_type: UploadFileType,
) -> Self
pub fn new( path: impl Into<PathBuf>, file_name: impl Into<String>, file_type: UploadFileType, ) -> Self
Creates an upload input with an explicit upload type.
Sourcepub fn photo(path: impl Into<PathBuf>, file_name: impl Into<String>) -> Self
pub fn photo(path: impl Into<PathBuf>, file_name: impl Into<String>) -> Self
Creates a photo upload input.
Sourcepub fn video(
path: impl Into<PathBuf>,
file_name: impl Into<String>,
metadata: UploadVideoMetadata,
) -> Self
pub fn video( path: impl Into<PathBuf>, file_name: impl Into<String>, metadata: UploadVideoMetadata, ) -> Self
Creates a video upload input with video metadata.
Sourcepub fn document(path: impl Into<PathBuf>, file_name: impl Into<String>) -> Self
pub fn document(path: impl Into<PathBuf>, file_name: impl Into<String>) -> Self
Creates a generic document upload input.
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 a MIME type override.
Sourcepub fn with_video_metadata(self, metadata: UploadVideoMetadata) -> Self
pub fn with_video_metadata(self, metadata: UploadVideoMetadata) -> Self
Sets video metadata for a video upload.
Trait Implementations§
Source§impl Clone for UploadFileInput
impl Clone for UploadFileInput
Source§fn clone(&self) -> UploadFileInput
fn clone(&self) -> UploadFileInput
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 UploadFileInput
impl Debug for UploadFileInput
impl Eq for UploadFileInput
Source§impl PartialEq for UploadFileInput
impl PartialEq for UploadFileInput
Source§fn eq(&self, other: &UploadFileInput) -> bool
fn eq(&self, other: &UploadFileInput) -> bool
Tests for
self and other values to be equal, and is used by ==.impl StructuralPartialEq for UploadFileInput
Auto Trait Implementations§
impl Freeze for UploadFileInput
impl RefUnwindSafe for UploadFileInput
impl Send for UploadFileInput
impl Sync for UploadFileInput
impl Unpin for UploadFileInput
impl UnsafeUnpin for UploadFileInput
impl UnwindSafe for UploadFileInput
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