Struct popsicle::Image
[−]
[src]
pub struct Image { /* fields omitted */ }
A simple wrapper around a File
that ensures that the file is a file, and
obtains the file's size ahead of time.
Methods
impl Image
[src]
pub fn new<P: AsRef<Path>>(path: P) -> Result<Image, ImageError>
[src]
Opens the file and obtains the size from the metadata, then returns an
Image
structure that contains the opened file and its file size.
pub fn get_path(&self) -> &Path
[src]
pub fn get_size(&self) -> u64
[src]
Returns the size of the file, in bytes.
pub fn read<P: FnMut(u64)>(
&mut self,
data: &mut Vec<u8>,
progress_callback: P
) -> Result<(), ImageError>
[src]
&mut self,
data: &mut Vec<u8>,
progress_callback: P
) -> Result<(), ImageError>
Reads the image into a vector, and reports progress to a callback.