pub struct Scheduler { /* private fields */ }Expand description
A demand-driven, parallel tile evaluator.
One scheduler can run many pipelines; the pool and cache are reused.
Implementations§
Source§impl Scheduler
impl Scheduler
Sourcepub fn new(options: SchedulerOptions) -> Result<Self>
pub fn new(options: SchedulerOptions) -> Result<Self>
Build a scheduler with options.
§Errors
Returns PixelsError::Io if worker threads cannot be spawned.
Sourcepub fn with_defaults() -> Result<Self>
pub fn with_defaults() -> Result<Self>
Sourcepub fn run(
&self,
image: &Image,
consume: impl FnMut(Region, &Tile<'_>) -> Result<()>,
) -> Result<RunStats>
pub fn run( &self, image: &Image, consume: impl FnMut(Region, &Tile<'_>) -> Result<()>, ) -> Result<RunStats>
Evaluate image, handing each output tile to consume in order.
consume is called on the calling thread, in tile order, so a sink may
hold non-Send state and an encoder still sees rows top to bottom.
§Errors
Propagates any producer, op or consumer error. A failure anywhere fails the whole run; the sink is simply not given the remaining tiles (ARCHITECTURE §Failure model).
Trait Implementations§
Auto Trait Implementations§
impl !RefUnwindSafe for Scheduler
impl !UnwindSafe for Scheduler
impl Freeze for Scheduler
impl Send for Scheduler
impl Sync for Scheduler
impl Unpin for Scheduler
impl UnsafeUnpin for Scheduler
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