pub struct TimeoutConfig {
pub task_timeout: Option<TaskTimeout>,
pub workflow_timeout: Option<WorkflowTimeout>,
}Expand description
Combined timeout configuration for tasks and workflows.
Provides configurable timeout limits for both individual tasks and entire workflows. Timeouts are optional - None means no timeout.
§Example
use forge_agent::workflow::timeout::TimeoutConfig;
// Use default timeouts (30s task, 5m workflow)
let config = TimeoutConfig::new();
// Disable task timeout
let config = TimeoutConfig::no_task_timeout();
// Disable both timeouts
let config = TimeoutConfig::no_timeouts();Fields§
§task_timeout: Option<TaskTimeout>Optional task-level timeout (None means no task timeout)
workflow_timeout: Option<WorkflowTimeout>Optional workflow-level timeout (None means no workflow timeout)
Implementations§
Source§impl TimeoutConfig
impl TimeoutConfig
Sourcepub fn new() -> Self
pub fn new() -> Self
Creates a new TimeoutConfig with default timeouts.
Defaults are 30 seconds for tasks and 5 minutes for workflows.
§Example
use forge_agent::workflow::timeout::TimeoutConfig;
use std::time::Duration;
let config = TimeoutConfig::new();
assert_eq!(config.task_timeout.unwrap().duration(), Duration::from_secs(30));
assert_eq!(config.workflow_timeout.unwrap().duration(), Duration::from_secs(300));Sourcepub fn no_task_timeout() -> Self
pub fn no_task_timeout() -> Self
Creates a TimeoutConfig with task timeout disabled.
§Example
use forge_agent::workflow::timeout::TimeoutConfig;
let config = TimeoutConfig::no_task_timeout();
assert!(config.task_timeout.is_none());
assert!(config.workflow_timeout.is_some());Sourcepub fn no_workflow_timeout() -> Self
pub fn no_workflow_timeout() -> Self
Creates a TimeoutConfig with workflow timeout disabled.
§Example
use forge_agent::workflow::timeout::TimeoutConfig;
let config = TimeoutConfig::no_workflow_timeout();
assert!(config.task_timeout.is_some());
assert!(config.workflow_timeout.is_none());Sourcepub fn no_timeouts() -> Self
pub fn no_timeouts() -> Self
Creates a TimeoutConfig with both timeouts disabled.
§Example
use forge_agent::workflow::timeout::TimeoutConfig;
let config = TimeoutConfig::no_timeouts();
assert!(config.task_timeout.is_none());
assert!(config.workflow_timeout.is_none());Trait Implementations§
Source§impl Clone for TimeoutConfig
impl Clone for TimeoutConfig
Source§fn clone(&self) -> TimeoutConfig
fn clone(&self) -> TimeoutConfig
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for TimeoutConfig
impl Debug for TimeoutConfig
Auto Trait Implementations§
impl Freeze for TimeoutConfig
impl RefUnwindSafe for TimeoutConfig
impl Send for TimeoutConfig
impl Sync for TimeoutConfig
impl Unpin for TimeoutConfig
impl UnsafeUnpin for TimeoutConfig
impl UnwindSafe for TimeoutConfig
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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>
Converts
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>
Converts
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