pub struct File(_);
Expand description
A File representation used with
FormData
.
Implementations
sourceimpl 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
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more