Skip to main content

RunnerConfigBuilder

Struct RunnerConfigBuilder 

Source
pub struct RunnerConfigBuilder<A, G, S> { /* private fields */ }
Expand description

A typestate builder for constructing a Runner.

The three type parameters track whether the required fields have been provided. build() is only available when all three are Has*.

Implementations§

Source§

impl RunnerConfigBuilder<NoAppName, NoAgent, NoSessionService>

Source

pub fn new() -> Self

Create a new builder with all fields unset and defaults applied.

Source§

impl<A, G, S> RunnerConfigBuilder<A, G, S>

Source

pub fn app_name( self, name: impl Into<String>, ) -> RunnerConfigBuilder<HasAppName, G, S>

Set the application name (required).

Source

pub fn agent(self, agent: Arc<dyn Agent>) -> RunnerConfigBuilder<A, HasAgent, S>

Set the root agent (required).

Source

pub fn session_service( self, service: Arc<dyn SessionService>, ) -> RunnerConfigBuilder<A, G, HasSessionService>

Set the session service (required).

Source§

impl<A, G, S> RunnerConfigBuilder<A, G, S>

Source

pub fn artifact_service(self, service: Arc<dyn ArtifactService>) -> Self

Set the artifact service (optional).

Source

pub fn memory_service(self, service: Arc<dyn Memory>) -> Self

Set the memory service (optional).

Source

pub fn plugin_manager(self, manager: Arc<PluginManager>) -> Self

Set the plugin manager (optional).

Source

pub fn run_config(self, config: RunConfig) -> Self

Set the run configuration (optional).

Source

pub fn compaction_config(self, config: EventsCompactionConfig) -> Self

Set the events compaction configuration (optional).

Source

pub fn context_cache_config(self, config: ContextCacheConfig) -> Self

Set the context cache configuration (optional).

Source

pub fn cache_capable(self, model: Arc<dyn CacheCapable>) -> Self

Set the cache-capable model reference (optional).

Source

pub fn request_context(self, ctx: RequestContext) -> Self

Set the request context from auth middleware (optional).

Source

pub fn cancellation_token(self, token: CancellationToken) -> Self

Set a cooperative cancellation token (optional).

Source§

impl RunnerConfigBuilder<HasAppName, HasAgent, HasSessionService>

Source

pub fn build(self) -> Result<Runner>

Consume the builder and create a Runner.

Delegates to Runner::new() internally.

§Errors

Returns an error if Runner::new() fails (e.g. invalid app_name).

Trait Implementations§

Source§

impl Default for RunnerConfigBuilder<NoAppName, NoAgent, NoSessionService>

Source§

fn default() -> Self

Returns the “default value” for a type. Read more

Auto Trait Implementations§

§

impl<A, G, S> Freeze for RunnerConfigBuilder<A, G, S>

§

impl<A, G, S> !RefUnwindSafe for RunnerConfigBuilder<A, G, S>

§

impl<A, G, S> Send for RunnerConfigBuilder<A, G, S>
where A: Send, G: Send, S: Send,

§

impl<A, G, S> Sync for RunnerConfigBuilder<A, G, S>
where A: Sync, G: Sync, S: Sync,

§

impl<A, G, S> Unpin for RunnerConfigBuilder<A, G, S>
where A: Unpin, G: Unpin, S: Unpin,

§

impl<A, G, S> UnsafeUnpin for RunnerConfigBuilder<A, G, S>

§

impl<A, G, S> !UnwindSafe for RunnerConfigBuilder<A, G, S>

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> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
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.
Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more