pub struct Upload { /* private fields */ }Expand description
A file received with the request, already in the app’s Storage. Only the framework makes
one, from a multipart/form-data body; a JSON body cannot name a stored file.
Implementations§
Source§impl Upload
impl Upload
pub fn key(&self) -> &StorageKey
Sourcepub fn filename(&self) -> &str
pub fn filename(&self) -> &str
The name it had on the sender’s machine, without its folders or characters unsafe in a file name; never a path in storage.
Sourcepub fn content_type(&self) -> &ContentType
pub fn content_type(&self) -> &ContentType
As declared, and matching the file’s first bytes for the types those tell apart.
pub fn size(&self) -> u64
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Upload
impl<'de> Deserialize<'de> for Upload
Source§fn deserialize<D: Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error>
fn deserialize<D: Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error>
Deserialize this value from the given Serde deserializer. Read more
impl Eq for Upload
impl StructuralPartialEq for Upload
Auto Trait Implementations§
impl Freeze for Upload
impl RefUnwindSafe for Upload
impl Send for Upload
impl Sync for Upload
impl Unpin for Upload
impl UnsafeUnpin for Upload
impl UnwindSafe for Upload
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.