pub struct InferenceJobBuilder<B: Backend, I: RoutineInput, S, Flag> { /* private fields */ }Expand description
Internal job builder accumulating input + devices + optional state before conversion to an executable job.
Implementations§
Source§impl<B, I, S, Flag> InferenceJobBuilder<B, I, S, Flag>
impl<B, I, S, Flag> InferenceJobBuilder<B, I, S, Flag>
Sourcepub fn new(input: <I as RoutineInput>::Inner<'static>) -> Self
pub fn new(input: <I as RoutineInput>::Inner<'static>) -> Self
Create a new job builder with the provided routine input payload.
Sourcepub fn with_devices(self, devices: impl IntoIterator<Item = B::Device>) -> Self
pub fn with_devices(self, devices: impl IntoIterator<Item = B::Device>) -> Self
Set the devices collection for this job.
Source§impl<B, I, S> InferenceJobBuilder<B, I, S, StateMissing>
impl<B, I, S> InferenceJobBuilder<B, I, S, StateMissing>
Sourcepub fn with_state(self, state: S) -> InferenceJobBuilder<B, I, S, StateProvided>
pub fn with_state(self, state: S) -> InferenceJobBuilder<B, I, S, StateProvided>
Attach state to the job; transitions the builder into the StateProvided phase.
Source§impl<B, I, S> InferenceJobBuilder<B, I, S, StateProvided>
impl<B, I, S> InferenceJobBuilder<B, I, S, StateProvided>
Sourcepub fn build(self) -> InferenceJob<B, I, S>
pub fn build(self) -> InferenceJob<B, I, S>
Finalize the builder into an InferenceJob. Panics if state missing (by design of type-state pattern).
Auto Trait Implementations§
impl<B, I, S, Flag> Freeze for InferenceJobBuilder<B, I, S, Flag>
impl<B, I, S, Flag> RefUnwindSafe for InferenceJobBuilder<B, I, S, Flag>where
<I as RoutineInput>::Inner<'static>: RefUnwindSafe,
S: RefUnwindSafe,
Flag: RefUnwindSafe,
<B as Backend>::Device: RefUnwindSafe,
impl<B, I, S, Flag> Send for InferenceJobBuilder<B, I, S, Flag>
impl<B, I, S, Flag> Sync for InferenceJobBuilder<B, I, S, Flag>
impl<B, I, S, Flag> Unpin for InferenceJobBuilder<B, I, S, Flag>
impl<B, I, S, Flag> UnwindSafe for InferenceJobBuilder<B, I, S, Flag>where
<I as RoutineInput>::Inner<'static>: UnwindSafe,
S: UnwindSafe,
Flag: UnwindSafe,
<B as Backend>::Device: UnwindSafe,
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
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more