pub struct Cookie { /* private fields */ }
Expand description
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.
Implementations§
source§impl Cookie
impl Cookie
pub fn new() -> Result<Self, Error>
sourcepub fn progress(&self) -> i32
pub fn progress(&self) -> i32
Communicates rendering progress back to the application. Increments as a page is being rendered.
sourcepub fn max_progress(&self) -> usize
pub fn max_progress(&self) -> usize
Communicates the known upper bound of rendering back to the application
sourcepub fn incomplete(&self) -> bool
pub fn incomplete(&self) -> bool
Initially should be set to 0. Will be set to non-zero if a TRYLATER error is thrown during rendering
pub fn set_incomplete(&mut self, value: bool)
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Cookie
impl RefUnwindSafe for Cookie
impl !Send for Cookie
impl !Sync for Cookie
impl Unpin for Cookie
impl UnwindSafe for Cookie
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