Skip to main content

Builder

Struct Builder 

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

Builder for Orchestrator. Use Orchestrator::builder to obtain one.

Implementations§

Source§

impl Builder

Source

pub fn cache<C: Cache + 'static>(self, c: C) -> Self

Set the cache backend. Requiredbuild() errors otherwise.

Source

pub fn cache_boxed(self, c: Box<dyn Cache>) -> Self

Set an already-boxed cache backend. Useful when the concrete type is only known at runtime (federation hooks return Box<dyn Cache>).

Source

pub fn manifest(self, m: Manifest) -> Self

Attach the parsed manifest snapshot (optional, for downstream consumers).

Source

pub fn max_parallelism(self, n: usize) -> Self

Cap on concurrent in-flight actions. Floored to 1 (zero is meaningless).

Source

pub fn shared_semaphore(self, sem: Arc<Semaphore>) -> Self

Draw concurrency permits from an externally-owned pool instead of a private one. Used by federation so --jobs N bounds the whole tree of orchestrators, not N per level. Overrides Self::max_parallelism when set.

Source

pub fn base_ctx(self, ctx: Ctx) -> Self

Override the base Ctx (cancel token, workdir, env).

Source

pub fn register<A: Action + 'static>(self, a: A) -> Self

Register one action. May be called many times.

Source

pub fn register_boxed(self, a: Box<dyn Action>) -> Self

Register an already-boxed action. Useful when the concrete type is only known at runtime (e.g. when assembled from a manifest factory).

Source

pub fn build(self) -> Result<Orchestrator, BuilderError>

Finalize.

§Errors

BuilderError::MissingCache when no cache was set.

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> 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.