pub struct Worker { /* private fields */ }Expand description
One child process with bounded messages, cancellation and failure cleanup. Applications own the scheduling queue and decide when to recycle or retire it.
Implementations§
Source§impl Worker
impl Worker
pub fn requests_completed(&self) -> usize
pub fn spawn(program: &Path, worker_argument: &str) -> Result<Self>
Sourcepub fn render(
&mut self,
source: &str,
light: bool,
options: RasterOptions,
timeout: Duration,
cancel: &AtomicBool,
) -> Result<Option<Raster>>
pub fn render( &mut self, source: &str, light: bool, options: RasterOptions, timeout: Duration, cancel: &AtomicBool, ) -> Result<Option<Raster>>
Render one diagram off the UI thread. Any error stops and reaps the worker; subsequent calls fail until the application creates a new handle.
Sourcepub fn render_with_background(
&mut self,
source: &str,
light: bool,
background: Background,
options: RasterOptions,
timeout: Duration,
cancel: &AtomicBool,
) -> Result<Option<Raster>>
pub fn render_with_background( &mut self, source: &str, light: bool, background: Background, options: RasterOptions, timeout: Duration, cancel: &AtomicBool, ) -> Result<Option<Raster>>
Render with an explicit canvas treatment. Transparency is applied before
rasterization, preserving antialiased edges and intentional diagram fills.
Uses the same limits, cancellation and worker cleanup as Self::render.
Trait Implementations§
Auto Trait Implementations§
impl !RefUnwindSafe for Worker
impl !Sync for Worker
impl !UnwindSafe for Worker
impl Freeze for Worker
impl Send for Worker
impl Unpin for Worker
impl UnsafeUnpin for Worker
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