pub struct UploadFile { /* private fields */ }Expand description
Binary file payload for Telegram multipart uploads.
Implementations§
Source§impl UploadFile
impl UploadFile
Sourcepub fn from_bytes(file_name: impl Into<String>, data: Vec<u8>) -> Result<Self>
pub fn from_bytes(file_name: impl Into<String>, data: Vec<u8>) -> Result<Self>
Build from in-memory bytes.
Sourcepub fn from_path(path: impl AsRef<Path>) -> Result<Self>
pub fn from_path(path: impl AsRef<Path>) -> Result<Self>
Load file content from local filesystem.
Sourcepub fn with_content_type(self, content_type: impl Into<String>) -> Self
pub fn with_content_type(self, content_type: impl Into<String>) -> Self
Attach a specific content-type for this file part.
Trait Implementations§
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 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto 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> 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