pub struct PhaseBuilder { /* private fields */ }Expand description
Builder for one nonempty first-class phase.
Implementations§
Source§impl PhaseBuilder
impl PhaseBuilder
Sourcepub fn tasks<I>(self, tasks: I) -> Selfwhere
I: IntoIterator<Item = Task>,
pub fn tasks<I>(self, tasks: I) -> Selfwhere
I: IntoIterator<Item = Task>,
Registers tasks in deterministic declaration order.
Sourcepub fn max_active_tasks(self, maximum: usize) -> Self
pub fn max_active_tasks(self, maximum: usize) -> Self
Sets the later scheduler’s phase-local active workload ceiling.
Sourcepub fn prepared_task_queue_capacity(self, capacity: usize) -> Self
pub fn prepared_task_queue_capacity(self, capacity: usize) -> Self
Sets the later scheduler’s prepared-work queue capacity.
Sourcepub fn delay_per_task(self, delay: Duration) -> Self
pub fn delay_per_task(self, delay: Duration) -> Self
Sets a minimum start-to-start interval for executable tasks.
This policy is optional. Without this call, tasks are admitted exactly as before. Completed tasks do not consume a delay rank.
Sourcepub fn task_timeout(self, timeout: Duration) -> Self
pub fn task_timeout(self, timeout: Duration) -> Self
Sets the maximum elapsed time for each task after it starts.
Expiration requests cooperative cancellation; Rust workloads cannot be forcibly terminated while they are blocked in user or system code.
Sourcepub fn deadline_after(self, deadline: Duration) -> Self
pub fn deadline_after(self, deadline: Duration) -> Self
Sets a phase-wide deadline relative to the phase execution start.
Once reached, no additional tasks start and active tasks receive a cooperative cancellation request.
Sourcepub fn depends_on(self, dependency: impl Into<PhaseId>) -> Self
pub fn depends_on(self, dependency: impl Into<PhaseId>) -> Self
Declares one phase that must be satisfied before this phase starts.
Sourcepub fn failure_policy(self, policy: PhaseFailurePolicy) -> Self
pub fn failure_policy(self, policy: PhaseFailurePolicy) -> Self
Selects behavior after the first workload failure.
Sourcepub fn require_confirm(self, require: bool) -> Self
pub fn require_confirm(self, require: bool) -> Self
Requires the user to type yes before advancing to the next phase.
The default is false. This setting has no effect when this phase is
the final selected phase because there is no transition to confirm.
Sourcepub fn build(self) -> Result<Phase, StudyError>
pub fn build(self) -> Result<Phase, StudyError>
Validates and creates one immutable nonempty phase.
Trait Implementations§
Auto Trait Implementations§
impl !RefUnwindSafe for PhaseBuilder
impl !Sync for PhaseBuilder
impl !UnwindSafe for PhaseBuilder
impl Freeze for PhaseBuilder
impl Send for PhaseBuilder
impl Unpin for PhaseBuilder
impl UnsafeUnpin for PhaseBuilder
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
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> ⓘ
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> ⓘ
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