pub struct PhlowBuilder { /* private fields */ }Expand description
Builder for creating a prepared PhlowRuntime.
Use this when you want a fluent API that returns a ready runtime.
Implementations§
Source§impl PhlowBuilder
impl PhlowBuilder
Sourcepub fn new() -> Self
pub fn new() -> Self
Create a new builder with default settings.
This sets var_main to a default value so non-main pipelines auto-start.
Sourcepub fn with_settings(settings: Settings) -> Self
pub fn with_settings(settings: Settings) -> Self
Create a new builder using explicit settings.
Sourcepub fn set_pipeline(self, pipeline: Value) -> Self
pub fn set_pipeline(self, pipeline: Value) -> Self
Set the pipeline to be executed.
Returns the builder for chaining.
Sourcepub fn set_context(self, context: Context) -> Self
pub fn set_context(self, context: Context) -> Self
Set the execution context.
Returns the builder for chaining.
Sourcepub fn set_settings(self, settings: Settings) -> Self
pub fn set_settings(self, settings: Settings) -> Self
Replace the runtime settings.
Returns the builder for chaining.
Sourcepub fn set_base_path<P: Into<PathBuf>>(self, base_path: P) -> Self
pub fn set_base_path<P: Into<PathBuf>>(self, base_path: P) -> Self
Set the base path used for resolving local module paths.
Returns the builder for chaining.
Sourcepub fn set_dispatch(self, dispatch: Dispatch) -> Self
pub fn set_dispatch(self, dispatch: Dispatch) -> Self
Provide a custom tracing dispatch instead of initializing OpenTelemetry.
Returns the builder for chaining.
Sourcepub fn set_module<S: Into<String>>(self, name: S, module: PhlowModule) -> Self
pub fn set_module<S: Into<String>>(self, name: S, module: PhlowModule) -> Self
Register an inline module by name.
The module must be declared in the pipeline modules list.
The handler runs asynchronously inside the runtime.
Returns the builder for chaining.
Sourcepub fn settings_mut(&mut self) -> &mut Settings
pub fn settings_mut(&mut self) -> &mut Settings
Mutable access to settings.
Sourcepub async fn build(self) -> Result<PhlowRuntime, PhlowRuntimeError>
pub async fn build(self) -> Result<PhlowRuntime, PhlowRuntimeError>
Build and return a prepared PhlowRuntime.
This consumes the builder and prepares the runtime for execution.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for PhlowBuilder
impl !RefUnwindSafe for PhlowBuilder
impl Send for PhlowBuilder
impl Sync for PhlowBuilder
impl Unpin for PhlowBuilder
impl UnsafeUnpin for PhlowBuilder
impl !UnwindSafe for PhlowBuilder
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> FutureExt for T
impl<T> FutureExt for T
Source§fn with_context(self, otel_cx: Context) -> WithContext<Self>
fn with_context(self, otel_cx: Context) -> WithContext<Self>
Source§fn with_current_context(self) -> WithContext<Self>
fn with_current_context(self) -> WithContext<Self>
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> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T in a tonic::Request