#[non_exhaustive]pub struct PickedFile {
pub name: String,
pub mime: String,
pub data: ImageData,
pub size: Size<DevicePixels>,
pub last_modified: Option<SystemTime>,
pub len: u64,
pub status: PickedStatus,
}Expand description
A file the user picked: what the app gets as a File.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.name: StringIts name, with an extension that matches Self::mime
(IMG_0042.jpg).
mime: StringIts media type (image/jpeg).
data: ImageDataIts bytes, shared with the File and with an Image showing it.
size: Size<DevicePixels>Its size in pixels, with its orientation applied (as it shows); zero when the platform does not say, then read from the bytes.
last_modified: Option<SystemTime>When it was last changed (File.lastModified); None: when the
app gets it.
len: u64Its size in bytes: its bytes’ length, or for a file not read, the
size its system gave (a pick of files fills it in,
finish_files).
status: PickedStatusWhether its bytes were read.
Implementations§
Source§impl PickedFile
impl PickedFile
Sourcepub fn new(
name: impl Into<String>,
mime: impl Into<String>,
data: ImageData,
) -> Self
pub fn new( name: impl Into<String>, mime: impl Into<String>, data: ImageData, ) -> Self
The file name of type mime holding data (its size read from
the bytes).
Sourcepub fn too_large(
name: impl Into<String>,
mime: impl Into<String>,
len: u64,
) -> Self
pub fn too_large( name: impl Into<String>, mime: impl Into<String>, len: u64, ) -> Self
The file name of len bytes, too large to read
(PickedStatus::TooLarge): no bytes, its type what its name says
when mime is empty (finish_files).