[][src]Struct mupdf_sys::fz_cookie

#[repr(C)]pub struct fz_cookie {
    pub abort: c_int,
    pub progress: c_int,
    pub progress_max: usize,
    pub errors: c_int,
    pub incomplete: c_int,
}

Provide two-way communication between application and library. Intended for multi-threaded applications where one thread is rendering pages and another thread wants to read progress feedback or abort a job that takes a long time to finish. The communication is unsynchronized without locking.

abort: The application should set this field to 0 before calling fz_run_page to render a page. At any point when the page is being rendered the application my set this field to 1 which will cause the rendering to finish soon. This field is checked periodically when the page is rendered, but exactly when is not known, therefore there is no upper bound on exactly when the rendering will abort. If the application did not provide a set of locks to fz_new_context, it must also await the completion of fz_run_page before issuing another call to fz_run_page. Note that once the application has set this field to 1 after it called fz_run_page it may not change the value again.

progress: Communicates rendering progress back to the application and is read only. Increments as a page is being rendered. The value starts out at 0 and is limited to less than or equal to progress_max, unless progress_max is -1.

progress_max: Communicates the known upper bound of rendering back to the application and is read only. The maximum value that the progress field may take. If there is no known upper bound on how long the rendering may take this value is -1 and progress is not limited. Note that the value of progress_max may change from -1 to a positive value once an upper bound is known, so take this into consideration when comparing the value of progress to that of progress_max.

errors: count of errors during current rendering.

incomplete: Initially should be set to 0. Will be set to non-zero if a TRYLATER error is thrown during rendering.

Fields

abort: c_intprogress: c_intprogress_max: usizeerrors: c_intincomplete: c_int

Trait Implementations

impl Clone for fz_cookie[src]

impl Copy for fz_cookie[src]

impl Debug for fz_cookie[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.