pub struct File(_);
Expand description
A File representation used with
FormData
.
Implementations§
source§impl File
impl File
sourcepub fn new(data: impl AsRef<[u8]>, name: &str) -> Self
pub fn new(data: impl AsRef<[u8]>, name: &str) -> Self
Construct a new named file from a buffer.
sourcepub async fn bytes(&self) -> Result<Vec<u8>>
pub async fn bytes(&self) -> Result<Vec<u8>>
Read the file from an internal buffer and get the resulting bytes.
sourcepub fn last_modified(&self) -> Date
pub fn last_modified(&self) -> Date
Get the last_modified metadata property of the file.
Trait Implementations§
Auto Trait Implementations§
impl RefUnwindSafe for File
impl !Send for File
impl !Sync for File
impl Unpin for File
impl UnwindSafe for File
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