pub struct RunOptions {
pub no_execute: bool,
pub task_id: Option<String>,
pub cancel: Option<CancellationToken>,
pub deadline: Option<Duration>,
pub stream_ndjson: bool,
pub seed: Option<ConversationHistory>,
pub output_schema: Option<Value>,
pub event_tx: Option<Sender<RunEvent>>,
pub plan: bool,
pub plan_autoaccept: bool,
}Expand description
Per-invocation options for run_non_interactive.
Added as a struct so new flags can land without reshuffling the function’s positional args. All fields default to “no change”.
Fields§
§no_execute: boolWhen true, register an empty ToolRegistry — the model sees no
tools and can’t take actions. Dry-run mode for
mermaid run --no-execute.
task_id: Option<String>Durable runtime task that owns this run, when launched through
mermaidd or mermaid run task creation.
cancel: Option<CancellationToken>External cancellation. When it fires, the driver injects
Msg::CancelTurn — the same message the TUI’s Esc sends — so the
reducer unwinds the turn gracefully (tool process tree killed, turn
JoinSet drained). If the reducer hasn’t reached Idle within a grace
window after that, the drive loop hard-stops.
deadline: Option<Duration>Wall-clock budget override. None keeps the built-in 20-minute
deadline.
stream_ndjson: boolWhen true, the driver streams the run lifecycle to stdout as
newline-delimited RunEvent JSON (mermaid run --format ndjson). Off
for the daemon scheduler and every other caller, which own their own
output.
seed: Option<ConversationHistory>Saved conversation to seed the session with (--resume <id> /
--continue). The run appends to the SAME session id, so repeated
--resume <id> invocations chain naturally.
output_schema: Option<Value>--output-schema: JSON Schema the final answer must conform to. The
agentic loop runs normally; one extra FORMATTING turn (no tools,
native constrained output where supported) reshapes the final answer,
validated client-side. See run_formatting_turn.
event_tx: Option<Sender<RunEvent>>Live RunEvent tee for daemon task subscriptions (subscribe_task).
Every event that would print on an NDJSON stream is also broadcast
here (send is sync + non-blocking; no-receiver errors are ignored).
plan: boolmermaid run --plan: enter plan mode before the prompt seeds, so the
run explores read-only and delivers a plan file.
plan_autoaccept: bool--plan-autoaccept: the headless approval starts implementation
immediately instead of ending the run at the plan.
Trait Implementations§
Source§impl Clone for RunOptions
impl Clone for RunOptions
Source§fn clone(&self) -> RunOptions
fn clone(&self) -> RunOptions
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for RunOptions
impl Debug for RunOptions
Source§impl Default for RunOptions
impl Default for RunOptions
Source§fn default() -> RunOptions
fn default() -> RunOptions
Auto Trait Implementations§
impl !RefUnwindSafe for RunOptions
impl !UnwindSafe for RunOptions
impl Freeze for RunOptions
impl Send for RunOptions
impl Sync for RunOptions
impl Unpin for RunOptions
impl UnsafeUnpin for RunOptions
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.Source§impl<T> DowncastSync for T
impl<T> DowncastSync for T
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> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
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 moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
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