#[repr(C)]
pub struct heif_reader { pub reader_api_version: c_int, pub get_position: Option<unsafe extern "C" fn(userdata: *mut c_void) -> i64>, pub read: Option<unsafe extern "C" fn(data: *mut c_void, size: usize, userdata: *mut c_void) -> c_int>, pub seek: Option<unsafe extern "C" fn(position: i64, userdata: *mut c_void) -> c_int>, pub wait_for_file_size: Option<unsafe extern "C" fn(target_size: i64, userdata: *mut c_void) -> heif_reader_grow_status>, }

Fields§

§reader_api_version: c_int

API version supported by this reader

§get_position: Option<unsafe extern "C" fn(userdata: *mut c_void) -> i64>

— version 1 functions —

§read: Option<unsafe extern "C" fn(data: *mut c_void, size: usize, userdata: *mut c_void) -> c_int>

The functions read(), and seek() return heif_error_ok on success. Generally, libheif will make sure that we do not read past the file size.

§seek: Option<unsafe extern "C" fn(position: i64, userdata: *mut c_void) -> c_int>§wait_for_file_size: Option<unsafe extern "C" fn(target_size: i64, userdata: *mut c_void) -> heif_reader_grow_status>

When calling this function, libheif wants to make sure that it can read the file up to ‘target_size’. This is useful when the file is currently downloaded and may grow with time. You may, for example, extract the image sizes even before the actual compressed image data has been completely downloaded.

Even if your input files will not grow, you will have to implement at least detection whether the target_size is above the (fixed) file length (in this case, return ‘size_beyond_eof’).

Trait Implementations§

source§

impl Clone for heif_reader

source§

fn clone(&self) -> heif_reader

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for heif_reader

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Copy for heif_reader

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for Twhere U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> ToOwned for Twhere T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for Twhere U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.