pub struct RunOptions<'pool, S: PoolStore + 'static> { /* private fields */ }Expand description
Builder for a synchronous pool task, returned by Pool::run.
Implements IntoFuture so it can be .awaited directly. Builder
methods add optional overrides before awaiting.
§Example
// Simplest form
let result = pool.run("write a poem").await?;
// With overrides
let result = pool
.run("refactor this module")
.config(TaskOverrides { model: Some("claude-opus-4-6".into()), ..Default::default() })
.working_dir("/tmp/project")
.on_output(|chunk| print!("{chunk}"))
.await?;Implementations§
Source§impl<'pool, S: PoolStore + 'static> RunOptions<'pool, S>
impl<'pool, S: PoolStore + 'static> RunOptions<'pool, S>
Sourcepub fn config(self, config: TaskOverrides) -> Self
pub fn config(self, config: TaskOverrides) -> Self
Override per-task configuration for this run.
Sourcepub fn working_dir(self, dir: impl Into<PathBuf>) -> Self
pub fn working_dir(self, dir: impl Into<PathBuf>) -> Self
Override the working directory for this run.
Trait Implementations§
Source§impl<'pool, S: PoolStore + 'static> IntoFuture for RunOptions<'pool, S>
impl<'pool, S: PoolStore + 'static> IntoFuture for RunOptions<'pool, S>
Source§type Output = Result<TaskResult, Error>
type Output = Result<TaskResult, Error>
The output that the future will produce on completion.
Source§type IntoFuture = Pin<Box<dyn Future<Output = Result<TaskResult, Error>> + Send + 'pool>>
type IntoFuture = Pin<Box<dyn Future<Output = Result<TaskResult, Error>> + Send + 'pool>>
Which kind of future are we turning this into?
Source§fn into_future(self) -> Self::IntoFuture
fn into_future(self) -> Self::IntoFuture
Creates a future from a value. Read more
Auto Trait Implementations§
impl<'pool, S> Freeze for RunOptions<'pool, S>
impl<'pool, S> !RefUnwindSafe for RunOptions<'pool, S>
impl<'pool, S> Send for RunOptions<'pool, S>
impl<'pool, S> Sync for RunOptions<'pool, S>
impl<'pool, S> Unpin for RunOptions<'pool, S>
impl<'pool, S> UnsafeUnpin for RunOptions<'pool, S>
impl<'pool, S> !UnwindSafe for RunOptions<'pool, S>
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
Mutably borrows from an owned value. Read more