#[non_exhaustive]pub struct PutInput {
pub data: Bytes,
pub prefix: String,
pub filename: Option<String>,
pub content_type: String,
}Expand description
Input for Storage::put() and Storage::put_with().
Use PutInput::from_upload() to build from an UploadedFile
received via multipart form data, or PutInput::new() for direct construction.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.data: BytesRaw file bytes.
prefix: StringStorage prefix (e.g., "avatars/").
filename: Option<String>Original filename — used to extract extension. None produces extensionless keys.
content_type: StringMIME content type (e.g., "image/jpeg").
Implementations§
Source§impl PutInput
impl PutInput
Sourcepub fn from_upload(file: &UploadedFile, prefix: &str) -> Self
pub fn from_upload(file: &UploadedFile, prefix: &str) -> Self
Build from an UploadedFile and a storage prefix.
Auto Trait Implementations§
impl !Freeze for PutInput
impl RefUnwindSafe for PutInput
impl Send for PutInput
impl Sync for PutInput
impl Unpin for PutInput
impl UnsafeUnpin for PutInput
impl UnwindSafe for PutInput
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