pub struct Registry<S, T> { /* private fields */ }Implementations§
Source§impl<S, T: Send + Sync> Registry<S, T>
impl<S, T: Send + Sync> Registry<S, T>
pub fn register( &mut self, handler: impl Fn(&mut S, Backend, &[&T]) -> Result<T, Error> + Send + Sync + 'static, ) -> OperationId
Sourcepub fn run(
&self,
nodes: &[Node],
capacity: Capacity,
history: &mut History,
factory: impl Fn(Backend) -> Result<S, String> + Sync,
) -> Result<(Vec<T>, Report), String>
pub fn run( &self, nodes: &[Node], capacity: Capacity, history: &mut History, factory: impl Fn(Backend) -> Result<S, String> + Sync, ) -> Result<(Vec<T>, Report), String>
An accelerator is provided by the factory; its implementation can use any compute API. The result owns each output. Include retained outputs separately when budgeting RAM.
Sourcepub fn run_interruptible(
&self,
nodes: &[Node],
capacity: Capacity,
history: &mut History,
factory: impl Fn(Backend) -> Result<S, String> + Sync,
cancelled: Option<&AtomicBool>,
) -> Result<(Vec<T>, Report), String>
pub fn run_interruptible( &self, nodes: &[Node], capacity: Capacity, history: &mut History, factory: impl Fn(Backend) -> Result<S, String> + Sync, cancelled: Option<&AtomicBool>, ) -> Result<(Vec<T>, Report), String>
Stop admitting new work after cancellation. Workers already in a callback finish before this method returns. No partial output list is returned.
Trait Implementations§
Auto Trait Implementations§
impl<S, T> !RefUnwindSafe for Registry<S, T>
impl<S, T> !UnwindSafe for Registry<S, T>
impl<S, T> Forget for Registry<S, T>
impl<S, T> Freeze for Registry<S, T>
impl<S, T> Move for Registry<S, T>
impl<S, T> Send for Registry<S, T>
impl<S, T> Sync for Registry<S, T>
impl<S, T> Unpin for Registry<S, T>
impl<S, T> UnsafeUnpin for Registry<S, T>
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