Skip to main content

PhaseBuilder

Struct PhaseBuilder 

Source
pub struct PhaseBuilder { /* private fields */ }
Expand description

Builder for one nonempty first-class phase.

Implementations§

Source§

impl PhaseBuilder

Source

pub fn task(self, task: Task) -> Self

Registers one task with this phase.

Source

pub fn tasks<I>(self, tasks: I) -> Self
where I: IntoIterator<Item = Task>,

Registers tasks in deterministic declaration order.

Source

pub fn max_active_tasks(self, maximum: usize) -> Self

Sets the later scheduler’s phase-local active workload ceiling.

Source

pub fn prepared_task_queue_capacity(self, capacity: usize) -> Self

Sets the later scheduler’s prepared-work queue capacity.

Source

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.

Source

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.

Source

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.

Source

pub fn depends_on(self, dependency: impl Into<PhaseId>) -> Self

Declares one phase that must be satisfied before this phase starts.

Source

pub fn failure_policy(self, policy: PhaseFailurePolicy) -> Self

Selects behavior after the first workload failure.

Source

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.

Source

pub fn build(self) -> Result<Phase, StudyError>

Validates and creates one immutable nonempty phase.

Trait Implementations§

Source§

impl Debug for PhaseBuilder

Source§

fn fmt(&self, formatter: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

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
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.