pub struct FilePayload {
pub name: String,
pub mime_type: String,
pub buffer: Vec<u8>,
}Expand description
Represents a file to upload with its content.
Fields§
§name: StringFile name.
mime_type: StringMIME type.
buffer: Vec<u8>File content as bytes.
Implementations§
Source§impl FilePayload
impl FilePayload
Sourcepub fn new(
name: impl Into<String>,
mime_type: impl Into<String>,
buffer: Vec<u8>,
) -> Self
pub fn new( name: impl Into<String>, mime_type: impl Into<String>, buffer: Vec<u8>, ) -> Self
Create a new file payload.
Sourcepub fn from_text(name: impl Into<String>, content: impl Into<String>) -> Self
pub fn from_text(name: impl Into<String>, content: impl Into<String>) -> Self
Create a file payload from a string content.
Trait Implementations§
Source§impl Clone for FilePayload
impl Clone for FilePayload
Source§fn clone(&self) -> FilePayload
fn clone(&self) -> FilePayload
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 FilePayload
impl RefUnwindSafe for FilePayload
impl Send for FilePayload
impl Sync for FilePayload
impl Unpin for FilePayload
impl UnwindSafe for FilePayload
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